It is strongly advised that this method only be used under explicit user
control. With enough errors, this method is likely to find a plausible
correction for any address (but for which no private key exists). This is
effectively equivalent to burning the funds.
Only 2 substitution errors can be corrected (or a single swap) – deletions
and insertions (errors that shift many other characters and change the
length of the payload) can never be safely corrected and will produce an
error.
Errors can be corrected in both the prefix and the payload, but attempting to
correct errors in the prefix prior to this method can improve results, e.g.
for bchtest:qq2azmyyv6dtgczexyalqar70q036yund53jvfde0x, the string
bchtest:qq2azmyyv6dtgczexyalqar70q036yund53jvfdecc can be corrected, while
typo:qq2azmyyv6dtgczexyalqar70q036yund53jvfdecc can not.
Parameters
address: string
the CashAddress on which to attempt error correction
Attempt to correct up to 2 errors in a CashAddress. The CashAddress must be properly formed (include a prefix and only contain Bech32 characters).
Improper use of this method carries the risk of lost funds.
It is strongly advised that this method only be used under explicit user control. With enough errors, this method is likely to find a plausible correction for any address (but for which no private key exists). This is effectively equivalent to burning the funds.
Only 2 substitution errors can be corrected (or a single swap) – deletions and insertions (errors that shift many other characters and change the length of the payload) can never be safely corrected and will produce an error.
Errors can be corrected in both the prefix and the payload, but attempting to correct errors in the prefix prior to this method can improve results, e.g. for
bchtest:qq2azmyyv6dtgczexyalqar70q036yund53jvfde0x
, the stringbchtest:qq2azmyyv6dtgczexyalqar70q036yund53jvfdecc
can be corrected, whiletypo:qq2azmyyv6dtgczexyalqar70q036yund53jvfdecc
can not.