⚑
WebLN Guide
CtrlK
  • 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()

Fetch the balance of the current account.

This API may not be available on all providers.

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

Last updated 1 year ago