QIE methods

POST: eth_accounts
Returns a list of account addresses a client owns.
note
To provide access to your key store and and then sign transactions, use EthSigner with QI.
Parameters
None
Returns
Array of data : List of 20-byte account addresses owned by the client.
POST : eth_blockNumber
Returns the index corresponding to the block number of the current chain head.
Parameters
None
Returns
result : QUANTITY - Hexadecimal integer representing the index corresponding to the block number of the current chain head.
BODY
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}
POST : eth_call
Invokes a contract function locally and does not change the state of the blockchain.
You can interact with contracts using eth_sendRawTransaction or eth_call.
If revert reason is enabled with --revert-reason-enabled, the eth_call error response will include the revert reason.
Parameters
OBJECT - Transaction call object.
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
note
By default, eth_call does not fail if the sender account has an insufficient balance. This is done by setting the balance of the account to a large amount of QI. To enforce balance rules, set the strict parameter in the transaction call object to true.
Returns
result - data - Return value of the executed contract.
BODY
{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [
{
"to": "0x69498dd54bd25aa0c886cf1f8b8ae0856d55ff13",
"value": "0x1"
},
"latest"
],
"id": 1
POST : eth_chainId
Returns the chain ID.
Parameters
None
Returns
result : quantity - Chain ID, in hexadecimal.
BODY
{
"jsonrpc": "2.0",
"method": "eth_chainId",
"params": [],
"id": 1
}
POST : eth_coinbase
Returns the client coinbase address. The coinbase address is the account to pay mining rewards to.
To set a coinbase address, start QI with the --miner-coinbase option set to a valid QI account address. You can get the QI account address from a client such as MetaMask or Explorer. For example:
Example
besu --miner-coinbase="0xfe3b557e8fb62b89f4916b721be55ceb828dbd73" --rpc-http-enabled
Parameters
None
Returns
result : data - Coinbase address.
BODY
{
"jsonrpc": "2.0",
"method": "eth_coinbase",
"params": [],
"id": 1
}
POST : eth_estimateGas
Returns an estimate of the gas required for a transaction to complete. The estimation process does not use gas and the transaction is not added to the blockchain. The resulting estimate can be greater than the amount of gas the transaction ends up using, for reasons including EVM mechanics and node performance.
The eth_estimateGas call does not send a transaction. You must call eth_sendRawTransaction to execute the transaction.
If revert reason is enabled with --revert-reason-enabled, the eth_estimateGas error response will include the revert reason.
Parameters
The transaction call object parameters are the same as those for eth_call except for the strict parameter. If strict is set to true, the sender account balance is checked for value transfer and transaction fees. The default for strict is false.
For eth_estimateGas, all fields are optional because setting a gas limit is irrelevant to the estimation process (unlike transactions, in which gas limits apply).
object - Transaction call object.
Returns
result : quantity - Amount of gas used.
BODY
{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{
"from": "0x687422eea2cb73b5d3e242ba5456b782919afc85",
"to": "0xdd37f65db31c107f773e82a4f85c693058fef7a9",
"value": "0x1"
},
"latest"
],
POST
eth_gasPrice
http://localhost:8545
Returns a percentile gas unit price for the most recent blocks, in Wei. By default, the last 100 blocks are examined and the 50th percentile gas unit price (that is, the median value) is returned.
If there are no blocks, the value for --min-gas-price is returned. The value returned is restricted to values between --min-gas-price and --api-gas-price-max. By default, 1000 Wei and 500GWei.
Use the --api-gas-price-blocks, --api-gas-price-percentile , and --api-gas-price-max command line options to configure the eth_gasPrice default values.
Parameters
None
Returns
result : quantity - Percentile gas unit price for the most recent blocks, in Wei, as a hexadecimal value.
BODY
{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}
POST : eth_getBalance
Returns the account balance of the specified address.
Parameters
DATA - 20-byte account address from which to retrieve the balance.
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result : QUANTITY - Current balance, in wei, as a hexadecimal value.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"latest"
],
"id": 1
}
POST : eth_getBlockByHash
Returns information about the block by hash.
Parameters
DATA - 32-byte hash of a block.
Boolean - If true, returns the full transaction objects; if false, returns the transaction hashes.
Returns
result : OBJECT - Block object , or null when there is no block.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0xaf5526fcb88b2f0d163c9a78ee678bf95b20115dc3d4e2b7b1f5fc4a308724a0",
false
],
"id": 1
}
POST : eth_getBlockByNumber
Returns information about a block by block number.
Parameters
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Boolean - If true, returns the full transaction objects; if false, returns only the hashes of the transactions.
Returns
result : OBJECT - Block object , or null when there is no block.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": [
"0xF",
true
],
"id": 1
}
POST : eth_getBlockTransactionCountByHash
Returns the number of transactions in the block matching the given block hash.
Parameters
data - 32-byte block hash.
Returns
result : quantity - Integer representing the number of transactions in the specified block.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": [
"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
],
"id": 1
}
POST : eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block matching the specified block number.
Parameters
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result : QUANTITY - Integer representing the number of transactions in the specified block.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": [
"0xe8"
],
"id": 1
}
POST : eth_getCode
Returns the code of the smart contract at the specified address. QI stores compiled smart contract code as a hexadecimal value.
Parameters
DATA - 20-byte contract address.
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result : DATA - Code stored at the specified address.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": [
"0xa50a51c09a5c451c52bb714527e1974b686d8e77",
"latest"
],
"id": 1
}
POST : eth_getFilterChanges
Polls the specified filter and returns an array of changes that have occurred since the last poll.
Parameters
data - Filter ID.
Returns
result : Array of Object - If nothing changed since the last poll, an empty list. Otherwise:
  • For filters created with eth_newBlockFilter, returns block hashes.
  • For filters created with eth_newPendingTransactionFilter, returns transaction hashes.
  • For filters created with eth_newFilter, returns log objects.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getFilterChanges",
"params": [
"0xf8bf5598d9e04fbe84523d42640b9b0e"
],
"id": 1
}
filter created with eth_newPendingTransactionFilter
POST : eth_getFilterLogs
Returns an array of logs for the specified filter.
Leave the --auto-log-bloom-caching-enabled command line option at the default value of true to improve log retrieval performance.
Note :
`eth_getFilterLogs` is only used for filters created with `eth_newFilter`. To specify a filter
object and get logs without creating a filter, use `eth_getLogs` .
Parameters
data - Filter ID.
Returns
array - Log objects.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": [
"0x5ace5de3985749b6a1b2b0d3f3e1fb69"
],
"id": 1
}
POST : eth_getLogs
Returns an array of logs matching a specified filter object.
Leave the --auto-log-bloom-caching-enabled command line option at the default value of true to improve log retrieval performance.
Attention
Using eth_getLogs to get the logs from a large range of blocks, especially an entire chain from its genesis block, can cause QI to hang and never return a response. We recommend splitting one large query into multiple ones for better performance.
Parameters
Object - Filter options object.
Returns
array - Log objects.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [
{
"fromBlock": "earliest",
"toBlock": "latest",
"address": "0x2e1f232a9439c3d459fceca0beef13acc8259dd8",
"topics": []
}
],
POST : eth_getMinerDataByBlockHash
Returns miner data for the specified block.
Parameters
data - 32 byte block hash.
Returns
result: object - Miner data.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getMinerDataByBlockHash",
"params": [
"0xbf137c3a7a1ebdfac21252765e5d7f40d115c2757e4a4abee929be88c624fdb7"
],
"id": 1
}
POST : eth_getMinerDataByBlockNumber
Returns miner data for the specified block.
Parameters
quantity|tag - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result: object - Miner data.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getMinerDataByBlockNumber",
"params": [
"0x7689D2"
],
"id": 1
}
POST : eth_getProof
Returns the account and storage values of the specified account, including the Merkle proof.
The API allows IoT devices or mobile apps which are unable to run light clients to verify responses from untrusted sources, by using a trusted block hash.
Parameters
DATA - 20-byte address of the account or contract.
ARRAY - Array of 32-byte storage keys to generate proofs for.
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result: Object - Account details:
  • balance:Quantity - Account balance.
  • codeHash:Data, 32-byte - Hash of the account code.
  • nonce:Quantity - Number of transactions sent from the account.
  • storageHash:Data, 32-byte - SHA3 of the storageRoot.
  • accountProof:Array - RLP-encoded Merkle tree nodes, starting with the stateRoot.
  • storageProof:Array- Storage entries. Each entry is an object that displays:
    • key:Quantity - Storage key.
    • value:Quantity - Storage value.
    • proof:Array - RLP-encoded Merkle tree nodes, starting with the storageHash.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0a8156e7ee392d885d10eaa86afd0e323afdcd95",
[
"0x0000000000000000000000000000000000000000000000000000000000000347"
],
"latest"
],
"id": 1
POST : eth_getStorageAt
Returns the value of a storage position at a specified address.
Parameters
DATA - A 20-byte storage address.
QUANTITY - Integer index of the storage position.
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result : DATA - The value at the specified storage position.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x3B3F3E",
"0x0",
"latest"
],
"id": 1
}
POST : eth_getTransactionByBlockHashAndIndex
Returns transaction information for the specified block hash and transaction index position.
Parameters
DATA - 32-byte hash of a block.
QUANTITY - Integer representing the transaction index position.
Returns
Object - Transaction object, or null when there is no transaction.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockHashAndIndex",
"params": [
"0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44",
"0x1"
],
"id": 1
}
POST : eth_getTransactionByBlockNumberAndIndex
Returns transaction information for the specified block number and transaction index position.
Parameters
QUANTITY|TAG - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
QUANTITY - The transaction index position.
Returns
Object - Transaction object, or null when there is no transaction.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [
"latest",
"0x0"
],
"id": 1
}
POST : eth_getTransactionByHash
Returns transaction information for the specified transaction hash.
Parameters
DATA - 32-byte transaction hash.
Returns
Object - Transaction object, or null when there is no transaction.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": [
"0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44"
],
"id": 1
}
POST : eth_getTransactionCount
Returns the number of transactions sent from a specified address. Use the pending tag to get the next account nonce not used by any pending transactions.
Parameters
data - 20-byte account address.
quantity|tag - Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result : quantity - Integer representing the number of transactions sent from the specified address.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0x9d8f8572f345e1ae53db1dFA4a7fce49B467bD7f",
"latest"
],
"id": 1
}
POST : eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash. Receipts for pending transactions are not available.
If you enabled revert reason, the receipt includes available revert reasons in the response.
Parameters
DATA - 32-byte hash of a transaction.
Returns
Object - Transaction receipt object, or null when there is no receipt.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": [
"0x96c6830efd87a70020d4d1647c93402d747c05ecf6beeb068dee621f8d13d8d1"
],
"id": 1
}
POST : eth_getUncleByBlockHashAndIndex
http://localhost:8545
Returns uncle specified by block hash and index.
Parameters
data - 32-byte block hash.
quantity - Index of the uncle.
Returns
result : Block object
note
Uncles do not contain individual transactions.
BODYraw
{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0xc48fb64230a82f65a08e7280bd8745e7fea87bc7c206309dee32209fe9a985f7",
"0x0"
],
"id": 1
}
POST : eth_getUncleByBlockNumberAndIndex
Returns uncle specified by block number and index.
Parameters
quantity|tag - Index of the block, or one of the string tags latest, earliest, or pending, as described in Block Parameter.
quantity - Index of the uncle.
Returns
result : Block object
note
Uncles do not contain individual transactions.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockNumberAndIndex",
"params": [
"0x7689D2",
"0x0"
],
"id": 1
}
POST : eth_getUncleCountByBlockHash
Returns the number of uncles in a block from a block matching the given block hash.
Parameters
DATA - 32-byte block hash.
Returns
result : QUANTITY - Integer representing the number of uncles in the specified block.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockHash",
"params": [
"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
],
"id": 1
}
POST : eth_getUncleCountByBlockNumber
Returns the number of uncles in a block matching the specified block number.
Parameters
QUANTITY|TAG - Integer representing either the index of the block within the blockchain, or one of the string tags latest, earliest, or pending, as described in Block Parameter.
Returns
result : QUANTITY - Integer representing the number of uncles in the specified block.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": [
"latest"
],
"id": 1
}
POST : eth_getWork
Returns the hash of the current block, the seed hash, and the required target boundary condition.
Parameters
None
Returns
result : Array with the following fields:
  • DATA, 32 Bytes - Hash of the current block header (pow-hash).
  • DATA, 32 Bytes - The seed hash used for the DAG.
  • DATA, 32 Bytes - The required target boundary condition: 2^256 / difficulty.
  • QUANTITY - Hexadecimal integer representing the current block number.
BODY
{
"jsonrpc": "2.0",
"method": "eth_getWork",
"params": [],
"id": 1
}
POST : eth_hashrate
Returns the number of hashes per second with which the node is mining.
When the stratum server is enabled, this method returns the cumulative hashrate of all sealers reporting their hashrate.
Parameters
None
Returns
result : quantity - Number of hashes per second.
BODY
{
"jsonrpc": "2.0",
"method": "eth_hashrate",
"params": [],
"id": 1
}
POST : eth_mining
Whether the client is actively mining new blocks. QI pauses mining while the client synchronizes with the network regardless of command settings or methods called.
Parameters
None
Returns
result (BOOLEAN) - true if the client is actively mining new blocks, otherwise false.
BODY
{
"jsonrpc": "2.0",
"method": "eth_mining",
"params": [],
"id": 1
}
POST : eth_newBlockFilter
Creates a filter to retrieve new block hashes. To poll for new blocks, use eth_getFilterChanges.
Parameters
None
Returns
data - Filter ID.
BODY
{
"jsonrpc": "2.0",
"method": "eth_newBlockFilter",
"params": [],
"id": 1
}
POST : eth_newFilter
Creates a log filter. To poll for logs associated with the created filter, use eth_getFilterChanges. To get all logs associated with the filter, use eth_getFilterLogs.
Parameters
Object - Filter options object.
note
fromBlock and toBlock in the filter options object default to latest.
Returns
data - Filter ID.
BODY
{
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [
{
"fromBlock": "earliest",
"toBlock": "latest",
"topics": []
}
],
"id": 1
POST : eth_newPendingTransactionFilter
Creates a filter to retrieve new pending transactions hashes. To poll for new pending transactions, use eth_getFilterChanges.
Parameters
None
Returns
data - Filter ID.
BODY
{
"jsonrpc": "2.0",
"method": "eth_newPendingTransactionFilter",
"params": [],
"id": 1
}
POST : eth_protocolVersion
Returns current QI protocol version.
Parameters
None
Returns
result : quantity - QI protocol version.
BODY
{
"jsonrpc": "2.0",
"method": "eth_protocolVersion",
"params": [],
"id": 1
}
POST : eth_sendRawTransaction
Sends a signed transaction. A transaction can send ether, deploy a contract, or interact with a contract. Set the maximum transaction fee for transactions using the --rpc-tx-feecap CLI option.
You can interact with contracts using [eth_sendRawTransaction or eth_call].
To avoid exposing your private key, create signed transactions offline and send the signed transaction data using eth_sendRawTransaction.
Parameters
data - Signed transaction serialized to hexadecimal format. For example:
params: ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"]
Returns
result : data - 32-byte transaction hash.
BODY
{
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": [
"0xf86a018203e882520894f17f52151ebef6c7334fad080c5704d77216b732896c6b935b8bbd400000801ba093129415f03b4794fd1512e79ee7f097e4271f66721020f8407aac92179893a5a0451b875d89721ec98be55201092980b0a87bb1c48507fccb86da713596b2a09e"
],
"id": 1
}
POST : eth_submitHashrate
Submits the mining hashrate.
Used by mining software such as Ethminer.
Parameters
  • DATA, 32 Bytes - Hexadecimal string representation of the hash rate.
  • DATA, 32 Bytes - Random hexadecimal ID identifying the client.
Returns
result: Boolean, true if submission is successful, otherwise false.
BODY
{
"jsonrpc": "2.0",
"method": "eth_submitHashrate",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000500000",
"0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c"
],
"id": 1
}
POST : eth_submitWork
http://localhost:8545
Submits a Proof of Work (Ethash) solution.
Used by mining software such as Ethminer.
Parameters
  • DATA, 8 Bytes - Retrieved nonce.
  • DATA, 32 Bytes - Hash of the block header (PoW-hash).
  • DATA, 32 Bytes - Mix digest.
Returns
result: Boolean, true if the provided solution is valid, otherwise false.
BODY
{
"jsonrpc": "2.0",
"method": "eth_submitWork",
"params": [
"0x0000000000000001",
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"0xD1GE5700000000000000000000000000D1GE5700000000000000000000000000"
],
"id": 1
}
POST : eth_syncing
Returns an object with data about the synchronization status, or false if not synchronizing.
Parameters
None
Returns
result : Object|Boolean - Object with synchronization status data or false if not synchronizing:
  • startingBlock : quantity - Index of the highest block on the blockchain when the network synchronization starts.
  • currentBlock : quantity - Index of the latest block (also known as the best block) for the current node. This is the same index that eth_blockNumber returns.
  • highestBlock: quantity - Index of the highest known block in the peer network (that is, the highest block so far discovered among peer nodes). This is the same value as currentBlock if the current node has no peers.
  • pulledStates: quantity - If fast synchronizing, the number of state entries fetched so far, or null if this is not known or not relevant. If full synchronizing or fully synchronized, this field is not returned.
  • knownStates: quantity - If fast synchronizing, the number of states the node knows of so far, or null if this is not known or not relevant. If full synchronizing or fully synchronized, this field is not returned.
BODY
{
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": [],
"id": 1
}
POST : eth_uninstallFilter
Uninstalls a filter with the specified ID. When a filter is no longer required, call this method.
Filters time out when not requested by eth_getFilterChanges or eth_getFilterLogs for 10 minutes.
Parameters
data - Filter ID.
Returns
Boolean - true if the filter was successfully uninstalled, otherwise false.
BODY
{
"jsonrpc": "2.0",
"method": "eth_uninstallFilter",
"params": [
"0x70355a0b574b437eaa19fe95adfedc0a"
],
"id": 1
}