Skip to main content

Method Signature

align.blockchain.tokens.getBalance(
  tokenAddress: string,
  walletAddress: string
): Promise<TokenBalance>

Example

// Get USDC balance on Polygon
const USDC_POLYGON = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";

const balance = await align.blockchain.tokens.getBalance(
  USDC_POLYGON,
  "0x742d35Cc6634C0532925a3b844Bc9e7595f0aB42"
);

console.log(`Balance: ${balance.formatted} USDC`);
console.log(`Raw: ${balance.value}`);

Response

{
  "value": "100000000",
  "decimals": 6,
  "formatted": "100.00",
  "symbol": "USDC"
}