@atomiqlabs/sdk
Version:
atomiq labs SDK for cross-chain swaps between smart chains and bitcoin
25 lines (24 loc) • 937 B
TypeScript
import { CoinType, CtorCoinTypes, IPriceProvider } from "../abstract/IPriceProvider";
import { MultiChain } from "../../swapper/Swapper";
import { CustomPriceFunction } from "../../types/CustomPriceFunction";
/**
* Price provider using custom pricing function
*
* @category Pricing
*/
export declare class CustomPriceProvider<T extends MultiChain> extends IPriceProvider<T> {
readonly getUsdPriceFn: CustomPriceFunction;
/**
* @param coinsMap Mapping of token tickers to token addresses
* @param getUsdPriceFn Pricing function, used to retrieve USD prices of the tokens
*/
constructor(coinsMap: CtorCoinTypes<T>, getUsdPriceFn: CustomPriceFunction);
/**
* @inheritDoc
*/
protected fetchPrice(token: CoinType, abortSignal?: AbortSignal): Promise<bigint>;
/**
* @inheritDoc
*/
protected fetchUsdPrice(abortSignal?: AbortSignal): Promise<number>;
}