API Documentation

Complete reference for integrating with the Westue blockchain network

Base URL
https://westue.com/api

Chain Info

GET /head
Get current chain head information including height, hash, chain ID, and protocol version.
Response
{
  "chain_id": 1,
  "protocol_version": 1,
  "height": 12345,
  "hash_hex": "abc123...",
  "emergency_halt": false
}
GET /health
Health check endpoint. Returns "ok" if the node is operational.
Response
ok

📦 Blocks

GET /block/:height
Get block information by height.
Example
GET /block/100
Response
{
  "header": {
    "chain_id": 1,
    "height": 100,
    "prev_hash": "...",
    "timestamp_ms": 1737000000000,
    "tx_root": "...",
    "proposer": "..."
  },
  "tx_count": 5,
  "tx_hashes": ["...", "..."]
}
GET /blocks
List blocks with pagination support.
Parameter Type Description
fromoptional number Starting block height (default: 0)
limitoptional number Number of blocks (default: 100, max: 1000)
Example
GET /blocks?from=100&limit=50
Response
{
  "blocks": [
    {
      "height": 100,
      "hash": "...",
      "prev_hash": "...",
      "timestamp_ms": 1737000000000,
      "tx_count": 5
    }
  ],
  "count": 50
}

💸 Transactions

GET /tx/:txid
Get transaction details by transaction hash.
Example
GET /tx/abc123...
Response
{
  "tx_hash": "abc123...",
  "from": "def456...",
  "to": "ghi789...",
  "amount": 1000000,
  "fee": 1000,
  "nonce": 5,
  "timestamp_ms": 1737000000000,
  "block_height": 123,
  "confirmations": 456
}
POST /tx
Submit a new transaction to the network. Rate limited to 100 requests per 60 seconds per IP.
Request
{
  "tx": {
    "from": "...",
    "to": "...",
    "amount": 1000000,
    "fee": 1000,
    "nonce": 5,
    "timestamp_ms": 1737000000000,
    "pubkey": [...],
    "sig": [...]
  }
}
Response
{
  "accepted": true,
  "tx_hash": "abc123..."
}
Rate Limit: 100 requests per 60 seconds
Max Body Size: 1MB

👤 Accounts

GET /account/:address
Get comprehensive account information including balance, nonce, and transaction count.
Example
GET /account/abc123...
Response
{
  "address": "abc123...",
  "balance": 1000000,
  "nonce": 5,
  "tx_count": 10
}
GET /balance/:address
Get account balance and nonce (lightweight endpoint).
Example
GET /balance/abc123...
Response
{
  "address": "abc123...",
  "balance": 1000000,
  "nonce": 5
}

🔐 Validators

GET /validators
List all validators in the network.
Response
{
  "validators": [
    {
      "pubkey_hex": "...",
      "address": "...",
      "is_active": true
    }
  ]
}

💰 Supply

GET /supply
Get token supply information including total, circulating, and burned supply.
Response
{
  "total_supply": 1000000000,
  "circulating_supply": 999999999,
  "burned_supply": 0
}

📊 Metrics

GET /metrics
Get node metrics including block counts, transaction statistics, and mempool size.
Response
{
  "head_height": 12345,
  "mempool_size": 10,
  "blocks_applied_total": 12345,
  "blocks_produced_total": 4000,
  "tx_accepted_total": 100000,
  "tx_rejected_total": 100
}

📝 Important Notes

Units & Decimals

Westue uses whole-coin units with NO decimals.

• All amounts are in base units (whole coins, no sub-units)
amount: 1000000 = 1,000,000 whole coins
fee: 1 = 1 whole coin (minimum fee)
• Do NOT divide by 1e9 or any decimal factor
1 WST = 1 base unit (no decimals)
For Exchanges/Wallets:
• Display amounts as whole numbers (no decimal places)
• Minimum fee: 1 whole coin per transaction
• All supply/balance values are whole coins

Address Format

Addresses are 32-byte values encoded as 64-character hex strings.

Example: 1111111111111111111111111111111111111111111111111111111111111111

Error Responses

Status Code Description
400 Bad Request - Invalid request
404 Not Found - Resource not found
429 Too Many Requests - Rate limit exceeded
413 Payload Too Large - Request body too large
500 Internal Server Error - Server error