⚡
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.sendPayment()

Last updated 1 year ago

Request that the user sends a payment for an invoice. The application needs to provide a invoice. For an invoiceless payment, use webln.keysend.

Method

async function sendPayment(paymentRequest: string): SendPaymentResponse;

Parameters

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

Response

interface SendPaymentResponse {
  preimage: string;
}

Example

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

Demo

đŸ’ģ
BOLT-11