For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Chiliz — web3, net, eth (2/3)

API reference for Chiliz. All methods ->

Part 2 of 3: 1 · 2 · 3

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.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <object> (hex encoded): the transaction object:

      • from (string; data, 20 bytes; optional): the address the transaction is sent from.
      • to (string; data, 20 bytes; optional): the address the transaction is directed to.
      • gas (string; quantity; optional): the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions.
      • gasPrice (string; quantity; optional): the gas price willing to be paid by the sender in wei.
      • value (string; quantity; optional): the value sent with this transaction, in wei; note that if the value exceeds the from address balance (which is 0.000000000000000001 ETH by default), then you'll receive an insufficient funds error in response.
      • data (string; data; optional): the hash of the method signature and encoded parameters.
    2. <string> (quantity|tag; optional): either a HEX value of a block number or one of the following block tags:

      • earliest: the lowest numbered block available on the client.
      • finalized: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination.
      • safe: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
      • pending: a sample next block built by the client on top of the latest and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet.

Returns

  • <string> (quantity): the amount of gas used.

Request example

curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [{"to":"0x6E9681c9cbCF23Fc3B9a044B04941B792B0dCBd9"}],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5208"
}

eth_getBlockByHash

Returns information for the block specified by block hash.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): the block hash.
    2. <boolean>: if true it returns the full transaction objects, if false — only the hashes of the transactions.

Returns

  • <object>: a block object, or null when no block was found:
    • number (string; quantity): the block number; null when it's a pending block.
    • hash (string; data, 32 bytes): the hash of the block; null when it's a pending block.
    • parentHash (string; data, 32 bytes): the hash of the parent block.
    • nonce (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block.
    • sha3Uncles (string; data, 32 bytes): SHA3 of the uncles data in the block.
    • logsBloom (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block.
    • transactionsRoot (string; data, 32 bytes): the root of the transaction trie of the block.
    • stateRoot (string; data, 32 bytes): the root of the final state trie of the block.
    • receiptsRoot (string; data, 32 bytes): the root of the receipts trie of the block.
    • miner (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given.
    • difficulty (string; quantity): the difficulty for this block.
    • totalDifficulty (string; quantity): the total difficulty of the chain until this block.
    • extraData (string; data): the extra data field of this block.
    • size (string; quantity): the size of this block in bytes.
    • gasLimit (string; quantity): the maximum gas allowed in this block.
    • gasUsed (string; quantity): the total used gas by all transactions in this block.
    • timestamp (string; quantity): the unix timestamp for when the block was collated.
    • transactions (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
    • uncles (array of strings): an array of uncle hashes.

Request example

curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": ["0x23b361994b3c5cf8101623b6efa01d5d20abbdb3e50e522e65094d6b2bd93280", false],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"baseFeePerGas": "0x31",
"difficulty": "0x0",
"extraData": "0x",
"gasLimit": "0x17d7840",
"gasUsed": "0x94012",
"hash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881",
"logsBloom": "0x00000000000000000000000000000000000000000400040000000000000000000000004000000000000001000000000000000000000000000100000000000000000000000000020800000008000000000000000000000000000000000000000004000000028040004000000000008800200000000000000000000110200100200008800000000040000000000000800000000000000000000002000000000000000000000000000000000000000000000000000000004000000000000000000000000002000000000000000000000008000000000000200000000000000820000001000000000000000000000000800000000000000000000008000000000000",
"miner": "0x4200000000000000000000000000000000000011",
"mixHash": "0x7180a31b9dd9cee2c54b01e8f2159f8f319344a6bef98ddb2ba1c7aa7b6f7881",
"nonce": "0x0000000000000000",
"number": "0x3c755c",
"parentHash": "0xd101d2af1b670fbe88eb0defb057cc4c0384df350edbe771a6a199e7898f9d65",
"receiptsRoot": "0x70f185eb69e67c0c084b299237c1503198cc1b7b7c27f4cf1279595a16cc038b",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x7e8",
"stateRoot": "0x15f9c468bc700599a24a230e60847f50e689617b033b27f371f703a91e3e5dc6",
"timestamp": "0x645257c8",
"totalDifficulty": "0x0",
"transactions": [
"0xf14686c9327d897ab5b0754b18cea248cf08a9caa3c9d7c98e73690d46d2cb39",
"0xc263dd53e1aaaabb951c49cfd4aa7a9e1251b0c5db1ad00226d72870f08c8d78",
"0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b",
"0x023fb744a61685e453db52bd35473c8593ecdf57e6642146c8de60a5cf642396",
"0xf4c8bfb6c3e9eefa28f297bdab17954e1e74532df3bd8c71e87c257408f56bea"
],
"transactionsRoot": "0x1c21ae0871abb6a8a1fc9b5e5d3b5d10b840903f628dfdf18da8b02fd16c972f",
"uncles": []
}
}

eth_getBlockByNumber

Returns information for the block specified by block number.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:
      • earliest: the lowest numbered block available on the client.
      • finalized: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination.
      • safe: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
      • pending: a sample next block built by the client on top of the latest and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet.
    2. <boolean>: if true it returns the full transaction objects, if false — only the hashes of the transactions.

Returns

  • <object>: a block object, or null when no block was found:
    • number (string; quantity): the block number; null when it's a pending block.
    • hash (string; data, 32 bytes): the hash of the block; null when it's a pending block.
    • parentHash (string; data, 32 bytes): the hash of the parent block.
    • nonce (string; data, 8 bytes): the hash of the generated proof-of-work; null when it's a pending block.
    • sha3Uncles (string; data, 32 bytes): SHA3 of the uncles data in the block.
    • logsBloom (string; data, 256 bytes): the bloom filter for the logs of the block. null when its pending block.
    • transactionsRoot (string; data, 32 bytes): the root of the transaction trie of the block.
    • stateRoot (string; data, 32 bytes): the root of the final state trie of the block.
    • receiptsRoot (string; data, 32 bytes): the root of the receipts trie of the block.
    • miner (string; data, 20 bytes): the address of the beneficiary to whom the mining rewards were given.
    • difficulty (string; quantity): the difficulty for this block.
    • totalDifficulty (string; quantity): the total difficulty of the chain until this block.
    • extraData (string; data): the extra data field of this block.
    • size (string; quantity): the size of this block in bytes.
    • gasLimit (string; quantity): the maximum gas allowed in this block.
    • gasUsed (string; quantity): the total used gas by all transactions in this block.
    • timestamp (string; quantity): the unix timestamp for when the block was collated.
    • transactions (array of strings): an array of transaction objects, or 32 bytes transaction hashes depending on the last given parameter.
    • uncles (array of strings): an array of uncle hashes.

Request example

curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", false],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x2",
"extraData": "0xd983010108846765746889676f312e31362e3135856c696e75780000bd7c1b1b4d5395dcb04ebc3bca5f8d501b11eae55e194bbddf2ba2a1b0957822b1fa632b547ec992b469068caaeb5f0fcf74062e4e65fbb0636a1f2f62423906b5f01a7c01",
"gasLimit": "0x1c9c380",
"gasUsed": "0x0",
"hash": "0x68ca2f7050fbf04874b9614e652b8bd4f6ac44bb5c1e600bb66c6070a5424170",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xf84aed72066e635fd9b0f2fbddbdb77a8761d028",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x2a3cde",
"parentHash": "0xb6bcca7a7e91f9854ef66a27eb7fa2e77f957903601f2fed214f87570591adc2",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x262",
"stateRoot": "0x6506ff6f995b6d1defd5f3fecff5054eb9266ce9be310afef12011f627f23aaf",
"timestamp": "0x6463776e",
"totalDifficulty": "0x54648b",
"transactions": [],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}

eth_getTransactionByHash

Returns information on a transaction specified by transaction hash.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): a transaction hash.

Returns

  • blockHash (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending.
  • blockNumber (string; quantity): a number of the block containing the transaction; null when it's pending.
  • from (string; data, 20 bytes): an address of the sender.
  • gas (string; quantity): the gas provided by the sender.
  • gasPrice (string; quantity): the gas price provided by the sender in wei.
  • hash (string; data, 32 bytes): the hash of the transaction.
  • input (string; data): the data send along with the transaction.
  • nonce (string; quantity): the number of transactions made by the sender prior to this one.
  • to (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction.
  • transactionIndex (string; quantity): the transaction index position in the block; null when it's pending.
  • value (string; quantity): the value transferred in wei.
  • v (string; quantity): ECDSA recovery ID.
  • r (string; quantity): ECDSA signature r.
  • s (string; quantity): ECDSA signature s.

Request example

curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x58a525386e069209bad64c761fe1b6b79e758ef2989e3659e1ef7cba6f4d594d"],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881",
"blockNumber": "0x3c755c",
"from": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f",
"gas": "0x186a0",
"gasPrice": "0x0",
"hash": "0xbb7ee1471cfd836d759e1df26b5726a3f6250459e1f0bc34fc3818f7f7736c3b",
"input": "0x",
"nonce": "0x0",
"to": "0x57b3a84e18d6302e2482841a1bc9839ab172b26f",
"transactionIndex": "0x2",
"value": "0x21ec894ca2f7b800",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0x4b34328ff3466ddda82a19e849e6724e03cae75075709ec600c7d8bf6c7b5e9b",
"mint": "0x21ec894ca2f7b800"
}
}

eth_getTransactionByBlockHashAndIndex

Returns information on a transaction specified by block hash and transaction index position.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (data, 32 bytes): a block hash.
    2. <string> (quantity): a transaction index position.

Returns

  • blockHash (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending.
  • blockNumber (string; quantity): a number of the block containing the transaction; null when it's pending.
  • from (string; data, 20 bytes): an address of the sender.
  • gas (string; quantity): the gas provided by the sender.
  • gasPrice (string; quantity): the gas price provided by the sender in wei.
  • hash (string; data, 32 bytes): the hash of the transaction.
  • input (string; data): the data send along with the transaction.
  • nonce (string; quantity): the number of transactions made by the sender prior to this one.
  • to (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction.
  • transactionIndex (string; quantity): the transaction index position in the block; null when it's pending.
  • value (string; quantity): the value transferred in wei.
  • v (string; quantity): ECDSA recovery ID.
  • r (string; quantity): ECDSA signature r.
  • s (string; quantity): ECDSA signature s.

Request example

curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockHashAndIndex",
"params": ["0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881", "0x0"],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x4389f44951cf44a521dd07c5e246ddd396212194ae72cd5c707661209dca1881",
"blockNumber": "0x3c755c",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas": "0x8f0d180",
"gasPrice": "0x0",
"hash": "0xf14686c9327d897ab5b0754b18cea248cf08a9caa3c9d7c98e73690d46d2cb39",
"input": "0x015d8eb90000000000000000000000000000000000000000000000000000000000885554000000000000000000000000000000000000000000000000000000006452579400000000000000000000000000000000000000000000000000000009abdfc80badc6a92f7b910d6eb19519df02d5f553acf1916705b5c8ffc363f19eae6378bb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240",
"nonce": "0x0",
"to": "0x4200000000000000000000000000000000000015",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0x8d211d9a6c156ad43a3330c0f07904f319936ae4eadf6d57cce64c1f52a569b1",
"mint": "0x0",
"isSystemTx": true
}
}

eth_getTransactionByBlockNumberAndIndex

Returns information on a transaction by block number and transaction index position.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:
      • earliest: the lowest numbered block available on the client.
      • finalized: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination.
      • safe: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
      • pending: a sample next block built by the client on top of the latest and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet.
    2. <string> (quantity): the transaction index position.

Returns

  • blockHash (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending.
  • blockNumber (string; quantity): a number of the block containing the transaction; null when it's pending.
  • from (string; data, 20 bytes): an address of the sender.
  • gas (string; quantity): the gas provided by the sender.
  • gasPrice (string; quantity): the gas price provided by the sender in wei.
  • hash (string; data, 32 bytes): the hash of the transaction.
  • input (string; data): the data send along with the transaction.
  • nonce (string; quantity): the number of transactions made by the sender prior to this one.
  • to (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction.
  • transactionIndex (string; quantity): the transaction index position in the block; null when it's pending.
  • value (string; quantity): the value transferred in wei.
  • v (string; quantity): ECDSA recovery ID.
  • r (string; quantity): ECDSA signature r.
  • s (string; quantity): ECDSA signature s.

Request example

curl -X POST https://rpc.ankr.com/chiliz/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": ["latest", "0x0"],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xa72d3db5dc554ec1eee6be321d3d7fa5eadf68ef19e1ddba2cbdde65bd049325",
"blockNumber": "0x3c764e",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas": "0x8f0d180",
"gasPrice": "0x0",
"hash": "0xfa21b7302972609248949646b06703f94010c724f1565949da1e050a56672504",
"input": "0x015d8eb9000000000000000000000000000000000000000000000000000000000088557000000000000000000000000000000000000000000000000000000000645259680000000000000000000000000000000000000000000000000000000d6a1b7750abf0a584e9f633edf00ea6ca61d6a845313965c3f39426e66ed959ba18f1c6d900000000000000000000000000000000000000000000000000000000000000020000000000000000000000002d679b567db6187c0c8323fa982cfb88b74dbcc7000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240",
"nonce": "0x0",
"to": "0x4200000000000000000000000000000000000015",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0x0d55c4a6698e3facccbb99f7d27a091886a9c4286c36f2789b850b70e7f83a0c",
"mint": "0x0",
"isSystemTx": true
}
}