UNPKG

@mimicry/kaleidoscope

Version:

Kaleidoscope is an NPM package that conveniently aggregates responses from multiple NFT data providers.

12 lines (10 loc) 261 B
import { CurrencyInfo } from '../types'; /** * Given a number and CurrencyInfo, return a bigint. */ export function numberToBigInt( _value: number, _currencyInfo: CurrencyInfo ): bigint { return BigInt(_value * Math.pow(10, _currencyInfo.decimals)); }