RDOC price
A small library to get the RDOC (RSK stable coin) price from the RDOC price feeder contract.
USAGE
Make sure to include in the .env file the NODE_URL and CONTRACT_ADDRESS (as specified in the env.placeholders example)
with the corresponding RSK node url and the price feeder contract address.
When using the library as standalone, the .env file must be at this directory's root. If it's being imported from another project,
use the .env file of the project.
Example:
const { getRDOCPrice } = require('@rsksmart/rdoc-price');
async function test() {
console.log(await getRDOCPrice())
}
test()
// testnet output: "0.999999999999999999"
The async function getRDOCPrice() will return a string containing the price of the token.