Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Asynchronously responding to Invoice Request #3318

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Commits on Sep 19, 2024

  1. Rename manually_handle_bolt12_invoices

    1. Till now this UserConfig option was used to indicate whether the user
       wants to handles the payment for received Bolt12Invoices manually.
    2. The future commits expand it's use case, so that it can also be used
       to indicate whether the user wants to handle response to the received
    Invoice Request manually as well.
    3. Rename this UserConfig appropriately to better represent its use
       case.
    shaavan committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    93fdfdb View commit details
    Browse the repository at this point in the history
  2. Introduce InvoiceRequestReceived Event

    1. This event will be triggered when user enables manual handling of
       BOLT12 Messages.
    2. With this event they can do some preprocessing on their end to make
       sure if they want to continue with this inbound payment.
    3. For example, this can be used by the user to do the currency
       conversion on their end and respond to invoice request accordingly.
    shaavan committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    5774809 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. f: Make Responder Required

    - Also move event generation after invoice request verification.
    shaavan committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    2a3c8c6 View commit details
    Browse the repository at this point in the history
  2. Introduce Bolt12ResponseError

    Introduce a new category of Bolt12 errors that contains the error
    generated while trying to respond asynchronously to Bolt12 messages.
    shaavan committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    6342cdd View commit details
    Browse the repository at this point in the history
  3. Update InvoiceBuilder's amount_msats

    1. The amount_msats function first checks if any amount is given with
       the invoice requests, and defaults to using offer's amount if it's
    absent.
    2. This can be a problem if the amount in offer was represent as a
       Currency.
    3. Update amount_msats to take in an optional custom amount which can be
       used in case amount if absent in Invoice Request.
    4. This update will be utilised in the following commits to set
       custom amount_msats when responding to Invoice Request Asychronously.
    shaavan committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    e3b4c9d View commit details
    Browse the repository at this point in the history
  4. f: Update custom_amount_msats check

    Custom amount should only be provided if only the offer is denomiated
    in currency, and no amount is provided in invoice request.
    
    This is done so that the use of Custom Amount can be more specific to
    the case when Offer is denomiated in Currency.
    shaavan committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    af75a15 View commit details
    Browse the repository at this point in the history
  5. Introduce get_response_for_invoice_request

    1. Introduce a set of private functions that handles the creation of
       response for a received Invoice Request.
    2. This helps refactor the the logic of response creation in a single
       function.
    3. This will be used in the following commit to send response for
       invoice_request asynchronously.
    shaavan committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    4431d52 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f8b48dc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f00047b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3a37880 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9b4daa4 View commit details
    Browse the repository at this point in the history