Skip to content

Commit

Permalink
feat: mf-6088 add metis chains (#11490)
Browse files Browse the repository at this point in the history
* feat: mf-6088 add metis chains

* refactor: remove community rpc

* refactor: rpc

---------

Co-authored-by: guanbinrui <52657989+guanbinrui@users.noreply.github.com>
  • Loading branch information
swkatmask and guanbinrui committed Mar 13, 2024
1 parent 6be5cf7 commit d6a1cb4
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cspell.json
Expand Up @@ -257,6 +257,8 @@
"resizer",
"rhonin",
"rindexed",
"ronin",
"roninchain",
"rpid",
"sablier",
"sbch",
Expand All @@ -265,6 +267,7 @@
"scrl",
"scroller",
"secp",
"sepolia",
"serializers",
"shiden",
"siddomains",
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/RedPacket/src/base.ts
Expand Up @@ -35,6 +35,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Conflux,
ChainId.Astar,
ChainId.Scroll,
ChainId.Metis,
ChainId.X1_Testnet,
],
},
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/Tips/src/base.ts
Expand Up @@ -35,6 +35,7 @@ export const base: Plugin.Shared.Definition = {
ChainId.Astar,
ChainId.Scroll,
ChainId.Optimism,
ChainId.Metis,
ChainId.X1_Testnet,
],
},
Expand Down
2 changes: 2 additions & 0 deletions packages/web3-constants/evm/ethereum.json
Expand Up @@ -20,6 +20,7 @@
"Aurora": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39",
"Astar": "0xf5056B96ab242C566002852d0b98ce0BcDf1af51",
"Scroll": "0xbC7d98985966f56A66B0cB5F23d865676dc2ac84",
"Metis": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39",
"X1": "0x8A42F70047a99298822dD1dbA34b454fc49913F2",
"X1_Testnet": "0x8A42F70047a99298822dD1dbA34b454fc49913F2"
},
Expand Down Expand Up @@ -47,6 +48,7 @@
"Conflux": "0x19f179d7e0d7d9f9d5386afff64271d98a91615b",
"Astar": "0x1410304B91a280ad083196B0B50e9d8df749d860",
"Scroll": "0x20Ee232E34B87061fE3ba0DB738A3531A3e915BF",
"Metis": "0x6cc1b1058F9153358278C35E0b2D382f1585854B",
"X1": "0xF8935Df67cAB7BfcA9532D1Ac2088C5c39b995b5",
"X1_Testnet": "0xF8935Df67cAB7BfcA9532D1Ac2088C5c39b995b5"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/web3-constants/evm/nft-red-packet.json
Expand Up @@ -14,6 +14,7 @@
"Conflux": "0x5b966f3a32db9c180843bcb40267a66b73e4f022",
"Astar": "0xc3e62b2CC70439C32a381Bfc056aCEd1d7162cef",
"Scroll": "0x727F8030964CCEC6B0E344399c8d8E2B4C837351",
"Metis": "0x812463356F58fc8194645A1838ee6C52D8ca2D26",
"X1": "0xd81c16d71432d7df04575ffe9fed76f837fea0cc",
"X1_Testnet": "0xd81c16d71432d7df04575ffe9fed76f837fea0cc"
},
Expand Down Expand Up @@ -44,6 +45,7 @@
"Conflux": 0,
"Astar": 0,
"Scroll": 96705,
"Metis": 1702933,
"X1": 0,
"X1_Testnet": 7319723
}
Expand Down
2 changes: 2 additions & 0 deletions packages/web3-constants/evm/red-packet.json
Expand Up @@ -37,6 +37,7 @@
"Conflux": "0x96c7d011cdfd467f551605f0f5fce279f86f4186",
"Astar": "0x2cF46Db820e279c5fBF778367D49d9C931D54524",
"Scroll": "0x16f61cb37169523635B6761f3C946892fb3c18fB",
"Metis": "0x2cf91AD8C175305EBe6970Bd8f81231585EFbd77",
"X1": "0x977baB5f7e2cEd0C91fDA890Ed1DBDfD3Ee9AE81",
"X1_Testnet": "0x977baB5f7e2cEd0C91fDA890Ed1DBDfD3Ee9AE81"
},
Expand Down Expand Up @@ -67,6 +68,7 @@
"Conflux": 37670572,
"Astar": 910985,
"Scroll": 96705,
"Metis": 1702860,
"X1": 0,
"X1_Testnet": 7320220
}
Expand Down
5 changes: 5 additions & 0 deletions packages/web3-constants/evm/rpc.json
Expand Up @@ -71,6 +71,9 @@
"Conflux": ["https://evm.confluxrpc.com"],
"Astar": ["https://astar.api.onfinality.io/public"],
"Scroll": ["https://rpc.scroll.io"],
"Metis": [
"https://andromeda.metis.io/?owner=1088",
],
"X1": ["https://rpc.x1.tech"],
"X1_Testnet": ["https://testrpc.x1.tech"]
},
Expand Down Expand Up @@ -101,6 +104,7 @@
"Conflux": ["https://evm.confluxrpc.com"],
"Astar": ["https://rpc.astar.network:8545"],
"Scroll": ["https://rpc.scroll.io"],
"Metis": ["https://andromeda.metis.io/?owner=1088"],
"X1": ["https://rpc.x1.tech"],
"X1_Testnet": ["https://testrpc.x1.tech"]
},
Expand Down Expand Up @@ -131,6 +135,7 @@
"Conflux": [0, 0, 0, 0, 0],
"Astar": [0, 0, 0, 0, 0],
"Scroll": [0, 0, 0, 0, 0],
"Metis": [0, 0, 0, 0, 0],
"X1": [0, 0, 0, 0, 0],
"X1_Testnet": [0, 0, 0, 0, 0]
}
Expand Down
6 changes: 4 additions & 2 deletions packages/web3-constants/evm/token-asset-base-url.json
Expand Up @@ -25,7 +25,8 @@
"Aurora_Testnet": [],
"Conflux": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/conflux"],
"Astar": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/astar"],
"Scroll": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/scroll"]
"Scroll": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/scroll"],
"Metis": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/metis"]
},
"ERC20_TOKEN_ASSET_BASE_URI": {
"Mainnet": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/ethereum/assets"],
Expand Down Expand Up @@ -53,6 +54,7 @@
"Aurora_Testnet": [],
"Conflux": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/conflux/assets"],
"Astar": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/astar/assets"],
"Scroll": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/scroll/assets"]
"Scroll": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/scroll/assets"],
"Metis": ["https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/metis/assets"]
}
}
1 change: 1 addition & 0 deletions packages/web3-constants/evm/token-list.json
Expand Up @@ -26,6 +26,7 @@
"Conflux": ["https://tokens.r2d2.to/latest/1030/tokens.json"],
"Astar": ["https://tokens.r2d2.to/latest/592/tokens.json"],
"Scroll": ["https://tokens.r2d2.to/latest/534352/tokens.json"],
"Metis": ["https://tokens.r2d2.to/latest/1088/tokens.json"],
"X1": ["https://tokens.r2d2.to/latest/196/tokens.json"],
"X1_Testnet": ["https://tokens.r2d2.to/latest/195/tokens.json"]
}
Expand Down
11 changes: 11 additions & 0 deletions packages/web3-shared/evm/src/assets/metis.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions packages/web3-shared/evm/src/constants/descriptors.ts
Expand Up @@ -291,6 +291,28 @@ export const NETWORK_DESCRIPTORS: ReadonlyArray<NetworkDescriptor<ChainId, Netwo
isMainnet: false,
averageBlockDelay: 10,
},
{
ID: `${PLUGIN_ID}_metis`,
networkSupporterPluginID: PLUGIN_ID,
chainId: ChainId.Metis,
type: NetworkType.Metis,
icon: new URL('../assets/metis.svg', import.meta.url).href,
iconColor: 'rgb(36, 150, 238)',
name: 'Metis Andromeda',
isMainnet: true,
averageBlockDelay: 10,
},
{
ID: `${PLUGIN_ID}_metis_sepolia`,
networkSupporterPluginID: PLUGIN_ID,
chainId: ChainId.Metis_Sepolia,
type: NetworkType.Metis,
icon: new URL('../assets/metis.svg', import.meta.url).href,
iconColor: 'rgb(36, 150, 238)',
name: 'Metis Sepolia',
isMainnet: false,
averageBlockDelay: 10,
},
{
ID: `${PLUGIN_ID}_x1_testnet`,
networkSupporterPluginID: PLUGIN_ID,
Expand Down
1 change: 1 addition & 0 deletions packages/web3-shared/evm/src/types/index.ts
Expand Up @@ -71,6 +71,7 @@ export enum ChainId {

// Metis
Metis = 1088,
Metis_Sepolia = 59902,

// Optimism
Optimism = 10,
Expand Down

0 comments on commit d6a1cb4

Please sign in to comment.