Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
parseKeyId – ERC-8128
Skip to content

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

Returns

{ chainId: number; address: Address } | null

The parsed result, or null if the keyid is invalid.

Parameters

keyid

  • Type: string

The keyid string to parse.