Skip to main content

Function: getChain()

getChain(chainId: number): Chain

This will resolve the chainId number to the corresponding chain name.

Parameters​

ParameterTypeDescription
chainIdnumberThe chainId of the network

Returns​

Chain

chain name

Example​

getChain(1) // 'ethereum'
getChain(11155111) // 'sepolia'

getChain(100) // 'gnosis'
getChain(10200) // 'chiado'

getChain(137) // 'polygon'
getChain(80002) // 'amoy'