Skip to main content

Overview

Wallets are the core entity in Camino Treasury. Each wallet represents an Ethereum address that your organization tracks. Once a wallet is added, you can fetch its on-chain token balances across supported chains.

Prerequisites

API keys are scoped to a single organization. All wallets and data returned are isolated to that organization.

1. List Wallets

Fetch all wallets in your organization:
const response = await fetch('https://api.caminotreasury.com/v1/wallets', {
  headers: { 'x-api-key': 'your-api-key' }
});

const { data: wallets, count } = await response.json();

// wallets:
// [
//   {
//     "id": 1,
//     "address": "0x742d35cc6634c0532925a3b844bc454e4438f44e",
//     "label": "Main Treasury",
//     "createdAt": "2024-01-15T10:30:00.000Z"
//   }
// ]
FieldTypeDescription
idintegerUnique wallet identifier
addressstringEthereum wallet address
labelstringHuman-readable name
createdAtstringISO 8601 timestamp

2. Create a Wallet

Add a new wallet to your organization:
const response = await fetch('https://api.caminotreasury.com/v1/wallets', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'your-api-key'
  },
  body: JSON.stringify({
    address: '0x742d35cc6634c0532925a3b844bc454e4438f44e',
    label: 'Main Treasury'
  })
});

const { wallet } = await response.json();
// { id: 1, address: "0x742d...", label: "Main Treasury", createdAt: "2024-01-15T10:30:00.000Z" }
Addresses must match the pattern 0x[a-fA-F0-9]{40}. If the wallet already exists in your organization, you’ll receive a 409 Conflict response.

3. Get Token Balances

Fetch on-chain token balances for a wallet. Balances are scoped by chain ID — use 1 for Ethereum Mainnet.
const chainId = 1;
const address = '0x742d35cc6634c0532925a3b844bc454e4438f44e';

const response = await fetch(
  `https://api.caminotreasury.com/v1/${chainId}/balances/${address}`,
  { headers: { 'x-api-key': 'your-api-key' } }
);

const { data: balances, count } = await response.json();

// balances:
// [
//   {
//     "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
//     "name": "USD Coin",
//     "symbol": "USDC",
//     "raw": "10000500000",
//     "decimals": 6
//   },
//   {
//     "token": "0xdac17f958d2ee523a2206206994597c13d831ec7",
//     "name": "Tether USD",
//     "symbol": "USDT",
//     "raw": "5000000000",
//     "decimals": 6
//   },
//   {
//     "token": "0x00c000f9e58725ed0a712e457669cad28b13eaee",
//     "name": "C0",
//     "symbol": "C0",
//     "raw": "0",
//     "decimals": 6
//   },
//   {
//     "token": "0x866a2bf4e572cbcf37d5071a7a58503bfb36be1b",
//     "name": "M",
//     "symbol": "M",
//     "raw": "0",
//     "decimals": 6
//   }
// ]
FieldTypeDescription
tokenstringToken contract address
namestringToken name
symbolstringToken symbol
rawstringRaw token balance as a string (for bigint precision)
decimalsintegerToken decimal places (6 for all supported tokens)
To convert a raw balance to a human-readable amount:
const usdc = balances.find(b => b.symbol === 'USDC');
const amount = Number(usdc.raw) / 10 ** usdc.decimals;
// 10000500000 / 1e6 = 10000.50

4. Delete a Wallet

Remove a wallet from your organization:
const address = '0x742d35cc6634c0532925a3b844bc454e4438f44e';

const response = await fetch(
  `https://api.caminotreasury.com/v1/wallets/${address}`,
  {
    method: 'DELETE',
    headers: { 'x-api-key': 'your-api-key' }
  }
);

const result = await response.json();
// { deleted: true }

Next Steps