aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-11-08 15:36:00 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-11-08 15:41:25 +0800
commitcde192df0d48bb45f57c319179dbd9f64abd13e9 (patch)
tree010893e4f4e993e668d26bf049a446a27e4a48fc /packages/instant/src/containers
parentd0c009adff53d94414cf51028eff490e0452a3c9 (diff)
downloaddexon-0x-contracts-cde192df0d48bb45f57c319179dbd9f64abd13e9.tar.gz
dexon-0x-contracts-cde192df0d48bb45f57c319179dbd9f64abd13e9.tar.zst
dexon-0x-contracts-cde192df0d48bb45f57c319179dbd9f64abd13e9.zip
feat(instant): fetch balance at startup
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r--packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts b/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts
index 2678d4a36..610335243 100644
--- a/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts
+++ b/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts
@@ -1,4 +1,6 @@
import { AssetBuyer, AssetBuyerError, BuyQuote } from '@0x/asset-buyer';
+import { BigNumber } from '@0x/utils';
+import { Web3Wrapper } from '@0x/web3-wrapper';
import * as _ from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
@@ -13,9 +15,11 @@ import { etherscanUtil } from '../util/etherscan';
interface ConnectedState {
accountAddress?: string;
+ accountEthBalanceInWei?: BigNumber;
buyQuote?: BuyQuote;
buyOrderProcessingState: OrderProcessState;
assetBuyer: AssetBuyer;
+ web3Wrapper: Web3Wrapper;
affiliateInfo?: AffiliateInfo;
onViewTransaction: () => void;
}
@@ -32,12 +36,16 @@ interface ConnectedDispatch {
export interface SelectedAssetBuyOrderStateButtons {}
const mapStateToProps = (state: State, _ownProps: SelectedAssetBuyOrderStateButtons): ConnectedState => {
const assetBuyer = state.providerState.assetBuyer;
+ const web3Wrapper = state.providerState.web3Wrapper;
const account = state.providerState.account;
const accountAddress = account.state === AccountState.Ready ? account.address : undefined;
+ const accountEthBalanceInWei = account.state === AccountState.Ready ? account.ethBalanceInWei : undefined;
return {
accountAddress,
+ accountEthBalanceInWei,
buyOrderProcessingState: state.buyOrderState.processState,
assetBuyer,
+ web3Wrapper,
buyQuote: state.latestBuyQuote,
affiliateInfo: state.affiliateInfo,
onViewTransaction: () => {