Skip to main content

GET /leokit/assets

Get list of supported tokens with current prices and metadata.

Request

Authentication: Api-Key header required
GET /leokit/assets
Api-Key: your_api_key_here

Response

Status Code: 200 OK Cache: 20 seconds
{
  "tokens": [
    {
      "identifier": "BTC.BTC",
      "blockchain": "BTC",
      "symbol": "BTC",
      "address": "",
      "decimals": 8,
      "price_usd": 98500.45,
      "icon": "https://static.leofinance.io/icons/btc.png",
      "chain_icon": "https://static.leofinance.io/chains/btc.png",
      "coingecko_id": "bitcoin"
    },
    {
      "identifier": "ETH.USDC-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "blockchain": "ETH",
      "symbol": "USDC",
      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "decimals": 6,
      "price_usd": 1.0001,
      "icon": "https://static.leofinance.io/icons/usdc.png",
      "chain_icon": "https://static.leofinance.io/chains/eth.png",
      "coingecko_id": "usd-coin"
    },
    {
      "identifier": "THOR.RUNE",
      "blockchain": "THOR",
      "symbol": "RUNE",
      "address": "",
      "decimals": 8,
      "price_usd": 4.25,
      "icon": "https://static.leofinance.io/icons/rune.png",
      "chain_icon": "https://static.leofinance.io/chains/thor.png",
      "coingecko_id": "thorchain"
    }
  ]
}

Asset Format

Each asset object contains the following fields:
FieldTypeDescription
identifierstringUnique asset identifier in format CHAIN.SYMBOL[-ADDRESS]
blockchainstringBlockchain short name (e.g., “BTC”, “ETH”, “THOR”)
symbolstringToken symbol (e.g., “BTC”, “USDC”, “RUNE”)
addressstringContract address for tokens, empty string for native assets
decimalsnumberNumber of decimal places for the token
price_usdnumberCurrent USD price
iconstringURL to token icon image
chain_iconstringURL to blockchain icon image
coingecko_idstringCoinGecko API identifier for price tracking

Asset Identifier Format

The identifier field uses a standardized format:
  • Native Assets: CHAIN.SYMBOL (e.g., “BTC.BTC”, “ETH.ETH”, “THOR.RUNE”)
  • Token Assets: CHAIN.SYMBOL-ADDRESS (e.g., “ETH.USDC-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48”)

Filtering Rules

The API automatically filters assets based on:
  1. Price Filter: Tokens with price_usd < $0.001 are excluded
  2. Banned Chains: Chains in BANNED_CHAINS constant are filtered out
  3. Client Configuration: Tokens on chains in client’s disabled_chains are excluded
  4. Client-Specific Tokens: Tokens from custom_evm_tokens table included if client_api_key matches

Data Sources

  • Primary: Supabase tokens table (updated every 5 minutes)
  • Secondary: custom_evm_tokens table for client-specific additions

POST /leokit/balances

Get wallet balances across multiple chains in a single request.

Request Body

[
  {
    "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "chain": "ETH"
  },
  {
    "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "chain": "BTC"
  },
  {
    "address": "thor1abc...",
    "chain": "THOR"
  }
]
Request Format: Array of wallet objects
FieldTypeRequiredDescription
addressstringYesWallet address for the chain
chainstringYesBlockchain short name (e.g., “ETH”)

Response

Status Code: 200 OK
{
  "wallets": [
    {
      "chain": "ETH",
      "balances": [
        {
          "token_symbol": "ETH",
          "price": 3500.25,
          "balance": 2.5,
          "balance_usd": 8750.625,
          "icon": "https://static.leofinance.io/icons/eth.png"
        },
        {
          "token_symbol": "USDC",
          "price": 1.0001,
          "balance": 5000,
          "balance_usd": 5000.5,
          "icon": "https://static.leofinance.io/icons/usdc.png"
        }
      ],
      "explorer": "https://etherscan.io/address/0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
      "balance_usd": 13751.125
    },
    {
      "chain": "BTC",
      "balances": [
        {
          "token_symbol": "BTC",
          "price": 98500.45,
          "balance": 1.25,
          "balance_usd": 123125.5625,
          "icon": "https://static.leofinance.io/icons/btc.png"
        }
      ],
      "explorer": "https://blockchain.com/btc/address/bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
      "balance_usd": 123125.5625
    },
    {
      "chain": "THOR",
      "balances": [
        {
          "token_symbol": "RUNE",
          "price": 4.25,
          "balance": 1000,
          "balance_usd": 4250,
          "icon": "https://static.leofinance.io/icons/rune.png"
        },
        {
          "token_symbol": "sTCY",
          "price": 0.15,
          "balance": 5000,
          "balance_usd": 750,
          "icon": "https://static.leofinance.io/icons/tcy.png"
        }
      ],
      "explorer": "https://runescan.io/address/thor1abc...",
      "balance_usd": 5000
    }
  ]
}

Response Format

Each wallet object contains:
FieldTypeDescription
chainstringBlockchain short name
balancesarrayArray of token balance objects
explorerstringBlock explorer URL for the wallet address
balance_usdnumberTotal USD value of all tokens in wallet

Token Balance Object

Each balance object contains:
FieldTypeDescription
token_symbolstringToken symbol (e.g., “ETH”, “USDC”)
pricenumberCurrent USD price per token
balancenumberToken balance (in readable units)
balance_usdnumberUSD value of token balance
iconstringURL to token icon image

Supported Chains (30+)

EVM Chains

  • ETH (Ethereum)
  • ARB (Arbitrum)
  • AVAX (Avalanche C-Chain)
  • BASE (Base)
  • BSC (Binance Smart Chain)
  • POLYGON (Polygon/Matic)
  • OPTIMISM (Optimism)
  • FANTOM (Fantom Opera)

UTXO Chains

  • BTC (Bitcoin)
  • LTC (Litecoin)
  • BCH (Bitcoin Cash)
  • DASH (Dash)
  • ZEC (Zcash)
  • DOGE (Dogecoin)

Cosmos Chains

  • THOR (THORChain)
  • MAYA (MAYAChain)
  • GAIA (Cosmos Hub)
  • KUJI (Kujira)

Other Chains

  • XRP (Ripple)
  • NEAR (NEAR Protocol)
  • SOL (Solana)
  • TRON (Tron Network)

Features

Balance Fetching

  • Parallel Fetching: All chains queried simultaneously for optimal speed
  • Scam Filter: Tokens with balance_usd < $0.10 are automatically excluded
  • Staked Assets: THORChain staked TCY (sTCY) automatically included for THOR wallets
  • Multi-Chain Aggregation: Uses Rango API for broad chain support
  • Chain-Specific Fetchers: Manual implementations for BTC, XRP, NEAR, and other specialized chains

Data Sources

  • Rango API: Primary aggregator for most EVM and Cosmos chains
  • Custom Fetchers: Direct blockchain queries for BTC, XRP, NEAR
  • THORChain API: For RUNE and staked TCY balances
  • Token Prices: Real-time prices from CoinGecko via the tokens table

Example Use Cases

Building a Portfolio Dashboard

// Request balances for multiple wallets
const wallets = [
  { address: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb", chain: "ETH" },
  { address: "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", chain: "BTC" },
  { address: "thor1abc...", chain: "THOR" }
];

const response = await fetch('/leokit/balances', {
  method: 'POST',
  headers: {
    'Api-Key': 'your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(wallets)
});

const data = await response.json();

// Calculate total portfolio value
const totalValue = data.wallets.reduce((sum, wallet) => sum + wallet.balance_usd, 0);
console.log(`Total Portfolio Value: $${totalValue.toFixed(2)}`);

Token Selector with Prices

// Fetch all supported assets
const response = await fetch('/leokit/assets', {
  headers: {
    'Api-Key': 'your_api_key'
  }
});

const { tokens } = await response.json();

// Filter tokens by chain
const ethereumTokens = tokens.filter(token => token.blockchain === 'ETH');

// Sort by USD price
const sortedTokens = tokens.sort((a, b) => b.price_usd - a.price_usd);