Amadeus Blockchain API
The HTTP API of an Amadeus node: chain state and balances, transaction submission, contract state reads, cryptographic proofs, validator and peer data, the bridge, and a push-only WebSocket event stream.
This reference describes node software 1.6.5 and is generated from openapi/amadeus.json.
Base URLs
| Network | HTTP API base | WebSocket |
|---|---|---|
| Mainnet | https://mainnet-rpc.ama.one/api | wss://mainnet-rpc.ama.one/ws/rpc |
| Testnet | https://testnet-rpc.ama.one/api | wss://testnet-rpc.ama.one/ws/rpc |
Every path in this reference already starts with /api (or /ws, /health, /metrics), so the server selector in the Try-It panel only holds the host. Use the full base with /api for curl and as baseUrl in new AmadeusSDK({ baseUrl }). Explorers, faucet and the other endpoints are listed on Networks.
curl -s https://mainnet-rpc.ama.one/api/chain/kpi
{"error":"ok","kpi":{"block_time":500,"active_peers":13,"active_validator_keys":120,"ama_burned":2276198.27,"fees_paid":4552396.54,"total_tx":375639024,"uaw":540675}}
Authentication and limits
- Chain, wallet, contract, proof, bridge and peer endpoints need no API key or auth header. CORS is open (
Access-Control-Allow-Origin: *). - Writes are transactions:
/api/tx/submit*accepts a transaction signed with the sender's BLS12-381 key. The contract POSTs (get,get_prefix,view) are unauthenticated reads. /healthand/metrics*are node-operator endpoints. They needAuthorization: Bearer <PROMETHEUS_TOKEN>and answer401 {"error":"unauthorized"}without it.- The testnet-only
/api/upow/*helpers are rate-limited per IP (60 or 100 requests per minute) and answer429 {"error":"rate_limited"}above the limit. - POST bodies need a
Content-Lengthheader and may be at most 1 MiB (transaction submission allows up to twice the node's maximum transaction size when that is larger). - Some answers are cached by the node:
/api/chain/statsand/api/chain/consensusfor 1 s,/api/chain/kpifor 10 s,/api/contract/richlistfor up to 1 hour.
Response conventions
Most JSON responses carry a top-level error field: "ok" on success, or a short error code. The payload sits next to it (stats, entry, entries, txs, balance, ...).
{"error":"ok","emission_address":null}
The HTTP status is 200 unless listed below. Many failures are therefore HTTP 200 with a non-ok code, for example a rejected transaction (invalid_signature, nonce_too_high), sol_not_found, state_root_mismatch or a proof error.
| Status | When |
|---|---|
| 400 | /api/contract/get_prefix with a prefix shorter than 8 bytes: {"error":"prefix_too_short","min":8} |
| 401 | /health and /metrics* without a valid bearer token |
| 404 | Unknown route, and an empty result on /api/chain/hash, /height, /height_with_txs, /tx and /txs_in_entry: {"error":"not_found"} |
| 429 | Testnet /api/upow/* above the per-IP rate limit |
| 503 | /api/sync/contractstate when the node does not serve snapshots or none is ready |
A request the node cannot parse (a non-numeric height, tx_by_filter with limit over 1000, a submit_and_wait that times out) gets no JSON reply: the node closes the connection, and the public RPC hosts answer with a 5xx gateway error.
Nodes that prune history (pruned_below_height > 0 in /api/chain/stats) forward history lookups they cannot answer to an upstream node. The public RPC hosts keep full history.
Content types
Everything is JSON except:
POST /api/contract/get_prefixreturns VecPak (binary): a map{rows, cursor}. See Models.GET /api/sync/contractstatereturnsapplication/zstd.- Testnet
/api/upow/seed*return raw bytes. /healthand/metrics*return Prometheus text./ws/rpc/testreturns an HTML page.
Binary request bodies (transactions, state keys, VecPak maps) are sent as raw bytes; Content-Type: application/octet-stream is a good default.
Identifiers and amounts
| Field | Format |
|---|---|
| Public key / address | Base58, 48 bytes (BLS12-381) |
| Hash (entry, transaction, state root) | Base58, 32 bytes |
| Signature | Base58, 96 bytes |
flat amount | Integer in base units, 1 AMA = 10<sup>9</sup> flat |
float amount | AMA as a floating-point number, for display |
Shared objects (entries, transactions, proofs) and the error codes are described on Models.
WebSocket
/ws/rpc is a push-only stream: for every new entry the node sends event_stats, event_entry and, when the entry has transactions, event_txs. Client messages are ignored. See WebSocket RPC endpoint.
SDK
The TypeScript SDK @amadeus-protocol/sdk wraps these endpoints and handles transaction building, signing and VecPak. Start with the SDK introduction.
Authentication
- HTTP: Bearer Auth
The node's PROMETHEUS_TOKEN
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Contact Amadeus Protocol: URL: https://ama.one