on master help sign in
devex: cleanup
788cba3tomholford
src/components/L2/Dropdowns/FeeDropdown.tsx−2
@@ -17,8 +17,6 @@ export interface GasPriceData {
17 suggestedBaseFeePerGas: number;
17 suggestedBaseFeePerGas: number;
18}
18}
19
19
20−// Convert seconds to minutes prettily
21−export const formatWait = (wait: number) => Math.round((wait * 100) / 60) / 100;
22export const formatDisplay = ({ price, wait }: GasPriceData) =>
20export const formatDisplay = ({ price, wait }: GasPriceData) =>
23 `${price} gwei (${wait} min)`;
21 `${price} gwei (${wait} min)`;
24
22
src/lib/getSuggestedGasPrice.js+3−1
@@ -1,6 +1,5 @@
1import { NETWORK_TYPES } from './network';
1import { NETWORK_TYPES } from './network';
2import { DEFAULT_GAS_PRICE_GWEI, MAX_GAS_PRICE_GWEI } from './constants';
2import { DEFAULT_GAS_PRICE_GWEI, MAX_GAS_PRICE_GWEI } from './constants';
3−import { formatWait } from 'components/L2/Dropdowns/FeeDropdown';
4import Web3 from 'web3';
3import Web3 from 'web3';
5
4
6// ethgasstation returns values in floating point, one order of magitude
5// ethgasstation returns values in floating point, one order of magitude
@@ -14,6 +13,9 @@ const feeToWei = (fee) => Web3.utils.toHex(Web3.utils.toWei(String(fee), 'gwei'
14
13
15const calculateMaxFee = (baseFee, maxPriorityFee) => feeToWei(Math.round((2 * baseFee) + maxPriorityFee))
14const calculateMaxFee = (baseFee, maxPriorityFee) => feeToWei(Math.round((2 * baseFee) + maxPriorityFee))
16
15
16+// Convert seconds to minutes prettily
17+const formatWait = (wait) => Math.round((wait * 100) / 60) / 100;
18+
17export const defaultGasValues = value => ({
19export const defaultGasValues = value => ({
18 fast: {
20 fast: {
19 price: value,
21 price: value,