Skip to content

RPC API

Ashen exposes a JSON-RPC 2.0 API defined by a single IDL (Interface Definition Language) file: node_rpc_v1.idl. Every type, method, parameter, and return value in the API is declared in this IDL. Clients, the TUI, and code-generation tooling all derive their behavior from the same source of truth rather than hand-coded stubs.

The node serves the IDL itself over HTTP so that tools can discover the API at runtime.

EndpointReturnsDescription
GET /v2/rpc/idltext/plainRaw IDL source text
GET /v2/rpc/manifestapplication/jsonParsed manifest with method signatures, struct/enum definitions

CLI shortcuts:

Terminal window
just rpc-idl # fetch raw IDL from a running node
just rpc-manifest # fetch the JSON manifest

The built-in TUI embeds the IDL at compile time and provides an RPC Explorer screen. It parses node_rpc_v1.idl at startup — no network call is needed for method discovery.

Features:

  • Filterable method list (press / to search)
  • Method signatures with parameter types and documentation
  • Direct execution: press x to call a method, v for read-only view
  • On-chain contract IDL loading via contract_idl()

All RPC calls use JSON-RPC 2.0 over HTTP:

POST /v2/rpc
Content-Type: application/json

Request:

{
"jsonrpc": "2.0",
"id": 1,
"method": "NodeRpcV1.status",
"params": {}
}

Methods can be addressed by qualified name (NodeRpcV1.status) or unqualified (status) when unambiguous.

  • Enums are encoded as {"type": "<variant_snake_case>", "value": <payload>}. Example: {"type": "transfer", "value": {"to": "0x...", "amount": "10"}}.
  • Large integers (u128, i128) are JSON strings: "1000000000000000000".
  • Addresses are hex strings with 0x prefix.
  • Hashes are lowercase hex strings (no fixed 0x requirement).

Methods are classified into three access tiers:

TierDescriptionExamples
PublicOpen to all callers, no auth requiredstatus, health, account, tx_submit
Paid (x402)Expensive operations, may require payment or rate limitingtx_simulate, chain_traceCall, view_call
AdminRestricted to node operatorstx_build, import_snapshot_chunk

Authentication uses a Bearer token in the Authorization header when required.

MethodParametersReturnsDescription
statusStatusChain tip, finalized height, epoch, validator set, txpool size
healthHealthResultLiveness probe (Kubernetes-compatible)
readinessReadinessResultReadiness probe: sync status, epoch key availability
validator_statusValidatorStatusDKG state, sync, peer health, consensus metrics
MethodParametersReturnsDescription
accountaddressAccountBalance and nonce lanes for an address
accountsaddresses[]AccountsResultBatch account lookup (deterministic order)
predict_addressdeployer, offset?PredictAddressResultPredict a contract deploy address
contract_metadataaddressContractMetadataResultVM type, code hash, ABI version, upgrade policy
contract_idladdressContractIdlResultRaw IDL text stored on-chain (if deployed with IDL)
view_callViewCallArgsViewCallResultRead-only contract call (no state change)
MethodParametersReturnsDescription
tx_buildTxBuildArgsTxBuildResultBuild an unsigned transaction envelope
tx_build_simulateTxBuildArgsTxBuildSimulateResultBuild + simulate in one call
tx_submitTxSubmitArgsTxSubmitResultSubmit a signed transaction
tx_by_hashtx_hashTxByHashResultLook up transaction by hash (pending, included, or not found)
tx_receipttx_hashTxReceiptResultFull receipt with decoded events (when IDL is available)
MethodParametersReturnsDescription
tx_simulateTxSimulateArgsTxSimulateResultSimulate execution, estimate gas
tx_simulate_accessTxSimulateAccessArgsTxSimulateAccessResultSimulate + return storage access list
tx_simulate_traceTxSimulateTraceArgsTxSimulateTraceResultSimulate with full execution trace
tx_simulate_pipelineTxSimulatePipelineArgsTxSimulatePipelineResultMulti-step pipeline (txs + view calls)
chain_traceTransactionChainTraceTransactionArgsChainTraceTransactionResultTrace an already-included transaction
chain_traceCallChainTraceCallArgsChainTraceCallResultTrace a view call
MethodParametersReturnsDescription
list_blocksListBlocksArgsListBlocksResultPaginated blocks (newest-first, cursor-based)
list_txsListTxsArgsListTxsResultPaginated transactions (newest-first)
list_txs_by_senderListTxsBySenderArgsListTxsBySenderResultTransactions by sender address
list_txs_by_contractListTxsByContractArgsListTxsByContractResultTransactions involving a contract
get_logsGetLogsArgsGetLogsResultEvent logs by contract, topic, and/or block range
list_pending_txsListPendingTxsArgsListPendingTxsResultPending transactions from the mempool
txpool_statsTxpoolStatsMempool size, lanes, sealed queue
get_blocksGetBlocksArgsGetBlocksResultBlocks by height range
get_block_summariesGetBlocksArgsGetBlockSummariesResultLightweight block summaries for a height range
get_txs_in_rangeGetBlocksArgsGetTxsInRangeResultAll transactions in a block height range
get_checkpoint_listCheckpointListResultAvailable checkpoints
MethodParametersReturnsDescription
finality_proofFinalityProofArgsFinalityProofResultFinality proof for a block height
light_client_contextLightClientContextArgsLightClientContextResultVerification context for light clients
state_proofStateProofArgsStateProofResultState proof for a contract (optionally a specific slot)
finalized_history_rootFinalizedHistoryRootArgsFinalizedHistoryRootResultCurrent finalized history MMR root
finalized_history_proofFinalizedHistoryProofArgsFinalizedHistoryProofResultMMR membership proof for a finalized block
MethodParametersReturnsDescription
get_light_snapshotGetLightSnapshotArgsGetLightSnapshotResultLight snapshot for verified fast sync
get_checkpointGetCheckpointArgsGetCheckpointResultCheckpoint descriptor by height
list_checkpointsListCheckpointsArgsListCheckpointsResultAvailable checkpoints with archive descriptors
get_snapshot_chunkGetSnapshotChunkArgsGetSnapshotChunkResultChunk of snapshot entries for state sync
import_snapshot_chunkImportSnapshotChunkArgsImportSnapshotChunkResultImport snapshot entries (Admin)
MethodParametersReturnsDescription
tx_submit_sealedTxSubmitSealedArgsTxSubmitSealedResultSubmit a threshold-encrypted transaction
get_epoch_keyGetEpochKeyArgsGetEpochKeyResultThreshold encryption public key for sealing
tx_submit_bundleTxSubmitBundleArgsTxSubmitBundleResultSubmit an atomic transaction bundle
chain_simulateBundleBundleSimulateArgsBundleSimulateResultSimulate a bundle with dependency analysis

Contracts can store their IDL on-chain at deploy time. The contract_idl method retrieves the raw IDL text for any address. The TUI uses this to provide method-level exploration and parameter templates for contract calls — the same IDL-driven discovery that powers the node RPC explorer also works for individual contracts.

Terminal window
curl -s http://localhost:8080/v2/rpc \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "NodeRpcV1.status",
"params": {}
}' | jq .result
{
"version": "0.1.0",
"chain_id": 1,
"now_ms": 1706900000000,
"uptime_ms": 3600000,
"block_time_ms": 500,
"tip": {
"height": 12345,
"hash": "a1b2c3...",
"timestamp_ms": 1706899999500,
"state_root": "d4e5f6...",
"epoch": 42,
"view": 0
},
"finalized_height": 12340,
"latest_checkpoint": {
"height": 12300,
"state_root": "..."
},
"txpool_size": 7
}