lndclient icon indicating copy to clipboard operation
lndclient copied to clipboard

Add support for AMP and zero amount invoices

Open thomasbarrett opened this issue 3 years ago • 2 comments
trafficstars

Pull Request Checklist

  • [x] PR is opened against correct version branch.
  • [x] Version compatibility matrix in the README and minimal required version in lnd_services.go are updated.
  • [x] Update macaroon_recipes.go if your PR adds a new method that is called differently than the RPC method it invokes.

thomasbarrett avatar Aug 03 '22 04:08 thomasbarrett

Hey! I am trying to use LndClient to do real-time payment streaming with a static AMP invoice. I ran into two issues using lndclient v0.16.0.

  1. Support for AMP payments does not seem to be built out yet in the AddInvoice method. Notably, the IsAmp field is not properly set in the lnrpc.Invoice object.

  2. Zero value invoices are not properly supported in the SendPayment method. Currently, a Value is only forwarded if the Invoice is not set. Ideally, we would forward the Value independently of whether the Invoice is set to enable zero-value invoices.

thomasbarrett avatar Aug 03 '22 04:08 thomasbarrett

Hey. I agree with the IsAmp flag, that needs to be added to the AddInvoice call. Though I'm not sure about the Amt field. It might be confusing to always add the value, especially if it gets overwritten if an invoice is also passed in. How about we add a new field to the SendPaymentRequest called AmpAmount that is only set if the invoice has a zero amount. Would that work for your use case?

guggero avatar Aug 03 '22 11:08 guggero