> ## Documentation Index
> Fetch the complete documentation index at: https://aarc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Chain Balances

**fetchBalances** function of the SDK  provides developers with the method required to access and display the balances of all tokens held in an Externally Owned Account (EOA) wallet on a single blockchain.

## Expected parameters

**`fetchBalances`** accepts the following parameters:

<table><thead><tr><th width="295">Parameters</th><th width="134">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>eoaAddress</code></td><td><code>string</code></td><td>The address for which balance information is needed.</td></tr><tr><td><code>chainId</code></td><td><code>number</code></td><td>The chain Id of the current network.</td></tr><tr><td><code>tokenAddresses\[OPTIONAL]</code></td><td><code>string\[]</code></td><td>Array of the token addresses for which the balances will be fetched.</td></tr><tr><td><code>fetchBalancesOnly</code></td><td><code>boolean</code></td><td>Default is set to <code>true.</code> If set to <code>false</code> then more details of the token are fetched.</td></tr></tbody></table>

<Info>
  **NOTE:**&#x20;

  * If the **`tokenAddresses`** are not provided, then balances of all the tokens within the EOA will be fetched.
  * **`fetchBalancesOnly`**is default to `true`.
</Info>

## Function Call

```typescript theme={null}
let balances = await aarcCoreSDK.fetchBalances(
  "EOA_ADDRESS",
  137, // Chain id of the network
  true, // fetch balances only
  ["0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"] // [OPTIONAL] array of specific token
);
```

## Response

#### When `fetchBalancesOnly` is 'true':

```json theme={null}
{
  "code": 200,
  "data": [
    {
      "tokenAddress": "0x...eee",
      "balance": number
    },
    {
      "tokenAddress": "0x...000",
      "balance": number
    },
  ],
  "message": "success"
}
```

#### When `fetchBalancesOnly` is 'false':

```json theme={null}
{
  "code": 200,
  "data": [
    {
      "decimals": number,
      "native_token": boolean,
      "name": string,
      "symbol": string,
      "token_address": 0xstring,
      "balance": string,
      "type": string,
      "permit2Allowance": string,
      "permitExist": boolean,
      "nft_data": [
         {
            "image": string;
            "tokenId": string;
         }
      ]
    },
    {
      "decimals": number,
      "native_token": boolean,
      "name": string,
      "symbol": string,
      "token_address": 0xstring,
      "balance": string,
      "type": string,
      "permit2Allowance": string,
      "permitExist": boolean,
      "nft_data": [
         {
            "image": string;
            "tokenId": string;
         }
      ]
    }
  ],
  "message": "success"
}
```

## Support

If you face any trouble, feel free to reach out to our engineers in the [Telegram support group](https://t.me/aarcxyz).
