Node API - Avalanche C-Chain
API AuthenticationClick to view API Authentication details
Authorization
request header or URL
property. Calls are made to one of the Avalanche C Chain Node API endpoints found in your app's dashboard. For example:
https://avalanche--mainnet--rpc.datahub.figment.io
- Fetch with Header
- Fetch with Parameter
- CURL with Header
- CURL with Parameter
fetch("https://avalanche--mainnet--rpc.datahub.figment.io/ext/bc/C/rpc", {
method: 'POST', // can also be 'GET', 'PUT' or any appropriate method
headers: {
"Authorization" : "<api_key>",
"Content-Type": "application/json" // if method is 'POST'
},
body: JSON.stringify({
// JSON Payload
})
})
fetch("https://avalanche--mainnet--rpc.datahub.figment.io/apikey/{{apikey}}/ext/bc/C/rpc", {
method: 'POST', // can also be 'GET', 'PUT' or any appropriate method
headers: {
"Content-Type": "application/json" // if method is 'POST'
},
body: JSON.stringify({
// JSON Payload
})
})
curl -X POST 'https://avalanche--mainnet--rpc.datahub.figment.io/ext/bc/C/rpc' \
--header 'Content-Type: application/json' \
--header 'Authorization: <api_key>' \
--data '{
// JSON Payload
}'
curl -X POST 'https://avalanche--mainnet--rpc.datahub.figment.io/apikey/{{apikey}}/ext/bc/C/rpc' \
--header 'Content-Type: application/json' \
--data '{
// JSON Payload
}'
Available Methods
eth_getBlockByHash
Returns information about a block by hash.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"baseFeePerGas": "0x5d21dba00",
"blockExtraData": "0x",
"blockGasCost": "0x0",
"difficulty": "0x1",
"extDataGasUsed": "0x0",
"extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"extraData": "0x0000000000000000000000000007594d0000000000000000000000000001bbc200000000000000000000000000048c27000000000000000000000000000becd400000000000000000000000000000000",
"gasLimit": "0x7a1200",
"gasUsed": "0x2978e",
"hash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"logsBloom": "0x00000000000000008008010000000000000000000000000020002000000000020000000000000800004000000000000000000000000000000000000000000000000080000000000000000008000000000800000000000008000000008000000000000000020000000000000000000820000000000000000080000010000000000000000000000000000000000000000000400401000000000000000100000000001100000000000000000000000000000000040000000000000000000000000000000002000000000000000008000000000000000040008000100000040020000000000000000000008000000080000000000000000000400200000000000000",
"miner": "0x0100000000000000000000000000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x1221df5",
"parentHash": "0x740e3c5c6319bc67553a60d8d7abdff3e12c6409528b35a352b9918415bf3bfb",
"receiptsRoot": "0x256dcd2bb79de7ab844eb026c199933e37ed5d676897f4bf19a6e722abdc4a46",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x5fe",
"stateRoot": "0x74845c4c63ba086522338420a212ddbb22231207e8b1ea66f65fdccfda2a1b5b",
"timestamp": "0x6304b292",
"totalDifficulty": "0x1221df5",
"transactions": [
{
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"gas": "0x1ba93",
"gasPrice": "0x62b85e900",
"maxFeePerGas": "0x835105080",
"maxPriorityFeePerGas": "0x59682f00",
"hash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x259",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"transactionIndex": "0x0",
"value": "0x16345785d8a0000",
"type": "0x2",
"accessList": [],
"chainId": "0xa86a",
"v": "0x1",
"r": "0xe0695229cd07b0021fc16ad9408ccb9d9900ccd61eaa3e77ce585735b9797f2c",
"s": "0x21dd5d8219ccd42948a2b52dc78ec43fd20eda543e26a2ad9241bc367b4aba1d"
},
{
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"from": "0xe0990d7698730cd7fe426f6e7967f5455626a322",
"gas": "0xe1c5",
"gasPrice": "0x62b85e900",
"maxFeePerGas": "0x835105080",
"maxPriorityFeePerGas": "0x59682f00",
"hash": "0xef1f34b4c2b6bbb10e190e715a539f0a17fe216187285ef51195b396760934c5",
"input": "0x8506b82a",
"nonce": "0x1d6",
"to": "0xab592d197acc575d16c3346f4eb70c703f308d1e",
"transactionIndex": "0x1",
"value": "0x0",
"type": "0x2",
"accessList": [],
"chainId": "0xa86a",
"v": "0x1",
"r": "0xf38a5821efdcceec803534549275c23dc85d852369c0719557b78eca2cde8e5b",
"s": "0x201c2f7445948a8afbf07cd9499d4b199ed950938bb8f662536a65aaf058d142"
}
],
"transactionsRoot": "0x6a83519f8bc69ff49db4a8a8911ea97e4d7b27440f2eecc7891282cc0c84adcc",
"uncles": []
}
}
SpecificationView Specification
Parameters
DATA
, 32 Bytes - Hash of a block.Boolean
- Iftrue
it returns the full transaction objects, iffalse
only the hashes of the transactions.
Response
Object
- A block object, or null
when no block was found:
number
:QUANTITY
- the block number.null
when its pending block.hash
:DATA
, 32 Bytes - hash of the block.null
when its pending block.parentHash
:DATA
, 32 Bytes - hash of the parent block.nonce
:DATA
, 8 Bytes - hash of the generated proof-of-work.null
when its pending block.sha3Uncles
:DATA
, 32 Bytes - SHA3 of the uncles data in the block.logsBloom
:DATA
, 256 Bytes - the bloom filter for the logs of the block.null
when its pending block.transactionsRoot
:DATA
, 32 Bytes - the root of the transaction trie of the block.stateRoot
:DATA
, 32 Bytes - the root of the final state trie of the block.receiptsRoot
:DATA
, 32 Bytes - the root of the receipts trie of the block.miner
:DATA
, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.difficulty
:QUANTITY
- integer of the difficulty for this block.totalDifficulty
:QUANTITY
- integer of the total difficulty of the chain until this block.extraData
:DATA
- the "extra data" field of this block.size
:QUANTITY
- integer the size of this block in bytes.gasLimit
:QUANTITY
- the maximum gas allowed in this block.gasUsed
:QUANTITY
- the total used gas by all transactions in this block.timestamp
:QUANTITY
- the unix timestamp for when the block was collated.transactions
:Array
- Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.uncles
:Array
- Array of uncle hashes.
eth_getBlockByNumber
Returns information about a block by block number.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"baseFeePerGas": "0x5d21dba00",
"blockExtraData": "0x",
"blockGasCost": "0x0",
"difficulty": "0x1",
"extDataGasUsed": "0x0",
"extDataHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"extraData": "0x0000000000000000000000000007594d0000000000000000000000000001bbc200000000000000000000000000048c27000000000000000000000000000becd400000000000000000000000000000000",
"gasLimit": "0x7a1200",
"gasUsed": "0x2978e",
"hash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"logsBloom": "0x00000000000000008008010000000000000000000000000020002000000000020000000000000800004000000000000000000000000000000000000000000000000080000000000000000008000000000800000000000008000000008000000000000000020000000000000000000820000000000000000080000010000000000000000000000000000000000000000000400401000000000000000100000000001100000000000000000000000000000000040000000000000000000000000000000002000000000000000008000000000000000040008000100000040020000000000000000000008000000080000000000000000000400200000000000000",
"miner": "0x0100000000000000000000000000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x1221df5",
"parentHash": "0x740e3c5c6319bc67553a60d8d7abdff3e12c6409528b35a352b9918415bf3bfb",
"receiptsRoot": "0x256dcd2bb79de7ab844eb026c199933e37ed5d676897f4bf19a6e722abdc4a46",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x5fe",
"stateRoot": "0x74845c4c63ba086522338420a212ddbb22231207e8b1ea66f65fdccfda2a1b5b",
"timestamp": "0x6304b292",
"totalDifficulty": "0x1221df5",
"transactions": [
{
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"gas": "0x1ba93",
"gasPrice": "0x62b85e900",
"maxFeePerGas": "0x835105080",
"maxPriorityFeePerGas": "0x59682f00",
"hash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x259",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"transactionIndex": "0x0",
"value": "0x16345785d8a0000",
"type": "0x2",
"accessList": [],
"chainId": "0xa86a",
"v": "0x1",
"r": "0xe0695229cd07b0021fc16ad9408ccb9d9900ccd61eaa3e77ce585735b9797f2c",
"s": "0x21dd5d8219ccd42948a2b52dc78ec43fd20eda543e26a2ad9241bc367b4aba1d"
},
{
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"from": "0xe0990d7698730cd7fe426f6e7967f5455626a322",
"gas": "0xe1c5",
"gasPrice": "0x62b85e900",
"maxFeePerGas": "0x835105080",
"maxPriorityFeePerGas": "0x59682f00",
"hash": "0xef1f34b4c2b6bbb10e190e715a539f0a17fe216187285ef51195b396760934c5",
"input": "0x8506b82a",
"nonce": "0x1d6",
"to": "0xab592d197acc575d16c3346f4eb70c703f308d1e",
"transactionIndex": "0x1",
"value": "0x0",
"type": "0x2",
"accessList": [],
"chainId": "0xa86a",
"v": "0x1",
"r": "0xf38a5821efdcceec803534549275c23dc85d852369c0719557b78eca2cde8e5b",
"s": "0x201c2f7445948a8afbf07cd9499d4b199ed950938bb8f662536a65aaf058d142"
}
],
"transactionsRoot": "0x6a83519f8bc69ff49db4a8a8911ea97e4d7b27440f2eecc7891282cc0c84adcc",
"uncles": []
}
}
SpecificationView Specification
Parameters
QUANTITY|TAG
- integer of a block number, or the string"earliest"
,"latest"
or"pending"
, as in the default block parameterBoolean
- Iftrue
it returns the full transaction objects, iffalse
only the hashes of the transactions.
Response
Object
- A block object, or null
when no block was found:
number
:QUANTITY
- the block number.null
when its pending block.hash
:DATA
, 32 Bytes - hash of the block.null
when its pending block.parentHash
:DATA
, 32 Bytes - hash of the parent block.nonce
:DATA
, 8 Bytes - hash of the generated proof-of-work.null
when its pending block.sha3Uncles
:DATA
, 32 Bytes - SHA3 of the uncles data in the block.logsBloom
:DATA
, 256 Bytes - the bloom filter for the logs of the block.null
when its pending block.transactionsRoot
:DATA
, 32 Bytes - the root of the transaction trie of the block.stateRoot
:DATA
, 32 Bytes - the root of the final state trie of the block.receiptsRoot
:DATA
, 32 Bytes - the root of the receipts trie of the block.miner
:DATA
, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.difficulty
:QUANTITY
- integer of the difficulty for this block.totalDifficulty
:QUANTITY
- integer of the total difficulty of the chain until this block.extraData
:DATA
- the "extra data" field of this block.size
:QUANTITY
- integer the size of this block in bytes.gasLimit
:QUANTITY
- the maximum gas allowed in this block.gasUsed
:QUANTITY
- the total used gas by all transactions in this block.timestamp
:QUANTITY
- the unix timestamp for when the block was collated.transactions
:Array
- Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.uncles
:Array
- Array of uncle hashes.
eth_getBlockTransactionCountByHash
Returns the number of transactions in a block from a block matching the given block hash.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x2"
}
SpecificationView Specification
Parameters
DATA
, 32 Bytes - hash of a block
Response
QUANTITY
- integer of the number of transactions in this block.
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block matching the given block number.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x2"
}
SpecificationView Specification
Parameters
QUANTITY|TAG
- integer of a block number, or the string"earliest"
,"latest"
or"pending"
, as in the default block parameter
Response
QUANTITY
- integer of the number of transactions in this block.
eth_getUncleCountByBlockHash
Returns the number of uncles in a block from a block matching the given block hash.
{
"jsonrpc": "2.0",
"id": 0,
"result": "0x0"
}
SpecificationView Specification
Parameters
DATA
, 32 Bytes - hash of a block
Response
QUANTITY
- integer of the number of uncles in this block.
eth_getUncleCountByBlockNumber
Returns the number of uncles in a block from a block matching the given block number.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0"
}
SpecificationView Specification
Parameters
QUANTITY|TAG
- integer of a block number, or the string "latest", "earliest" or "pending", see the default block parameter
Response
QUANTITY
- integer of the number of uncles in this block.
eth_getUncleByBlockHashAndIndex
Returns information about an uncle of a block by hash and uncle index position.
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}
SpecificationView Specification
Parameters
DATA
, 32 Bytes - The hash of a block.QUANTITY
- The uncle's index position.
Response
Object
- A block object, or null
when no block was found:
number
:QUANTITY
- the block number.null
when its pending block.hash
:DATA
, 32 Bytes - hash of the block.null
when its pending block.parentHash
:DATA
, 32 Bytes - hash of the parent block.nonce
:DATA
, 8 Bytes - hash of the generated proof-of-work.null
when its pending block.sha3Uncles
:DATA
, 32 Bytes - SHA3 of the uncles data in the block.logsBloom
:DATA
, 256 Bytes - the bloom filter for the logs of the block.null
when its pending block.transactionsRoot
:DATA
, 32 Bytes - the root of the transaction trie of the block.stateRoot
:DATA
, 32 Bytes - the root of the final state trie of the block.receiptsRoot
:DATA
, 32 Bytes - the root of the receipts trie of the block.miner
:DATA
, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.difficulty
:QUANTITY
- integer of the difficulty for this block.totalDifficulty
:QUANTITY
- integer of the total difficulty of the chain until this block.extraData
:DATA
- the "extra data" field of this block.size
:QUANTITY
- integer the size of this block in bytes.gasLimit
:QUANTITY
- the maximum gas allowed in this block.gasUsed
:QUANTITY
- the total used gas by all transactions in this block.timestamp
:QUANTITY
- the unix timestamp for when the block was collated.transactions
:Array
- Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.uncles
:Array
- Array of uncle hashes.Returns information about a block by hash. Note: An uncle doesn't contain individual transactions.
eth_getUncleByBlockNumberAndIndex
Returns information about an uncle of a block by number and uncle index position.
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}
SpecificationView Specification
Parameters
QUANTITY|TAG
- a block number, or the string"earliest"
,"latest"
or"pending"
, as in the default block parameterQUANTITY
- the uncle's index position.
Response
Object
- A block object, or null
when no block was found:
number
:QUANTITY
- the block number.null
when its pending block.hash
:DATA
, 32 Bytes - hash of the block.null
when its pending block.parentHash
:DATA
, 32 Bytes - hash of the parent block.nonce
:DATA
, 8 Bytes - hash of the generated proof-of-work.null
when its pending block.sha3Uncles
:DATA
, 32 Bytes - SHA3 of the uncles data in the block.logsBloom
:DATA
, 256 Bytes - the bloom filter for the logs of the block.null
when its pending block.transactionsRoot
:DATA
, 32 Bytes - the root of the transaction trie of the block.stateRoot
:DATA
, 32 Bytes - the root of the final state trie of the block.receiptsRoot
:DATA
, 32 Bytes - the root of the receipts trie of the block.miner
:DATA
, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.difficulty
:QUANTITY
- integer of the difficulty for this block.totalDifficulty
:QUANTITY
- integer of the total difficulty of the chain until this block.extraData
:DATA
- the "extra data" field of this block.size
:QUANTITY
- integer the size of this block in bytes.gasLimit
:QUANTITY
- the maximum gas allowed in this block.gasUsed
:QUANTITY
- the total used gas by all transactions in this block.timestamp
:QUANTITY
- the unix timestamp for when the block was collated.transactions
:Array
- Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.uncles
:Array
- Array of uncle hashes.Returns information about a block by hash. Note: An uncle doesn't contain individual transactions.
eth_chainId
Returns the chain ID of the current network.
{
"jsonrpc": "2.0",
"id": 0,
"result": "0xa86a"
}
SpecificationView Specification
Parameters
none
Response
quantity
- EIP155 Chain ID.
eth_syncing
Returns an object with data about the sync status or false
.
{
"jsonrpc": "2.0",
"id": 1,
"result": false
}
SpecificationView Specification
Parameters
None
Response
Object|Boolean
, An object with sync status data or FALSE
, when not syncing:
startingBlock
:QUANTITY
- The block at which the import started (will only be reset, after the sync reached his head)currentBlock
:QUANTITY
- The current block, same as eth_blockNumberhighestBlock
:QUANTITY
- The estimated highest block
eth_blockNumber
Returns the number of most recent block.
{
"jsonrpc": "2.0",
"id": 83,
"result": "0x1221f9b"
}
SpecificationView Specification
Parameters
None
Response
QUANTITY
- integer of the current block number the client is on.
eth_call
Executes a new message call immediately without creating a transaction on the block chain.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x"
}
SpecificationView Specification
Parameters
Object
- The transaction call object
from
:DATA
, 20 Bytes - (optional) The address the transaction is sent from.to
:DATA
, 20 Bytes - The address the transaction is directed to.gas
:QUANTITY
- (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.gasPrice
:QUANTITY
- (optional) Integer of the gasPrice used for each paid gasvalue
:QUANTITY
- (optional) Integer of the value sent with this transactiondata
:DATA
- (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation
QUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
, see the default block parameter
Response
DATA
- the return value of executed contract.
eth_estimateGas
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x523f"
}
SpecificationView Specification
Parameters
See eth_call parameters, expect that all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit.
Response
QUANTITY
- the amount of gas used.
eth_gasPrice
Returns the current price per gas in wei.
{
"jsonrpc": "2.0",
"id": 73,
"result": "0x5d21dba00"
}
SpecificationView Specification
Parameters
None
Response
QUANTITY
- integer of the current gas price in wei.
eth_feeHistory
Returns the transaction fee history.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"oldestBlock": "0x122202b",
"reward": [
[
"0x59682f00",
"0x59682f00"
],
[
"0x0",
"0x1"
],
[
"0x59682f00",
"0x59682f00"
],
[
"0x59682f00",
"0x9502f900"
]
],
"baseFeePerGas": [
"0x5d21dba00",
"0x5d21dba00",
"0x5d21dba00",
"0x5d21dba00"
],
"gasUsedRatio": [
0.050517625,
0.263831625,
0.0375035,
0.044393375
]
}
}
SpecificationView Specification
Parameters
BLOCKCOUNT
- Number of blocks in the requested range. 1 ~ 1024 blocks can be requested in a single query. Less than requested may be returned if not all blocks are available.
NEWESTBLOCK
- Highest number of blocks in the requested range.
REWARDPERCENTILES
- (optional) Percentage values between 0 and 100, sampled in ascending order.
Response
OLDESTBLOCK
- Smallest number block of the returned range.
BASEFEEPERGAS
- An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.
GASUSEDRATIO
- An array of gas usage. Which is calculated as the ratio of gasUsed and gasLimit.
REWARD
- (Optional) An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.
eth_baseFee
Get the base fee for the next block.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5d21dba00"
}
SpecificationView Specification
Parameters
- None
Response
result
is the hex value of the base fee for the next block.
eth_maxPriorityFeePerGas
Get the priority fee needed to be included in a block.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0"
}
SpecificationView Specification
Parameters
- None
Response
result
is hex value of the priority fee needed to be included in a block.
eth_newFilter
Creates a filter object, based on filter options, to notify when the state changes (logs).
{
"jsonrpc": "2.0",
"id": 0,
"result": "0x662f0bacb84be34940c0eeaf8a7e192c"
}
SpecificationView Specification
To check if the state has changed, call eth_getFilterChanges. A note on specifying topic filters: Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic filters:
[]
"anything"[A]
"A in first position (and anything after)"[null, B]
"anything in first position AND B in second position (and anything after)"[A, B]
"A in first position AND B in second position (and anything after)"[[A, B], [A, B]]
"(A OR B) in first position AND (A OR B) in second position (and anything after)"-
Parameters
Object
- The filter options:
fromBlock
:QUANTITY|TAG
- (optional, default:"latest"
) Integer block number, or"latest"
for the last mined block or"pending"
,"earliest"
for not yet mined transactions.toBlock
:QUANTITY|TAG
- (optional, default:"latest"
) Integer block number, or"latest"
for the last mined block or"pending"
,"earliest"
for not yet mined transactions.address
:DATA|Array
, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.topics
:Array of DATA
, - (optional) Array of 32 BytesDATA
topics. Topics are order-dependent. Each topic can also be an array of DATA with "or" options.
Response
QUANTITY
- A filter id.
eth_newBlockFilter
Creates a filter in the node, to notify when a new block arrives.
{
"jsonrpc": "2.0",
"id": 73,
"result": "0x9c6193b3002eecb9ff79e73cf2baa89a"
}
SpecificationView Specification
To check if the state has changed, call eth_getFilterChanges.
Parameters
None
Response
QUANTITY
- A filter id.
eth_newPendingTransactionFilter
Creates a filter in the node, to notify when new pending transactions arrive.
{
"jsonrpc": "2.0",
"id": 73,
"result": "0x19a42d9378088f89144b27d17faef103"
}
SpecificationView Specification
To check if the state has changed, call eth_getFilterChanges.
Parameters
None
Response
QUANTITY
- A filter id.
eth_uninstallFilter
Uninstalls a filter with given id. Should always be called when watch is no longer needed. Additionally Filters timeout when they aren't requested with eth_getFilterChanges for a period of time.
{
"jsonrpc": "2.0",
"id": 73,
"result": true
}
SpecificationView Specification
Parameters
QUANTITY
- The filter id.
Response
Boolean
- true
if the filter was successfully uninstalled, otherwise false
.
eth_getFilterChanges
Polling method for a filter, which returns an array of logs which occurred since last poll.
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"logIndex": "0x1",
"blockNumber": "0x1b4",
"blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
"transactionIndex": "0x0",
"address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"topics": [
"0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"
]
}
]
}
SpecificationView Specification
Parameters
QUANTITY
- the filter id.
Response
Array
- Array of log objects, or an empty array if nothing has changed since last poll.
- For filters created with
eth_newBlockFilter
the return are block hashes (DATA
, 32 Bytes), e.g.["0x3454645634534..."]
. - For filters created with
eth_newPendingTransactionFilter
the return are transaction hashes (DATA
, 32 Bytes), e.g.["0x6345343454645..."]
. - For filters created with
eth_newFilter
logs are objects with following params:removed
:TAG
-true
when the log was removed, due to a chain reorganization.false
if its a valid log.logIndex
:QUANTITY
- integer of the log index position in the block.null
when its pending log.transactionIndex
:QUANTITY
- integer of the transactions index position log was created from.null
when its pending log.transactionHash
:DATA
, 32 Bytes - hash of the transactions this log was created from.null
when its pending log.blockHash
:DATA
, 32 Bytes - hash of the block where this log was in.null
when its pending.null
when its pending log.blockNumber
:QUANTITY
- the block number where this log was in.null
when its pending.null
when its pending log.address
:DATA
, 20 Bytes - address from which this log originated.data
:DATA
- contains one or more 32 Bytes non-indexed arguments of the log.topics
:Array of DATA
- Array of 0 to 4 32 BytesDATA
of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g.Deposit(address,bytes32,uint256)
), except you declared the event with theanonymous
specifier.)
eth_getFilterLogs
Returns an array of all logs matching filter with given id.
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"logIndex": "0x1",
"blockNumber": "0x1b4",
"blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
"transactionIndex": "0x0",
"address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"topics": [
"0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"
]
}
]
}
SpecificationView Specification
Parameters
QUANTITY
- The filter id.`
Response
Array
- Array of log objects, or an empty array if nothing has changed since last poll.
- For filters created with
eth_newBlockFilter
the return are block hashes (DATA
, 32 Bytes), e.g.["0x3454645634534..."]
. - For filters created with
eth_newPendingTransactionFilter
the return are transaction hashes (DATA
, 32 Bytes), e.g.["0x6345343454645..."]
. - For filters created with
eth_newFilter
logs are objects with following params:removed
:TAG
-true
when the log was removed, due to a chain reorganization.false
if its a valid log.logIndex
:QUANTITY
- integer of the log index position in the block.null
when its pending log.transactionIndex
:QUANTITY
- integer of the transactions index position log was created from.null
when its pending log.transactionHash
:DATA
, 32 Bytes - hash of the transactions this log was created from.null
when its pending log.blockHash
:DATA
, 32 Bytes - hash of the block where this log was in.null
when its pending.null
when its pending log.blockNumber
:QUANTITY
- the block number where this log was in.null
when its pending.null
when its pending log.address
:DATA
, 20 Bytes - address from which this log originated.data
:DATA
- contains one or more 32 Bytes non-indexed arguments of the log.topics
:Array of DATA
- Array of 0 to 4 32 BytesDATA
of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g.Deposit(address,bytes32,uint256)
), except you declared the event with theanonymous
specifier.)
eth_getLogs
Returns an array of all logs matching a given filter object.
{
"jsonrpc": "2.0",
"id": 0,
"result": [
{
"address": "0xb41653024c39dc2bd14dee34e7e52577194ff65d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000003b2b84330117b4502b7851f40a64b54dc4848430",
"0x00000000000000000000000081ee15ddd233a8a23ab8e6a789669f87e7ec5424"
],
"data": "0x000000000000000000000000000000000000000000000000005986be575ff463",
"blockNumber": "0xe64fa8",
"transactionHash": "0x299df58584ac3217ac2264a2cf885e79361d461cd9978957b84292ba7250a219",
"transactionIndex": "0xd8",
"blockHash": "0x1ea1fcda2cb0742eb90ac8b25127ee99d667f85181db29e13ed4133f37777ddc",
"logIndex": "0x228",
"removed": false
}
]
}
SpecificationView Specification
Parameters
Object
- The filter options:
fromBlock
:QUANTITY|TAG
- (optional, default:"latest"
) Integer block number, or"latest"
for the last mined block or"pending"
,"earliest"
for not yet mined transactions.toBlock
:QUANTITY|TAG
- (optional, default:"latest"
) Integer block number, or"latest"
for the last mined block or"pending"
,"earliest"
for not yet mined transactions.address
:DATA|Array
, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.topics
:Array of DATA
, - (optional) Array of 32 BytesDATA
topics. Topics are order-dependent. Each topic can also be an array of DATA with "or" options.blockhash
:DATA
, 32 Bytes - (optional, future) With the addition of EIP-234,blockHash
will be a new filter option which restricts the logs returned to the single block with the 32-byte hashblockHash
. UsingblockHash
is equivalent tofromBlock
=toBlock
= the block number with hashblockHash
. IfblockHash
is present in in the filter criteria, then neitherfromBlock
nortoBlock
are allowed.
Response
Array
- Array of log objects, or an empty array if nothing has changed since last poll.
- For filters created with
eth_newBlockFilter
the return are block hashes (DATA
, 32 Bytes), e.g.["0x3454645634534..."]
. - For filters created with
eth_newPendingTransactionFilter
the return are transaction hashes (DATA
, 32 Bytes), e.g.["0x6345343454645..."]
. - For filters created with
eth_newFilter
logs are objects with following params:removed
:TAG
-true
when the log was removed, due to a chain reorganization.false
if its a valid log.logIndex
:QUANTITY
- integer of the log index position in the block.null
when its pending log.transactionIndex
:QUANTITY
- integer of the transactions index position log was created from.null
when its pending log.transactionHash
:DATA
, 32 Bytes - hash of the transactions this log was created from.null
when its pending log.blockHash
:DATA
, 32 Bytes - hash of the block where this log was in.null
when its pending.null
when its pending log.blockNumber
:QUANTITY
- the block number where this log was in.null
when its pending.null
when its pending log.address
:DATA
, 20 Bytes - address from which this log originated.data
:DATA
- contains one or more 32 Bytes non-indexed arguments of the log.topics
:Array of DATA
- Array of 0 to 4 32 BytesDATA
of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g.Deposit(address,bytes32,uint256)
), except you declared the event with theanonymous
specifier.)
eth_sign
The sign method calculates an Ethereum specific signature with: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)))
.
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"
}
SpecificationView Specification
By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious dapp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim. Note: the address to sign with must be unlocked.
Parameters
DATA
, 20 Bytes - addressDATA
, N Bytes - message to sign
Response
DATA
: Signature
eth_signTransaction
Signs a transaction that can be submitted to the network at a later time using with eth_sendRawTransaction.
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"
}
SpecificationView Specification
Parameters
Object
- The transaction object
from
:DATA
, 20 Bytes - The address the transaction is sent from.to
:DATA
, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.gas
:QUANTITY
- (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.gasPrice
:QUANTITY
- (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas, in Wei.value
:QUANTITY
- (optional) Integer of the value sent with this transaction, in Wei.data
:DATA
- The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.nonce
:QUANTITY
- (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
Response
DATA
, The signed transaction object.
eth_getBalance
Returns the balance of the account of given address.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xd0454e1aff1759d1ec6"
}
SpecificationView Specification
Parameters
DATA
, 20 Bytes - address to check for balance.QUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
, see the default block parameter
Response
QUANTITY
- integer of the current balance in wei.
eth_getAssetBalance
In addition to the standard Ethereum APIs, Avalanche offers eth_getAssetBalance
to retrieve the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance
).
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0"
}
SpecificationView Specification
Parameters
address
owner of the assetblk
is the block number or hash at which to retrieve the balanceassetID
id of the asset for which the balance is requested
Response
QUANTITY
- Balance of first class Avalanche Native Tokens on the C-Chain.
eth_getStorageAt
Returns the value from a storage position at a given address.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
SpecificationView Specification
Parameters
DATA
, 20 Bytes - address of the storage.QUANTITY
- integer of the position in the storage.QUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
Response
DATA
- the value at this storage position.
eth_getTransactionCount
Returns the number of transactions sent from an address.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x130f7"
}
SpecificationView Specification
Parameters
DATA
, 20 Bytes - address.QUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
Response
QUANTITY
- integer of the number of transactions send from this address.
eth_getCode
Returns code at a given address.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x"
}
SpecificationView Specification
Parameters
DATA
, 20 Bytes - addressQUANTITY|TAG
- integer block number, or the string"latest"
,"earliest"
or"pending"
Response
DATA
- the code from the given address.
eth_sendTransaction
Creates new message call transaction or a contract creation, if the data field contains code.
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
SpecificationView Specification
Parameters
Object
- The transaction object
from
:DATA
, 20 Bytes - The address the transaction is sent from.to
:DATA
, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.gas
:QUANTITY
- (optional, default: 90000) Integer of the gas provided for the transaction execution. It will return unused gas.gasPrice
:QUANTITY
- (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas.value
:QUANTITY
- (optional) Integer of the value sent with this transaction.data
:DATA
- The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.nonce
:QUANTITY
- (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.
Response
DATA
, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.
Use eth_getTransactionReceipt to get the contract address, after the transaction was mined, when you created a contract.
eth_sendRawTransaction
Creates new message call transaction or a contract creation for signed transactions.
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
SpecificationView Specification
Parameters
DATA
, The signed transaction data.
Response
DATA
, 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.
Use eth_getTransactionReceipt to get the contract address, after the transaction was mined, when you created a contract.
eth_getTransactionByHash
Returns the information about a transaction requested by transaction hash.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"gas": "0x1ba93",
"gasPrice": "0x62b85e900",
"maxFeePerGas": "0x835105080",
"maxPriorityFeePerGas": "0x59682f00",
"hash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x259",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"transactionIndex": "0x0",
"value": "0x16345785d8a0000",
"type": "0x2",
"accessList": [],
"chainId": "0xa86a",
"v": "0x1",
"r": "0xe0695229cd07b0021fc16ad9408ccb9d9900ccd61eaa3e77ce585735b9797f2c",
"s": "0x21dd5d8219ccd42948a2b52dc78ec43fd20eda543e26a2ad9241bc367b4aba1d"
}
}
SpecificationView Specification
Parameters
DATA
, 32 Bytes - hash of a transaction
Response
Object
- A transaction object, or null
when no transaction was found:
blockHash
:DATA
, 32 Bytes - hash of the block where this transaction was in.null
when its pending.blockNumber
:QUANTITY
- block number where this transaction was in.null
when its pending.from
:DATA
, 20 Bytes - address of the sender.gas
:QUANTITY
- gas provided by the sender.gasPrice
:QUANTITY
- gas price provided by the sender in Wei.hash
:DATA
, 32 Bytes - hash of the transaction.input
:DATA
- the data send along with the transaction.nonce
:QUANTITY
- the number of transactions made by the sender prior to this one.to
:DATA
, 20 Bytes - address of the receiver.null
when its a contract creation transaction.transactionIndex
:QUANTITY
- integer of the transactions index position in the block.null
when its pending.value
:QUANTITY
- value transferred in Wei.v
:QUANTITY
- ECDSA recovery idr
:QUANTITY
- ECDSA signature rs
:QUANTITY
- ECDSA signature s
eth_getTransactionByBlockHashAndIndex
Returns information about a transaction by block hash and transaction index position.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"gas": "0x1ba93",
"gasPrice": "0x62b85e900",
"maxFeePerGas": "0x835105080",
"maxPriorityFeePerGas": "0x59682f00",
"hash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x259",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"transactionIndex": "0x0",
"value": "0x16345785d8a0000",
"type": "0x2",
"accessList": [],
"chainId": "0xa86a",
"v": "0x1",
"r": "0xe0695229cd07b0021fc16ad9408ccb9d9900ccd61eaa3e77ce585735b9797f2c",
"s": "0x21dd5d8219ccd42948a2b52dc78ec43fd20eda543e26a2ad9241bc367b4aba1d"
}
}
SpecificationView Specification
Parameters
DATA
, 32 Bytes - hash of a block.QUANTITY
- integer of the transaction index position.
Response
Object
- A transaction object, or null
when no transaction was found:
blockHash
:DATA
, 32 Bytes - hash of the block where this transaction was in.null
when its pending.blockNumber
:QUANTITY
- block number where this transaction was in.null
when its pending.from
:DATA
, 20 Bytes - address of the sender.gas
:QUANTITY
- gas provided by the sender.gasPrice
:QUANTITY
- gas price provided by the sender in Wei.hash
:DATA
, 32 Bytes - hash of the transaction.input
:DATA
- the data send along with the transaction.nonce
:QUANTITY
- the number of transactions made by the sender prior to this one.to
:DATA
, 20 Bytes - address of the receiver.null
when its a contract creation transaction.transactionIndex
:QUANTITY
- integer of the transactions index position in the block.null
when its pending.value
:QUANTITY
- value transferred in Wei.v
:QUANTITY
- ECDSA recovery idr
:QUANTITY
- ECDSA signature rs
:QUANTITY
- ECDSA signature s
eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"gas": "0x1ba93",
"gasPrice": "0x62b85e900",
"maxFeePerGas": "0x835105080",
"maxPriorityFeePerGas": "0x59682f00",
"hash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x259",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"transactionIndex": "0x0",
"value": "0x16345785d8a0000",
"type": "0x2",
"accessList": [],
"chainId": "0xa86a",
"v": "0x1",
"r": "0xe0695229cd07b0021fc16ad9408ccb9d9900ccd61eaa3e77ce585735b9797f2c",
"s": "0x21dd5d8219ccd42948a2b52dc78ec43fd20eda543e26a2ad9241bc367b4aba1d"
}
}
SpecificationView Specification
Parameters
QUANTITY|TAG
- a block number, or the string"earliest"
,"latest"
or"pending"
, as in the default block parameterQUANTITY
- the transaction index position.
Response
Object
- A transaction object, or null
when no transaction was found:
blockHash
:DATA
, 32 Bytes - hash of the block where this transaction was in.null
when its pending.blockNumber
:QUANTITY
- block number where this transaction was in.null
when its pending.from
:DATA
, 20 Bytes - address of the sender.gas
:QUANTITY
- gas provided by the sender.gasPrice
:QUANTITY
- gas price provided by the sender in Wei.hash
:DATA
, 32 Bytes - hash of the transaction.input
:DATA
- the data send along with the transaction.nonce
:QUANTITY
- the number of transactions made by the sender prior to this one.to
:DATA
, 20 Bytes - address of the receiver.null
when its a contract creation transaction.transactionIndex
:QUANTITY
- integer of the transactions index position in the block.null
when its pending.value
:QUANTITY
- value transferred in Wei.v
:QUANTITY
- ECDSA recovery idr
:QUANTITY
- ECDSA signature rs
:QUANTITY
- ECDSA signature s
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"blockNumber": "0x1221df5",
"contractAddress": null,
"cumulativeGasUsed": "0x1b5c9",
"effectiveGasPrice": "0x62b85e900",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"gasUsed": "0x1b5c9",
"logs": [
{
"address": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"topics": [
"0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c",
"0x000000000000000000000000a65592fc7afa222ac30a80f273280e6477a274e3"
],
"data": "0x000000000000000000000000000000000000000000000000016345785d8a0000",
"blockNumber": "0x1221df5",
"transactionHash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"transactionIndex": "0x0",
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"logIndex": "0x0",
"removed": false
},
{
"address": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000a65592fc7afa222ac30a80f273280e6477a274e3",
"0x000000000000000000000000ef63ebce1e5c1d6db7a875cf8c533486f65a557c"
],
"data": "0x000000000000000000000000000000000000000000000000016345785d8a0000",
"blockNumber": "0x1221df5",
"transactionHash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"transactionIndex": "0x0",
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"logIndex": "0x1",
"removed": false
},
{
"address": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"topics": [
"0x10245fe505d77c35824e8d77d61029a8843760e743b4949c9a7fd9af92e18459"
],
"data": "0x000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"blockNumber": "0x1221df5",
"transactionHash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"transactionIndex": "0x0",
"blockHash": "0x775e32ea46364b6b65fc8a3ae490d5e05b829efe7ba12a16069f336629891ac8",
"logIndex": "0x2",
"removed": false
}
],
"logsBloom": "0x00000000000000000000010000000000000000000000000020000000000000000000000000000800004000000000000000000000000000000000000000000000000080000000000000000008000000000800000000000008000000008000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000401000000000000000100000000000000000000000000000000000000000000040000000000000000000000000000000002000000000000000008000000000000000000000000000000040000000000000000000000008000000080000000000000000000400200000000000000",
"status": "0x1",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"transactionHash": "0x791193c6bc5624080a192541529f2110f2f6453f710f5d9bc64dd082f90bf638",
"transactionIndex": "0x0",
"type": "0x2"
}
}
SpecificationView Specification
Note That the receipt is not available for pending transactions.
Parameters
DATA
, 32 Bytes - hash of a transaction
Response
Object
- A transaction receipt object, or null
when no receipt was found:
transactionHash
:DATA
, 32 Bytes - hash of the transaction.transactionIndex
:QUANTITY
- integer of the transactions index position in the block.blockHash
:DATA
, 32 Bytes - hash of the block where this transaction was in.blockNumber
:QUANTITY
- block number where this transaction was in.from
:DATA
, 20 Bytes - address of the sender.to
:DATA
, 20 Bytes - address of the receiver. null when its a contract creation transaction.cumulativeGasUsed
:QUANTITY
- The total amount of gas used when this transaction was executed in the block.gasUsed
:QUANTITY
- The amount of gas used by this specific transaction alone.contractAddress
:DATA
, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwisenull
.logs
:Array
- Array of log objects, which this transaction generated.logsBloom
:DATA
, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. It also returns either :root
:DATA
32 bytes of post-transaction stateroot (pre Byzantium)status
:QUANTITY
either1
(success) or0
(failure)
web3_clientVersion
Returns the current client version.
{
"jsonrpc": "2.0",
"id": 67,
"result": "v0.8.14"
}
SpecificationView Specification
Parameters
None
Response
String
- The current client version
web3_sha3
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
{
"jsonrpc": "2.0",
"id": 64,
"result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad"
}
SpecificationView Specification
Parameters
DATA
- the data to convert into a SHA3 hash
Response
DATA
- The SHA3 result of the given string.
net_version
Returns the current network id.
{
"jsonrpc": "2.0",
"id": 67,
"result": "43114"
}
SpecificationView Specification
Parameters
None
Response
String
- The current network id.
The full list of current network IDs is available at chainlist.org. Sopme common ones are:
1
: Ethereum Mainnet
2
: Morden testnet (now deprecated)
3
: Ropsten testnet
4
: Rinkeby testnet
5
: Goerli testnet
net_listening
Returns true
if client is actively listening for network connections.
{
"jsonrpc": "2.0",
"id": 67,
"result": true
}
SpecificationView Specification
Parameters
None
Response
Boolean
- true
when listening, otherwise false
.
net_peerCount
Returns number of peers currently connected to the client.
{
"jsonrpc": "2.0",
"id": 74,
"result": "0x0"
}
SpecificationView Specification
Parameters
None
Response
QUANTITY
- integer of the number of connected peers.
debug_traceBlockByHash
The debug_traceBlockByHash
method will return a full stack trace of all invoked opcodes of all transaction that were included in this block.
{
"jsonrpc": "2.0",
"id": 0,
"result": [
{
"result": {
"type": "CALL",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"value": "0x16345785d8a0000",
"gas": "0x15917",
"gasUsed": "0x1544d",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"output": "0x",
"calls": [
{
"type": "DELEGATECALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0x0fa0304c10c1e3f37a7a4586d19dd3fd74eaf70c",
"gas": "0x1373e",
"gasUsed": "0x1373e",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"output": "0x",
"calls": [
{
"type": "STATICCALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xec675b7c5471c67e9b203c6d1c604df28a89fb7f",
"gas": "0x1122d",
"gasUsed": "0xa1a",
"input": "0x6352211e000000000000000000000000000000000000000000000000000000000000258f",
"output": "0x000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db"
},
{
"type": "CALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"value": "0x0",
"gas": "0x265b",
"gasUsed": "0x1f50",
"input": "0xa9059cbb000000000000000000000000ef63ebce1e5c1d6db7a875cf8c533486f65a557c000000000000000000000000000000000000000000000000016345785d8a0000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
]
}
]
}
},
{
"result": {
"type": "CALL",
"from": "0xe0990d7698730cd7fe426f6e7967f5455626a322",
"to": "0xab592d197acc575d16c3346f4eb70c703f308d1e",
"value": "0x0",
"gas": "0x8f7d",
"gasUsed": "0x8f7d",
"input": "0x8506b82a",
"output": "0x"
}
}
]
}
SpecificationView Specification
Parameters
hash
- Hash of the block to be traced.
Response
array
- Block traces, which have the following object shape (all return types are in hex values):
Response
- Trace Object, which has the following fields:
calls
- Array of transactions in the block with the following fields -from
- Addressgas
- Quantitygasused
- Quantityinput
- Dataoutput
- Datato
- Addresstype
- Datavalue
- Quantity
debug_traceBlockByNumber
The debug_traceBlockByNumber
method will return a full stack trace of all invoked opcodes of all transaction that were included in this block.
{
"jsonrpc": "2.0",
"id": 0,
"result": [
{
"result": {
"type": "CALL",
"from": "0x675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"to": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"value": "0x16345785d8a0000",
"gas": "0x15917",
"gasUsed": "0x1544d",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"output": "0x",
"calls": [
{
"type": "DELEGATECALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0x0fa0304c10c1e3f37a7a4586d19dd3fd74eaf70c",
"gas": "0x1373e",
"gasUsed": "0x1373e",
"input": "0x97c3032e000000000000000000000000000000000000000000000000000000000002f232000000000000000000000000000000000000000000000000000000000000258f000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006304b2bf00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000001f368b900000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000415cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e8801b00000000000000000000000000000000000000000000000000000000000000",
"output": "0x",
"calls": [
{
"type": "STATICCALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xec675b7c5471c67e9b203c6d1c604df28a89fb7f",
"gas": "0x1122d",
"gasUsed": "0xa1a",
"input": "0x6352211e000000000000000000000000000000000000000000000000000000000000258f",
"output": "0x000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db"
},
{
"type": "STATICCALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0x0000000000000000000000000000000000000001",
"gas": "0xfebc",
"gasUsed": "0xbb8",
"input": "0x653ae0ecc88d3bf78c0d3beabad4dec2889abe46245d95df4c80ba2bf12fbfdc000000000000000000000000000000000000000000000000000000000000001b5cea03717927277469485e9ad521b5f4465b701cbee28c35903656fed51070e945c424b673c41e0e085d8ffc2fe9c7c4bcdf195c5fa848145e6d06043b00e880",
"output": "0x000000000000000000000000fef175225e934be03fe1ba5e448669aec1b7388b"
},
{
"type": "STATICCALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"gas": "0xd69e",
"gasUsed": "0x9bb",
"input": "0x70a08231000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"output": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
{
"type": "STATICCALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"gas": "0xab76",
"gasUsed": "0x1eb",
"input": "0x70a08231000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"output": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
{
"type": "STATICCALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"gas": "0xa739",
"gasUsed": "0x1eb",
"input": "0x70a08231000000000000000000000000675975f0f593b50ccc2c22b6a6dcfcfd6e3ff2db",
"output": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
{
"type": "CALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"value": "0x16345785d8a0000",
"gas": "0x8901",
"gasUsed": "0x5d46",
"input": "0xd0e30db0",
"output": "0x"
},
{
"type": "STATICCALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"gas": "0x2b2c",
"gasUsed": "0x1eb",
"input": "0x70a08231000000000000000000000000a65592fc7afa222ac30a80f273280e6477a274e3",
"output": "0x000000000000000000000000000000000000000000000000016345785d8a0000"
},
{
"type": "CALL",
"from": "0xa65592fc7afa222ac30a80f273280e6477a274e3",
"to": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7",
"value": "0x0",
"gas": "0x265b",
"gasUsed": "0x1f50",
"input": "0xa9059cbb000000000000000000000000ef63ebce1e5c1d6db7a875cf8c533486f65a557c000000000000000000000000000000000000000000000000016345785d8a0000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
]
}
]
}
},
{
"result": {
"type": "CALL",
"from": "0xe0990d7698730cd7fe426f6e7967f5455626a322",
"to": "0xab592d197acc575d16c3346f4eb70c703f308d1e",
"value": "0x0",
"gas": "0x8f7d",
"gasUsed": "0x8f7d",
"input": "0x8506b82a",
"output": "0x"
}
}
]
}
SpecificationView Specification
Parameters
quantity
- Number of the block to be traced or the string 'latest', 'earliest' or 'pending'.
Response
array
- Block traces, which have the following object shape (all return types are in hex values):
Response
- Trace Object, which has the following fields:
calls
- Array of transactions in the block with the following fields -from
- Addressgas
- Quantitygasused
- Quantityinput
- Dataoutput
- Datato
- Addresstype
- Datavalue
- Quantity
debug_traceCall
The debug_traceCall
method will return a full stack trace of all invoked opcodes of all transaction that were included in this block.
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"type": "CALL",
"from": "0xe7804c37c13166ff0b37f5ae0bb07a3aebb6e245",
"to": "0x23dfb4c1b418e87cbfc8ee5d3f977ff040092a3b",
"value": "0x0",
"gas": "0x48914",
"gasUsed": "0x0",
"input": "0x",
"output": "0x"
}
}
SpecificationView Specification
Parameters
from
- (optional) wallet address the transaction is sent from.
to
- wallet address the transaction is sent to.
gas
- (optional) gas provided for the transaction
gasprice
- (optional) gasPrice
value
- (optional) Integer of the value sent with the transaction in hexadecimal.
data
- (optional) hash of the method signature and encoded parameters
quantity
- Number of the block or the string 'latest', 'earliest' or 'pending'.
Response
array
- Block traces, which have the following object shape (all return types are in hex values):
Response
- Trace Object, which has the following fields:
failed
- Addressgas
- Quantityreturnvalue
- Datastructlogs
- Arrayentries
- Arraystoragesbydepth
- Array
debug_traceTransaction
The debug_traceTransaction
method will return a full stack trace of all invoked opcodes of all transaction that were included in this block.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"gas": 112073,
"failed": false,
"returnValue": "",
"structLogs": [
{
"pc": 0,
"op": "PUSH1",
"gas": 88343,
"gasCost": 3,
"depth": 1,
"stack": []
},
{
"pc": 2,
"op": "PUSH1",
"gas": 88340,
"gasCost": 3,
"depth": 1,
"stack": [
"0x80"
]
},
{
"pc": 4,
"op": "MSTORE",
"gas": 88337,
"gasCost": 12,
"depth": 1,
"stack": [
"0x80",
"0x40"
]
},
{
"pc": 881,
"op": "PUSH1",
"gas": 1229,
"gasCost": 3,
"depth": 1,
"stack": [
"0x97c3032e",
"0x5b",
"0x116",
"0xfa0304c10c1e3f37a7a4586d19dd3fd74eaf70c",
"0x1",
"0x1",
"0x0"
]
},
{
"pc": 883,
"op": "RETURN",
"gas": 1226,
"gasCost": 0,
"depth": 1,
"stack": [
"0x97c3032e",
"0x5b",
"0x116",
"0xfa0304c10c1e3f37a7a4586d19dd3fd74eaf70c",
"0x1",
"0x1",
"0x0",
"0x0"
]
}
]
}
}
SpecificationView Specification
Parameters
hash
- The hash of the transaction
Response
array
- Block traces, which have the following object shape (all return types are in hex values):
Response
- Trace Object, which has the following fields:
failed
- Addressgas
- Quantityreturnvalue
- Datastructlogs
- Arrayentries
- Arraystoragesbydepth
- Array
avax.getAtomicTx
Gets a transaction by its ID. Optional encoding parameter to specify the format for the returned transaction. Can only be hex when a value is provided.
{
"jsonrpc": "2.0",
"result": {
"tx": "0x000000000000000030399d0775f450604bd2fbc49ce0c5c1c6dfeb2dc2acb8c92c26eeae6e6df4502b19d891ad56056d9c01f18f43f58b5c784ad07a4a49cf3d1f11623804b5cba2c6bf000000018212d6807a0ec9c1b26321418fe7a548180b5be728ce53fe7e98ab5755ed316100000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000005000003a352a382400000000100000000000000018db97c7cece249c2b98bdc0226cc4c2a57bf52fc000003a3529edd17dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db000000010000000900000001ead19377f015422fbb8731204fcf6d6879dd05146c2d5b5594e2fea2cb420b2f40bd457b71e279e547790b28fe5482f278c76cf39b2dce5c2e6c53352fe6827d002cc7d20d",
"encoding": "hex",
"blockHeight": "1"
},
"id": 1
}
SpecificationView Specification
Parameters
txID
is the transacion ID. It should be in cb58 format.encoding
is the encoding format to use. Can only behex
when a value is provided.
Response
tx
is the transaction encoded to encoding.encoding
is theencoding
.blockHeight
is the height of the block which the transaction was included in.
avax.export
Export an asset from the C-Chain to X-Chain or P-Chain. After calling this method, you must call the X-Chain's avm.import or P-Chain's platform.import.
{
"jsonrpc": "2.0",
"result": {
"txID": "2W5JuFENitZKTpJsy9igBpTcEeBKxBHHGAUkgsSUnkjVVGQ9i8"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
to
is the X-Chain or P-Chain address the asset is sent to.amount
is the amount of the asset to send.assetID
is the ID of the asset. To export AVAX use "AVAX" as the assetID.baseFee
is the base fee that should be used when creating the transaction. If ommitted, a suggested fee will be used.username
is the user that controls the address that transaction will be sent from.password
is username‘s password.
Response
txID
Transaction's ID
avax.exportKey
Get the private key that controls a given address. The returned private key can be added to a user with avax.importKey.
{
"jsonrpc": "2.0",
"result": {
"privateKey": "PrivateKey-2o2uPgTSf3aR5nW6yLHjBEAiatAFKEhApvYzsjvAJKRXVWCYkE",
"privateKeyHex": "0xec381fb8d32168be4cf7f8d4ce9d8ca892d77ba574264f3665ad5edb89710157"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
username
must controladdress
.address
is the address for which you want to export the corresponding private key. It should be in hex format.
Response
privateKey
is the CB58 endcoded string representation of the private key that controlsaddress
. It has aPrivateKey
- prefix and can be used to import a key viaavax.importKey
.privateKeyHex
is the hex string representation of the private key that controlsaddress
. It can be used to import an account into Metamask.
avax.getUTXOs
Gets the UTXOs that reference a given address.
{
"jsonrpc": "2.0",
"result": {
"numFetched": "3",
"utxos": [
"0x0000a799e7448acf74ca9223159a04f93b948f99cf28509f908839532b2f85baffc300000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c22d23171",
"0x00006385c683d43bdbe754c224be36c5004ea7ce49c0849cadeaea6af93dae18cc7700000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29cb81cc877",
"0x000038137283c94582351b86c3e90808312636769e3f5c14fbf1152d6634f770695c00000001dbcf890f77f49b96857648b72b77f9f82937f28a68704af05da0dc12ba53f2db00000007000003a352a38240000000000000000000000001000000013cb7d3842e8cee6a0ebd09f1fe884f6861e1b29c7412490e"
],
"endIndex": {
"address": "C-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5",
"utxo": "0x9333ef8a05f26acf2d8766f94723f749870fa2ca80c19c33cc945d79013d7c50fd023beb"
},
"encoding": "hex"
},
"id": 1
}
SpecificationView Specification
Parameters
addresses
to get the UTXOs for.- At most
limit
UTXOs are returned. Iflimit
is omitted or greater than 1024, it is set to 1024. - If
startIndex
is omitted, will fetch all UTXOs up tolimit
. - When using pagination (ie when
startIndex
is provided), UTXOs are not guaranteed to be unique across multiple calls. That is, a UTXO may appear in the result of the first call, and then again in the second call. encoding
sets the format for the returned UTXOs. Can only behex
when a value is provided.
Response
utxos
is a list of UTXOs such that each UTXO references at least one address inaddresses
.- At most
limit
UTXOs are returned. Iflimit
is omitted or greater than 1024, it is set to 1024. - This method supports pagination.
endIndex
denotes the last UTXO returned. To get the next set of UTXOs, use the value ofendIndex
asstartIndex
in the next call. - If
startIndex
is omitted, will fetch all UTXOs up tolimit
. - When using pagination (ie when
startIndex
is provided), UTXOs are not guaranteed to be unique across multiple calls. That is, a UTXO may appear in the result of the first call, and then again in the second call. - When using pagination, consistency is not guaranteed across multiple calls. That is, the UTXO set of the addresses may have changed between calls.
encoding
sets the format for the returned UTXOs. Can only behex
when a value is provided.
avax.import
Finalize the transfer of a non-AVAX or AVAX from X-Chain or P-Chain to the C-Chain. Before this method is called, you must call the X-Chain’s avm.export
or P-Chain’s platform.exportAVAX
with assetID AVAX
to initiate the transfer.
{
"jsonrpc": "2.0",
"result": {
"txID": "6bJq9dbqhiQvoshT3uSUbg9oB24n7Ei6MLnxvrdmao78oHR9t"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
to
is the address the asset is sent to. This must be the same as theto
argument in the corresponding call to the X-Chain's or P-Chain'sexport
.sourceChain
is the ID or alias of the chain the asset is being imported from. To import funds from the X-Chain, use"X"
; for the P-Chain, use"P"
.baseFee
is the base fee that should be used when creating the transaction. If omitted, a suggested fee will be used.username
is the user that controls the address that transaction will be sent from.password
isusername
‘s password.
Response
txID
is the ID of the completed ImportTx.
avax.importKey
Give a user control over an address by providing the private key that controls the address.
{
"jsonrpc": "2.0",
"result": {
"address": "0xc876DF0F099b3eb32cBB78820d39F5813f73E18C"
},
"id": 1
}
SpecificationView Specification
Not recommended for use on Mainnet. See warning notice in Keystore API.
Parameters
- Add
privateKey
tousername
's set of private keys.
Response
address
is the addressusername
now controls with the private key. It will be in hex format.
avax.issueTx
Send a signed transaction to the network. encoding
specifies the format of the signed transaction. Can only be hex
when a value is provided.
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"txID": "NUPLwbt2hsYxpQg4H2o451hmTWQ4JZx2zMzM4SinwtHgAdX1JLPHXvWSXEnpecStLj"
}
}
SpecificationView Specification
Parameters
tx
- Signed transaction string.encoding
sets the format for the returned UTXOs. Can only behex
when a value is provided.
Response
txID
is the ID of the completed transaction.
avax.getAtomicTxStatus
Get the status of an atomic transaction sent to the network.
{
"jsonrpc": "2.0",
"result": {
"status": "Unknown"
},
"id": 1
}
SpecificationView Specification
Parameters
txID
is the ID of the completed transaction.
Response
status
is one of:
Accepted
: The transaction is (or will be) accepted by every node. Check theblockHeight
propertyProcessing
: The transaction is being voted on by this nodeDropped
: The transaction was dropped by this node because it thought the transaction invalidUnknown
: The transaction hasn’t been seen by this node