Usage
Redstone api usage
First, you need to import redstone module
Node.js require
ES6 import
1
// Using Node.js `require()`
2
const redstone = require('redstone-api');
Copied!
1
// Using ES6 imports
2
import redstone from 'redstone-api';
Copied!
Then you can fetch the prices with just a single line of code
1
const price = await redstone.getPrice("AR");
2
3
console.log(price.value); // latest price value for AR token (in USD)
4
console.log(price.timestamp); // the exact timestamp of the price
Copied!
See more examples in the documentation of the following methods:
You can also check out docs for the redstone fluent interface, which makes the price fetching even simpler thanks to human readable syntax.
Copy link