Skip to content

Commit

Permalink
fix: correct some configuration for Metis (#11499)
Browse files Browse the repository at this point in the history
  • Loading branch information
swkatmask authored and guanbinrui committed Mar 18, 2024
1 parent 78ee6be commit 4557fa4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
Expand Up @@ -76,7 +76,15 @@ function useCreateParamsCallback(
const seed = Math.random().toString()
const tokenType = token!.schema === SchemaType.Native ? 0 : 1
const tokenAddress = token!.schema === SchemaType.Native ? NATIVE_TOKEN_ADDRESS : token!.address
if (!tokenAddress) return null
if (!tokenAddress) {
if (process.env.NODE_ENV === 'development' && !NATIVE_TOKEN_ADDRESS) {
console.error(
'Not native token address for chain %s. Do you forget to configure it in token.json file?',
token!.chainId,
)
}
return null
}

const paramsObj: ParamsObjType = {
publicKey,
Expand Down
2 changes: 2 additions & 0 deletions packages/web3-constants/evm/token.json
Expand Up @@ -24,6 +24,7 @@
"Aurora": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",
"Astar": "0xaeaaf0e2c81af264101b9129c00f4440ccf0f720",
"Scroll": "0x5300000000000000000000000000000000000004",
"Metis": "0x420000000000000000000000000000000000000A",
"X1": "0x049a970485cf54904a6da1e1cea2ac18c9b8fb9f",
"X1_Testnet": "0x049a970485cf54904a6da1e1cea2ac18c9b8fb9f"
},
Expand Down Expand Up @@ -316,6 +317,7 @@
"Conflux": "0x0000000000000000000000000000000000000000",
"Astar": "0x0000000000000000000000000000000000000000",
"Scroll": "0x0000000000000000000000000000000000000000",
"Metis": "0x0000000000000000000000000000000000000000",
"X1": "0x0000000000000000000000000000000000000000",
"X1_Testnet": "0x0000000000000000000000000000000000000000"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-shared/evm/src/constants/chains.json
Expand Up @@ -1077,7 +1077,7 @@
"name": "Metis",
"symbol": "METIS",
"decimals": 18,
"logoURL": "https://imagedelivery.net/PCnTHRkdRhGodr0AWBAvMA/Assets/blockchains/metis/info/logo.png/quality=85"
"logoURL": "https://bridge.metis.io/static/media/logo.f1bdb422692299f1b236d7144106b7af.svg"
},
"infoURL": "https://www.metis.io",
"shortName": "metis-andromeda",
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-shared/evm/src/constants/descriptors.ts
Expand Up @@ -298,7 +298,7 @@ export const NETWORK_DESCRIPTORS: ReadonlyArray<NetworkDescriptor<ChainId, Netwo
type: NetworkType.Metis,
icon: new URL('../assets/metis.svg', import.meta.url).href,
iconColor: 'rgb(36, 150, 238)',
name: 'Metis Andromeda',
name: 'Metis',
isMainnet: true,
averageBlockDelay: 10,
},
Expand Down

0 comments on commit 4557fa4

Please sign in to comment.