@pgchain/blockchain-libs
Version:
PGWallet Blockchain Libs
22 lines (21 loc) • 1.06 kB
TypeScript
import BigNumber from 'bignumber.js';
import { ProviderController } from '../provider';
import { CoinInfo } from '../types/chain';
import { StorageLike } from '../types/external-config';
import { PriceChannel } from './interfaces';
declare class PriceController {
private static readonly PRICE_CACHE_TIMEOUT;
readonly providerController: ProviderController;
readonly storage: StorageLike;
private readonly priceCache;
constructor(providerController: ProviderController, storage: StorageLike);
private _channels?;
get channels(): Array<PriceChannel>;
static generateSearchPaths(coin: CoinInfo, unit: string): Array<Array<string>>;
static splitPathsToPairs(paths: Array<Array<string>>): Array<string>;
initChannels(): Array<PriceChannel>;
pricing(coins: Array<CoinInfo>): Promise<void>;
getPrice(coin: CoinInfo, unit: string, orDefault?: number | BigNumber): Promise<BigNumber>;
getPriceNoCache(coin: CoinInfo, unit: string, orDefault?: number | BigNumber): Promise<BigNumber>;
}
export { PriceController };