Skip to main content
GET
/
orderbooks
/
stocks
/
api
/
custody
/
{custodyContract}
/
balance
/
{userAddress}
/
{tokenAddress}
curl -X GET "https://api.trusset.org/orderbooks/stocks/api/custody/0x9876.../balance/0x1111.../0x1234...?tokenType=STOCK_TOKEN" \
  -H "x-api-key: trusset_{instanceRef}_{secret}"
{
  "success": true,
  "data": {
    "custodyContract": "0x9876543210fedcba9876543210fedcba98765432",
    "userAddress": "0x1111111111111111111111111111111111111111",
    "tokenAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "balance": "50000000000000000000",
    "tokenType": "STOCK_TOKEN"
  },
  "metadata": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "timestamp": "2025-01-15T10:35:00.000Z",
    "instanceId": "inst_abc"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.trusset.org/llms.txt

Use this file to discover all available pages before exploring further.

Returns the balance of a specific token held by a user within a custody contract. Custody contracts escrow tokens during the trading and settlement lifecycle.

Authentication

Requires an instance API key with the trading service enabled.

Path Parameters

custodyContract
string
required
EVM address of the custody contract. Must match 0x[a-fA-F0-9]{40}.
userAddress
string
required
EVM address of the user. Must match 0x[a-fA-F0-9]{40}.
tokenAddress
string
required
EVM address of the token. Must match 0x[a-fA-F0-9]{40}.

Query Parameters

tokenType
string
Token type to query. One of LIGHT_TOKEN (default) or STOCK_TOKEN.
curl -X GET "https://api.trusset.org/orderbooks/stocks/api/custody/0x9876.../balance/0x1111.../0x1234...?tokenType=STOCK_TOKEN" \
  -H "x-api-key: trusset_{instanceRef}_{secret}"
{
  "success": true,
  "data": {
    "custodyContract": "0x9876543210fedcba9876543210fedcba98765432",
    "userAddress": "0x1111111111111111111111111111111111111111",
    "tokenAddress": "0x1234567890abcdef1234567890abcdef12345678",
    "balance": "50000000000000000000",
    "tokenType": "STOCK_TOKEN"
  },
  "metadata": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "timestamp": "2025-01-15T10:35:00.000Z",
    "instanceId": "inst_abc"
  }
}