From 1c9428cbba873fe8d5bd18b2cb10522cbdb17a3f Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 7 Feb 2018 15:02:41 +0100 Subject: Move .taker.feeAmount to .takerFee and .maker.feeAmount to .makerFee --- packages/website/ts/components/fill_order.tsx | 12 ++++++------ packages/website/ts/schemas/order_schema.ts | 4 ++++ packages/website/ts/schemas/order_taker_schema.ts | 3 +-- packages/website/ts/types.ts | 12 ++++++++++-- packages/website/ts/utils/utils.ts | 4 ++-- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index 33c88f61e..7cef247a3 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -418,8 +418,8 @@ export class FillOrder extends React.Component { const takerAmount = new BigNumber(parsedOrder.taker.amount); const expiration = new BigNumber(parsedOrder.expirationUnixTimestampSec); const salt = new BigNumber(parsedOrder.salt); - const parsedMakerFee = new BigNumber(parsedOrder.maker.feeAmount); - const parsedTakerFee = new BigNumber(parsedOrder.taker.feeAmount); + const parsedMakerFee = new BigNumber(parsedOrder.makerFee); + const parsedTakerFee = new BigNumber(parsedOrder.takerFee); const zeroExOrder: ZeroExOrder = { exchangeContractAddress: parsedOrder.exchangeContractAddress, @@ -536,8 +536,8 @@ export class FillOrder extends React.Component { parsedOrder.taker.token.address, new BigNumber(parsedOrder.maker.amount), new BigNumber(parsedOrder.taker.amount), - new BigNumber(parsedOrder.maker.feeAmount), - new BigNumber(parsedOrder.taker.feeAmount), + new BigNumber(parsedOrder.makerFee), + new BigNumber(parsedOrder.takerFee), new BigNumber(this.state.parsedOrder.expirationUnixTimestampSec), parsedOrder.feeRecipient, parsedOrder.ecSignature, @@ -639,8 +639,8 @@ export class FillOrder extends React.Component { parsedOrder.taker.token.address, new BigNumber(parsedOrder.maker.amount), takerTokenAmount, - new BigNumber(parsedOrder.maker.feeAmount), - new BigNumber(parsedOrder.taker.feeAmount), + new BigNumber(parsedOrder.makerFee), + new BigNumber(parsedOrder.takerFee), new BigNumber(this.state.parsedOrder.expirationUnixTimestampSec), parsedOrder.feeRecipient, parsedOrder.ecSignature, diff --git a/packages/website/ts/schemas/order_schema.ts b/packages/website/ts/schemas/order_schema.ts index 430f707da..e69891df1 100644 --- a/packages/website/ts/schemas/order_schema.ts +++ b/packages/website/ts/schemas/order_schema.ts @@ -3,6 +3,8 @@ export const orderSchema = { properties: { maker: { $ref: '/OrderTaker' }, taker: { $ref: '/OrderTaker' }, + makerFee: { type: 'string' }, + takerFee: { type: 'string' }, salt: { type: 'string' }, ecSignature: { $ref: '/SignatureData' }, expirationUnixTimestampSec: { type: 'string' }, @@ -13,6 +15,8 @@ export const orderSchema = { required: [ 'maker', 'taker', + 'makerFee', + 'takerFee', 'salt', 'ecSignature', 'expirationUnixTimestampSec', diff --git a/packages/website/ts/schemas/order_taker_schema.ts b/packages/website/ts/schemas/order_taker_schema.ts index c784c29c5..c8d56a417 100644 --- a/packages/website/ts/schemas/order_taker_schema.ts +++ b/packages/website/ts/schemas/order_taker_schema.ts @@ -4,8 +4,7 @@ export const orderTakerSchema = { address: { type: 'string' }, token: { $ref: '/Token' }, amount: { type: 'string' }, - feeAmount: { type: 'string' }, }, - required: ['address', 'token', 'amount', 'feeAmount'], + required: ['address', 'token', 'amount'], type: 'object', }; diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts index dad2e734f..28822d484 100644 --- a/packages/website/ts/types.ts +++ b/packages/website/ts/types.ts @@ -80,9 +80,17 @@ export interface Order { networkId: number; } +export interface SerializedOrderParty { + address: string; + token: OrderToken; + amount: string; +} + export interface SerializedOrder { - maker: OrderParty; - taker: OrderParty; + maker: SerializedOrderParty; + taker: SerializedOrderParty; + makerFee: string; + takerFee: string; expirationUnixTimestampSec: string; feeRecipient: string; salt: string; diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 7204586c6..b615ba646 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -75,6 +75,8 @@ export const utils = { const makerToken = tokenByAddress[sideToAssetToken[Side.Deposit].address]; const takerToken = tokenByAddress[sideToAssetToken[Side.Receive].address]; const order = { + makerFee: makerFee.toString(), + takerFee: takerFee.toString(), maker: { address: orderMakerAddress, token: { @@ -84,7 +86,6 @@ export const utils = { address: makerToken.address, }, amount: sideToAssetToken[Side.Deposit].amount.toString(), - feeAmount: makerFee.toString(), }, taker: { address: orderTakerAddress, @@ -95,7 +96,6 @@ export const utils = { address: takerToken.address, }, amount: sideToAssetToken[Side.Receive].amount.toString(), - feeAmount: takerFee.toString(), }, expirationUnixTimestampSec: expirationUnixTimestampSec.toString(), feeRecipient, -- cgit