RPC del nodo
xrs-node 0.1.1puerto 5600148 rutas
Cuatro rutas escriben; el resto lee.
Base
| Dato | Valor |
|---|---|
| URL base | http://<host>:56001 |
| transporte | HTTP/1.1, sin TLS |
| CORS | * |
| cuerpo | JSON |
| errores | {"error":"…"}, HTTP 200; 501 solo en los stubs de gobernanza y claim |
| tasa de escritura | 30 por minuto por IP |
| cuerpo de escritura | 256 KiB |
| cuerpo del planificador | 16 KiB |
| lecturas | sin límite |
| importes | lamports salvo que la clave termine en _xrs |
| importes de tokens | los decimals del token |
Escritura
| Ruta | Primera instrucción | Comprobaciones previas | Éxito |
|---|---|---|---|
POST /submit | cualquiera | admisión | {"status": "ok", "signature"} |
POST /stake | Stake | firmante = pubkey; saldo ≥ importe; clave del roster en mainnet | {"status": "queued", "staked", …} |
POST /unstake | Unstake | stake ≥ importe; retirar todo o conservar ≥ 1,000 XRS; al menos 1 XRS | {"status": "queued", "unstaked", "unbonding_period_slots": 151200} |
POST /pq-register | PqKeyRegister | firmante = ed25519_pubkey | {"status": "queued", "ed25519_pubkey"} |
Cuerpo de las cuatro: {"tx_base64":"…"}, la transacción bincode en base64 (sobre).
curl -s -X POST http://138.197.116.81:56001/submit \
-H 'Content-Type: application/json' \
-d '{"tx_base64":"<base64>"}'
# {"status":"ok","signature":"<base58>"} | {"error":"…"}
await client.sendInstruction(wallet, ix); // POST /submit
await client.stakeXrs(wallet, 1000); // POST /stake
await client.unstakeXrs(wallet, 1000); // POST /unstake
// POST /pq-register, clave de 1,952 bytes
await client.pqKeyRegister(wallet, pqPublicKey, 'dilithium3', 3);
Admisión
| Comprobación | Rechazo en /submit |
|---|---|
| límite de tasa | Rate limited. Max 30 write RPCs per minute per IP. |
| base64 | Invalid base64 encoding |
| bincode | Failed to deserialize transaction |
| firma | Transaction validation failed: Invalid transaction signature |
| número de instrucciones | Transaction validation failed: Too many instructions in transaction |
| tamaño de instrucción | Transaction validation failed: Instruction data exceeds size limit |
| transferencia legacy | Transaction validation failed: Legacy SystemInstruction::Transfer is disabled |
SubDelegate | Transaction validation failed: SubDelegate is disabled (XWC-82) |
| federación | Public self-staking is closed during federated beta |
| ya en cadena | Transaction already processed |
| ya en el mempool | Transaction already in mempool |
| blockhash | Transaction rejected: recent_blockhash expired or unknown |
| pagador sin saldo para la tarifa, cuota llena | "status":"rejected_underfunded_quota" |
| pool lleno | "status":"rejected_mempool_full" |
Cadena y stake
| Ruta | Devuelve |
|---|---|
GET /health | {"status":"ok"} |
GET /blocks | 50 bloques más recientes, hashes como arrays de bytes |
GET /stake/{address} | stake, isValidator (≥ 1,000 XRS), earns_staking_rewards (≥ 100 XRS), 7 % APR estimado |
GET /account/ | sessions[]; *_time = slot × 4 s |
GET /network/economics | emisión, recompensa por bloque, halving, tarifas, totales de staking |
curl -s http://138.197.116.81:56001/network/economics
# {"chain_height":…,"current_block_reward_xrs":10.0,
# "emission_cap_xrs":500000000.0,"base_tx_fee_xrs":0.001,…}
Tokens
| Ruta | Devuelve |
|---|---|
GET /tokens | {"tokens":[…]}, sin paginar |
GET /token/ | balance, token_info |
GET /token/ | native_xrs (lamports), token_accounts[] |
Contratos y launchpads
| Ruta | Devuelve |
|---|---|
GET /contracts | contract_id, type, owner, is_active |
GET /contract/{id} | contract.state, indexado por tipo |
GET /contract/ | cotización de swap; price_impact_pct es una cadena |
GET /contract/ | {"vesting":{"enabled":false}}: el deploy rechaza vesting |
GET /launchpads | todos los launchpads, el más reciente primero; xeris_fee_bps 77 |
GET /launchpad/ | tokens_out, tarifas, price_impact_pct (número) |
Agentes, capacidades, tareas
| Ruta | Devuelve |
|---|---|
GET /agent/ | agents[]: límites, gasto, revoked |
GET /agent/ | authorized, revoked, expired, agent |
GET /capabilities | listados activos con identidad activa |
GET /capabilities/ | filtrados, por reputación; limit 50 |
GET /tasks | open_tasks, data[] |
GET /tasks/{id} | un TaskEntry |
Planificador
Ruta, action | Petición | Devuelve |
|---|---|---|
POST /agent/plan | {"action":"…",…} | variant_index, variant_name, params |
transfer | from, to, amount_xrs | NativeTransfer, fee, sufficient_balance |
swap | pool_id, token_in, amount_in, slippage_pct | ContractCall, args como 16 bytes, quote |
buy_launchpad | launchpad_id, xrs_amount, slippage_pct | ContractCall, args como objeto JSON, quote |
stake | pubkey, amount_xrs | Stake |
wrap, unwrap | amount_xrs | WrapXrs, UnwrapXrs |
Solo lectura: devuelve qué firmar, nunca firma.
curl -s -X POST http://138.197.116.81:56001/agent/plan \
-H 'Content-Type: application/json' \
-d '{"action":"transfer","from":"<from>","to":"<to>","amount_xrs":1.5}'
# {"action":"transfer","variant_index":11,"variant_name":"NativeTransfer",
# "params":{"from":"…","to":"…","amount":1500000000},"amount_xrs":1.5,
# "fee":1000000,"fee_xrs":0.001,"sender_balance":…,
# "sufficient_balance":true}
import { fromPlan } from 'xeris-sdk';
// POST /agent/plan
const plan = await client.planTransfer(wallet.publicKey, to, 1.5);
await client.sendInstruction(wallet, fromPlan(plan)); // firma y envía
Gobernanza, ZK, PQ
| Ruta | Devuelve |
|---|---|
GET /governance/ | proposals[]; las marcas de tiempo son slot × 4,000 ms |
GET /governance/ | locked_amount, locked_xrs, delegate |
GET /zk/ | proofs[] por remitente |
GET /zk/ | un ZkProofRecord |
GET /zk/stats | total_proofs, total_verified |
GET /pq/keys/{address} | has_pq_key, algorithm, security_level, key_hash, active |
GET /pq/status | total_registered, algorithms, quantum_ready_pct |
Precios
| Ruta | Devuelve |
|---|---|
GET /price-history?pool_id=&limit= | últimos limit (500, ≤ 10,080); uno cada 100 bloques |
GET /pools/price-history | últimos 100 por pool |
Local al nodo, no consenso.
Deshabilitado
| Ruta | Respuesta |
|---|---|
/ | HTTP 200, "status":501 |
POST /stake/claim | HTTP 501 |
POST /governance/ | HTTP 501, variantes 39–41 en su lugar |
POST /token/ | HTTP 200, Direct RPC mutation disabled… |
POST /contract/ | HTTP 200, Direct RPC mutation disabled… |
POST /rwa/ | HTTP 200, Direct RPC mutation disabled… |
Los cambios de estado pasan por /submit.