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) // 'ethereum'

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

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

Defined in

utils.ts:163