parseKeyId
Parse an ERC-8128 keyid into chain ID and address.
Usage
Pass a keyid string to extract the chain ID and address. Returns null if the format is invalid.
import { parseKeyId } from '@slicekit/erc8128'
const result = parseKeyId('erc8128:1:0xabc123...')
// { chainId: 1, address: '0xabc123...' }
const invalid = parseKeyId('invalid')
// nullReturns
{ chainId: number; address: Address } | null
The parsed result, or null if the keyid is invalid.
Parameters
keyid
- Type:
string
The keyid string to parse.