Function encodeCashAddressNonStandard

  • Encode a payload as a CashAddress. This function is similar to encodeCashAddress but supports non-standard prefixes and types.

    Note: this function cannot prevent all implementation errors via types. The function will throw if payload is not a valid CashAddressSupportedLength. Confirm the length of untrusted inputs before providing them to this function.

    For other address standards that closely follow the CashAddress specification (but have alternative version byte requirements), use encodeCashAddressFormat.

    Parameters

    • prefix: string

      a valid prefix indicating the network for which to encode the address (usually a CashAddressNetworkPrefix) – must be only lowercase letters

    • typeBits: CashAddressAvailableTypeBits

      the type bit to encode in the version byte – must be a number between 0 and 15

    • payload: Uint8Array

      the payload to encode (for P2PKH, the public key hash; for P2SH, the redeem bytecode hash)

    Returns string

Generated using TypeDoc