aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/constants.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-05 01:59:55 +0800
committerFabio Berger <me@fabioberger.com>2018-10-05 01:59:55 +0800
commit3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e (patch)
tree87bda5d41b34973960ec230dfb9320e54aea6588 /packages/asset-buyer/src/constants.ts
parente7ab9938ce5bde17600130584fc75bc8a45f6dc5 (diff)
parent2da7626b5356f7b0ec809719f1b9da14b2969a07 (diff)
downloaddexon-sol-tools-3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e.tar
dexon-sol-tools-3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e.tar.gz
dexon-sol-tools-3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e.tar.bz2
dexon-sol-tools-3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e.tar.lz
dexon-sol-tools-3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e.tar.xz
dexon-sol-tools-3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e.tar.zst
dexon-sol-tools-3991e66a58f28dbed5e75f74ef4aaaf6bb3a4d3e.zip
merge developmemnt
Diffstat (limited to 'packages/asset-buyer/src/constants.ts')
-rw-r--r--packages/asset-buyer/src/constants.ts24
1 files changed, 19 insertions, 5 deletions
diff --git a/packages/asset-buyer/src/constants.ts b/packages/asset-buyer/src/constants.ts
index 79b5d9052..e1056e39b 100644
--- a/packages/asset-buyer/src/constants.ts
+++ b/packages/asset-buyer/src/constants.ts
@@ -1,6 +1,15 @@
import { BigNumber } from '@0xproject/utils';
-import { BuyQuoteRequestOpts } from './types';
+import { AssetBuyerOpts, BuyQuoteExecutionOpts, BuyQuoteRequestOpts } from './types';
+
+const NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
+const MAINNET_NETWORK_ID = 1;
+
+const DEFAULT_ASSET_BUYER_OPTS: AssetBuyerOpts = {
+ networkId: MAINNET_NETWORK_ID,
+ orderRefreshIntervalMs: 10000, // 10 seconds
+ expiryBufferSeconds: 15,
+};
const DEFAULT_BUY_QUOTE_REQUEST_OPTS: BuyQuoteRequestOpts = {
feePercentage: 0,
@@ -8,13 +17,18 @@ const DEFAULT_BUY_QUOTE_REQUEST_OPTS: BuyQuoteRequestOpts = {
slippagePercentage: 0.2, // 20% slippage protection
};
+// Other default values are dynamically determined
+const DEFAULT_BUY_QUOTE_EXECUTION_OPTS: BuyQuoteExecutionOpts = {
+ feeRecipient: NULL_ADDRESS,
+};
+
export const constants = {
ZERO_AMOUNT: new BigNumber(0),
- NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
- MAINNET_NETWORK_ID: 1,
- DEFAULT_ORDER_REFRESH_INTERVAL_MS: 10000, // 10 seconds
+ NULL_ADDRESS,
+ MAINNET_NETWORK_ID,
ETHER_TOKEN_DECIMALS: 18,
+ DEFAULT_ASSET_BUYER_OPTS,
+ DEFAULT_BUY_QUOTE_EXECUTION_OPTS,
DEFAULT_BUY_QUOTE_REQUEST_OPTS,
MAX_PER_PAGE: 10000,
- DEFAULT_EXPIRY_BUFFER_SECONDS: 15,
};