aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/instant/src/util/gas_price_estimator.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/instant/src/util/gas_price_estimator.ts b/packages/instant/src/util/gas_price_estimator.ts
index 818bf6f92..33eeb932d 100644
--- a/packages/instant/src/util/gas_price_estimator.ts
+++ b/packages/instant/src/util/gas_price_estimator.ts
@@ -1,4 +1,4 @@
-import { BigNumber } from '@0x/utils';
+import { BigNumber, fetchAsync } from '@0x/utils';
import { DEFAULT_GAS_PRICE, ETH_GAS_STATION_API_BASE_URL } from '../constants';
@@ -16,8 +16,8 @@ interface EthGasStationResult {
safeLow: number;
}
-const fetchFastAmountInWei = async () => {
- const res = await fetch(`${ETH_GAS_STATION_API_BASE_URL}/json/ethgasAPI.json`);
+const fetchFastAmountInWeiAsync = async () => {
+ const res = await fetchAsync(`${ETH_GAS_STATION_API_BASE_URL}/json/ethgasAPI.json`);
const gasInfo = (await res.json()) as EthGasStationResult;
const gasPriceInGwei = new BigNumber(gasInfo.fast / 10);
return gasPriceInGwei.mul(1000000000);
@@ -28,7 +28,7 @@ export class GasPriceEstimator {
public async getFastAmountInWeiAsync(): Promise<BigNumber> {
let fetchedAmount: BigNumber | undefined;
try {
- fetchedAmount = await fetchFastAmountInWei();
+ fetchedAmount = await fetchFastAmountInWeiAsync();
} catch {
fetchedAmount = undefined;
}