UNPKG

@cygnus-wealth/asset-valuator

Version:

Asset valuation library for retrieving and converting cryptocurrency prices

15 lines (14 loc) 553 B
import { PriceProvider, AssetPrice, ConversionOptions } from './types.js'; export declare class AssetValuator { private provider; private cache; private cacheTimeout; constructor(provider?: PriceProvider); private getCacheKey; private getCachedOrFetchPrice; getPrice(base: string, quote?: string): Promise<AssetPrice>; convert(options: ConversionOptions): Promise<number>; getPrices(symbols: string[], quote?: string): Promise<AssetPrice[]>; setCacheTimeout(milliseconds: number): void; clearCache(): void; }