T402 API Reference - v2.8.0
    Preparing search index...

    Lightning Network client implementation for the Exact payment scheme.

    Pays BOLT11 invoices using a Lightning node and returns the payment preimage as proof of payment.

    Note: The scheme is 'exact' because Lightning payments are always for the exact invoice amount.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    scheme: "exact" = SCHEME_EXACT

    Methods

    • Creates a payment payload for the Lightning scheme.

      1. Extracts the BOLT11 invoice from requirements.extra.bolt11Invoice
      2. Pays the invoice using the Lightning signer
      3. Returns the preimage and payment hash as proof of payment

      Parameters

      • t402Version: number

        The t402 protocol version

      • paymentRequirements: PaymentRequirements

        The payment requirements

      Returns Promise<Pick<PaymentPayload, "t402Version" | "payload">>

      Promise resolving to a payment payload