Join raw base address bytes and hook data into a bech32-encoded hooked address. The bech32-payload is:

offset 0 3 3+len(baseAddress) len(payload)-2
data magic baseAddress hookData len(baseAddress)

magic is a 3-byte prefix that identifies a hooked address and its version nibble, whose value is 4 bits (between 0 and 0xf (15)). Currently, the only supported version is 0.

 0x78, 0xf1, (0x70 | ADDRESS_HOOK_VERSION),

This magic prefix encodes as 0rch, regardless of the version or HRP (e.g. agoric10rch<rest of payload as bech32><bech32 checksum>).

  • Parameters

    • baseAddress: string
    • hookData: ArrayLike<number>
    • OptionalcharLimit: number = DEFAULT_HOOKED_ADDRESS_CHAR_LIMIT

    Returns string