aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/constants.ts
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-09-24 23:47:59 +0800
committerGitHub <noreply@github.com>2018-09-24 23:47:59 +0800
commitb830c28d83a33c0170d4f150ee287ea97ccf7865 (patch)
tree34aa214865e941723a66b34fd45c59036015ae53 /packages/asset-buyer/src/constants.ts
parent4a316571ff9b539a540f0503b5753eb03509fea8 (diff)
parentd8d1c98a40f5cc895329f73af4d8d000c6a5195b (diff)
downloaddexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar
dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.gz
dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.bz2
dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.lz
dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.xz
dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.tar.zst
dexon-sol-tools-b830c28d83a33c0170d4f150ee287ea97ccf7865.zip
Merge pull request #1037 from 0xProject/feature/forwarder-helper/sra-and-rpc
[asset-buyer] Create new AssetBuyer class
Diffstat (limited to 'packages/asset-buyer/src/constants.ts')
-rw-r--r--packages/asset-buyer/src/constants.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/asset-buyer/src/constants.ts b/packages/asset-buyer/src/constants.ts
new file mode 100644
index 000000000..79b5d9052
--- /dev/null
+++ b/packages/asset-buyer/src/constants.ts
@@ -0,0 +1,20 @@
+import { BigNumber } from '@0xproject/utils';
+
+import { BuyQuoteRequestOpts } from './types';
+
+const DEFAULT_BUY_QUOTE_REQUEST_OPTS: BuyQuoteRequestOpts = {
+ feePercentage: 0,
+ shouldForceOrderRefresh: false,
+ slippagePercentage: 0.2, // 20% slippage protection
+};
+
+export const constants = {
+ ZERO_AMOUNT: new BigNumber(0),
+ NULL_ADDRESS: '0x0000000000000000000000000000000000000000',
+ MAINNET_NETWORK_ID: 1,
+ DEFAULT_ORDER_REFRESH_INTERVAL_MS: 10000, // 10 seconds
+ ETHER_TOKEN_DECIMALS: 18,
+ DEFAULT_BUY_QUOTE_REQUEST_OPTS,
+ MAX_PER_PAGE: 10000,
+ DEFAULT_EXPIRY_BUFFER_SECONDS: 15,
+};