UNPKG

@atomiqlabs/sdk

Version:

atomiq labs SDK for cross-chain swaps between smart chains and bitcoin

24 lines (23 loc) 821 B
import { CoinType, CtorCoinTypes } from "../abstract/IPriceProvider"; import { HttpPriceProvider } from "./abstract/HttpPriceProvider"; import { MultiChain } from "../../swapper/Swapper"; export type CoinGeckoResponse<Currency extends string> = { [coinId: string]: { [c in Currency]: number; }; }; /** * Price provider using CoinGecko API * @category Pricing */ export declare class CoinGeckoPriceProvider<T extends MultiChain> extends HttpPriceProvider<T> { constructor(coinsMap: CtorCoinTypes<T>, url?: string, httpRequestTimeout?: number); /** * @inheritDoc */ protected fetchPrice(token: CoinType, abortSignal?: AbortSignal): Promise<bigint>; /** * @inheritDoc */ protected fetchUsdPrice(abortSignal?: AbortSignal): Promise<number>; }