Skip to content

Token Management API

Get Specific Token

Retrieves details for a specific token by ID.

Endpoint

http
GET /api/wallet/{wallet}/token/{token}

Parameters

  • wallet (integer): Wallet ID
  • token (integer): Token ID

Response

json
{
  "status": "success",
  "message": "Wallet token fetched successfully",
  "data": {
    "id": 1,
    "name": "Ethereum",
    "symbol": "ETH",
    "decimals": 18,
    "is_native": true,
    "is_active": true,
    "is_testnet": false,
    "contract": "0x0000000000000000000000000000000000000000",
    "balance": "1.23456789",
    "last_balance": "1.23456789",
    "created_at": "2024-01-01 00:00:00",
    "updated_at": "2024-01-01 00:00:00"
  }
}

Example Request

bash
curl -H "Authorization: Bearer {token}" \
     https://zafira-app.vratts.com/api/wallet/1/token/1

Token Model Details

Fields

  • id (integer): Unique token identifier
  • name (string): Token display name
  • symbol (string): Token symbol (e.g., ETH, USDC)
  • decimals (integer): Token decimal places
  • is_native (boolean): Whether token is native to the network
  • is_active (boolean): Whether token is active
  • is_testnet (boolean): Whether token is for testnet
  • contract (string): Token contract address
  • created_at (datetime): Token creation timestamp
  • updated_at (datetime): Last update timestamp

Hidden Fields (for security)

  • wallet_id: Associated wallet ID

Special Notes

  • contract defaults to 0x0000000000000000000000000000000000000000 for native tokens
  • balance and last_balance fields come from the WalletBalance model
  • Token information is automatically fetched from blockchain when added

Error Handling

Common Errors

Token Not Found (404)

json
{
  "status": "error",
  "message": "Token not found",
  "data": null
}

Unauthorized Access (401)

json
{
  "status": "error",
  "message": "Unauthenticated",
  "data": null
}

Next Steps

Released under the MIT License.