Function lockingBytecodeToCashAddress

  • Encode a locking bytecode as a CashAddress given a network prefix.

    If bytecode matches a standard pattern, it is encoded using the proper address type and returned as a valid CashAddress (string).

    If bytecode cannot be encoded as an address (i.e. because the pattern is not standard), the resulting AddressContents is returned.


    • bytecode: Uint8Array

      the locking bytecode to encode

    • prefix: "bitcoincash" | "bchtest" | "bchreg" = 'bitcoincash'

      the network prefix to use, e.g. bitcoincash, bchtest, or bchreg, defaults to bitcoincash

    • options: {
          tokenSupport: boolean;
      } = ...

      an object describing address options, defaults to { tokenSupport: false }

      • tokenSupport: boolean

    Returns string | {
        error: CashAddressEncodingError;

Generated using TypeDoc