altangent / lightnode-invoice

Lightning Network invoice protocol library
MIT License
12 stars 4 forks source link

Add btcd simnet to valid network list #2

Closed uiur closed 6 years ago

uiur commented 6 years ago

btcd has simnet mode, which is similar to regtest mode for bitcoind. Also, lnd can be run in simnet mode.

Currently, decoding simnet invoice throws an invalid network error.

> invoice.decode('lnsb1pd3d8fhpp5nc5kplnmxpdy243gm8svtt6k7j45x9vur6vd9xj7djn0gxqdgnrqdqqcqzyslrx06l6ep9ls3xdmqx8z5940dkuj9hgt0ksg8j6mh220m2l6pan5rsczr2hphl5cqgpr6tcr8htv2ytqch9lkawmp28xavq3de4pzxqqrrkanj')
Error: Invalid network
    at parsePrefix (/Users/zat/.ghq/github.com/uiureo/pika/client/node_modules/lightning-invoice/src/decoder.js:151:39)
    at Object.decode (/Users/zat/.ghq/github.com/uiureo/pika/client/node_modules/lightning-invoice/src/decoder.js:16:29)

Human readable part for simnet is not defined in BIP 173, but accepting it would be useful for development.

By the way, thanks for creating such a great module. This module saved me hours.

bmancini55 commented 6 years ago

I'll publish 0.2.1 shortly. Thanks for the contribution!