Usage

Redstone api usage

First, you need to import redstone module

// Using Node.js `require()`
const redstone = require('redstone-api');

Then you can fetch the prices with just a single line of code

const price = await redstone.getPrice("AR");

console.log(price.value); // latest price value for AR token (in USD)
console.log(price.timestamp); // the exact timestamp of the price

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.

Last updated