Note that this function defaults to throwing encoding errors. To handle
errors in a type-safe way, set throwErrors to false.
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.
If throwErrors is true, the CashAddress as a string. If
throwErrors is false, a CashAddressResult on successful encoding
or an error message as a string.
Encode a payload as a CashAddress.
Note that this function defaults to throwing encoding errors. To handle errors in a type-safe way, set
throwErrors
tofalse
.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.
To decode a CashAddress, use decodeCashAddress.