diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-09-24 23:47:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-24 23:47:59 +0800 |
commit | b830c28d83a33c0170d4f150ee287ea97ccf7865 (patch) | |
tree | 34aa214865e941723a66b34fd45c59036015ae53 /packages/contract-wrappers/src/utils/utils.ts | |
parent | 4a316571ff9b539a540f0503b5753eb03509fea8 (diff) | |
parent | d8d1c98a40f5cc895329f73af4d8d000c6a5195b (diff) | |
download | dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.gz dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.bz2 dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.lz dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.xz dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.zst dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.zip |
Merge pull request #1037 from 0xProject/feature/forwarder-helper/sra-and-rpc
[asset-buyer] Create new AssetBuyer class
Diffstat (limited to 'packages/contract-wrappers/src/utils/utils.ts')
-rw-r--r-- | packages/contract-wrappers/src/utils/utils.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/contract-wrappers/src/utils/utils.ts b/packages/contract-wrappers/src/utils/utils.ts index 689a7ee0a..f7949ec34 100644 --- a/packages/contract-wrappers/src/utils/utils.ts +++ b/packages/contract-wrappers/src/utils/utils.ts @@ -1,4 +1,7 @@ import { BigNumber } from '@0xproject/utils'; +import { Web3Wrapper } from '@0xproject/web3-wrapper'; + +import { constants } from './constants'; export const utils = { getCurrentUnixTimestampSec(): BigNumber { @@ -8,4 +11,7 @@ export const utils = { getCurrentUnixTimestampMs(): BigNumber { return new BigNumber(Date.now()); }, + numberPercentageToEtherTokenAmountPercentage(percentage: number): BigNumber { + return Web3Wrapper.toBaseUnitAmount(constants.ONE_AMOUNT, constants.ETHER_TOKEN_DECIMALS).mul(percentage); + }, }; |