aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/buy_button.tsx
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-03 06:34:37 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-03 06:34:37 +0800
commitcfa748e2062160858a6135643b2c1d8cfe4d1adb (patch)
treeee08a088547ed4cfa575f0edc0c68239923bf829 /packages/instant/src/components/buy_button.tsx
parent8284f9c2ba80992609149333f8feb70fbe9b1bd1 (diff)
parent18fef7ade493798426417c7095d0458219423d14 (diff)
downloaddexon-0x-contracts-cfa748e2062160858a6135643b2c1d8cfe4d1adb.tar.gz
dexon-0x-contracts-cfa748e2062160858a6135643b2c1d8cfe4d1adb.tar.zst
dexon-0x-contracts-cfa748e2062160858a6135643b2c1d8cfe4d1adb.zip
Merge branch 'development' into fix/instant/decimal-fields-scaling-amount-input-bn
Diffstat (limited to 'packages/instant/src/components/buy_button.tsx')
-rw-r--r--packages/instant/src/components/buy_button.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 12ac62601..9d9a8540c 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -1,4 +1,5 @@
import { AssetBuyer, AssetBuyerError, BuyQuote } from '@0x/asset-buyer';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import * as React from 'react';
import { oc } from 'ts-optchain';
@@ -10,7 +11,6 @@ import { getBestAddress } from '../util/address';
import { balanceUtil } from '../util/balance';
import { gasPriceEstimator } from '../util/gas_price_estimator';
import { util } from '../util/util';
-import { web3Wrapper } from '../util/web3_wrapper';
import { Button, Text } from './ui';
@@ -50,7 +50,8 @@ export class BuyButton extends React.Component<BuyButtonProps> {
}
this.props.onValidationPending(buyQuote);
- const takerAddress = await getBestAddress();
+ const web3Wrapper = new Web3Wrapper(assetBuyer.provider);
+ const takerAddress = await getBestAddress(web3Wrapper);
const hasSufficientEth = await balanceUtil.hasSufficientEth(takerAddress, buyQuote, web3Wrapper);
if (!hasSufficientEth) {