Hanzo
OpenapiWeb3

Forwards a JSON-RPC call to the named chain and returns its answer unchanged.

Forwards a JSON-RPC call to the named chain and returns its answer unchanged.

POST /v1/web3/rpc/{chain}

Addresshttps://api.hanzo.ai/v1/web3/rpc/{chain}
MethodPOST
Operationpost_web3_rpc_by_chain
AuthAuthorization: Bearer $HANZO_API_KEY

Forwards a JSON-RPC call to the named chain and returns its answer unchanged. Only declared chains are reachable, and only to a caller with a validated principal — this is the deployment's upstream, not an open relay.

Request

6 fields, body application/json (required).

FieldInTypeRequiredDescription
chainpathstringyesChain is the registry id, from the URL.
chainbodystringChain is the registry id, from the URL.
idbodyanyID is echoed back untouched.
jsonrpcbodystringJSONRPC must be "2.0" when present.
methodbodystringMethod is the RPC method, e.g.
paramsbodyanyParams is the method's parameters, passed through unread.

Response

StatusBodyMeaning
200rpcOutok

200 body — 6 fields.

FieldInTypeAlwaysDescription
errorbodyrpcError
error.codebodyintegerCode is the JSON-RPC error code the chain reported, passed through as it came.
error.messagebodystringMessage is the chain's own explanation, e.g. "execution reverted".
idbodyanyID is the request's id, echoed back untouched — any JSON value, because JSON-RPC lets the caller choose.
jsonrpcbodystringJSONRPC is always "2.0". An upstream that omits it has it filled in, so a client never has to cope with a response that is missing the one field telling it…
resultbodyanyResult is the chain's answer, passed through unread: an eth_getBalance result is a 0x-quantity string, a block is an object.

Failure carries the platform error shape — see Errors.

Examples

hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.


Web3 API · All Hanzo APIs · Interactive reference

How is this guide?

On this page