lnbits / bolt11 Goto Github PK
View Code? Open in Web Editor NEWLightning BOLT11 implementation for Python.
Home Page: https://pypi.org/project/bolt11
License: MIT License
Lightning BOLT11 implementation for Python.
Home Page: https://pypi.org/project/bolt11
License: MIT License
Performing a sequential decode/encode on an LND invoice throws exceptions. The expiry and signature tags specifically. The Enum in tags.py doesn't appear to be in-spec with the bolt11 spec.
this snippet:
import bolt11
invoice = 'lnbc1950n1pjtrgxnpp5ye3lhh8ye8ywm85evshn9wyhdsdg9a350tdhm3dyw89mwfht8s9qdqqxqyjw5q9q7sqqqqqqqqqqqqqqqqqqqqqqqqq9qsqsp5z22wjrrm0lgl32e0yes38dzmvjxnajrvanhw3hp4duq4k55wl0gsrzjqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glclludsryzx7vvvqqqqqlgqqqqqeqqjqqq3zq0d9kw8q4fhsgxh595f2l0ass4zaj2pdknzhxzzrlf7g5wgsk3nlgzzeduhnp6mva9jehwcq9y4hrllwt6ffl822q5drdgvxtjspmgfnls'
decoded = bolt11.decode(invoice)
give me this output:
Traceback (most recent call last):
File "/home/pythcoiner/python/bolt11/main.py", line 4, in <module>
decoded = bolt11.decode(invoice)
File "/home/pythcoiner/python/bolt11/venv/lib/python3.10/site-packages/bolt11/decode.py", line 82, in decode
tags["9"] = Features.from_bitstring(tagdata) # type: ignore
File "/home/pythcoiner/python/bolt11/venv/lib/python3.10/site-packages/bolt11/models/features.py", line 76, in from_bitstring
raise ValueError(f"Feature index ({i}) out of range, word_length: {length}")
ValueError: Feature index (100) out of range, word_length: 150
invoice generated by Phoenix wallet
edit: pip install from pypi (pip install bolt11)
Right now encoding invoices with no description or (""
as description) throws
ValueError: Must include either 'd' or 'h'
multiple f fields not supported yet
MAY include one or more f fields.
for Bitcoin payments:
MUST set an f field to a valid witness version and program,
OR to 17 followed by a public key hash, OR to 18 followed by a script hash.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.