-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: use Infura gas API #23717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use Infura gas API #23717
Changes from 13 commits
d82803a
6be0acb
130a4c9
63a0fbf
d041cb6
63ac478
0eb4339
02f957b
8317208
295b560
f18a886
047e4fc
2949a1b
a5df691
afbf079
88c2533
dcd66ee
770076b
83216da
4281423
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,6 +190,54 @@ async function setupMocking(server, testSpecificMock, { chainId }) { | |
| }; | ||
| }); | ||
|
|
||
| // Both are added to support swaps e2e tests | ||
|
||
| await server | ||
| .forGet(`${GAS_API_BASE_URL}/networks/1/gasPrices`) | ||
| .thenCallback(() => { | ||
| return { | ||
| statusCode: 200, | ||
| json: { | ||
| SafeGasPrice: '1', | ||
| ProposeGasPrice: '2', | ||
| FastGasPrice: '3', | ||
| }, | ||
| }; | ||
| }); | ||
| await server | ||
matthewwalsh0 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .forGet(`${GAS_API_BASE_URL}/networks/1/suggestedGasFees`) | ||
| .thenCallback(() => { | ||
| return { | ||
| statusCode: 200, | ||
| json: { | ||
| low: { | ||
| suggestedMaxPriorityFeePerGas: '1', | ||
| suggestedMaxFeePerGas: '20.44436136', | ||
| minWaitTimeEstimate: 15000, | ||
| maxWaitTimeEstimate: 30000, | ||
| }, | ||
| medium: { | ||
| suggestedMaxPriorityFeePerGas: '1.5', | ||
| suggestedMaxFeePerGas: '25.80554517', | ||
| minWaitTimeEstimate: 15000, | ||
| maxWaitTimeEstimate: 45000, | ||
| }, | ||
| high: { | ||
| suggestedMaxPriorityFeePerGas: '2', | ||
| suggestedMaxFeePerGas: '27.277766977', | ||
| minWaitTimeEstimate: 15000, | ||
| maxWaitTimeEstimate: 60000, | ||
| }, | ||
| estimatedBaseFee: '19.444436136', | ||
| networkCongestion: 0.14685, | ||
| latestPriorityFeeRange: ['0.378818859', '6.555563864'], | ||
| historicalPriorityFeeRange: ['0.1', '248.262969261'], | ||
| historicalBaseFeeRange: ['14.146999781', '28.825256275'], | ||
| priorityFeeTrend: 'down', | ||
| baseFeeTrend: 'up', | ||
| }, | ||
| }; | ||
| }); | ||
|
|
||
| await server | ||
| .forGet('https://swap.metaswap.codefi.network/networks/1/token') | ||
| .withQuery({ address: '0x72c9Fb7ED19D3ce51cea5C56B3e023cd918baaDf' }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export const METASWAP_BASE_URL = 'https://swap.metaswap.codefi.network'; | ||
| export const GAS_API_URL = 'https://gas.api.cx.metamask.io'; | ||
| export const GAS_API_URL = 'https://gas.api.infura.io'; |

Uh oh!
There was an error while loading. Please reload this page.