Comment on page
getAllPrices
getAllPrices method can be used to fetch the latest price for all the available tokens
▸ getAllPrices(
opts?
: GetPriceOptions): Promise<{ [symbol: string]: PriceData; }>Returns the latest price for all the supported symbols
Parameters:
Name | Type | Default value | Description |
opts | GetPriceOptions | {} | An optional options object.
|
Returns: Promise<{ [symbol: string]: PriceData; }>
The latest price for all the supported tokens
To fetch the latest prices for all available tokens use the
getAllPrices
method.const prices = await redstone.getAllPrices();
console.log(prices); // Example output below
/*
{
"BTC": {...},
"ETH": {...},
...
}
*/
console.log(prices["AR"].value); // latest price value for AR
console.log(prices["EUR"].value); // latest price value for EUR
Last modified 2yr ago