Prerequisites

  • A Spark wallet created following the Create First Wallet guide
  • Basic understanding of Bitcoin units (satoshis)

Checking Your Balance

To check your Spark wallet balance, use the getBalance() method:

const balance = await wallet.getBalance();
console.log("Balance:", balance);

The getBalance() method returns a Promise resolving to an object containing:

  • balance: A bigint representing the total amount in satoshis
  • tokenBalances: A Map of token balances, where each entry contains:
    • balance: A bigint representing the token amount

Understanding Your Balance

Your balance represents the sum of all available UTXOs in your wallet. This includes:

  • Deposits from Bitcoin
  • Received Lightning payments
  • Received Spark transfers

Claiming Incoming Funds

If you received incoming lightning payments, spark transfers, or bitcoin deposits, they won’t be reflected in your balance right away: you need to claim them.

They are automatically claimed when you initialize your wallet, but if you need to refresh your balance, use the forceRefetch argument:

const balance = await wallet.getBalance(true /* forceRefetch */);
console.log(`Balance: ${balance} sats`);

Note: That In mainnet, we recommend you maintain the balance below 1000 sats. And in regtest, we recommend you maintain the balance below 100,000 sats.

Best Practices

  • Regularly check your balance to ensure expected amounts
  • Verify and claim pending balances after receiving payments

Next Steps

Once you know your balance, you can:

Need Help?