UNPKG

@covalenthq/client-sdk

Version:

<div align="center"> <a href="https://goldrush.dev/products/goldrush/" target="_blank" rel="noopener noreferrer"> <img alt="GoldRush TS SDK Logo" src="./repo-static/ts-sdk-banner.png" style="max-width: 100%;"/> </a> </div>

26 lines (25 loc) 1.58 kB
import { type Execution } from "../utils/functions/execution"; import { type Chain, type GoldRushResponse, type Quote } from "../utils/types/Generic.types"; import { type GetTokenPricesQueryParamOpts, type TokenPricesResponse } from "../utils/types/PricingService.types"; /** * Pricing API * */ export declare class PricingService { private execution; constructor(execution: Execution); /** * * Commonly used to get historic prices of a token between date ranges. Supports native tokens. * * @param {Chain} chainName - The chain name eg: `eth-mainnet` or 1. * @param {string} quoteCurrency - The currency to convert. Supports `USD`, `CAD`, `EUR`, `SGD`, `INR`, `JPY`, `VND`, `CNY`, `KRW`, `RUB`, `TRY`, `NGN`, `ARS`, `AUD`, `CHF`, and `GBP`. * @param {string} contractAddress - Contract address for the token. Passing in an `ENS`, `RNS`, `Lens Handle`, or an `Unstoppable Domain` resolves automatically. Supports multiple contract addresses separated by commas. * @param {GetTokenPricesQueryParamOpts} queryParamOpts * - `from`: The start day of the historical price range (YYYY-MM-DD). * - `to`: The end day of the historical price range (YYYY-MM-DD). * - `pricesAtAsc`: Sort the prices in chronological ascending order. By default, it's set to `false` and returns prices in chronological descending order. * */ getTokenPrices(chainName: Chain, quoteCurrency: Quote, contractAddress: string, queryParamOpts?: GetTokenPricesQueryParamOpts): Promise<GoldRushResponse<TokenPricesResponse[]>>; }