BOLT12 Decoder
Decode BOLT12 Offers, Invoice Requests and invoices.
The goal is to match the output of the CoreLN decode
RPC response.
Code is mostly grabbed from Rusty's BOLT12 repo with some changes and fixes.
Install
yarn add bolt12-decoder
npm i bolt12-decoder
Usage
import decodeBolt12 from 'bolt12-decoder'
const bolt12 =
'lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2q42xjurnyyfqys2zzcssx06thlxk00g0epvynxff5vj46p3en8hz8ax9uy4ckyyfuyet8eqg'
const decoded = decodeBolt12(bolt12)
console.log(decoded)
Caveats
- Does not decode recurrence (will add once recurrence is added back in to the spec)
- Does not decode
invoice_paths
and invoice_blindedpay
as I could not get it working (I hope to fix this some time soon)