diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-09 01:28:54 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-09 01:28:54 +0800 |
commit | 43cf8d30bdab025cdcda888897d35b25ad455031 (patch) | |
tree | cb07da70da5076e06459209ede8e761fc4479ab7 /packages/website/ts/components | |
parent | ec198343b551020cfed321937d680af59c2ce127 (diff) | |
download | dexon-sol-tools-43cf8d30bdab025cdcda888897d35b25ad455031.tar dexon-sol-tools-43cf8d30bdab025cdcda888897d35b25ad455031.tar.gz dexon-sol-tools-43cf8d30bdab025cdcda888897d35b25ad455031.tar.bz2 dexon-sol-tools-43cf8d30bdab025cdcda888897d35b25ad455031.tar.lz dexon-sol-tools-43cf8d30bdab025cdcda888897d35b25ad455031.tar.xz dexon-sol-tools-43cf8d30bdab025cdcda888897d35b25ad455031.tar.zst dexon-sol-tools-43cf8d30bdab025cdcda888897d35b25ad455031.zip |
Implement blockchain.portalOrderToZeroExOrder
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r-- | packages/website/ts/components/fill_order.tsx | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index 063c57688..51e44134c 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -518,21 +518,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { globalErrMsg = 'You must specify a fill amount'; } - const signedOrder = { - exchangeContractAddress: this.props.blockchain.getExchangeContractAddressIfExists(), - maker: parsedOrder.signedOrder.maker, - taker: _.isEmpty(parsedOrder.signedOrder.taker) ? constants.NULL_ADDRESS : parsedOrder.signedOrder.taker, - makerTokenAddress: parsedOrder.signedOrder.makerTokenAddress, - takerTokenAddress: parsedOrder.signedOrder.takerTokenAddress, - makerTokenAmount: new BigNumber(parsedOrder.signedOrder.makerTokenAmount), - takerTokenAmount: new BigNumber(parsedOrder.signedOrder.takerTokenAmount), - makerFee: new BigNumber(parsedOrder.signedOrder.makerFee), - takerFee: new BigNumber(parsedOrder.signedOrder.takerFee), - expirationUnixTimestampSec: new BigNumber(this.state.parsedOrder.signedOrder.expirationUnixTimestampSec), - feeRecipient: parsedOrder.signedOrder.feeRecipient, - ecSignature: parsedOrder.signedOrder.ecSignature, - salt: new BigNumber(parsedOrder.signedOrder.salt), - }; + const signedOrder = this.props.blockchain.portalOrderToZeroExOrder(parsedOrder); if (_.isEmpty(globalErrMsg)) { try { await this.props.blockchain.validateFillOrderThrowIfInvalidAsync( @@ -621,21 +607,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { const takerTokenAmount = new BigNumber(parsedOrder.signedOrder.takerTokenAmount); - const signedOrder = { - exchangeContractAddress: this.props.blockchain.getExchangeContractAddressIfExists(), - maker: parsedOrder.signedOrder.maker, - taker: parsedOrder.signedOrder.taker, - makerTokenAddress: parsedOrder.signedOrder.makerTokenAddress, - takerTokenAddress: parsedOrder.signedOrder.takerTokenAddress, - makerTokenAmount: new BigNumber(parsedOrder.signedOrder.makerTokenAmount), - takerTokenAmount: new BigNumber(parsedOrder.signedOrder.takerTokenAmount), - makerFee: new BigNumber(parsedOrder.signedOrder.makerFee), - takerFee: new BigNumber(parsedOrder.signedOrder.takerFee), - expirationUnixTimestampSec: new BigNumber(this.state.parsedOrder.signedOrder.expirationUnixTimestampSec), - feeRecipient: parsedOrder.signedOrder.feeRecipient, - ecSignature: parsedOrder.signedOrder.ecSignature, - salt: new BigNumber(parsedOrder.signedOrder.salt), - }; + const signedOrder = this.props.blockchain.portalOrderToZeroExOrder(parsedOrder); const orderHash = ZeroEx.getOrderHashHex(signedOrder); const unavailableTakerAmount = await this.props.blockchain.getUnavailableTakerAmountAsync(orderHash); const availableTakerTokenAmount = takerTokenAmount.minus(unavailableTakerAmount); |