Encode a payload as a CashAddress.
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.
To encode a CashAddress with a custom/unknown prefix or type bit, see encodeCashAddressNonStandard. For other address standards that closely follow the CashAddress specification (but have alternative version byte requirements), use encodeCashAddressFormat.
the network for which to encode the address (a CashAddressNetworkPrefix)
the address type (a CashAddressType)
the payload to encode – for P2PKH, the public key hash; for P2SH, the redeem bytecode hash
Generated using TypeDoc