EIP 1474: Remote procedure call specification
Author | Paul Bouchon |
---|---|
Discussions-To | https://ethereum-magicians.org/t/eip-remote-procedure-call-specification/1537 |
Status | Draft |
Type | Standards Track |
Category | Interface |
Created | 2018-10-02 |
Simple Summary
This proposal defines a standard set of remote procedure call methods that an Ethereum node should implement.
Abstract
Nodes created by the current generation of Ethereum clients expose inconsistent and incompatible remote procedure call (RPC) methods because no formal Ethereum RPC specification exists. This proposal standardizes such a specification to provide developers with a predictable Ethereum RPC interface regardless of underlying node implementation.
Specification
Concepts
RFC-2119
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC-2119.
JSON-RPC
Communication with Ethereum nodes is accomplished using JSON-RPC, a stateless, lightweight remote procedure call protocol that uses JSON as its data format. Ethereum RPC methods MUST be called using JSON-RPC request objects and MUST respond with JSON-RPC response objects.
Error codes
If an Ethereum RPC method encounters an error, the error
member included on the response object MUST be an object containing a code
member and descriptive message
member. The following list contains all possible error codes and associated messages:
Code | Message | Meaning | Category |
---|---|---|---|
-32700 | Parse error | Invalid JSON | standard |
-32600 | Invalid request | JSON is not a valid request object | standard |
-32601 | Method not found | Method does not exist | standard |
-32602 | Invalid params | Invalid method parameters | standard |
-32603 | Internal error | Internal JSON-RPC error | standard |
-32000 | Invalid input | Missing or invalid parameters | non-standard |
-32001 | Resource not found | Requested resource not found | non-standard |
-32002 | Resource unavailable | Requested resource not available | non-standard |
-32003 | Transaction rejected | Transaction creation failed | non-standard |
-32004 | Method not supported | Method is not implemented | non-standard |
Example error response:
{
"id": 1337
"jsonrpc": "2.0",
"error": {
"code": -32003,
"message": "Transaction rejected"
}
}
Value encoding
Specific types of values passed to and returned from Ethereum RPC methods require special encoding:
Quantity
- A
Quantity
value MUST be hex-encoded. - A
Quantity
value MUST be “0x”-prefixed. - A
Quantity
value MUST be expressed using the fewest possible hex digits per byte. - A
Quantity
value MUST express zero as “0x0”.
Examples Quantity
values:
Value | Valid | Reason |
---|---|---|
0x | invalid |
empty not a valid quantity |
0x0 | valid |
interpreted as a quantity of zero |
0x00 | invalid |
leading zeroes not allowed |
0x41 | valid |
interpreted as a quantity of 65 |
0x400 | valid |
interpreted as a quantity of 1024 |
0x0400 | invalid |
leading zeroes not allowed |
ff | invalid |
values must be prefixed |
Data
- A
Data
value MUST be hex-encoded. - A
Data
value MUST be “0x”-prefixed. - A
Data
value MUST be expressed using two hex digits per byte.
Examples Data
values:
Value | Valid | Reason |
---|---|---|
0x | valid |
interpreted as empty data |
0x0 | invalid |
each byte must be represented using two hex digits |
0x00 | valid |
interpreted as a single zero byte |
0x41 | true |
interpreted as a data value of 65 |
0x004200 | true |
interpreted as a data value of 16896 |
0xf0f0f | false |
bytes require two hex digits |
004200 | false |
values must be prefixed |
Proposing changes
New Ethereum RPC methods and changes to existing methods MUST be proposed via the traditional EIP process. This allows for community consensus around new method implementations and proposed method modifications. RPC method proposals MUST reach “draft” status before being added to this proposal and the official Ethereum RPC specification defined herein.
Methods
web3_clientVersion
#### Description
Returns the version of the current client
#### Parameters
_(none)_
#### Returns
{`string`} - client version
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "web3_clientVersion",
"params": [],
}' web3_sha3
#### Description
Hashes data using the Keccak-256 algorithm
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|data to hash|
#### Returns
{[`Data`](#data)} - Keccak-256 hash of the given data
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "web3_sha3",
"params": ["0x68656c6c6f20776f726c64"]
}' net_listening
#### Description
Determines if this client is listening for new network connections
#### Parameters
_(none)_
#### Returns
{`boolean`} - `true` if listening is active or `false` if listening is not active
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "net_listening",
"params": []
}' net_peerCount
#### Description
Returns the number of peers currently connected to this client
#### Parameters
_(none)_
#### Returns
{[`Quantity`](#quantity)} - number of connected peers
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "net_peerCount",
"params": []
}' net_version
#### Description
Returns the chain ID associated with the current network
#### Parameters
_(none)_
#### Returns
{`string`} - chain ID associated with the current network
Common chain IDs:
- `"1"` - Ethereum mainnet
- `"3"` - Ropsten testnet
- `"4"` - Rinkeby testnet
- `"42"` - Kovan testnet
**Note:** See EIP-155 for a [complete list](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md#list-of-chain-ids) of possible chain IDs.
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337
"jsonrpc": "2.0",
"method": "net_version",
"params": [],
}' eth_accounts
#### Description
Returns a list of addresses owned by this client
#### Parameters
_(none)_
#### Returns
{[`Data[]`](#data)} - array of addresses
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_accounts",
"params": []
}' eth_blockNumber
#### Description
Returns the number of the most recent block seen by this client
#### Parameters
_(none)_
#### Returns
{[`Quantity`](#quantity)} - number of the latest block
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": []
}' eth_call
#### Description
Executes a new message call immediately without submitting a transaction to the network
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{`object`}|@property {[`Data`](#data)} `[from]` - transaction sender@property {[`Data`](#data)} `to` - transaction recipient or `null` if deploying a contract
@property {[`Quantity`](#quantity)} `[gas]` - gas provided for transaction execution
@property {[`Quantity`](#quantity)} `[gasPrice]` - price in wei of each gas used
@property {[`Quantity`](#quantity)} `[value]` - value in wei sent with this transaction
@property {[`Data`](#data)} `[data]` - contract code or a hashed method call with encoded args| |2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| #### Returns {[`Data`](#data)} - return value of executed contract #### Example ```sh # Request curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", "method": "eth_call", "params": [{ "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a" }] }'
eth_coinbase
#### Description
Returns the coinbase address for this client
#### Parameters
_(none)_
#### Returns
{[`Data`](#data)} - coinbase address
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_coinbase",
"params": []
}' eth_estimateGas
#### Description
Estimates the gas necessary to complete a transaction without submitting it to the network
**Note:** The resulting gas estimation may be significantly more than the amount of gas actually used by the transaction. This is due to a variety of reasons including EVM mechanics and node performance.
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{`object`}|@property {[`Data`](#data)} `[from]` - transaction sender@property {[`Data`](#data)} `[to]` - transaction recipient
@property {[`Quantity`](#quantity)} `[gas]` - gas provided for transaction execution
@property {[`Quantity`](#quantity)} `[gasPrice]` - price in wei of each gas used
@property {[`Quantity`](#quantity)} `[value]` - value in wei sent with this transaction
@property {[`Data`](#data)} `[data]` - contract code or a hashed method call with encoded args| |2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| #### Returns {[`Quantity`](#quantity)} - amount of gas required by transaction #### Example ```sh # Request curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [{ "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a" }] }'
eth_gasPrice
#### Description
Returns the current price of gas expressed in wei
#### Parameters
_(none)_
#### Returns
{[`Quantity`](#quantity)} - current gas price in wei
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": []
}' eth_getBalance
#### Description
Returns the balance of an address in wei
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|address to query for balance|
|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
#### Returns
{[`Quantity`](#quantity)} - balance of the provided account in wei
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"]
}' eth_getBlockByHash
#### Description
Returns information about a block specified by hash
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|hash of a block|
|2|{`boolean`}|`true` will pull full transaction objects, `false` will pull transaction hashes|
#### Returns
{`null|object`} - `null` if no block is found, otherwise a block object with the following members:
- {[`Data`](#data)} `extraData` - "extra data" field of this block
- {[`Data`](#data)} `hash` - block hash or `null` if pending
- {[`Data`](#data)} `logsBloom` - logs bloom filter or `null` if pending
- {[`Data`](#data)} `miner` - address that received this block's mining rewards
- {[`Data`](#data)} `nonce` - proof-of-work hash or `null` if pending
- {[`Data`](#data)} `parentHash` - parent block hash
- {[`Data`](#data)} `receiptsRoot` -root of the this block's receipts trie
- {[`Data`](#data)} `sha3Uncles` - SHA3 of the uncles data in this block
- {[`Data`](#data)} `stateRoot` - root of this block's final state trie
- {[`Data`](#data)} `transactionsRoot` - root of this block's transaction trie
- {[`Quantity`](#quantity)} `difficulty` - difficulty for this block
- {[`Quantity`](#quantity)} `gasLimit` - maximum gas allowed in this block
- {[`Quantity`](#quantity)} `gasUsed` - total used gas by all transactions in this block
- {[`Quantity`](#quantity)} `number` - block number or `null` if pending
- {[`Quantity`](#quantity)} `size` - size of this block in bytes
- {[`Quantity`](#quantity)} `timestamp` - unix timestamp of when this block was collated
- {[`Quantity`](#quantity)} `totalDifficulty` - total difficulty of the chain until this block
- {`Arrayeth_getBlockByNumber
#### Description
Returns information about a block specified by number
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
|2|{`boolean`}|`true` will pull full transaction objects, `false` will pull transaction hashes|
#### Returns
{`null|object`} - `null` if no block is found, otherwise a block object with the following members:
- {[`Data`](#data)} `extraData` - "extra data" field of this block
- {[`Data`](#data)} `hash` - block hash or `null` if pending
- {[`Data`](#data)} `logsBloom` - logs bloom filter or `null` if pending
- {[`Data`](#data)} `miner` - address that received this block's mining rewards
- {[`Data`](#data)} `nonce` - proof-of-work hash or `null` if pending
- {[`Data`](#data)} `parentHash` - parent block hash
- {[`Data`](#data)} `receiptsRoot` -root of the this block's receipts trie
- {[`Data`](#data)} `sha3Uncles` - SHA3 of the uncles data in this block
- {[`Data`](#data)} `stateRoot` - root of this block's final state trie
- {[`Data`](#data)} `transactionsRoot` - root of this block's transaction trie
- {[`Quantity`](#quantity)} `difficulty` - difficulty for this block
- {[`Quantity`](#quantity)} `gasLimit` - maximum gas allowed in this block
- {[`Quantity`](#quantity)} `gasUsed` - total used gas by all transactions in this block
- {[`Quantity`](#quantity)} `number` - block number or `null` if pending
- {[`Quantity`](#quantity)} `size` - size of this block in bytes
- {[`Quantity`](#quantity)} `timestamp` - unix timestamp of when this block was collated
- {[`Quantity`](#quantity)} `totalDifficulty` - total difficulty of the chain until this block
- {`Arrayeth_getBlockTransactionCountByHash
#### Description
Returns the number of transactions in a block specified by block hash
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|hash of a block|
#### Returns
{[`Quantity`](#quantity)} - number of transactions in the specified block
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByHash",
"params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f"]
}' eth_getBlockTransactionCountByNumber
#### Description
Returns the number of transactions in a block specified by block number
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
#### Returns
{[`Quantity`](#quantity)} - number of transactions in the specified block
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getBlockTransactionCountByNumber",
"params": ["0xe8"]
}' eth_getCode
#### Description
Returns the contract code stored at a given address
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|address to query for code|
|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
#### Returns
{[`Data`](#data)} - code from the specified address
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getCode",
"params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"]
}' eth_getFilterChanges
#### Description
Returns a list of all logs based on filter ID since the last log retrieval
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Quantity`](#quantity)}|ID of the filter|
#### Returns
{`Arrayeth_getFilterLogs
#### Description
Returns a list of all logs based on filter ID
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Quantity`](#quantity)}|ID of the filter|
#### Returns
{`Arrayeth_getLogs
#### Description
Returns a list of all logs based on a filter object
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{`object`}|@property {[`Quantity`](#quantity)\|`string`} `[fromBlock]` - block number, or one of `"latest"`, `"earliest"` or `"pending"`@property {[`Quantity`](#quantity)\|`string`} `[toBlock]` - block number, or one of `"latest"`, `"earliest"` or `"pending"`
@property {[`Data`](#data)\|[`Data[]`](#data)} `[address]` - contract address or a list of addresses from which logs should originate
@property {[`Data[]`](#data)} `[topics]` - list of order-dependent topics
@property {[`Data`](#data)} `[blockhash]` - restrict logs to a block by hash| **Note:** If `blockhash` is passed, neither `fromBlock` nor `toBlock` are allowed or respected. #### Returns {`Array
eth_getStorageAt
#### Description
Returns the value from a storage position at an address
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|address of stored data|
|2|{[`Quantity`](#quantity)}|index into stored data|
|3|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
#### Returns
{[`Data`](#data)} - value stored at the given address and data index
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"]
}' eth_getTransactionByBlockHashAndIndex
#### Description
Returns information about a transaction specified by block hash and transaction index
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|hash of a block|
|2|{[`Quantity`](#quantity)}|index of a transaction in the specified block|
#### Returns
{`null|object`} - `null` if no transaction is found, otherwise a transaction object with the following members:
- {[`Data`](#data)} `r` - ECDSA signature r
- {[`Data`](#data)} `s` - ECDSA signature s
- {[`Data`](#data)} `blockHash` - hash of block containing this transaction or `null` if pending
- {[`Data`](#data)} `from` - transaction sender
- {[`Data`](#data)} `hash` - hash of this transaction
- {[`Data`](#data)} `input` - contract code or a hashed method call
- {[`Data`](#data)} `to` - transaction recipient or `null` if deploying a contract
- {[`Quantity`](#quantity)} `v` - ECDSA recovery ID
- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this transaction or `null` if pending
- {[`Quantity`](#quantity)} `gas` - gas provided for transaction execution
- {[`Quantity`](#quantity)} `gasPrice` - price in wei of each gas used
- {[`Quantity`](#quantity)} `nonce` - unique number identifying this transaction
- {[`Quantity`](#quantity)} `transactionIndex` - index of this transaction in the block or `null` if pending
- {[`Quantity`](#quantity)} `value` - value in wei sent with this transaction
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockHashAndIndex",
"params":["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "0x0"]
}' eth_getTransactionByBlockNumberAndIndex
#### Description
Returns information about a transaction specified by block number and transaction index
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
|2|{[`Quantity`](#quantity)}|index of a transaction in the specified block|
#### Returns
{`null|object`} - `null` if no transaction is found, otherwise a transaction object with the following members:
- {[`Data`](#data)} `r` - ECDSA signature r
- {[`Data`](#data)} `s` - ECDSA signature s
- {[`Data`](#data)} `blockHash` - hash of block containing this transaction or `null` if pending
- {[`Data`](#data)} `from` - transaction sender
- {[`Data`](#data)} `hash` - hash of this transaction
- {[`Data`](#data)} `input` - contract code or a hashed method call
- {[`Data`](#data)} `to` - transaction recipient or `null` if deploying a contract
- {[`Quantity`](#quantity)} `v` - ECDSA recovery ID
- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this transaction or `null` if pending
- {[`Quantity`](#quantity)} `gas` - gas provided for transaction execution
- {[`Quantity`](#quantity)} `gasPrice` - price in wei of each gas used
- {[`Quantity`](#quantity)} `nonce` - unique number identifying this transaction
- {[`Quantity`](#quantity)} `transactionIndex` - index of this transaction in the block or `null` if pending
- {[`Quantity`](#quantity)} `value` - value in wei sent with this transaction
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockNumberAndIndex",
"params":["0x29c", "0x0"]
}' eth_getTransactionByHash
#### Description
Returns information about a transaction specified by hash
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|hash of a transaction|
#### Returns
{`null|object`} - `null` if no transaction is found, otherwise a transaction object with the following members:
- {[`Data`](#data)} `r` - ECDSA signature r
- {[`Data`](#data)} `s` - ECDSA signature s
- {[`Data`](#data)} `blockHash` - hash of block containing this transaction or `null` if pending
- {[`Data`](#data)} `from` - transaction sender
- {[`Data`](#data)} `hash` - hash of this transaction
- {[`Data`](#data)} `input` - contract code or a hashed method call
- {[`Data`](#data)} `to` - transaction recipient or `null` if deploying a contract
- {[`Quantity`](#quantity)} `v` - ECDSA recovery ID
- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this transaction or `null` if pending
- {[`Quantity`](#quantity)} `gas` - gas provided for transaction execution
- {[`Quantity`](#quantity)} `gasPrice` - price in wei of each gas used
- {[`Quantity`](#quantity)} `nonce` - unique number identifying this transaction
- {[`Quantity`](#quantity)} `transactionIndex` - index of this transaction in the block or `null` if pending
- {[`Quantity`](#quantity)} `value` - value in wei sent with this transaction
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"]
}' eth_getTransactionCount
#### Description
Returns the number of transactions sent from an address
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|address to query for sent transactions|
|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
#### Returns
{[`Quantity`](#quantity)} - number of transactions sent from the specified address
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"]
}' eth_getTransactionReceipt
#### Description
Returns the receipt of a transaction specified by hash
**Note:** Transaction receipts are unavailable for pending transactions.
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|hash of a transaction|
#### Returns
{`null|object`} - `null` if no transaction is found, otherwise a transaction receipt object with the following members:
- {[`Data`](#data)} `blockHash` - hash of block containing this transaction
- {[`Data`](#data)} `contractAddress` - address of new contract or `null` if no contract was created
- {[`Data`](#data)} `from` - transaction sender
- {[`Data`](#data)} `logsBloom` - logs bloom filter
- {[`Data`](#data)} `to` - transaction recipient or `null` if deploying a contract
- {[`Data`](#data)} `transactionHash` - hash of this transaction
- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this transaction
- {[`Quantity`](#quantity)} `cumulativeGasUsed` - gas used by this and all preceding transactions in this block
- {[`Quantity`](#quantity)} `gasUsed` - gas used by this transaction
- {[`Quantity`](#quantity)} `status` - `1` if this transaction was successful or `0` if it failed
- {[`Quantity`](#quantity)} `transactionIndex` - index of this transaction in the block
- {`Arrayeth_getUncleByBlockHashAndIndex
#### Description
Returns information about an uncle specified by block hash and uncle index position
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|hash of a block|
|2|{[`Quantity`](#quantity)}|index of uncle|
#### Returns
{`null|object`} - `null` if no block or uncle is found, otherwise an uncle object with the following members:
- {[`Data`](#data)} `extraData` - "extra data" field of this block
- {[`Data`](#data)} `hash` - block hash or `null` if pending
- {[`Data`](#data)} `logsBloom` - logs bloom filter or `null` if pending
- {[`Data`](#data)} `miner` - address that received this block's mining rewards
- {[`Data`](#data)} `nonce` - proof-of-work hash or `null` if pending
- {[`Data`](#data)} `parentHash` - parent block hash
- {[`Data`](#data)} `receiptsRoot` -root of the this block's receipts trie
- {[`Data`](#data)} `sha3Uncles` - SHA3 of the uncles data in this block
- {[`Data`](#data)} `stateRoot` - root of this block's final state trie
- {[`Data`](#data)} `transactionsRoot` - root of this block's transaction trie
- {[`Quantity`](#quantity)} `difficulty` - difficulty for this block
- {[`Quantity`](#quantity)} `gasLimit` - maximum gas allowed in this block
- {[`Quantity`](#quantity)} `gasUsed` - total used gas by all transactions in this block
- {[`Quantity`](#quantity)} `number` - block number or `null` if pending
- {[`Quantity`](#quantity)} `size` - size of this block in bytes
- {[`Quantity`](#quantity)} `timestamp` - unix timestamp of when this block was collated
- {[`Quantity`](#quantity)} `totalDifficulty` - total difficulty of the chain until this block
- {`Arrayeth_getUncleByBlockNumberAndIndex
#### Description
Returns information about an uncle specified by block number and uncle index position
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
|2|{[`Quantity`](#quantity)}|index of uncle|
#### Returns
{`null|object`} - `null` if no block or uncle is found, otherwise an uncle object with the following members:
- {[`Data`](#data)} `extraData` - "extra data" field of this block
- {[`Data`](#data)} `hash` - block hash or `null` if pending
- {[`Data`](#data)} `logsBloom` - logs bloom filter or `null` if pending
- {[`Data`](#data)} `miner` - address that received this block's mining rewards
- {[`Data`](#data)} `nonce` - proof-of-work hash or `null` if pending
- {[`Data`](#data)} `parentHash` - parent block hash
- {[`Data`](#data)} `receiptsRoot` -root of the this block's receipts trie
- {[`Data`](#data)} `sha3Uncles` - SHA3 of the uncles data in this block
- {[`Data`](#data)} `stateRoot` - root of this block's final state trie
- {[`Data`](#data)} `transactionsRoot` - root of this block's transaction trie
- {[`Quantity`](#quantity)} `difficulty` - difficulty for this block
- {[`Quantity`](#quantity)} `gasLimit` - maximum gas allowed in this block
- {[`Quantity`](#quantity)} `gasUsed` - total used gas by all transactions in this block
- {[`Quantity`](#quantity)} `number` - block number or `null` if pending
- {[`Quantity`](#quantity)} `size` - size of this block in bytes
- {[`Quantity`](#quantity)} `timestamp` - unix timestamp of when this block was collated
- {[`Quantity`](#quantity)} `totalDifficulty` - total difficulty of the chain until this block
- {`Arrayeth_getUncleCountByBlockHash
#### Description
Returns the number of uncles in a block specified by block hash
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|hash of a block|
#### Returns
{[`Quantity`](#quantity)} - number of uncles in the specified block
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockHash",
"params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f"]
}' eth_getUncleCountByBlockNumber
#### Description
Returns the number of uncles in a block specified by block number
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`|
#### Returns
{[`Quantity`](#quantity)} - number of uncles in the specified block
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getUncleCountByBlockNumber",
"params": ["0xe8"]
}' eth_getWork
#### Description
Returns a list containing relevant information for proof-of-work
#### Parameters
_none_
#### Returns
{[`Data[]`](#data)} - array with the following items:
1. {[`Data`](#data)} - current block header pow-hash
1. {[`Data`](#data)} - seed hash used for the DAG
1. {[`Data`](#data)} - boundary condition ("target"), 2^256 / difficulty
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_getWork",
"params": []
}' eth_hashrate
#### Description
Returns the number of hashes-per-second this node is mining at
#### Parameters
_(none)_
#### Returns
{[`Quantity`](#quantity)} - number of hashes-per-second
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_hashrate",
"params": []
}' eth_mining
#### Description
Determines if this client is mining new blocks
#### Parameters
_(none)_
#### Returns
{`boolean`} - `true` if this client is mining or `false` if it is not mining
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_mining",
"params": []
}' eth_newBlockFilter
#### Description
Creates a filter to listen for new blocks that can be used with `eth_getFilterChanges`
#### Parameters
_none_
#### Returns
{[`Quantity`](#quantity)} - ID of the newly-created filter that can be used with `eth_getFilterChanges`
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337
"jsonrpc": "2.0",
"method": "eth_newBlockFilter",
"params": []
}' eth_newFilter
#### Description
Creates a filter to listen for specific state changes that can then be used with `eth_getFilterChanges`
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{`object`}|@property {[`Quantity`](#quantity)\|`string`} `[fromBlock]` - block number, or one of `"latest"`, `"earliest"` or `"pending"`@property {[`Quantity`](#quantity)\|`string`} `[toBlock]` - block number, or one of `"latest"`, `"earliest"` or `"pending"`
@property {[`Data`](#data)\|[`Data[]`](#data)} `[address]` - contract address or a list of addresses from which logs should originate
@property {[`Data[]`](#data)} `[topics]` - list of order-dependent topics| **Note:** 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)" #### Returns {[`Quantity`](#quantity)} - ID of the newly-created filter that can be used with `eth_getFilterChanges` #### Example ```sh # Request curl -X POST --data '{ "id": 1337 "jsonrpc": "2.0", "method": "eth_newFilter", "params": [{ "topics": ["0x0000000000000000000000000000000000000000000000000000000012341234"] }] }'
eth_newPendingTransactionFilter
#### Description
Creates a filter to listen for new pending transactions that can be used with `eth_getFilterChanges`
#### Parameters
_none_
#### Returns
{[`Quantity`](#quantity)} - ID of the newly-created filter that can be used with `eth_getFilterChanges`
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337
"jsonrpc": "2.0",
"method": "eth_newPendingTransactionFilter",
"params": []
}' eth_protocolVersion
#### Description
Returns the current Ethereum protocol version
#### Parameters
_(none)_
#### Returns
{`string`} - current Ethereum protocol version
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_protocolVersion",
"params": []
}' eth_sendRawTransaction
#### Description
Sends and already-signed transaction to the network
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|signed transaction data|
#### Returns
{[`Data`](#data)} - transaction hash, or the zero hash if the transaction is not yet available
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"]
}' eth_sendTransaction
#### Description
Creates, signs, and sends a new transaction to the network
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{`object`}|@property {[`Data`](#data)} `from` - transaction sender@property {[`Data`](#data)} `[to]` - transaction recipient
@property {[`Quantity`](#quantity)} `[gas="0x15f90"]` - gas provided for transaction execution
@property {[`Quantity`](#quantity)} `[gasPrice]` - price in wei of each gas used
@property {[`Quantity`](#quantity)} `[value]` - value in wei sent with this transaction
@property {[`Data`](#data)} `[data]` - contract code or a hashed method call with encoded args
@property {[`Quantity`](#quantity)} `[nonce]` - unique number identifying this transaction| #### Returns {[`Data`](#data)} - transaction hash, or the zero hash if the transaction is not yet available #### Example ```sh # Request curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", "method": "eth_sendTransaction", "params": [{ "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a" }] }'
eth_sign
#### Description
Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{[`Data`](#data)}|address to use for signing|
|2|{[`Data`](#data)}|data to sign|
#### Returns
{[`Data`](#data)} - signature hash of the provided data
#### Example
```sh
# Request
curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_sign",
"params": ["0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "0xdeadbeaf"]
}' eth_signTransaction
#### Description
Signs a transaction that can be submitted to the network at a later time using with `eth_sendRawTransaction`
#### Parameters
|#|Type|Description|
|-|-|-|
|1|{`object`}|@property {[`Data`](#data)} `from` - transaction sender@property {[`Data`](#data)} `[to]` - transaction recipient
@property {[`Quantity`](#quantity)} `[gas="0x15f90"]` - gas provided for transaction execution
@property {[`Quantity`](#quantity)} `[gasPrice]` - price in wei of each gas used
@property {[`Quantity`](#quantity)} `[value]` - value in wei sent with this transaction
@property {[`Data`](#data)} `[data]` - contract code or a hashed method call with encoded args
@property {[`Quantity`](#quantity)} `[nonce]` - unique number identifying this transaction| #### Returns {[`Data`](#data)} - signature hash of the transaction object #### Example ```sh # Request curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", "method": "eth_signTransaction", "params": [{ "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", "gas": "0x76c0", "gasPrice": "0x9184e72a000", "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", "value": "0x9184e72a" }] }'