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

Last updated 1 year ago

Fetch the balance of the current account.

This API may not be available on all .

Method

async function getBalance(): BalanceResponse;

Response

type BalanceResponse = {
    balance: number;
    currency?: "sats" | "EUR" | "USD"
}

Code Example

await webln.enable();
const result = await webln.getBalance();

Demo

đŸ’ģ
🆕
providers