aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Millman <brandon@0xproject.com>2018-10-30 06:17:29 +0800
committerGitHub <noreply@github.com>2018-10-30 06:17:29 +0800
commit48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae (patch)
tree56639fa21ff4907defb8b30557ed02d951ebe675
parentfdf9e860dedf5dbe7840951f304a33ac2d7b1b51 (diff)
parentaeec8f47ef9f72d73674f625a381f60df8a3246a (diff)
downloaddexon-0x-contracts-48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae.tar
dexon-0x-contracts-48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae.tar.gz
dexon-0x-contracts-48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae.tar.bz2
dexon-0x-contracts-48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae.tar.lz
dexon-0x-contracts-48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae.tar.xz
dexon-0x-contracts-48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae.tar.zst
dexon-0x-contracts-48ff13e3e22bf9f71bc1a367f86aaa0ae89989ae.zip
Merge pull request #1196 from 0xProject/feature/instant/default-gas-price
[instant] Add default gasPrice of 6 gwei to transactions
-rw-r--r--packages/instant/src/components/buy_button.tsx5
-rw-r--r--packages/instant/src/constants.ts2
2 files changed, 5 insertions, 2 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 129aedaf3..e65e62e47 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -2,7 +2,7 @@ import { AssetBuyer, AssetBuyerError, BuyQuote } from '@0x/asset-buyer';
import * as _ from 'lodash';
import * as React from 'react';
-import { WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX } from '../constants';
+import { DEFAULT_GAS_PRICE, WEB_3_WRAPPER_TRANSACTION_FAILED_ERROR_MSG_PREFIX } from '../constants';
import { ColorOption } from '../style/theme';
import { ZeroExInstantError } from '../types';
import { getBestAddress } from '../util/address';
@@ -57,7 +57,8 @@ export class BuyButton extends React.Component<BuyButtonProps> {
let txHash: string | undefined;
try {
- txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote, { takerAddress });
+ const gasPrice = DEFAULT_GAS_PRICE;
+ txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote, { gasPrice, takerAddress });
} catch (e) {
if (e instanceof Error) {
if (e.message === AssetBuyerError.SignatureRequestDenied) {
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts
index e4281d54a..47cb2eaeb 100644
--- a/packages/instant/src/constants.ts
+++ b/packages/instant/src/constants.ts
@@ -3,3 +3,5 @@ export const BIG_NUMBER_ZERO = new BigNumber(0);
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 DEFAULT_GAS_PRICE = GWEI_IN_WEI.mul(6);