aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-07 21:41:40 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-02-07 21:41:40 +0800
commit9b3680780fab26543331524870eba75eea08a426 (patch)
tree8ed51682e7f1a7b86d1ea84c9f53ef468f7ccaf2 /packages/website/ts/components
parent12d62e1157168ec9e8cd23749523b2bcda8eefe5 (diff)
downloaddexon-0x-contracts-9b3680780fab26543331524870eba75eea08a426.tar.gz
dexon-0x-contracts-9b3680780fab26543331524870eba75eea08a426.tar.zst
dexon-0x-contracts-9b3680780fab26543331524870eba75eea08a426.zip
Rename expiration to expirationUnixTimestampSec
Diffstat (limited to 'packages/website/ts/components')
-rw-r--r--packages/website/ts/components/fill_order.tsx16
-rw-r--r--packages/website/ts/components/portal.tsx16
2 files changed, 20 insertions, 12 deletions
diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx
index 97f616be2..c0b16f251 100644
--- a/packages/website/ts/components/fill_order.tsx
+++ b/packages/website/ts/components/fill_order.tsx
@@ -20,7 +20,7 @@ import { VisualOrder } from 'ts/components/visual_order';
import { Dispatcher } from 'ts/redux/dispatcher';
import { orderSchema } from 'ts/schemas/order_schema';
import { SchemaValidator } from 'ts/schemas/validator';
-import { AlertTypes, BlockchainErrs, Order, Token, TokenByAddress, WebsitePaths } from 'ts/types';
+import { AlertTypes, BlockchainErrs, SerializedOrder, Token, TokenByAddress, WebsitePaths } from 'ts/types';
import { colors } from 'ts/utils/colors';
import { constants } from 'ts/utils/constants';
import { errorReporter } from 'ts/utils/error_reporter';
@@ -34,7 +34,7 @@ interface FillOrderProps {
networkId: number;
userAddress: string;
tokenByAddress: TokenByAddress;
- initialOrder: Order;
+ initialOrder: SerializedOrder;
dispatcher: Dispatcher;
lastForceTokenStateRefetch: number;
}
@@ -45,7 +45,7 @@ interface FillOrderState {
globalErrMsg: string;
orderJSON: string;
orderJSONErrMsg: string;
- parsedOrder: Order;
+ parsedOrder: SerializedOrder;
didFillOrderSucceed: boolean;
didCancelOrderSucceed: boolean;
unavailableTakerAmount: BigNumber;
@@ -204,7 +204,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
const orderTaker = !_.isEmpty(this.state.parsedOrder.taker.address)
? this.state.parsedOrder.taker.address
: this.props.userAddress;
- const parsedOrderExpiration = new BigNumber(this.state.parsedOrder.expiration);
+ const parsedOrderExpiration = new BigNumber(this.state.parsedOrder.expirationUnixTimestampSec);
const exchangeRate = orderMakerAmount.div(orderTakerAmount);
let orderReceiveAmount = 0;
@@ -402,7 +402,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
}
private async _validateFillOrderFireAndForgetAsync(orderJSON: string) {
let orderJSONErrMsg = '';
- let parsedOrder: Order;
+ let parsedOrder: SerializedOrder;
try {
const order = JSON.parse(orderJSON);
const validationResult = this._validator.validate(order, orderSchema);
@@ -416,7 +416,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
const exchangeContractAddr = this.props.blockchain.getExchangeContractAddressIfExists();
const makerAmount = new BigNumber(parsedOrder.maker.amount);
const takerAmount = new BigNumber(parsedOrder.taker.amount);
- const expiration = new BigNumber(parsedOrder.expiration);
+ 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);
@@ -538,7 +538,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
new BigNumber(parsedOrder.taker.amount),
new BigNumber(parsedOrder.maker.feeAmount),
new BigNumber(parsedOrder.taker.feeAmount),
- new BigNumber(this.state.parsedOrder.expiration),
+ new BigNumber(this.state.parsedOrder.expirationUnixTimestampSec),
parsedOrder.feeRecipient,
parsedOrder.signature,
new BigNumber(parsedOrder.salt),
@@ -641,7 +641,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> {
takerTokenAmount,
new BigNumber(parsedOrder.maker.feeAmount),
new BigNumber(parsedOrder.taker.feeAmount),
- new BigNumber(this.state.parsedOrder.expiration),
+ new BigNumber(this.state.parsedOrder.expirationUnixTimestampSec),
parsedOrder.feeRecipient,
parsedOrder.signature,
new BigNumber(parsedOrder.salt),
diff --git a/packages/website/ts/components/portal.tsx b/packages/website/ts/components/portal.tsx
index 92589f75c..6727645fc 100644
--- a/packages/website/ts/components/portal.tsx
+++ b/packages/website/ts/components/portal.tsx
@@ -23,7 +23,15 @@ import { localStorage } from 'ts/local_storage/local_storage';
import { Dispatcher } from 'ts/redux/dispatcher';
import { orderSchema } from 'ts/schemas/order_schema';
import { SchemaValidator } from 'ts/schemas/validator';
-import { BlockchainErrs, HashData, Order, ProviderType, ScreenWidths, TokenByAddress, WebsitePaths } from 'ts/types';
+import {
+ BlockchainErrs,
+ HashData,
+ ProviderType,
+ ScreenWidths,
+ SerializedOrder,
+ TokenByAddress,
+ WebsitePaths,
+} from 'ts/types';
import { colors } from 'ts/utils/colors';
import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants';
@@ -48,7 +56,7 @@ export interface PortalAllProps {
userEtherBalance: BigNumber;
userAddress: string;
shouldBlockchainErrDialogBeOpen: boolean;
- userSuppliedOrderCache: Order;
+ userSuppliedOrderCache: SerializedOrder;
location: Location;
flashMessage?: string | React.ReactNode;
lastForceTokenStateRefetch: number;
@@ -66,7 +74,7 @@ interface PortalAllState {
export class Portal extends React.Component<PortalAllProps, PortalAllState> {
private _blockchain: Blockchain;
- private _sharedOrderIfExists: Order;
+ private _sharedOrderIfExists: SerializedOrder;
private _throttledScreenWidthUpdate: () => void;
public static hasAlreadyDismissedWethNotice() {
const didDismissWethNotice = localStorage.getItemIfExists(constants.LOCAL_STORAGE_KEY_DISMISS_WETH_NOTICE);
@@ -349,7 +357,7 @@ export class Portal extends React.Component<PortalAllProps, PortalAllState> {
isWethNoticeDialogOpen: false,
});
}
- private _getSharedOrderIfExists(): Order | undefined {
+ private _getSharedOrderIfExists(): SerializedOrder | undefined {
const queryString = window.location.search;
if (queryString.length === 0) {
return undefined;