[ecashaddrjs] Support use of lowercase types for encoding addresses
Summary:
T3215
There isn't really any kind of standard for whether or not ecash address types should be uppercase or lowercase. This library used the standard of always uppercase, e.g. P2PKH. However, chronik-client requires input to be lowercase, i.e. p2pkh.
This has caused a good deal of ambiguity when working with both libraries.
I don't see a significant risk in supporting mixed case for the only two supported types, since this does not make them ambiguous with each other.
This diff preserves original functionality of the encode function but also allows it to accept lowercase or mixed case inputs for address type.
Test Plan: npm test
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D14172