Skip to main content
Gets the available Bitcoin balance in satoshis for a Spark address. Automatically paginates through all wallet nodes.

Method Signature

async getAvailableBalance(sparkAddress: string): Promise<bigint>

Parameters

sparkAddress
string
required
The Spark address to query (e.g., "sp1...").

Returns

balance
bigint
required
Available balance in satoshis. Returns 0n for private wallets queried without authentication.

Example

const balance = await client.getAvailableBalance("sp1...");
console.log("Balance:", balance, "sats");
console.log("Balance (BTC):", Number(balance) / 1e8);