Brief JSON RPC reference
A brief overview of supported Ethereum JSON RPC calls.
This page shows a brief overview of supported Ethereum JSON RPC calls. Find a detaild list of supported calls.
Returns information about a block by hash.
RESULT: Block information
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
false
]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
false
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runGetBlockByHash() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_getBlockByHash", [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
false,
]);
// Print the output to console
console.log(result);
}
(async () => {
runGetBlockByHash();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"number": "0x77ed36",
"hash": "0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
"parentHash": "0xdf9734476dcc360d864e31cc8422ce96f8aa8dff9a827b57f2c3c4ec8f71c421",
"nonce": "0x0000000000000000",
"mixHash": "0x3dd2d65fcd45d469cdca6e524382053d27b9e36b2b2e2f5808247c406d6bafd5",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00300000000000080000000800800800000040c000080012000888102002041000000000020002000020000040000800000008000002404100001000402468300844000080000008880800280808090000000001001400000000290040000800000400004200088001402280800008120d000040104000000000001000800080000000840060480001020000000005000000008028000204010208008020004002050800500002900000083080000000010000010400006100100000000000200804900200000800051400001800a050000008240001001000000028008060201034004000020011200008080000008880080008000048019040000081000010",
"stateRoot": "0x1a6a2f5902392bf771ec405d427eae2df1c634ed26705e182e48adb893e2fa22",
"miner": "0x4d496ccc28058b1d74b7a19541663e21154f9c84",
"difficulty": "0x0",
"extraData": "0x",
"size": "0xead",
"gasLimit": "0x1c9c380",
"gasUsed": "0x20af8f",
"timestamp": "0x635e2a44",
"transactionsRoot": "0x24254b70d82f362e21f82ca841a893d1fe714fcdadba260fac0032359a40d9d8",
"receiptsRoot": "0x956eb9e1ec572a6d044663dc0085bf421d6cf49193e383b4dc004c36e2f676e5",
"baseFeePerGas": "0x10",
"totalDifficulty": "0xa4a470",
"uncles": [],
"transactions": [
"0xea5bbd6f391894557eec975d161391f25ce4cf86cc404964a2c39957b11dad43",
"0x08f23a8d29dc0b23989b648f11fd89fad609c6694305b5d35e9b6d5fe1616d3a",
"0x912b1146c5bc2c17b2e0726cc43d51ba9d22e19cd0a38dd248062520349db02b",
"0xf10ba2f27477339095f9e7b60611812d6ca2a75e69e72f6acb64e2b109ae74b8",
"0x559fd3851c1470cac199885335676fedcdde9789aee0ad894feef6705be7139c",
"0x2ecf200a6c4da6478430acfac77a58fe90bd9c7db8c5bc19059eecd87dbb6794",
"0xe5227c1cc37b2c7af8ef050fbc56913425b01b82b1866fa5099ba512630ae7d1",
"0x4033bed32cca181377b703e742f092142447a0ab65ae4c1fb8a156d816ac397f",
"0x6d8d45835f7101188cb9e7b5e8fb18e3d1fdc3bd26e3417ffbed63423a936c37",
"0xe78704b2a82a49603ca2cdeffde7543911b68207ff397ed756e19da125e3eda6"
]
}
}
Returns information about a block by number.
RESULT: Block information
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", false]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": [
"latest",
false
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runGetBlockByNumber() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_getBlockByNumber", ["latest", false]);
// Print the output to console
console.log(result);
}
(async () => {
runGetBlockByNumber();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"number": "0x7aa3a9",
"hash": "0xd65ea6ed7a1204d48c3f172aa052efabf1e3ebfbab251e5ffb55e2cac8b511d5",
"parentHash": "0x988e81a9643753ac9959780087370985cc2070ed67c52d5949e7389ff3b43c76",
"nonce": "0x0000000000000000",
"mixHash": "0x1cc7290c64fbeaa6a2390a992b304e6b0e89d738acbda2eba58eb65429f74a0f",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00a001092200000e04021201860000002808a00000010002001100000000040040002008200000690000040a04048450004140144200000c04006a01202482c01000024004288850c084800800010122000014000296004000510c0080004140000000000a0200404201000008440800004000088880620420102010028002040000002008040318cc400004000000001000001122480888000000600b4000000202804c44020020040404c0240120000842b480002081404023004010880650401450420000000840001e0100200410002000201010801002c04000028060400910001008100c400112000208c8003020100000020012510000401008000880",
"stateRoot": "0x2e3c31aa466540e4c9ca562f562b7e1b4edff1f6453f5b15071f308e095a1791",
"miner": "0xf36f155486299ecaff2d4f5160ed5114c1f66000",
"difficulty": "0x0",
"extraData": "0x",
"size": "0x1f06",
"gasLimit": "0x1c9c380",
"gasUsed": "0x35f28e",
"timestamp": "0x6384f504",
"transactionsRoot": "0xb40ced8fd738c03d1101d4ed0aecb6b290c7c54230bafc92f3303240b056d957",
"receiptsRoot": "0xcac0a3181c307c3b77e076fa557a06e97659f7fef07993935a16dd301021efcb",
"baseFeePerGas": "0x1ce43b283",
"totalDifficulty": "0xa4a470",
"uncles": [],
"transactions": [
"0x5b0696572afb2c544efebf62d7e0eea2520b2cd74156ced8dbe3294d44209b25",
"0x052242bf239f5fc8b5bb2f156cf22ef6ce2eb738304ba3a7d5998c15d2a97140",
"0x3efdf4bc4f2b3c0ffbbd1508dbe6e198315f4a239e8d5e55713f9feb1eadeb49",
"0xd4cc079012c245c55ec929f7bad97aefcbafdbb9df3b66a76e812714887c607c",
"0xc7b29089a46aefbb6de2fdd65cf3d8914bd104e093ba0c2edfa410649665cc6c",
"0x20a573986ec0a56d01292e23b24788ca8438883e32a04cf1cc44a6244a35f562",
"0x160daaf007c66dacc2849a3a2a4c212f223762a780c0bc3c3e95e4d152a62ef9",
"0x7e520c067a8943ef14cb867b882fb2e7a22b3015c9b4c9998a97a03d6003bed4",
"0x50a2c03cb33be9a371f8814f1557cb6d4569b4e2bec308156109268dd803e212",
"0xdd731274cbeb96d9c754bc2a191fd59b51811ad0d432c060d8c5676c0ea67fa9",
"0x4e32fdef7b398ec1f83e7d4a23a2b31274c69e0018bae1cb619cac8dd7adb450",
"0x5ef6c92d1e34d40eb0b0ccbf7f8ae1a6b46aa65093632a40f76c1dcbe0cff8ed",
"0xacee7050d37de355b942dc661337c06ef0e2fe13cf7bbca1ea37753cffdd1c90",
"0x82247b876b0a25b281d4e752af62f6c54478995bd785914a5573565fd76fe8e8",
"0xbc93b221f37b785848dedd47f63ec1f64ccb2f5182c29a2f3033d3c8dab4156b",
"0xfc328bcef60eccae79f9e2f8666ec5b29774435f940dd89870a449c0466e2f62",
"0x658be3de19f2cf3bb8849e4ef2008b71c47493b167d4d0874ab25d6af3f62b53",
"0xbb7d18283c0d34d3d6f9ed359a7a9f7d8980c7b5a69118bd5d6cad9e8a810a9f"
]
}
}
Returns the number of transactions in a block from a block matching the given block hash.
RESULT: Transaction count
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e"
]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e"
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runGetBlockTransactionCountByHash() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_getBlockTransactionCountByHash", [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
]);
// Print the output to console
console.log(result);
}
(async () => {
runGetBlockTransactionCountByHash();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0xa"
}
Returns the number of transactions in a block matching the given block number.
RESULT: Transaction count
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": ["latest"]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"latest"
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runGetBlockTransactionCountByNumber() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_getBlockTransactionCountByNumber", [
"latest",
]);
// Print the output to console
console.log(result);
}
(async () => {
runGetBlockTransactionCountByNumber();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0x12"
}
Returns the number of uncles in a block from a block matching the given block hash.
RESULT: Uncle count
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e"
]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockHash",
"params": [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e"
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runGetUncleCountByBlockHash() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_getUncleCountByBlockHash", [
"0x5a10754ae6c673ebabb1a78166232c6b88633d50fafe1499392dd6e4c61c344e",
]);
// Print the output to console
console.log(result);
}
(async () => {
runGetUncleCountByBlockHash();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0x0"
}
Returns the number of transactions in a block matching the given block number.
RESULT: Uncle count
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": ["latest"]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"latest"
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runGetUncleCountByBlockNumber() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_getUncleCountByBlockNumber", [
"latest",
]);
// Print the output to console
console.log(result);
}
(async () => {
runGetUncleCountByBlockNumber();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0x0"
}
Returns the chain ID of the current network.
RESULT: Chain ID
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_chainId",
"params": []
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_chainId",
"params": []
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runChainId() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_chainId", []);
// Print the output to console
console.log(result);
}
(async () => {
runChainId();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0x5"
}
Returns an object with data about the sync status or false.
RESULT: Syncing status
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": []
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": []
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runSyncing() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_syncing", []);
// Print the output to console
console.log(result);
}
(async () => {
runSyncing();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": false
}
Returns a list of addresses owned by client.
RESULT: Accounts
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_accounts",
"params": []
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_accounts",
"params": []
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runAccounts() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_accounts", []);
// Print the output to console
console.log(result);
}
(async () => {
runAccounts();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": []
}
Returns the number of most recent block.
RESULT: Block number
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": []
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": []
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runBlockNumber() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_blockNumber", []);
// Print the output to console
console.log(result);
}
(async () => {
runBlockNumber();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0x7aa3a9"
}
Executes a new message call immediately without creating a transaction on the block chain.
RESULT: Return data
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"
]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runCall() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_call", [
{
from: "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
to: "0xff39a3e734fe363e631441f6d24c7539240c2628",
value: "0x0",
data: "0x2e7700f0",
},
"latest",
]);
// Print the output to console
console.log(result);
}
(async () => {
runCall();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.
RESULT: Gas used
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"
]
}
curl https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY \
-X POST \
-H "Content-Type: application/json" \
-d \
'{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"
]
}'
// Installation Instructions: https://docs.ethers.io/v5/getting-started/#installing
const { ethers } = require("ethers");
async function runEstimateGas() {
// Initialize an ethers instance
const provider = new ethers.providers.JsonRpcProvider(
"https://goerli.gateway.tenderly.co/$TENDERLY_WEB3_GATEWAY_KEY"
);
// Execute method
const result = await provider.send("eth_estimateGas", [
{
from: "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
to: "0xff39a3e734fe363e631441f6d24c7539240c2628",
value: "0x0",
data: "0x2e7700f0",
},
"latest",
]);
// Print the output to console
console.log(result);
}
(async () => {
runEstimateGas();
})();
{
"id": 0,
"jsonrpc": "2.0",
"result": "0x5bf6"
}
Generates an access list for a transaction.
RESULT: Gas used
Raw
cURL
ethers
Response
{
"id": 0,
"jsonrpc": "2.0",
"method": "eth_createAccessList",
"params": [
{
"from": "0xDC6bDc37B2714eE601734cf55A05625C9e512461",
"to": "0xff39a3e734fe363e631441f6d24c7539240c2628",
"value": "0x0",
"data": "0x2e7700f0"
},
"latest"