API Reference

Base URL

https://cryptain.xyz/api

Authentication

All endpoints that require authentication expect a Solana wallet signature. The signature should be included in the request body along with the message that was signed.

Endpoints

Votes

Get Vote Logs

GET /api/votes/logs

Returns the most recent vote logs and system logs.

Response

[
  {
    "id": "string",
    "type": "vote | analysis | token_profile | telegram",
    "message": "string",
    "related_id": "string | null",
    "data": "string | null",
    "timestamp": "string (ISO 8601)",
    "source": "vote | system"
  }
]

Get Last Vote

GET /api/votes/last/{walletAddress}

Returns the last vote for a specific wallet.

Parameters

  • walletAddress: Solana wallet address

Response

{
  "id": "string",
  "wallet_address": "string",
  "token_address": "string",
  "token_name": "string",
  "token_symbol": "string",
  "staked_amount": "number",
  "analysis_data": "string",
  "timestamp_ms": "number",
  "timestamp": "string (ISO 8601)"
}

Get Vote Rankings

GET /api/votes/rankings

Returns the current vote rankings.

Response

[
  {
    "token_address": "string",
    "token_name": "string",
    "token_symbol": "string",
    "total_stake": "number",
    "vote_count": "number",
    "last_vote": "string (ISO 8601)"
  }
]

Submit Vote

POST /api/votes

Submit a new vote.

Request Body

{
  "walletAddress": "string",
  "tokenAddress": "string",
  "signature": "string",
  "publicKey": "string",
  "message": "string"
}

Response

{
  "id": "string"
}

Stakes

Get Stake Status

GET /api/stakes/status/{walletAddress}

Returns the current stake status for a wallet.

Parameters

  • walletAddress: Solana wallet address

Response

{
  "amount": "number"
}

Get Total Staked

GET /api/stakes/total

Returns the total amount staked across all wallets.

Response

{
  "total": "number"
}

Process Unstake

POST /api/stakes/unstake

Process an unstake request.

Request Body

{
  "walletAddress": "string",
  "amount": "number",
  "signature": "string",
  "publicKey": "string",
  "message": "string"
}

Response

{
  "signature": "string"
}

Tokens

Validate Token

GET /api/tokens/validate/{address}

Validates a token address and returns token information.

Parameters

  • address: Token contract address

Response

{
  "isValid": "boolean",
  "tokenInfo": {
    "name": "string",
    "symbol": "string"
  },
  "analysisData": "string"
}

Transactions

Prepare Transaction

POST /api/transactions/prepare

Prepares a stake transaction.

Request Body

{
  "walletAddress": "string",
  "amount": "number"
}

Response

{
  "serializedTransaction": "string (base64)"
}

Verify Transaction

POST /api/transactions/verify

Verifies a completed transaction.

Request Body

{
  "signature": "string",
  "walletAddress": "string"
}

Response

{
  "success": "boolean"
}

Portfolio

Get Portfolio

GET /api/portfolio

Returns the current portfolio data.

Response

{
  "total_usd": "number",
  "tokens": [
    {
      "token_address": "string",
      "name": "string",
      "symbol": "string",
      "decimals": "number",
      "balance": "string",
      "ui_amount": "number",
      "price_usd": "number",
      "value_usd": "number",
      "logo_uri": "string | null"
    }
  ]
}

Error Handling

All endpoints follow the same error response format:

{
  "error": "string"
}

Common HTTP status codes:

  • 200: Success

  • 400: Bad Request

  • 401: Unauthorized

  • 403: Forbidden

  • 404: Not Found

  • 429: Too Many Requests

  • 500: Internal Server Error

Rate Limiting

  • Vote endpoints have a 60-minute cooldown between votes per wallet

  • Unstake operations are rate limited to 5 requests per minute per wallet

  • Other endpoints have standard rate limiting of 100 requests per minute per IP

Last updated