ClawNetwork

API Reference

ClawNetwork exposes a JSON-RPC 2.0 API on port 9710.

All methods accept POST requests to http://localhost:9710 with Content-Type: application/json.

HTTP Endpoints

GET/health

Node health status including version, height, peer count, and uptime.

GET/metrics

Prometheus metrics in text exposition format.

JSON-RPC Methods

clw_blockNumber

Get the current block height.

Params[]
Returnsnumber
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_blockNumber","params":[]}'

clw_getBlockByNumber

Get a block by its height.

Params[height]
ReturnsBlock | null
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getBlockByNumber","params":[height]}'

clw_getBalance

Get CLW balance for an address (in base units).

Params[address]
Returnsstring
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getBalance","params":[address]}'

clw_getNonce

Get the current nonce for an address.

Params[address]
Returnsnumber
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getNonce","params":[address]}'

clw_getAgent

Get registered agent info.

Params[address]
ReturnsAgentIdentity | null
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getAgent","params":[address]}'

clw_getReputation

Get all reputation attestations for an agent.

Params[address]
ReturnsAttestation[]
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getReputation","params":[address]}'

clw_getServices

List registered services, optionally filtered by type.

Params[type?]
ReturnsServiceEntry[]
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getServices","params":[type?]}'

clw_getTokenBalance

Get custom token balance.

Params[address, tokenId]
Returnsstring
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getTokenBalance","params":[address, tokenId]}'

clw_getTokenInfo

Get custom token metadata.

Params[tokenId]
ReturnsTokenDef | null
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getTokenInfo","params":[tokenId]}'

clw_getTransactionReceipt

Get transaction receipt (block height + index).

Params[txHash]
ReturnsReceipt | null
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_getTransactionReceipt","params":[txHash]}'

clw_sendTransaction

Submit a signed transaction. Returns transaction hash.

Params[hexEncodedTx]
Returnsstring
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_sendTransaction","params":[hexEncodedTx]}'

clw_faucet

Request testnet CLW from the faucet (testnet only).

Params[address]
ReturnsFaucetResult
Example curl
curl -X POST http://localhost:9710 \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"clw_faucet","params":[address]}'