For the full documentation of available parameters and descriptions, please visit the official XDC JSON-RPC docs.
For compatibility with Parity, please prefix all hex strings with " 0x ".
eth_blockNumber
Returns the number of most recent block
https://api.xdcscan.com/api
?module=proxy
&action=eth_blockNumber
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Sample response
{
"jsonrpc":"2.0",
"id":83,
"result":"0xc36b29"
}
eth_getBlockByNumber
Returns information about a block by block number.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getBlockByNumber
&tag=0x1c2db4
&boolean=true
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the block number, in hex eg. 0xC36B3C |
| the boolean value to show full transaction objects. when true , returns full transaction objects and their information, when false only returns a list of transactions. |
Sample response
{
"jsonrpc":"2.0",
"id":1,
"result":{
"baseFeePerGas":"0x32",
"difficulty":"0x0",
"extraData":"0x",
"gasLimit":"0x1c9c380",
"gasUsed":"0xb741",
"hash":"0xb1bbed9bab282eaaeab9eb2c4c67a98d31ace416710e9d48cdc5003d2741e380",
"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner":"0x4200000000000000000000000000000000000011",
"mixHash":"0xcd253e25aae2f8959a1ab0ff3f41de2d3e4d6ab7da2656dd0534a624f96c49c3",
"nonce":"0x0000000000000000",
"number":"0x1c2db4",
"parentHash":"0xa0682bc7c6ce23d648a4e881a39c8909bb8d8a2fb023bd2ebb839b62ec7e982c",
"receiptsRoot":"0x3f71ebd8822765e8146170b0f930f55f753dbb867f55e4e605894016cd32f1e2",
"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size":"0x365",
"stateRoot":"0x30a668962a68663d3faac3b7a66f85e531eb6a0c932ffc773c6fa4a86be2771c",
"timestamp":"0x64c2b84b",
"totalDifficulty":"0x0",
"transactions":[
{
"blockHash":"0xb1bbed9bab282eaaeab9eb2c4c67a98d31ace416710e9d48cdc5003d2741e380",
"blockNumber":"0x1c2db4",
"from":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas":"0xf4240",
"gasPrice":"0x0",
"hash":"0x5ebd5ae8859b8a73473926270d8661e60b77e9746cc35c34db452a46429a33be",
"input":"0x015d8eb900000000000000000000000000000000000000000000000000000000010f65600000000000000000000000000000000000000000000000000000000064c2b7fb00000000000000000000000000000000000000000000000000000009ec701ec7159ab264910b8d4cb19542f92c7d1b0460a9f107bf8014318aa59879d7f6b57600000000000000000000000000000000000000000000000000000000000000030000000000000000000000005050f69a9786f081509234f1a7f4684b5e5b76c900000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000a6fe0",
"nonce":"0x1c2db3",
"to":"0x4200000000000000000000000000000000000015",
"transactionIndex":"0x0",
"value":"0x0",
"type":"0x7e",
"v":"0x0",
"r":"0x0",
"s":"0x0",
"sourceHash":"0xcdb38f7209b8da33e14b5b98ff4b00a2d294cd12e4cf6899221ebc0d35c13c92",
"mint":"0x0"
}
],
"transactionsRoot":"0x222f4a4b8f831ce0fb9481cd335790bd7f406c1525ccc9929b7bee0472dc9d79",
"uncles":[
]
}
}
eth_getUncleByBlockNumberAndIndex
Returns information about a uncle by block number.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getUncleByBlockNumberAndIndex
&tag=0xC63276
&index=0x0
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the block number, in hex eg. 0xC36B3C |
| the position of the uncle's index in the block, in hex eg. 0x5 |
Sample response
{
"jsonrpc":"2.0",
"id":1,
"result":{
"baseFeePerGas":"0x65a42b13c",
"difficulty":"0x1b1457a8247bbb",
"extraData":"0x486976656f6e2063612d68656176792059476f6e",
"gasLimit":"0x1ca359a",
"gasUsed":"0xb48fe1",
"hash":"0x1da88e3581315d009f1cb600bf06f509cd27a68cb3d6437bda8698d04089f14a",
"logsBloom":"0xf1a360ca505cdda510d810c1c81a03b51a8a508ed601811084833072945290235c8721e012182e40d57df552cf00f1f01bc498018da19e008681832b43762a30c26e11709948a9b96883a42ad02568e3fcc3000004ee12813e4296498261619992c40e22e60bd95107c5bd8462fcca570a0095d52a4c24720b00f13a2c3d62aca81e852017470c109643b15041fd69742406083d67654fc841a18b405ab380e06a8c14c0138b6602ea8f48b2cd90ac88c3478212011136802900264718a085047810221225080dfb2c214010091a6f233883bb0084fa1c197330a10bb0006686e678b80e50e4328000041c218d1458880181281765d28d51066058f3f80a7822",
"miner":"0x1ad91ee08f21be3de0ba2ba6918e714da6b45836",
"mixHash":"0xa8e1dbbf073614c7ed05f44b9e92fbdb3e1d52575ed8167fa57f934210bbb0a2",
"nonce":"0x28cc3e5b7bee9866",
"number":"0xc63274",
"parentHash":"0x496dae3e722efdd9ee1eb69499bdc7ed0dca54e13cd1157a42811c442f01941f",
"receiptsRoot":"0x9c9a7a99b4af7607691a7f2a50d474290385c0a6f39c391131ea0c67307213f4",
"sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size":"0x224",
"stateRoot":"0xde9a11f0ee321390c1a7843cab7b9ffd3779d438bc8f77de4361dfe2807d7dee",
"timestamp":"0x6110bd1a",
"transactionsRoot":"0xa04a79e531db3ec373cb63e9ebfbc9c95525de6347958918a273675d4f221575",
"uncles":[
]
}
}
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getBlockTransactionCountByNumber
&tag=0x1c2db4
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the block number, in hex eg. 0x10FB78 |
Sample response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x1"
}
eth_getTransactionByHash
Returns the information about a transaction requested by transaction hash.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getTransactionByHash
&txhash=0x5ebd5ae8859b8a73473926270d8661e60b77e9746cc35c34db452a46429a33be
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the hash of the transaction |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":{
"blockHash":"0xb1bbed9bab282eaaeab9eb2c4c67a98d31ace416710e9d48cdc5003d2741e380",
"blockNumber":"0x1c2db4",
"from":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas":"0xf4240",
"gasPrice":"0x0",
"hash":"0x5ebd5ae8859b8a73473926270d8661e60b77e9746cc35c34db452a46429a33be",
"input":"0x015d8eb900000000000000000000000000000000000000000000000000000000010f65600000000000000000000000000000000000000000000000000000000064c2b7fb00000000000000000000000000000000000000000000000000000009ec701ec7159ab264910b8d4cb19542f92c7d1b0460a9f107bf8014318aa59879d7f6b57600000000000000000000000000000000000000000000000000000000000000030000000000000000000000005050f69a9786f081509234f1a7f4684b5e5b76c900000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000a6fe0",
"nonce":"0x1c2db3",
"to":"0x4200000000000000000000000000000000000015",
"transactionIndex":"0x0",
"value":"0x0",
"type":"0x7e",
"v":"0x0",
"r":"0x0",
"s":"0x0",
"sourceHash":"0xcdb38f7209b8da33e14b5b98ff4b00a2d294cd12e4cf6899221ebc0d35c13c92",
"mint":"0x0"
}
}
eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getTransactionByBlockNumberAndIndex
&tag=0x1c2db4
&index=0x0
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the block number, in hex eg. 0x10FB78 |
| the position of the uncle's index in the block, in hex eg. 0x0 |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":{
"blockHash":"0xb1bbed9bab282eaaeab9eb2c4c67a98d31ace416710e9d48cdc5003d2741e380",
"blockNumber":"0x1c2db4",
"from":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas":"0xf4240",
"gasPrice":"0x0",
"hash":"0x5ebd5ae8859b8a73473926270d8661e60b77e9746cc35c34db452a46429a33be",
"input":"0x015d8eb900000000000000000000000000000000000000000000000000000000010f65600000000000000000000000000000000000000000000000000000000064c2b7fb00000000000000000000000000000000000000000000000000000009ec701ec7159ab264910b8d4cb19542f92c7d1b0460a9f107bf8014318aa59879d7f6b57600000000000000000000000000000000000000000000000000000000000000030000000000000000000000005050f69a9786f081509234f1a7f4684b5e5b76c900000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000a6fe0",
"nonce":"0x1c2db3",
"to":"0x4200000000000000000000000000000000000015",
"transactionIndex":"0x0",
"value":"0x0",
"type":"0x7e",
"v":"0x0",
"r":"0x0",
"s":"0x0",
"sourceHash":"0xcdb38f7209b8da33e14b5b98ff4b00a2d294cd12e4cf6899221ebc0d35c13c92",
"mint":"0x0"
}
}
eth_getTransactionCount
Returns the number of transactions performed by an address.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getTransactionCount
&address=0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the address to get transaction count |
| the string pre-defined block parameter, either earliest , pending or latest |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x1c2e9d"
}
eth_sendRawTransaction
Submits a pre-signed transaction for broadcast to the XDC network.
https://api.xdcscan.com/api
?module=proxy
&action=eth_sendRawTransaction
&hex=0xf904808000831cfde080
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the signed raw transaction data to broadcast. |
💡 Tip: Send a POST request if your hex string is particularly long.
🖋️ For more information on creating a signed raw transaction, visit this page.
Sample Response
{
"id":1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
⛏️ Note: The result
represents the transaction hash of the submitted raw transaction.
Use eth_getTransactionReceipt to retrieve full details.
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getTransactionReceipt
&txhash=0x5ebd5ae8859b8a73473926270d8661e60b77e9746cc35c34db452a46429a33be
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the hash of the transaction |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":{
"blockHash":"0xb1bbed9bab282eaaeab9eb2c4c67a98d31ace416710e9d48cdc5003d2741e380",
"blockNumber":"0x1c2db4",
"contractAddress":null,
"cumulativeGasUsed":"0xb741",
"depositNonce":"0x1c2db3",
"effectiveGasPrice":"0x0",
"from":"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gasUsed":"0xb741",
"logs":[
],
"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status":"0x1",
"to":"0x4200000000000000000000000000000000000015",
"transactionHash":"0x5ebd5ae8859b8a73473926270d8661e60b77e9746cc35c34db452a46429a33be",
"transactionIndex":"0x0",
"type":"0x7e"
}
}
eth_call
Executes a new message call immediately without creating a transaction on the block chain.
https://api.xdcscan.com/api
?module=proxy
&action=eth_call
&to=0xAEEF46DB4855E25702F8237E8f403FddcaF931C0
&data=0x70a08231000000000000000000000000e16359506c028e51f16be38986ec5746251e9724
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the address to interact with |
| the hash of the method signature and encoded parameters |
| the string pre-defined block parameter, either earliest , pending or latest |
⛽ Note: The gas
parameter is capped at 2x the current block gas limit.
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x00000000000000000000000000000000000000000000000000601d8888141c00"
}
eth_getCode
Returns code at a given address.
https://api.xdcscan.com/api
?module=proxy
&action=eth_getCode
&address=0x4200000000000000000000000000000000000015
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the address to get code |
| the string pre-defined block parameter, either earliest , pending or latest |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100be5780638f283970146100f8578063f851a440146101185761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61012d565b005b61006b61012d565b34801561008157600080fd5b5061006b6100903660046106d9565b610224565b6100a86100a33660046106f4565b610296565b6040516100b59190610777565b60405180910390f35b3480156100ca57600080fd5b506100d3610419565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b5565b34801561010457600080fd5b5061006b6101133660046106d9565b6104b0565b34801561012457600080fd5b506100d3610517565b60006101577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b905073ffffffffffffffffffffffffffffffffffffffff8116610201576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50726f78793a20696d706c656d656e746174696f6e206e6f7420696e6974696160448201527f6c697a656400000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b3660008037600080366000845af43d6000803e8061021e573d6000fd5b503d6000f35b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061027d575033155b1561028e5761028b816105a3565b50565b61028b61012d565b60606102c07fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102f7575033155b1561040a57610305846105a3565b6000808573ffffffffffffffffffffffffffffffffffffffff16858560405161032f9291906107ea565b600060405180830381855af49150503d806000811461036a576040519150601f19603f3d011682016040523d82523d6000602084013e61036f565b606091505b509150915081610401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f50726f78793a2064656c656761746563616c6c20746f206e657720696d706c6560448201527f6d656e746174696f6e20636f6e7472616374206661696c65640000000000000060648201526084016101f8565b91506104129050565b61041261012d565b9392505050565b60006104437fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061047a575033155b156104a557507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6104ad61012d565b90565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610509575033155b1561028e5761028b8161060b565b60006105417fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610578575033155b156104a557507fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81905560405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60006106357fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038390556040805173ffffffffffffffffffffffffffffffffffffffff8084168252851660208201529192507f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a15050565b803573ffffffffffffffffffffffffffffffffffffffff811681146106d457600080fd5b919050565b6000602082840312156106eb57600080fd5b610412826106b0565b60008060006040848603121561070957600080fd5b610712846106b0565b9250602084013567ffffffffffffffff8082111561072f57600080fd5b818601915086601f83011261074357600080fd5b81358181111561075257600080fd5b87602082850101111561076457600080fd5b6020830194508093505050509250925092565b600060208083528351808285015260005b818110156107a457858101830151858201604001528201610788565b818111156107b6576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b818382376000910190815291905056fea164736f6c634300080f000a"
}
eth_getStorageAt
Returns the value from a storage position at a given address.
This endpoint is still experimental and may have potential issues
https://api.xdcscan.com/api
?module=proxy
&action=eth_getStorageAt
&address=0x4200000000000000000000000000000000000015
&position=0x0
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser
Query Parameters
Parameter | Description |
---|
| the string representing the address to get code |
| the hex code of the position in storage, eg 0x0 |
| the string pre-defined block parameter, either earliest , pending or latest |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x000000000000000000000000000000000000000064c2ba3b00000000010f6590"
}
eth_gasPrice
Returns the current price per gas in wei.
https://api.xdcscan.com/api
?module=proxy
&action=eth_gasPrice
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Sample Response
{
"jsonrpc":"2.0",
"id":73,
"result":"0x3b9aca32"
}
📖 Tip: The result
is returned in wei.
Easily convert XDC units using our unit converter.
eth_estimateGas
Makes a call or transaction, which won't be added to the blockchain and returns the used gas.
https://api.xdcscan.com/api
?module=proxy
&action=eth_estimateGas
&data=0x4e71d92d
&to=0xf0160428a8552ac9bb7e050d90eeade4ddd52843
&value=0xff22
&gasPrice=0x51da038cc
&gas=0x5f5e0ff
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the hash of the method signature and encoded parameters |
| the string representing the address to interact with |
| the value sent in this transaction, in hex eg. 0xff22 |
| the amount of gas provided for the transaction, in hex eg. 0x5f5e0ff |
| the gas price paid for each unit of gas, in wei post EIP-1559, the gasPrice has to be higher than the block's baseFeePerGas |
⛽ Note: The gas
parameter is capped at 2x the current block gas limit.
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x6556"
}
Last updated