JSON-RPC methods supported on ZKsync Mainnet and ZKsync Testnet through Tatum RPC Gateway, with base URLs and an example request.
Call ZKsync JSON-RPC methods through Tatum RPC Gateway. Send an HTTP POST request with a JSON-RPC 2.0 body to the network's base URL, with your API key in the x-api-key header. See Authentication.
Base URLs
| Network | Base URL |
|---|---|
| ZKsync Mainnet | https:/ |
| ZKsync Testnet | https:/ |
Example request
curl 'https://zksync-mainnet.gateway.tatum.io' \
--header 'content-type: application/json' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'Methods
51 methods. Parameters and responses are described in the Ethereum JSON-RPC API; linked method names go to their page there.
| Method | Description |
|---|---|
debug_traceBlockByHash | Traces every transaction of the block with the given hash. |
debug_traceBlockByNumber | Traces every transaction of the block with the given number or tag. |
debug_traceCall | Executes a call without creating a transaction and returns its execution trace. |
debug_traceTransaction | Returns the execution trace of a mined transaction. |
eth_blockNumber | Returns the number of the most recent block. |
eth_call | Executes a message call immediately without creating a transaction on the chain. |
eth_chainId | Returns the chain ID used for signing replay-protected transactions. |
eth_estimateGas | Estimates the gas needed to execute a transaction without adding it to the chain. |
eth_feeHistory | Returns base fees, gas usage ratios and priority fee percentiles for a range of blocks. |
eth_gasPrice | Returns the current gas price in wei. |
eth_getBalance | Returns the balance of an address in wei. |
eth_getBlockByHash | Returns information about a block by hash. |
eth_getBlockByNumber | Returns information about a block by number. |
eth_getBlockReceipts | Returns the receipts of all transactions in a block. |
eth_getBlockTransactionCountByHash | Returns the number of transactions in a block, selected by hash. |
eth_getBlockTransactionCountByNumber | Returns the number of transactions in a block, selected by number. |
eth_getCode | Returns the bytecode at an address. |
eth_getLogs | Returns the logs that match a filter object. |
eth_getStorageAt | Returns the value of a storage slot at an address. |
eth_getTransactionByBlockHashAndIndex | Returns a transaction by block hash and transaction index. |
eth_getTransactionByBlockNumberAndIndex | Returns a transaction by block number and transaction index. |
eth_getTransactionByHash | Returns a transaction by hash. |
eth_getTransactionCount | Returns the number of transactions sent from an address (its nonce). |
eth_getTransactionReceipt | Returns the receipt of a transaction by transaction hash. |
eth_maxPriorityFeePerGas | Returns a suggested priority fee (tip) per gas in wei. |
eth_sendRawTransaction | Submits a signed, RLP-encoded transaction to the network. |
eth_syncing | Returns the sync status of the node, or false when it is not syncing. |
net_listening | Returns true if the node is listening for network connections. |
net_peerCount | Returns the number of peers connected to the client. |
net_version | Returns the current network ID. |
web3_clientVersion | Returns the client version. |
zks_estimateFee | Estimates the fee of a transaction: gas limit, max fee per gas and gas per pubdata. |
zks_estimateGasL1ToL2 | Estimates the gas needed for an L1-to-L2 transaction. |
zks_gasPerPubdata | Returns the current gas per pubdata byte for the open batch, scaled by 1e18. |
zks_getBaseTokenL1Address | Returns the L1 address of the chain base token. |
zks_getBlockDetails | Returns details of an L2 block: status, L1 batch, commit, prove and execute transactions. |
zks_getBridgeContracts | Returns the addresses of the default bridge contracts on L1 and L2. |
zks_getBridgehubContract | Returns the address of the Bridgehub contract. |
zks_getBytecodeByHash | Returns the bytecode of a deployed contract by its bytecode hash. |
zks_getFeeParams | Returns the current fee parameters, including the L1 gas price, pubdata price and fee model config. |
zks_getL1BatchBlockRange | Returns the first and last L2 block of an L1 batch. |
zks_getL1BatchDetails | Returns details of an L1 batch: status, root hash, commit, prove and execute transactions. |
zks_getL1GasPrice | Returns the current L1 gas price in wei. |
zks_getL2ToL1LogProof | Returns the Merkle proof of an L2-to-L1 log in its L1 batch. |
zks_getMainContract | Returns the address of the main ZKsync contract on L1. |
zks_getProof | Returns Merkle proofs for storage slots of an account at a given L1 batch. |
zks_getRawBlockTransactions | Returns the raw transactions of an L2 block. |
zks_getTestnetPaymaster | Returns the address of the testnet paymaster, if there is one. |
zks_getTransactionDetails | Returns details of a transaction: status, fee, initiator and the L1 transactions that committed it. |
zks_L1BatchNumber | Returns the number of the latest L1 batch. |
zks_L1ChainId | Returns the chain ID of the underlying L1. |
The gateway lists its supported methods at runtime:
Method unavailable?If you need a method we don't support yet, contact support.