Balances Information

The /balances endpoint returns all wallet balances across protocols and networks Enso supports.

API Reference: GET /v1/wallet/balances

[
    {
    "token": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
    "amount": "7568910913750864",
    "decimals": 18,
    "price": 2559.27,
    "name": "ETH",
    "symbol": "ETH",
    "logoUri": "https://static.debank.com/image/coin/logo_url/eth/6443cdccced33e204d90cb723c632917.png"
  },
  {
    "token": "0x030ba81f1c18d280636f32af80b9aad02cf0854e",
    "amount": "2455429",
    "decimals": 18,
    "price": 2509.83,
    "name": "Aave interest bearing WETH",
    "symbol": "aWETH",
    "logoUri": "https://static.debank.com/image/eth_token/logo_url/0x030ba81f1c18d280636f32af80b9aad02cf0854e/b6910e236da889f08602435e79c08f98.png"
  }
]

Example Request

import { EnsoClient } from '@enso/sdk';

// Initialize the client with your API key
const enso = new EnsoClient({
  apiKey: 'YOUR_API_KEY' // Replace with your actual API key
});

// Get user balances across all protocols on a specific chain
async function getUserBalances(chainId: number, address: string) {
  try {
    const balances = await enso.getBalances({
      chainId,
      eoaAddress: address,
      useEoa: true // Get balances for EOA; set to false for Enso Smart Wallet
    });
    
    console.log(`Balances for ${address} on chain ${chainId}:`, balances);
    return balances;
  } catch (error) {
    console.error('Error fetching user balances:', error);
    throw error;
  }
}

// Get user balances on Ethereum
getUserBalances(1, '0xd8da6bf26964af9d7eed9e03e53415d37aa96045');