parseCaip2ChainId()
parseCaip2ChainId(
chainId): {namespace:string;reference:string; } |undefined
Defined in: utils/caip.ts:38
Splits a CAIP-2 chain ID into its namespace and reference, validating both against the CAIP-2 grammar.
Parameters
chainId
string
The chain ID to parse.
Returns
{ namespace: string; reference: string; } | undefined
The namespace and reference, or undefined when the value is not a CAIP-2 chain ID.
Example
parseCaip2ChainId('eip155:8453'); // { namespace: 'eip155', reference: '8453' }
parseCaip2ChainId('8453'); // undefinedLast updated on