@bancor/carbon-sdk
Version:
The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfi
2 lines (1 loc) • 320 B
JavaScript
;exports.Decimals=class{_fetcher;_cachedDecimals=new Map;constructor(e){this._fetcher=e}async fetchDecimals(e){let t=this._cachedDecimals.get(e);if(void 0!==t)return t;if(t=await this._fetcher(e),void 0===t)throw new Error(`Could not fetch decimals for token ${e}`);return this._cachedDecimals.set(e,t),t}};