Prerequisites

  • Ensure you have a wallet created.
  • API Key: Ensure you have an API key with the scopes: wallets.read and wallets:balance.read.

Retrieving Wallet Balances

import { useWallet } from '@crossmint/client-sdk-react-ui';

const { wallet } = useWallet();

const { nativeToken, usdc, tokens } = await wallet.balances(tokens);

Parameters

tokens
string[]

The tokens to get the balances for. This can be a token symbol or a token address.

Returns

nativeToken
Token

The native token balance.

usdc
Token

The USDC balance.

tokens
Token[]

The tokens balances.