bitcoin-sv / ts-sdk

Other
51 stars 13 forks source link

toAddress() string prefix support #72

Closed tiagolr closed 6 months ago

tiagolr commented 6 months ago

A slight improvement to the API, allows string prefixes like 'testnet' on privateKey.toAddress() and publicKey.toAddress() methods.

Allows prefixes 'mainnet', 'testnet' and also the shorthand 'main' and 'test' to indentify the network.

Although the use of [0x6f] prefix is well documented, this makes the code less cryptic to read and write, works like the old bsv library, also included shorthand 'main' and 'test' as they are the network identifiers used in WhatsOnChain.