Skip to main content
Leafage exposes exactly one protocol: JSON-RPC 2.0 over HTTP. Any client that can send an HTTP POST can use it directly; no SDK is required. This page starts with the first request and works up to batch calls, block context, gas estimation, simulation, and tracing.

Endpoints

chainId is decimal; ETH mainnet is /1. A hex form is normalized to decimal by the proxy. The examples below use the production endpoint; drop the path when talking to a node directly.

Request headers

First request: eth_call

Read totalSupply() of the USDT contract; the function selector is 0x18160ddd:
Response:
The parameters of eth_call are, in order, the call object, the block parameter, and the optional stateOverride and blockOverrides. The call object has the same fields as Ethereum’s eth_call: from, to, data / input, value, gas, gasPrice, and so on.
The eth_* methods are compatible with standard Ethereum, so libraries such as ethers, viem, and web3.py can use http://proxy:8663/1 as an ordinary RPC endpoint. Send DeBank namespace methods through their raw call interface, for example ethers’ provider.send(method, params).

Batch requests

A request body that is an array is processed as a JSON-RPC batch, returning several results in one round trip:
A batch is routed as a whole to one node. To run a set of contract calls against one block, contractMultiCall below is a better fit than a batch of eth_call: it guarantees that all calls see the same state.

Choosing the block: blockCtx

Methods in the DeBank namespace have no prefix and declare their block context with a blockCtx object. Read a balance at a historical height:
Omitting blockCtx means latest. See Block context and routing for the semantics.

Calling several contracts at once: contractMultiCall

Runs a set of read-only calls on one state and returns each call’s result plus the block that state belongs to:
The parameter order is requests, blockCtx, blockOverrides, stateOverride, fastFail, useParallel, disableCache. Optional parameters are positional; use null for the ones you skip. A per-call code of 0 means success; on revert it is -39000 and err carries the decoded revert reason. The request as a whole returns a JSON-RPC level error only when parameter or block resolution fails.
eth_multiCall is the eth namespace version of the same capability: its block parameter uses the standard form, its response fields are camelCase (fromCache, gasUsed, blockNum), and its per-call revert code is -40014. Do not share one parser between the two.

Estimating gas: estimateGas

The method name has no eth_ prefix. Estimate a USDT transfer:
Returns the gas used as a hex string. The second parameter is an optional blockCtx, the third an optional blockOverrides.

Simulating a transaction sequence: simulateTransactions

Executes a set of transactions in order, each seeing the state changes of the previous one, and returns the call traces and events of each:
Each results[i] in the response contains traces, events, code, err, and gas_used; stats names the block the simulation was based on.

Tracing one call: pre_traceCall

Returns an instruction-level struct log without needing the write node’s debug API:
The second parameter is an optional block parameter in the same form as eth_call. The batch version is pre_traceMany.

Handling errors

JSON-RPC level errors appear in the response’s error field:
See the RPC reference for the full error code table.

Next steps

RPC reference

All methods, parameters, and return structures.

Block context and routing

The semantics of Equals / Contains and the proxy’s routing rules.