import { Amount, CurrencyInfo } from '../types';
import { Decimal } from 'decimal.js';

/**
 * Given a number and CurrencyInfo, return an Amount.
 */
export function numberToAmount(
  _value: number,
  _currencyInfo: CurrencyInfo
): Amount {
  return {
    atomic: BigInt(_value * Math.pow(10, _currencyInfo.decimals)),
    decimal: new Decimal(_value),
  };
}
