@mimicry/kaleidoscope
Version:
Kaleidoscope is an NPM package that conveniently aggregates responses from multiple NFT data providers.
15 lines (13 loc) • 417 B
text/typescript
import { CurrencyInfo, Value } from '../types';
import { bigIntToValue } from './bigIntToValue';
import { numberToBigInt } from './numberToBigInt';
/**
* Given a number and CurrencyInfo, return a bigint.
*/
export function numberToValue(
_value: number,
_currencyInfo: CurrencyInfo
): Value {
const bigValue: bigint = numberToBigInt(_value, _currencyInfo);
return bigIntToValue(bigValue, _currencyInfo);
}