R
R
Redstone API
Github
NPM
Website
Discord
Search…
1.0.0
What is Redstone API
Getting started
Installation
Usage
Methods
getPrice
getHistoricalPrice
getAllPrices
query
Fluent interface
Redstone query
HTTP API
Prices HTTP Api
Knowledge base
Cache layer
Signature verification
Provider
Links
Github repo
NPM
Website
Discord
Powered By
GitBook
getAllPrices
getAllPrices method can be used to fetch the latest price for all the available tokens
Get the latest price for all 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.
opts.provider:
provider name (string)
opts.verifySignature
: enable signature verification (boolean)
Returns:
Promise
<{ [symbol: string]: PriceData; }>
The latest price for all the supported tokens
Examples
Get prices for all available tokens
To fetch the latest prices for all available tokens use the
getAllPrices
method.
1
const
prices
=
await
redstone
.
getAllPrices
();
2
3
console
.
log
(
prices
);
// Example output below
4
/*
5
{
6
"BTC": {...},
7
"ETH": {...},
8
...
9
}
10
*/
11
12
console
.
log
(
prices
[
"AR"
].
value
);
// latest price value for AR
13
console
.
log
(
prices
[
"EUR"
].
value
);
// latest price value for EUR
Copied!
Methods - Previous
getHistoricalPrice
Next - Methods
query
Last modified
11mo ago
Copy link
Contents
Get the latest price for all tokens
Examples
Get prices for all available tokens