Closed ok300 closed 3 days ago
@hydra-yse your older PR #598 parses the offer to more detailed fields:
As that PR is still in review, I'm not sure if that structure is final (LNOffer
, InputType::Bolt12Offer(LNOffer offer)
).
So would you say we need those fields as defined there? If so, I can integrate them in this PR.
So would you say we need those fields as defined there? If so, I can integrate them in this PR
I think they are needed, we need to parse the offer for the user. I also think our PR struct is out of date and I would suggest bumping the lightning
/lightning-invoice
dependencies. The current version doesn't parse offers according to the latest spec (e.g. the description field is now optional), which I think is not compatible with Phoenix
As that PR is still in review, I'm not sure if that structure is final (
LNOffer
,InputType::Bolt12Offer(LNOffer offer)
).So would you say we need those fields as defined there? If so, I can integrate them in this PR.
Also keep in mind there are invoice requests and invoices in bolt12, next to offers. We don't have to support them, but let's make the interface in such a way that we don't have to break anything to support them in the future.
I tried to bump lightning
and lightning-invoice
as suggested above. Indeed we would need them to support optional descriptions, like in the Bolt12 invoices from Boltz.
However due to inter-dependencies between crates, this means also updating bech32
, bip21
, bitcoin
crates. This results in two problems:
node_api.rs
, since it relies on the old (current) lightning
, lightning_invoice
and bitcoin versions
to interface with gl-client
.(This is reflected in the last commit f0d19cc3917ce38fe4020c96a99865d5dcffda19 . Almost half the errors are fixed, but I stopped when realizing the node_api
issue.)
The only way to avoid the above is to store the unparsed Bolt12 option as String
in the InputParser::Bolt12
variant.
Another option is to ask GL to update their lightning
, lightning-invoice
and bitcoin
crates to the newer ones we would use, but I don't know how feasible that is.
Am I missing something? Do you see a simpler way to bump lightning
and lightning-invoice
?
As discussed, this is adding a simple Bolt12Offer { offer: String }
variant, until gl-client
supports the newer lightning
and lightning-invoice
crates.
In addition, Liquid SDK will attempt to parse the offer locally.
IMO it's best to add them when they will also be tested and used.
This PR extends the input parsed in
sdk-common
to recognize Bolt12 offers.