🆕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