githubEdit

πŸ†•webln.sendPaymentAsync()

Request that the user sends a payment for an invoice. The application needs to provide a BOLT-11arrow-up-right invoice. The payment will only be initiated and will not wait for a preimage to be returned. This is useful when paying HOLD invoicesarrow-up-right. There is no guarantee that the payment will be successfully sent to the receiver. It's up to the receiver to check whether or not the invoice has been paid.

circle-exclamation

Method

async function
    sendPaymentAsync(paymentRequest: string): SendPaymentAsyncResponse;

Parameters

paymentRequest: string // the invoice you'd like the user to pay (lnbc...)

Response

interface SendPaymentAsyncResponse {} // no preimage returned!

Example

const invoice = "lnbc100...";
const result = await window.webln.sendPaymentAsync(invoice);

Demo

Last updated

Was this helpful?