Get the price of the specified pair in real-time
//
// query the price of BTC/USD in real-time
//
const priceObj : ChainLinkPriceResult | null = await new WalletAccount().queryPairPrice( `BTC/USD` );
// should return:
{
chainLink: {
roundId: 110680464442257326336n,
answer: 7087192046296n,
startedAt: 1717653347n,
updatedAt: 1717653347n,
answeredInRound: 110680464442257326336n,
address: '0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c',
decimals: 8
},
price: 7087192046296n,
floatPrice: 70871.92
}
{string} - e.g.: BTC/USD, see: EthereumPriceFeedAddresses.ts
Get the current price of any cryptocurrencies in any other supported currencies that you need.
{string} id of coins, comma-separated if querying more than 1 coin. see: src/resources/coinGeckoCoinList.json
{string} vs_currency of coins, comma-separated if querying more than 1 vs_currency. see: src/resources/coinGeckoSupportedVsCurrencies.json
Get current price of tokens (using contract addresses) for a given platform in any other currency that you need.
{string} The id of the platform issuing tokens. see: src/resources/coinGeckoAssetPlatforms.json
{string} The contract address of tokens, comma separated see: src/resources/ethereumTokens.json.ts
{string} vs_currency of coins, comma-separated if querying more than 1 vs_currency see: src/resources/coinGeckoSupportedVsCurrencies.json
query balance of derivative tokens, and try to query the balance of the native token, if specified.
{string} wallet address
{Array
Optional
ABI: UsdtABIItem[]{Array
query the value of derivative tokens
{string} wallet address
{Array
Optional
ABI: UsdtABIItem[]{Array
query the value of derivative tokens
{string} wallet address
Optional
ABI: UsdtABIItem[]{Array
query value
{string} wallet address
{string} e.g.: ETH/USD, see: EthereumPriceFeedAddresses.ts
Optional
decimals: number = 18{number} decimals, default ot 18
query the balance of native currency on chain