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.
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.