zkSync Era JSON-RPC API Reference
BlockEden.xyz provides comprehensive support for the zkSync Era JSON-RPC specification, including all standard methods plus debug and trace APIs for advanced use cases. This reference covers all available methods with detailed parameters, return values, and code examples.
Standard RPC Methods
Account & Balance Methods
eth_getBalance
Get the balance of an account at a given block.
Parameters:
address
(string) - 20-byte address to check for balanceblockNumber
(string) - Block number in hex, or "latest", "earliest", "pending"
Returns: Balance in wei as a hex string
curl -X POST https://api.blockeden.xyz/zksync/${accessKey} \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4", "latest"],
"id": 1
}'
// Using Web3.js
const balance = await web3.eth.getBalance('0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4');
// Using Ethers.js
const balance = await provider.getBalance('0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4');
eth_getTransactionCount
Get the number of transactions sent from an address (nonce).
Parameters:
address
(string) - 20-byte addressblockNumber
(string) - Block number in hex, or "latest", "earliest", "pending"
Returns: Transaction count as hex string
curl -X POST https://api.blockeden.xyz/zksync/${accessKey} \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": ["0x742D5Cc6bF2442E8C7c74c7b4Be6AB9d6f10f5B4", "latest"],
"id": 1
}'
eth_getCode
Get the code at a given address.
Parameters:
address
(string) - 20-byte addressblockNumber
(string) - Block number in hex, or "latest", "earliest", "pending"
Returns: Code as hex string
curl -X POST https://api.blockeden.xyz/zksync/${accessKey} \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": ["0xA0b86a33E6c0e4A2a2a5FB1C6A6D6a30BF8b6B3a", "latest"],
"id": 1
}'