For the full documentation of available parameters and descriptions, please visit the official BNB 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-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_blockNumber
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Sample response
{
"jsonrpc":"2.0",
"result":"0xe7fddc",
"id":83
}
eth_getBlockByNumber
Returns information about a block by block number.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getBlockByNumber
&tag=0x91b743
&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": "0x8",
"difficulty": "0x0",
"extraData": "0x",
"gasLimit": "0x5f5e100",
"gasUsed": "0xc551",
"hash": "0x4074ed8c568ce6610e7cbb6980a8065565374aeca35cc9f49a4e235bf381475b",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x4200000000000000000000000000000000000011",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x91b743",
"parentHash": "0xc81595365bef52cdbae4ddf53c544686d2f11aa266afc2410be7b258796b46ab",
"receiptsRoot": "0x4809376ebbc058211525bd61bfbeca9151c5cc13b8d403211db9163f9f67c145",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x365",
"stateRoot": "0x68ff082aa5b926eb9913d93f215791f0811ba22059c94fbc3e370548c5fec182",
"timestamp": "0x651d706d",
"totalDifficulty": "0x0",
"transactions": [
{
"blockHash": "0x4074ed8c568ce6610e7cbb6980a8065565374aeca35cc9f49a4e235bf381475b",
"blockNumber": "0x91b743",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas": "0xf4240",
"gasPrice": "0x0",
"hash": "0xa7c0571f43fa9c67d70533e68ceabe880b41ef3e8f294e9d046481d5fa034016",
"input": "0x015d8eb90000000000000000000000000000000000000000000000000000000002056e4e00000000000000000000000000000000000000000000000000000000651d703b000000000000000000000000000000000000000000000000000000022f4a4dd5eeb35d6e4962d2bc1f0dddd52048c94cf5cb31e2bced62f01122b57d58aaca2700000000000000000000000000000000000000000000000000000000000000000000000000000000000000001fd6a75cc72f39147756a663f3ef1fc95ef89495000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240",
"nonce": "0x91b742",
"to": "0x4200000000000000000000000000000000000015",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0x81a336b47e24ed278b6fd77d9e4391ae7c2011bbefd80642d8f5a8495115c91c",
"mint": "0x0"
}
],
"transactionsRoot": "0x859209659f940019361f254912fbec963faaa0a2218f84e0a1c9879747eca9a4",
"uncles": []
}
}
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getBlockTransactionCountByNumber
&tag=0x10A70A
&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-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getTransactionByHash
&txhash=0x0713b595ee5135b55de3d732831112a710cbf115eba92553f1bd32240ddf6edf
&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": "0x632a8aeb20aef241ca852baed8a31d617f1566fb7f5eddd5b284606ddf2c9ed8",
"blockNumber": "0xe7fb7c",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas": "0xf4240",
"gasPrice": "0x0",
"hash": "0x0713b595ee5135b55de3d732831112a710cbf115eba92553f1bd32240ddf6edf",
"input": "0x015d8eb9000000000000000000000000000000000000000000000000000000000222200b000000000000000000000000000000000000000000000000000000006573b475000000000000000000000000000000000000000000000000000000012a05f2007ce654af89ad9970784853ce38a9742e5b3cffda3013ee61c03168d4def40ad700000000000000000000000000000000000000000000000000000000000000010000000000000000000000001fd6a75cc72f39147756a663f3ef1fc95ef8949500000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000a6fe0",
"nonce": "0xe7fb7b",
"to": "0x4200000000000000000000000000000000000015",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0x77c4e53207306f6c64f5bf07cb36df6cba9b1eb24918301035b7a9e0d42729e9",
"mint": "0x0"
}
}
eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getTransactionByBlockNumberAndIndex
&tag=0x10A70A
&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": "0xb7d1f89a725cbaa26aaa4dae57b6e5979c00fc091011c2e88af712ea7fa44741",
"blockNumber": "0x10a70a",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas": "0xf4240",
"gasPrice": "0x0",
"hash": "0x4ca278328b892787693b2135fffcfe3c3bf264722f491be2196842482f80f6ca",
"input": "0x015d8eb90000000000000000000000000000000000000000000000000000000001da6b0000000000000000000000000000000000000000000000000000000000649c6005000000000000000000000000000000000000000000000000000000077359400089bb17f583fe994b09f01001b7cf0a20b035a002909d6fab004b013f56e3cbc900000000000000000000000000000000000000000000000000000000000000000000000000000000000000001fd6a75cc72f39147756a663f3ef1fc95ef89495000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240",
"nonce": "0x10a709",
"to": "0x4200000000000000000000000000000000000015",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0x364adca68b0ed75cbe26a9fd4e42440c9abe410c52166b5230be4803b8637ffc",
"mint": "0x0"
}
}
eth_getTransactionCount
Returns the number of transactions performed by an address.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getTransactionCount
&address=0x1d41D6B1091C1a8A334096771bd1776019243d5e
&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":"0x6f"
}
eth_sendRawTransaction
Submits a pre-signed transaction for broadcast to the BNB network.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_sendRawTransaction
&hex=0x02f874030185012a05f200852e90edd00082520894eeee7341f206302f2216e39d715b96d8c6901a1c880de0b6b3a764000080c001a0bf61ea5419c7856be4ea2221b721b849d50fec738d10a714e7aaa809d9ad8838a01e59353aa8e567cc0661fb58b047361998df234df6593bf424839bc5ea214a2c
&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": "0x84c81fc1e23474e13be0114f94f99b43696830f33292fd1d642f37e87e95acd6"
}
⛏️ 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-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getTransactionReceipt
&txhash=0x0713b595ee5135b55de3d732831112a710cbf115eba92553f1bd32240ddf6edf
&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": "0x632a8aeb20aef241ca852baed8a31d617f1566fb7f5eddd5b284606ddf2c9ed8",
"blockNumber": "0xe7fb7c",
"contractAddress": null,
"cumulativeGasUsed": "0xfa01",
"depositNonce": "0xe7fb7b",
"effectiveGasPrice": "0x0",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gasUsed": "0xfa01",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": "0x1",
"to": "0x4200000000000000000000000000000000000015",
"transactionHash": "0x0713b595ee5135b55de3d732831112a710cbf115eba92553f1bd32240ddf6edf",
"transactionIndex": "0x0",
"type": "0x7e"
}
}
eth_call
Executes a new message call immediately without creating a transaction on the block chain.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_call
&to=0x272c31fc25e4e609cbcc9e7a9e6171b4b39feaca
&data=0x60fe47b10000000000000000000000000000000000000000000000000000000000010f2c
&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":"0x"
}
eth_getCode
Returns code at a given address.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getCode
&address=0x272c31fc25e4e609cbcc9e7a9e6171b4b39feaca
&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":"0x608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b5780636d4ce63c14610057575b600080fd5b6100556004803603810190610050919061009d565b610075565b005b61005f61007f565b60405161006c91906100d9565b60405180910390f35b8060008190555050565b60008054905090565b60008135905061009781610103565b92915050565b6000602082840312156100b3576100b26100fe565b5b60006100c184828501610088565b91505092915050565b6100d3816100f4565b82525050565b60006020820190506100ee60008301846100ca565b92915050565b6000819050919050565b600080fd5b61010c816100f4565b811461011757600080fd5b5056fea2646970667358221220d7dae2ccb3d6437f2a190839abef6ef723207c70463c87c2b1257d40c938e42564736f6c63430008070033"
}
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-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_getStorageAt
&address=0x272c31fc25e4e609cbcc9e7a9e6171b4b39feaca
&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":"0x000000000000x0000000000000000000000000000000000000000000000000000000000010f2c00000000000000000000000000000000000000000000000000000"
}
eth_gasPrice
Returns the current price per gas in wei.
https://api-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_gasPrice
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Sample Response
{
"jsonrpc":"2.0",
"id":73,
"result":"0x3b9aca07"
}
📖 Tip: The result
is returned in wei.
Easily convert BNB 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-opbnb-testnet.bscscan.com/api
?module=proxy
&action=eth_estimateGas
&data=0x60fe47b10000000000000000000000000000000000000000000000000000000000000004
&to=0x272c31fC25E4e609CbCC9E7a9e6171b4B39feAca
&value=0x0
&gasPrice=0x51da038cc
&gas=0x186A0
&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":"0x67ea"
}
Last updated