Repository navigation
feat: add infura supported networks #6972
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
72dec2b
feat: add infura supported networks
salimtb e644624
fix: add changelog
salimtb 589fd90
fix: add changelog
salimtb 618764d
fix: add changelog
salimtb 60f872e
fix: fix unit tests
salimtb d4dd6a3
fix: fix changelog
salimtb 72188d8
fix: fix changelog
salimtb 25e3ef5
fix: fix changelog
salimtb 00bf534
fix: fix cursor comment
salimtb eea603c
fix: fix test
salimtb f26c3c4
fix: clean up
salimtb ff8f151
fix: clean up
salimtb 4e8cdc7
fix: fix linter
salimtb 3f82040
Merge branch 'main' into feat/add-infura-networks
salimtb 6dc6243
fix: fix tests
salimtb 624a9ca
fix: fix PR comments
salimtb e0bbdc7
fix: clean changelog
salimtb fea7391
Merge branch 'main' into feat/add-infura-networks
salimtb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,11 @@ export const InfuraNetworkType = { | |
| 'linea-sepolia': 'linea-sepolia', | ||
| 'linea-mainnet': 'linea-mainnet', | ||
| 'base-mainnet': 'base-mainnet', | ||
| 'arbitrum-mainnet': 'arbitrum-mainnet', | ||
| 'bsc-mainnet': 'bsc-mainnet', | ||
| 'optimism-mainnet': 'optimism-mainnet', | ||
| 'polygon-mainnet': 'polygon-mainnet', | ||
| 'sei-mainnet': 'sei-mainnet', | ||
| } as const; | ||
|
|
||
| export type InfuraNetworkType = | ||
|
|
@@ -80,6 +85,11 @@ export enum BuiltInNetworkName { | |
| MegaETHTestnet = 'megaeth-testnet', | ||
| MonadTestnet = 'monad-testnet', | ||
| BaseMainnet = 'base-mainnet', | ||
| ArbitrumOne = 'arbitrum-mainnet', | ||
| BscMainnet = 'bsc-mainnet', | ||
| OptimismMainnet = 'optimism-mainnet', | ||
| PolygonMainnet = 'polygon-mainnet', | ||
| SeiMainnet = 'sei-mainnet', | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -98,6 +108,11 @@ export const ChainId = { | |
| [BuiltInNetworkName.MegaETHTestnet]: '0x18c6', // toHex(6342) | ||
| [BuiltInNetworkName.MonadTestnet]: '0x279f', // toHex(10143) | ||
| [BuiltInNetworkName.BaseMainnet]: '0x2105', // toHex(8453) | ||
| [BuiltInNetworkName.ArbitrumOne]: '0xa4b1', // toHex(42161) | ||
| [BuiltInNetworkName.BscMainnet]: '0x38', // toHex(56) | ||
| [BuiltInNetworkName.OptimismMainnet]: '0xa', // toHex(10) | ||
| [BuiltInNetworkName.PolygonMainnet]: '0x89', // toHex(137) | ||
| [BuiltInNetworkName.SeiMainnet]: '0x531', // toHex(1329) | ||
| } as const; | ||
| export type ChainId = (typeof ChainId)[keyof typeof ChainId]; | ||
|
|
||
|
|
@@ -114,6 +129,13 @@ export enum NetworksTicker { | |
| 'monad-testnet' = 'MON', | ||
| // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values | ||
| 'base-mainnet' = 'ETH', | ||
| // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooh, this rule is not very useful, is it. I will look into disabling this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on this , i don't think it's really useful actually |
||
| 'arbitrum-mainnet' = 'ETH', | ||
| 'bsc-mainnet' = 'BNB', | ||
| // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values | ||
| 'optimism-mainnet' = 'ETH', | ||
| 'polygon-mainnet' = 'POL', | ||
| 'sei-mainnet' = 'SEI', | ||
| rpc = '', | ||
| } | ||
|
|
||
|
|
@@ -127,6 +149,11 @@ export const BlockExplorerUrl = { | |
| [BuiltInNetworkName.MegaETHTestnet]: 'https://megaexplorer.xyz', | ||
| [BuiltInNetworkName.MonadTestnet]: 'https://testnet.monadexplorer.com', | ||
| [BuiltInNetworkName.BaseMainnet]: 'https://basescan.org', | ||
| [BuiltInNetworkName.ArbitrumOne]: 'https://arbiscan.io', | ||
| [BuiltInNetworkName.BscMainnet]: 'https://bscscan.com', | ||
| [BuiltInNetworkName.OptimismMainnet]: 'https://optimistic.etherscan.io', | ||
| [BuiltInNetworkName.PolygonMainnet]: 'https://polygonscan.com', | ||
| [BuiltInNetworkName.SeiMainnet]: 'https://seitrace.com', | ||
| } as const satisfies Record<BuiltInNetworkType, string>; | ||
| export type BlockExplorerUrl = | ||
| (typeof BlockExplorerUrl)[keyof typeof BlockExplorerUrl]; | ||
|
|
@@ -141,6 +168,11 @@ export const NetworkNickname = { | |
| [BuiltInNetworkName.MegaETHTestnet]: 'Mega Testnet', | ||
| [BuiltInNetworkName.MonadTestnet]: 'Monad Testnet', | ||
| [BuiltInNetworkName.BaseMainnet]: 'Base Mainnet', | ||
| [BuiltInNetworkName.ArbitrumOne]: 'Arbitrum One', | ||
| [BuiltInNetworkName.BscMainnet]: 'BSC Mainnet', | ||
| [BuiltInNetworkName.OptimismMainnet]: 'Optimism Mainnet', | ||
| [BuiltInNetworkName.PolygonMainnet]: 'Polygon Mainnet', | ||
| [BuiltInNetworkName.SeiMainnet]: 'Sei Mainnet', | ||
| } as const satisfies Record<BuiltInNetworkType, string>; | ||
| export type NetworkNickname = | ||
| (typeof NetworkNickname)[keyof typeof NetworkNickname]; | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mark this as a breaking change?
Technically this is an addition, however I remember adding base-mainnet as a default network caused cascading changes on other controllers/clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that these changes look innocuous. Also these changes make it so that these can be used as default networks but don't change the set of default networks themselves. I would expect that we would do that by changing
network-controller. Do we anticipate also doing that in a separate PR?That said, if have concerns, perhaps we could confirm by publishing a preview build and updating the clients as a preemptive measure?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcmire this has been tested on the client side already , a PR for it has been merged MetaMask/metamask-extension#37172 using a patch , it was test by QA and all works as expected
let me know if this answer your concerns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we applied a patch since core releases was blocked, and we needed this change to be included in the current release cut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh perfect, okay, no problem then!