Page MenuHomePhabricator

[ecashaddrjs] Return address decode results ready for chronik
ClosedPublic

Authored by bytesofman on Mar 31 2023, 17:16.

Details

Summary

T3063

cashaddr.decode can now return address hash as a string, which is accepted for chronik calls. However, it still returns address type in all uppercase, e.g. P2PKH. chronik-client only accepts input like p2pkh

ecashaddrjs is modified to return chronik-ready address information if a flag is passed to the cashaddr.decode function. It is handled this way to preserve backward compatibility (calling the function as it has always been called will still return the old format).

Unit tests are added for the case of chronik-ready input and output formats.

Test Plan

Review change, unit test change, and npm test
Confirm README change makes sense

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable