> For the complete documentation index, see [llms.txt](https://docs.xverse.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xverse.app/sats-connect/bitcoin-methods/getbalance.md).

# getBalance

You can use the `getBalance` method to retrieve your user's Bitcoin balance, i.e. the amount of BTC that their [connected wallet](/sats-connect/connecting-to-the-wallet.md)'s Bitcoin payment address owns.&#x20;

Your app must have first [connected to the wallet](/sats-connect/connecting-to-the-wallet/connect-to-xverse-wallet.md) and obtained [account read permissions.](/sats-connect/xverse-wallet-permissions.md) \
\
No query parameters are required for the method:

```typescript
import { request } from 'sats-connect';

const response = await request('getBalance', undefined);

if (response.status === 'success') {
  console.log(response.result);
} else {
  console.error(response.error);
}
```

The `getBalance` method will **not** trigger any operation or prompt your user to sign any transaction. It will return an object representing the connected wallet's payment address BTC holdings:

<table><thead><tr><th width="204">balance </th><th>Description</th></tr></thead><tbody><tr><td><code>confirmed</code></td><td>a string representing the connected wallet's <strong>confirmed</strong> BTC balance, i.e. the amount of <strong>confirmed</strong> BTC which the payment address holds, in satoshis</td></tr><tr><td><code>unconfirmed</code></td><td>a string representing the connected wallet's <strong>unconfirmed BTC</strong> balance, i.e. the amount of <strong>unconfirmed</strong> BTC which the payment address will send/receive as a result of pending mempool transactions, in satoshis<br><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span>Note that this amount can be negative if the net result of pending mempool transaction decreases the address balance.</td></tr><tr><td><code>total</code></td><td>a string representing the sum of <code>confirmed</code> and <code>unconfirmed</code> BTC balances.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xverse.app/sats-connect/bitcoin-methods/getbalance.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
