Skip to Content
dApps
On this page

sendPayment

Request that the user sends a payment for an invoice. The application needs to provide a BOLT-11 invoice

Method

declare function sendPayment(paymentRequest: string): Promise<SendPaymentResponse>;
  • paymentRequest: The invoice you’d like the user to pay (lnbc…)

Response

interface SendPaymentResponse { preimage: string; }

Example

const provider = (window.$onekey && window.$onekey.webln) || window.webln; const invoice = "<BOLT11_INVOICE>"; // Replace with a complete invoice. await provider.enable(); const info = await provider.sendPayment(invoice);

Demo

Open example 

Last updated on