import BigNumber from 'bignumber.js' ; export class Web3Pure { static toWei ( amount , decimals = 18 ) { return new BigNumber ( amount || 0 ) . times ( new BigNumber ( 10 ) . pow ( decimals ) ) . toFixed ( 0 ) ; } static fromWei ( amountInWei , decimals = 18 ) { return new BigNumber ( amountInWei ) . div ( new BigNumber ( 10 ) . pow ( decimals ) ) ; } static calculateGasMargin ( amount , percent ) { return new BigNumber ( amount || '0' ) . multipliedBy ( percent ) . toFixed ( 0 ) ; } }