> For the complete documentation index, see [llms.txt](https://solpay-docs.solblaze.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://solpay-docs.solblaze.org/reference/sdk-reference/get-balance.md).

# getBalance

```javascript
(async() => {
    let balance_1 = await SOLPay.getBalance(); // {"lamports": 1}
    let balance_2 = await SOLPay.getBalance("SOLANA_ADDRESS"); // {"lamports": 1}
})();
```

### Parameters:

* address (optional, default: connected wallet address): string - the Solana address with which to get the Solana lamports balance

### Returns:

object (`{"lamports": 1}`) - the balance details for the specified address

* lamports: number (`1`) - the number of lamports in the account

### Throws:

* `SOL Pay SDK Fatal Error: Invalid address ${address}, and no wallet was connected. Use SOLPay.connectWallet() to connect to a Solana wallet.` - an invalid address was used, and no wallet was connected
* `SOL Pay SDK Fatal Error: No connection found. Use SOLPay.connectNetwork() to connect to the Solana network.` - could not find a connection to the Solana network
* `SOL Pay SDK Fatal Error: Connection did not respond. Use SOLPay.connectNetwork() to connect to the Solana network.` - did not receive response from Solana network
