Derive the canonical CAIP-2 identifier from a network’s genesis hash per the Algorand profile.
Import
import { networkFromGenesisHash } from 'x402-avm-js';
Signature
export function networkFromGenesisHash(genesisHash: Uint8Array | string): string;
Derive the canonical CAIP-2 identifier from a network’s genesis hash per the Algorand profile.Computes URL-safe base64 of the genesis hash (with + -> -, / -> _, stripped padding)
and truncates to the first 32 characters as the CAIP-2 reference.
Parameters
Uint8Array | string
required
32-byte genesis hash as a Uint8Array or base64-encoded string.
Returns
string
Canonical CAIP-2 identifier formatted as “algorand:<32-char-urlsafe-base64>”.