diff options
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 4 | ||||
-rw-r--r-- | packages/instant/src/util/balance.ts | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 13c1dc88c..129aedaf3 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -49,8 +49,8 @@ export class BuyButton extends React.Component<BuyButtonProps> { this.props.onValidationPending(buyQuote); const takerAddress = await getBestAddress(); - const hasSufficentEth = await balanceUtil.hasSufficentEth(takerAddress, buyQuote, web3Wrapper); - if (!hasSufficentEth) { + const hasSufficientEth = await balanceUtil.hasSufficientEth(takerAddress, buyQuote, web3Wrapper); + if (!hasSufficientEth) { this.props.onValidationFail(buyQuote, ZeroExInstantError.InsufficientETH); return; } diff --git a/packages/instant/src/util/balance.ts b/packages/instant/src/util/balance.ts index 533656858..f2271495b 100644 --- a/packages/instant/src/util/balance.ts +++ b/packages/instant/src/util/balance.ts @@ -3,11 +3,11 @@ import { Web3Wrapper } from '@0x/web3-wrapper'; import * as _ from 'lodash'; export const balanceUtil = { - hasSufficentEth: async (takerAddress: string | undefined, buyQuote: BuyQuote, web3Wrapper: Web3Wrapper) => { + hasSufficientEth: async (takerAddress: string | undefined, buyQuote: BuyQuote, web3Wrapper: Web3Wrapper) => { if (_.isUndefined(takerAddress)) { return false; } const balanceWei = await web3Wrapper.getBalanceInWeiAsync(takerAddress); - return balanceWei >= buyQuote.worstCaseQuoteInfo.totalEthAmount; + return balanceWei.gte(buyQuote.worstCaseQuoteInfo.totalEthAmount); }, }; |