From fd4b4f8f8289d1e5a873ff5aa0aa9f7ac6a2ba08 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 18 Sep 2018 23:56:07 +0200 Subject: Make ForwaderWrapper take in a number for feePercentage instead of BigNumber --- packages/contract-wrappers/src/utils/utils.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/contract-wrappers/src/utils/utils.ts') 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); + }, }; -- cgit