diff options
author | Fabio Berger <me@fabioberger.com> | 2018-11-10 06:20:06 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-11-10 06:20:06 +0800 |
commit | 773cf3cd143769a93cea66b30d46cb9f4620b74d (patch) | |
tree | 549d12546b0076d5e69d1a4570ca7a42b628c5c1 /packages/instant/src/containers/selected_asset_buy_order_state_buttons.ts | |
parent | 53d0f5b98ebd132d51b1fdf463fe57481c895ec4 (diff) | |
parent | b4a11de097258d37fa9271e64fc28a1d012a8d26 (diff) | |
download | dexon-sol-tools-773cf3cd143769a93cea66b30d46cb9f4620b74d.tar dexon-sol-tools-773cf3cd143769a93cea66b30d46cb9f4620b74d.tar.gz dexon-sol-tools-773cf3cd143769a93cea66b30d46cb9f4620b74d.tar.bz2 dexon-sol-tools-773cf3cd143769a93cea66b30d46cb9f4620b74d.tar.lz dexon-sol-tools-773cf3cd143769a93cea66b30d46cb9f4620b74d.tar.xz dexon-sol-tools-773cf3cd143769a93cea66b30d46cb9f4620b74d.tar.zst dexon-sol-tools-773cf3cd143769a93cea66b30d46cb9f4620b74d.zip |
Merge branch 'development' into fixOrderValidation
* development: (25 commits)
Publish
Updated CHANGELOGS
fix(instant): fix bug where we potentially fetch balance for the wrong account
fix: Lock Ledger hw-transport to 4.24.0
fix: wrong prop names used
chore: PR feedback
fix: broken features because of merge
fix: remove default props, fix lint problems
chore: convert payment method to stateless component
feat: add boxShadow on dropdown hover
fix: various style issues
fix: remove all:initial rule from all div based ui compoennts
fix: token selector scrolling container height
chore(instant): fix lint errors
feat(instant): fetch balance at startup
feat(instant): fetch account address at startup and drive account state changes
chore: cleanup
fix: restore button to previous state
feat: implement copy-to-clipboard
feat: add MetaMask sign, refactor Circle
...
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.ts | 14 |
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: () => { |