Skip to content

Commit

Permalink
chore: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
commoddity committed Nov 19, 2024
1 parent 1be7ca7 commit 7d1b6f8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/utils/chainUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export const CHAIN_DOCS_URL: KeyValuePair<string> = {
"zklink-nova-archival": "zklink-nova-api/endpoints/zklink-nova-archival",
}

// evmChains is an array of the relay chain IDs for EVM chains.
// It must be updated whenever a new EVM chain is added to the relay.
//
// The current list of chain IDs on the protocol may be fetched with:
// pocket query params --remoteCLIURL https://pocket-rpc.liquify.com | tail -n +2 | jq '.pocket_params[] | select(.param_key == "pocketcore/SupportedBlockchains")'
export const evmChains = [
"F003", // avax
"F02B", // zksync-era
Expand Down Expand Up @@ -132,6 +137,9 @@ export const evmMethods = [
"eth_syncing",
]

// isEvmChain uses the relay chain IDs defined in the evmChains array in this file
// Using the chain ID is more reliable than using the blockchain alias as it is strictly
// one to one.
export const isEvmChain = (chain: Blockchain | null): boolean =>
!!chain && evmChains.includes(chain.id)

Expand Down

0 comments on commit 7d1b6f8

Please sign in to comment.