aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-02 02:15:34 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-02 02:15:34 +0800
commitcd79a2fad1babd1d421c693208cd7de5ae980630 (patch)
treeeedd29933a0a41233ed8088b977b1da485098d91 /packages/instant
parentf82d16a5b06a47f3ede917165ba75dfd73f48137 (diff)
downloaddexon-sol-tools-cd79a2fad1babd1d421c693208cd7de5ae980630.tar
dexon-sol-tools-cd79a2fad1babd1d421c693208cd7de5ae980630.tar.gz
dexon-sol-tools-cd79a2fad1babd1d421c693208cd7de5ae980630.tar.bz2
dexon-sol-tools-cd79a2fad1babd1d421c693208cd7de5ae980630.tar.lz
dexon-sol-tools-cd79a2fad1babd1d421c693208cd7de5ae980630.tar.xz
dexon-sol-tools-cd79a2fad1babd1d421c693208cd7de5ae980630.tar.zst
dexon-sol-tools-cd79a2fad1babd1d421c693208cd7de5ae980630.zip
Use new constants
Diffstat (limited to 'packages/instant')
-rw-r--r--packages/instant/src/components/time_counter.tsx5
-rw-r--r--packages/instant/src/constants.ts4
2 files changed, 6 insertions, 3 deletions
diff --git a/packages/instant/src/components/time_counter.tsx b/packages/instant/src/components/time_counter.tsx
index 7d9245b5d..c98fd2550 100644
--- a/packages/instant/src/components/time_counter.tsx
+++ b/packages/instant/src/components/time_counter.tsx
@@ -1,5 +1,6 @@
import * as React from 'react';
+import { ONE_SECOND_MS } from '../constants';
import { timeUtil } from '../util/time';
import { Flex } from './ui/flex';
@@ -34,7 +35,7 @@ export class TimeCounter extends React.Component<TimeCounterProps, TimeCounterSt
}
public render(): React.ReactNode {
- const estimatedTimeSeconds = this.props.estimatedTimeMs / 1000;
+ const estimatedTimeSeconds = this.props.estimatedTimeMs / ONE_SECOND_MS;
return (
<Flex justify="space-between">
<Text>Est. Time ({timeUtil.secondsToHumanDescription(estimatedTimeSeconds)})</Text>
@@ -53,7 +54,7 @@ export class TimeCounter extends React.Component<TimeCounterProps, TimeCounterSt
this.setState({
elapsedSeconds: this.state.elapsedSeconds + 1,
});
- }, 1000);
+ }, ONE_SECOND_MS);
}
private _clearTimer(): void {
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts
index df1e6f53f..e811d3d13 100644
--- a/packages/instant/src/constants.ts
+++ b/packages/instant/src/constants.ts
@@ -4,8 +4,10 @@ export const ETH_DECIMALS = 18;
export const DEFAULT_ZERO_EX_CONTAINER_SELECTOR = '#zeroExInstantContainer';
export const WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX = 'Transaction failed';
export const GWEI_IN_WEI = new BigNumber(1000000000);
+export const ONE_SECOND_MS = 1000;
+export const ONE_MINUTE_MS = ONE_SECOND_MS * 60;
export const DEFAULT_GAS_PRICE = GWEI_IN_WEI.mul(6);
-export const DEFAULT_ESTIMATED_TRANSACTION_TIME_MS = 2 * 60 * 1000; // 2 minutes
+export const DEFAULT_ESTIMATED_TRANSACTION_TIME_MS = ONE_MINUTE_MS * 2;
export const ETH_GAS_STATION_API_BASE_URL = 'https://ethgasstation.info';
export const COINBASE_API_BASE_URL = 'https://api.coinbase.com/v2';
export const PROGRESS_STALL_AT_WIDTH = '95%';