⚡
WebLN Guide
  • Introduction
    • 👋Welcome
    • â„šī¸What is WebLN
    • 🏅Benefits of WebLN
  • Building Lightning Apps
    • 👨‍đŸ’ģ👨đŸ’ģ Getting Started
    • đŸ’ģWebLN Reference
      • 🆕webln.isEnabled()
      • webln.enable()
      • webln.getInfo()
      • webln.keysend()
      • webln.makeInvoice()
      • webln.sendPayment()
      • 🆕webln.sendPaymentAsync()
      • webln.signMessage()
      • webln.verifyMessage()
      • 🆕webln.request()
      • 🆕webln.lnurl()
      • 🆕webln.on()
      • 🆕webln.off()
      • 🆕webln.getBalance()
      • Error handling
    • đŸ› ī¸Libraries and Tools
    • 🔆Best Practices
  • Ressources
    • ⚡WebLN Providers
    • 🚀Showcases
    • 👩‍đŸĢTutorials
    • 🌐Additional Resources
  • Contribute
    • đŸ—ī¸Working Group & Guidelines
    • 📖Glossary
Powered by GitBook
On this page
Edit on GitHub
  1. Building Lightning Apps
  2. WebLN Reference

webln.sendPaymentAsync()

Last updated 1 year ago

Request that the user sends a payment for an invoice. The application needs to provide a invoice. The payment will only be initiated and will not wait for a preimage to be returned. This is useful when paying . 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.

This API may not be available on all .

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

đŸ’ģ
🆕
BOLT-11
HOLD invoices
providers