Skip to main content
Check how much USDC is in your Unified Balance in total and on each source blockchain.

Prerequisites

Before you begin, ensure that you’ve: These are required so any example below runs with a valid kit and adapter.

Check balances by adapter

Query balances with the same adapters you use for deposits. If you query more than one signing ecosystem, such as EVM and Solana, pass one source for each adapter. Omitting the chains parameter returns balances for all supported chains available to that source and networkType.
TypeScript
const balances = await kit.unifiedBalance.getBalances({
  sources: [{ adapter: evmAdapter }, { adapter: solanaAdapter }],
});

// Log confirmed and pending totals plus per-depositor, per-chain breakdown.
console.dir(balances, { depth: null });
You will see an output similar to:
Shell
{
  token: "USDC",
  totalConfirmedBalance: "166.954132",
  breakdown: [
    {
      depositor: "1234abcd1234abcd1234abcd1234abcd1234abcd1234",
      totalConfirmed: "13.124021",
      breakdown: [
        {
          chain: "Solana",
          confirmedBalance: "13.124021",
        },
      ],
    },
    {
      depositor: "0x0123abcd0123abcd0123abcd0123abcd0123abcd",
      totalConfirmed: "153.830111",
      breakdown: [
        {
          chain: "Ethereum",
          confirmedBalance: "11.998900",
        }, {
          chain: "Base",
          confirmedBalance: "19.926391",
        }, {
          chain: "Avalanche",
          confirmedBalance: "19.458595",
        }, {
          chain: "Arbitrum",
          confirmedBalance: "9.989950",
        }, {
          chain: "Sonic",
          confirmedBalance: "11.939700",
        }, {
          chain: "World_Chain",
          confirmedBalance: "10.929750",
        }, {
          chain: "Sei",
          confirmedBalance: "25.891695",
        }, {
          chain: "HyperEVM",
          confirmedBalance: "9.699800",
        }, {
          chain: "Optimism",
          confirmedBalance: "9.998450",
        }, {
          chain: "Polygon",
          confirmedBalance: "13.997930",
        }, {
          chain: "Unichain",
          confirmedBalance: "9.998950",
        }
      ],
    },
  ],
}

Check balances by address

You can also query by account address. This is useful when you need to inspect an account’s Unified Balance without signing.
TypeScript
const balances = await kit.unifiedBalance.getBalances({
  sources: {
    address: "0xWalletAddress",
    chains: ["Base_Sepolia"],
  },
});

console.dir(balances, { depth: null });
You will see an output similar to:
Shell
{
  token: "USDC",
  totalConfirmedBalance: "0.082000",
  breakdown: [
    {
      depositor: "0xWalletAddress",
      totalConfirmed: "0.082000",
      breakdown: [
        {
          chain: "Base_Sepolia",
          confirmedBalance: "0.082000"
        }
      ]
    }
  ]
}

Query specific chains

Use chains to limit the response to the chains you care about. If you omit chains, App Kit returns balances for the supported chains available to that source and networkType. Note that all chains in the array must be on the same network, you cannot mix testnet and mainnet chains.
TypeScript
const balances = await kit.unifiedBalance.getBalances({
  sources: {
    adapter,
    chains: ["Base_Sepolia", "Arc_Testnet"],
  },
});
You will see an output similar to:
Shell
{
  token: "USDC",
  totalConfirmedBalance: "32.207843",
  breakdown: [
    {
      depositor: "0x0123abcd0123abcd0123abcd0123abcd0123abcd",
      totalConfirmed: "32.207843",
      breakdown: [
        {
          chain: "Arc_Testnet",
          confirmedBalance: "12.281452"
        }, {
          chain: "Base_Sepolia",
          confirmedBalance: "19.926391"
        }
      ]
    }
  ]
}

Select a network

Set networkType to query testnet balances. If you omit networkType, App Kit uses mainnet when chains cannot be derived from the source. This is not an issue if you include the chains parameter.
TypeScript
const balances = await kit.unifiedBalance.getBalances({
  sources: { address: "0xWalletAddress" },
  networkType: "testnet",
});
You will see an output similar to:
Shell
{
  token: "USDC",
  totalConfirmedBalance: "0.282000",
  breakdown: [
    {
      depositor: "0xWalletAddress",
      totalConfirmed: "0.282000",
      breakdown: [
        {
          chain: "Ethereum_Sepolia",
          confirmedBalance: "0.000000",
        }, {
          chain: "Base_Sepolia",
          confirmedBalance: "0.200000",
        }, {
          chain: "Avalanche_Fuji",
          confirmedBalance: "0.000000",
        }, {
          chain: "Arbitrum_Sepolia",
          confirmedBalance: "0.000000",
        }, {
          chain: "Sonic_Testnet",
          confirmedBalance: "0.000000",
        }, {
          chain: "World_Chain_Sepolia",
          confirmedBalance: "0.000000",
        }, {
          chain: "Sei_Testnet",
          confirmedBalance: "0.000000",
        }, {
          chain: "HyperEVM_Testnet",
          confirmedBalance: "0.000000",
        }, {
          chain: "Arc_Testnet",
          confirmedBalance: "0.082000",
        }, {
          chain: "Optimism_Sepolia",
          confirmedBalance: "0.000000",
        }, {
          chain: "Polygon_Amoy_Testnet",
          confirmedBalance: "0.000000",
        }, {
          chain: "Unichain_Sepolia",
          confirmedBalance: "0.000000",
        }
      ],
    }
  ],
}

Include pending balances

Set includePending: true to include pending balance totals and pending transaction details in the response.
TypeScript
const balances = await kit.unifiedBalance.getBalances({
  sources: { adapter },
  includePending: true,
});
You will see an output similar to:
Shell
{
  token: "USDC",
  totalConfirmedBalance: "0.000000",
  breakdown: [
    {
      depositor: "1234abcd1234abcd1234abcd1234abcd1234abcd1234",
      totalConfirmed: "0.000000",
      breakdown: [
        {
          chain: "Solana",
          confirmedBalance: "0.000000",
          pendingBalance: "0.000000",
          pendingTransactions: [],
        }
      ],
      totalPending: "0.000000",
    }
  ],
  totalPendingBalance: "0.000000",
}

Query multiple sources

Pass an array when you need balances across multiple sources. Each source can use an adapter or an address.
TypeScript
const balances = await kit.unifiedBalance.getBalances({
  sources: [
    {
      adapter: evmAdapter,
      chains: ["Arc_Testnet"],
    },
    {
      address: "SolanaWalletAddress",
      chains: ["Solana_Devnet"],
    },
  ],
});
You will see an output similar to:
Shell
{
  token: "USDC",
  totalConfirmedBalance: "25.405473",
  breakdown: [
    {
      depositor: "0x0123abcd0123abcd0123abcd0123abcd0123abcd",
      totalConfirmed: "12.281452",
      breakdown: [
        {
          chain: "Arc_Testnet",
          confirmedBalance: "12.281452",
        }
      ],
    }, {
      depositor: "SolanaWalletAddress",
      totalConfirmed: "13.124021",
      breakdown: [
        {
          chain: "Solana_Devnet",
          confirmedBalance: "13.124021",
        }
      ],
    }
  ],
}