aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-09 09:38:46 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-09 09:38:46 +0800
commita50f0ca997bf3ea09a4ac2c12e406385ba252eb7 (patch)
tree3172c4a04a06d85555ffc44d43d4e833c2d460b6 /packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts
parent39ae21d6939b43fbae0669219801b2bab140da9c (diff)
parent12bc6f5d5816a3c1c5ed03b23ce67a1be4e72f39 (diff)
downloaddexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar
dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.gz
dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.bz2
dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.lz
dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.xz
dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.tar.zst
dexon-sol-tools-a50f0ca997bf3ea09a4ac2c12e406385ba252eb7.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/metamask-connect-flow
Diffstat (limited to 'packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts')
-rw-r--r--packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts14
1 files changed, 13 insertions, 1 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 c3a5e88b9..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';
@@ -7,14 +9,17 @@ import { Dispatch } from 'redux';
import { BuyOrderStateButtons } from '../components/buy_order_state_buttons';
import { Action, actions } from '../redux/actions';
import { State } from '../redux/reducer';
-import { AffiliateInfo, OrderProcessState, ZeroExInstantError } from '../types';
+import { AccountState, AffiliateInfo, OrderProcessState, ZeroExInstantError } from '../types';
import { errorFlasher } from '../util/error_flasher';
import { etherscanUtil } from '../util/etherscan';
interface ConnectedState {
+ accountAddress?: string;
+ accountEthBalanceInWei?: BigNumber;
buyQuote?: BuyQuote;
buyOrderProcessingState: OrderProcessState;
assetBuyer: AssetBuyer;
+ web3Wrapper: Web3Wrapper;
affiliateInfo?: AffiliateInfo;
onViewTransaction: () => void;
}
@@ -31,9 +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: () => {