From cb184d6f0ae00480cec77b859fb788fc470b63d3 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Mon, 8 Oct 2018 11:36:13 -0400 Subject: [PATCH] EIP-RPC: add undocumented eth_signTransaction method and alphabetize methods --- EIPS/eip-rpc.md | 1456 ++++++++++++++++++++++++----------------------- 1 file changed, 751 insertions(+), 705 deletions(-) diff --git a/EIPS/eip-rpc.md b/EIPS/eip-rpc.md index c386d77714a8e..120b8959c5946 100644 --- a/EIPS/eip-rpc.md +++ b/EIPS/eip-rpc.md @@ -177,51 +177,6 @@ curl -X POST --data '{ --- -
-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": [], -}' - -# Response -{ - "id": 1337, - "jsonrpc": "2.0", - "result": "3" -} -``` ---- -
-
net_listening @@ -294,11 +249,11 @@ curl -X POST --data '{
-eth_protocolVersion +net_version #### Description -Returns the current Ethereum protocol version +Returns the chain ID associated with the current network #### Parameters @@ -306,78 +261,44 @@ _(none)_ #### Returns -{`string`} - current Ethereum protocol version - -#### Example -```sh -# Request -curl -X POST --data '{ - "id": 1337, - "jsonrpc": "2.0", - "method": "eth_protocolVersion", - "params": [] -}' - -# Response -{ - "id": 1337, - "jsonrpc": "2.0", - "result": "54" -} -``` ---- -
- -
-eth_syncing - -#### Description - -Returns information about the status of this client's network synchronization - -#### Parameters - -_(none)_ +{`string`} - chain ID associated with the current network -#### Returns +Common chain IDs: -{`boolean|object`} - `false` if this client is not syncing with the network, otherwise an object with the following members: +- `"1"` - Ethereum mainnet +- `"3"` - Ropsten testnet +- `"4"` - Rinkeby testnet +- `"42"` - Kovan testnet -- {[`Quantity`](#quantity)} `currentBlock` - number of the most-recent block synced -- {[`Quantity`](#quantity)} `highestBlock` - number of latest block on the network -- {[`Quantity`](#quantity)} `startingBlock` - block number at which syncing started +**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, + "id": 1337 "jsonrpc": "2.0", - "method": "eth_syncing", - "params": [] + "method": "net_version", + "params": [], }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": { - "currentBlock": '0x386', - "highestBlock": '0x454', - "startingBlock": '0x384' - } + "result": "3" } ``` ---
-eth_coinbase +eth_accounts #### Description -Returns the coinbase address for this client +Returns a list of addresses owned by this client #### Parameters @@ -385,7 +306,7 @@ _(none)_ #### Returns -{[`Data`](#data)} - coinbase address +{[`Data[]`](#data)} - array of addresses #### Example @@ -394,7 +315,7 @@ _(none)_ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_coinbase", + "method": "eth_accounts", "params": [] }' @@ -402,18 +323,18 @@ curl -X POST --data '{ { "id": 1337, "jsonrpc": "2.0", - "result": "0xc94770007dda54cF92009BFF0dE90c06F603a09f" + "result": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f"] } ``` ---
-eth_mining +eth_blockNumber #### Description -Determines if this client is mining new blocks +Returns the number of the most recent block seen by this client #### Parameters @@ -421,7 +342,7 @@ _(none)_ #### Returns -{`boolean`} - `true` if this client is mining or `false` if it is not mining +{[`Quantity`](#quantity)} - number of the latest block #### Example @@ -430,7 +351,7 @@ _(none)_ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_mining", + "method": "eth_blockNumber", "params": [] }' @@ -438,26 +359,29 @@ curl -X POST --data '{ { "id": 1337, "jsonrpc": "2.0", - "result": true + "result": "0xc94" } ``` ---
-eth_hashrate +eth_call #### Description -Returns the number of hashes-per-second this node is mining at +Executes a new message call immediately without submitting a transaction to the network #### Parameters -_(none)_ +|#|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 -{[`Quantity`](#quantity)} - number of hashes-per-second +{[`Data`](#data)} - return value of executed contract #### Example @@ -466,26 +390,33 @@ _(none)_ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_hashrate", - "params": [] + "method": "eth_call", + "params": [{ + "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", + "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", + "value": "0x9184e72a" + }] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0x38a" + "result": "0x" } ``` ---
-eth_gasPrice +eth_coinbase #### Description -Returns the current price of gas expressed in wei +Returns the coinbase address for this client #### Parameters @@ -493,7 +424,7 @@ _(none)_ #### Returns -{[`Quantity`](#quantity)} - current gas price in wei +{[`Data`](#data)} - coinbase address #### Example @@ -502,7 +433,7 @@ _(none)_ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_gasPrice", + "method": "eth_coinbase", "params": [] }' @@ -510,26 +441,31 @@ curl -X POST --data '{ { "id": 1337, "jsonrpc": "2.0", - "result": "0x09184e72a000" + "result": "0xc94770007dda54cF92009BFF0dE90c06F603a09f" } ``` ---
-eth_accounts +eth_estimateGas #### Description -Returns a list of addresses owned by this client +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 -_(none)_ +|#|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 -{[`Data[]`](#data)} - array of addresses +{[`Quantity`](#quantity)} - amount of gas required by transaction #### Example @@ -538,26 +474,33 @@ _(none)_ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_accounts", - "params": [] + "method": "eth_estimateGas", + "params": [{ + "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", + "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", + "value": "0x9184e72a" + }] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f"] + "result": "0x5208" } ``` ---
-eth_blockNumber +eth_gasPrice #### Description -Returns the number of the most recent block seen by this client +Returns the current price of gas expressed in wei #### Parameters @@ -565,7 +508,7 @@ _(none)_ #### Returns -{[`Quantity`](#quantity)} - number of the latest block +{[`Quantity`](#quantity)} - current gas price in wei #### Example @@ -574,7 +517,7 @@ _(none)_ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_blockNumber", + "method": "eth_gasPrice", "params": [] }' @@ -582,7 +525,7 @@ curl -X POST --data '{ { "id": 1337, "jsonrpc": "2.0", - "result": "0xc94" + "result": "0x09184e72a000" } ``` --- @@ -628,23 +571,42 @@ curl -X POST --data '{
-eth_getStorageAt +eth_getBlockByHash #### Description -Returns the value from a storage position at an address +Returns information about a block specified by hash #### 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"`| +|1|{[`Data`](#data)}|hash of a block| +|2|{`boolean`}|`true` will pull full transaction objects, `false` will pull transaction hashes| #### Returns -{[`Data`](#data)} - value stored at the given address and data index +{`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 +- {`Array`} `transactions` - list of transaction objects or hashes +- {`Array`} `uncles` - list of uncle hashes #### Example @@ -653,37 +615,76 @@ Returns the value from a storage position at an address curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getStorageAt", - "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"] + "method": "eth_getBlockByHash", + "params":["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" + "result": { + "difficulty": "0x027f07", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x9f759", + "gasUsed": "0x9f759", + "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", + "logsBloom": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", + "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", + "nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2", + "number": "0x1b4", + "parentHash": "0x9646252be9520f6e71339a8df9c55e4d7619deeb018d2a3f2d21fc165dde5eb5", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "size": "0x027f07", + "stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff", + "timestamp": "0x54e34e8e" + "totalDifficulty": "0x027f07", + "transactions": [] + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncles": ["0x1606e5...", "0xd5145a9..."] + } } ``` ---
-eth_getTransactionCount +eth_getBlockByNumber #### Description -Returns the number of transactions sent from an address +Returns information about a block specified by number #### 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"`| +|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 -{[`Quantity`](#quantity)} - number of transactions sent from the specified address +{`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 +- {`Array`} `transactions` - list of transaction objects or hashes +- {`Array`} `uncles` - list of uncle hashes #### Example @@ -692,15 +693,34 @@ Returns the number of transactions sent from an address curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getTransactionCount", - "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"] + "method": "eth_getBlockByNumber", + "params":["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0x1" + "result": { + "difficulty": "0x027f07", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x9f759", + "gasUsed": "0x9f759", + "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", + "logsBloom": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", + "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", + "nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2", + "number": "0x1b4", + "parentHash": "0x9646252be9520f6e71339a8df9c55e4d7619deeb018d2a3f2d21fc165dde5eb5", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "size": "0x027f07", + "stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff", + "timestamp": "0x54e34e8e" + "totalDifficulty": "0x027f07", + "transactions": [] + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncles": ["0x1606e5...", "0xd5145a9..."] + } } ``` --- @@ -783,21 +803,22 @@ curl -X POST --data '{
-eth_getUncleCountByBlockHash +eth_getCode #### Description -Returns the number of uncles in a block specified by block hash +Returns the contract code stored at a given address #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|hash of a block| +|1|{[`Data`](#data)}|address to query for code| +|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| #### Returns -{[`Quantity`](#quantity)} - number of uncles in the specified block +{[`Data`](#data)} - code from the specified address #### Example @@ -806,36 +827,48 @@ Returns the number of uncles in a block specified by block hash curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getUncleCountByBlockHash", - "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f"] + "method": "eth_getCode", + "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0xc" + "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" } ``` ---
-eth_getUncleCountByBlockNumber +eth_getFilterChanges #### Description -Returns the number of uncles in a block specified by block number +Returns a list of all logs based on filter ID since the last log retrieval #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| +|1|{[`Quantity`](#quantity)}|ID of the filter| #### Returns -{[`Quantity`](#quantity)} - number of uncles in the specified block +{`Array`} - array of log objects with the following members: + +- {[`Data`](#data)} `address` - address from which this log originated +- {[`Data`](#data)} `blockHash` - hash of block containing this log or `null` if pending +- {[`Data`](#data)} `data` - contains the non-indexed arguments of the log +- {[`Data`](#data)} `transactionHash` - hash of the transaction that created this log or `null` if pending +- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this log or `null` if pending +- {[`Quantity`](#quantity)} `logIndex` - index of this log within its block or `null` if pending +- {[`Quantity`](#quantity)} `transactionIndex` - index of the transaction that created this log or `null` if pending +- {[`Data[]`](#data)} `topics` - list of order-dependent topics +- {`boolean`} `removed` - `true` if this filter has been destroyed and is invalid + +**Note:** The return value of `eth_getFilterChanges` when retrieving logs from `eth_newBlockFilter` and `eth_newPendingTransactionFilter` filters will be an array of hashes, not an array of Log objects. #### Example @@ -844,37 +877,57 @@ Returns the number of uncles in a block specified by block number curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getUncleCountByBlockNumber", - "params": ["0xe8"] + "method": "eth_getFilterChanges", + "params": ["0x16"] }' # Response { - "id": 1337, - "jsonrpc": "2.0", - "result": "0x1" + "id": 1337, + "jsonrpc": "2.0", + "result": [{ + "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", + "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", + "blockNumber":"0x1b4", + "data":"0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x1", + "topics": [], + "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", + "transactionIndex": "0x0" + }] } ``` ---
-eth_getCode +eth_getFilterLogs #### Description -Returns the contract code stored at a given address +Returns a list of all logs based on filter ID #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|address to query for code| -|2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| +|1|{[`Quantity`](#quantity)}|ID of the filter| #### Returns -{[`Data`](#data)} - code from the specified address +{`Array`} - array of log objects with the following members: + +- {[`Data`](#data)} address - address from which this log originated +- {[`Data`](#data)} blockHash - hash of block containing this log or `null` if pending +- {[`Data`](#data)} data - contains the non-indexed arguments of the log +- {[`Data`](#data)} transactionHash - hash of the transaction that created this log or `null` if pending +- {[`Quantity`](#quantity)} blockNumber - number of block containing this log or `null` if pending +- {[`Quantity`](#quantity)} logIndex - index of this log within its block or `null` if pending +- {[`Quantity`](#quantity)} transactionIndex - index of the transaction that created this log or `null` if pending +- {`Array`} topics - list of order-dependent topics +- {`boolean`} removed - `true` if this filter has been destroyed and is invalid + +**Note:** The return value of `eth_getFilterLogs` when retrieving logs from `eth_newBlockFilter` and `eth_newPendingTransactionFilter` filters will be an array of hashes, not an array of Log objects. #### Example @@ -883,37 +936,110 @@ Returns the contract code stored at a given address curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getCode", - "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"] + "method": "eth_getFilterLogs", + "params": ["0x16"] }' # Response { + "id": 1337, + "jsonrpc": "2.0", + "result": [{ + "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", + "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", + "blockNumber":"0x1b4", + "data":"0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x1", + "topics": [], + "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", + "transactionIndex": "0x0" + }] +} +``` +--- +
+ +
+eth_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`} - array of log objects with the following members: + +- {[`Data`](#data)} `address` - address from which this log originated +- {[`Data`](#data)} `blockHash` - hash of block containing this log or `null` if pending +- {[`Data`](#data)} `data` - contains the non-indexed arguments of the log +- {[`Data`](#data)} `transactionHash` - hash of the transaction that created this log or `null` if pending +- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this log or `null` if pending +- {[`Quantity`](#quantity)} `logIndex` - index of this log within its block or `null` if pending +- {[`Quantity`](#quantity)} `transactionIndex` - index of the transaction that created this log or `null` if pending +- {[`Data`](#data)} `topics` - list of order-dependent topics +- {`boolean`} `removed` - `true` if this filter has been destroyed and is invalid + +**Note:** The return value of `eth_getLogs` when retrieving logs from `eth_newBlockFilter` and `eth_newPendingTransactionFilter` filters will be an array of hashes, not an array of Log objects. + +#### Example + +```sh +# Request +curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "result": "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056" + "method": "eth_getLogs", + "params": [{ + "topics":["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"] + }] +}' + +# Response +{ + "id": 1337, + "jsonrpc": "2.0", + "result": [{ + "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", + "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", + "blockNumber":"0x1b4", + "data":"0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x1", + "topics": [], + "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", + "transactionIndex": "0x0" + }] } ``` ---
-eth_sign +eth_getStorageAt #### Description -Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))` +Returns the value from a storage position at an address #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|address to use for signing| -|2|{[`Data`](#data)}|data to sign| +|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)} - signature hash of the provided data +{[`Data`](#data)} - value stored at the given address and data index #### Example @@ -922,128 +1048,121 @@ Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereu curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_sign", - "params": ["0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "0xdeadbeaf"] + "method": "eth_getStorageAt", + "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b" + "result": "0x00000000000000000000000000000000000000000000000000000000000004d2" } ``` ---
-eth_signTypedData +eth_getTransactionByBlockHashAndIndex #### Description -Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))` +Returns information about a transaction specified by block hash and transaction index #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|address to use for signing| -|2|{[`Data`](#data)}|message to sign containing type information, a domain separator, and data| - -**Note:** Client developers should refer to EIP-712 for complete semantics around [encoding and signing data](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification). Dapp developers should refer to EIP-712 for the expected structure of [RPC method input parameters](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#parameters). +|1|{[`Data`](#data)}|hash of a block| +|2|{[`Quantity`](#quantity)}|index of a transaction in the specified block| #### Returns -{[`Data`](#data)} - signature hash of the provided message +{`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_signTypedData", - "params": ["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", { - "types": { - "EIP712Domain": [{ - "name": "name", - "type": "string" - }, { - "name": "version", - "type": "string" - }, { - "name": "chainId", - "type": "uint256" - }, { - "name": "verifyingContract", - "type": "address" - }], - "Person": [{ - "name": "name", - "type": "string" - }, { - "name": "wallet", - "type": "address" - }], - "Mail": [{ - "name": "from", - "type": "Person" - }, { - "name": "to", - "type": "Person" - }, { - "name": "contents", - "type": "string" - }] - }, - "primaryType": "Mail", - "domain": { - "name": "Ether Mail", - "version": "1", - "chainId": 1, - "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" - }, - "message": { - "from": { - "name": "Cow", - "wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" - }, - "to": { - "name": "Bob", - "wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB" - }, - "contents": "Hello, Bob!" - } - }] + "id": 1337, + "jsonrpc": "2.0", + "method": "eth_getTransactionByBlockHashAndIndex", + "params":["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "0x0"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c" + "result": { + "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", + "blockNumber": "0x5daf3b", + "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", + "gas": "0xc350", + "gasPrice": "0x4a817c800", + "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", + "input": "0x68656c6c6f21", + "nonce": "0x15", + "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", + "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c", + "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", + "transactionIndex": "0x41", + "v": "0x25", + "value": "0xf3dbb76162000" + } } ``` ---
-eth_sendTransaction +eth_getTransactionByBlockNumberAndIndex #### Description -Creates, signs, and sends a new transaction to the network +Returns information about a transaction specified by block number and transaction index #### 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| +|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 -{[`Data`](#data)} - transaction hash, or the zero hash if the transaction is not yet available +{`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 @@ -1052,43 +1171,66 @@ Creates, signs, and sends a new transaction to the network 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" - }] + "method": "eth_getTransactionByBlockNumberAndIndex", + "params":["0x29c", "0x0"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" + "result": { + "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", + "blockNumber": "0x5daf3b", + "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", + "gas": "0xc350", + "gasPrice": "0x4a817c800", + "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", + "input": "0x68656c6c6f21", + "nonce": "0x15", + "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", + "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c", + "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", + "transactionIndex": "0x41", + "v": "0x25", + "value": "0xf3dbb76162000" + } } ``` ---
-eth_sendRawTransaction +eth_getTransactionByHash #### Description -Sends and already-signed transaction to the network +Returns information about a transaction specified by hash #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|signed transaction data| +|1|{[`Data`](#data)}|hash of a transaction| #### Returns -{[`Data`](#data)} - transaction hash, or the zero hash if the transaction is not yet available +{`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 @@ -1097,37 +1239,52 @@ Sends and already-signed transaction to the network curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_sendRawTransaction", - "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"] + "method": "eth_getTransactionByHash", + "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" + "result": { + "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", + "blockNumber": "0x5daf3b", + "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", + "gas": "0xc350", + "gasPrice": "0x4a817c800", + "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", + "input": "0x68656c6c6f21", + "nonce": "0x15", + "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", + "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c", + "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", + "transactionIndex": "0x41", + "v": "0x25", + "value": "0xf3dbb76162000" + } } ``` ---
-eth_call +eth_getTransactionCount #### Description -Executes a new message call immediately without submitting a transaction to the network +Returns the number of transactions sent from an address #### 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| +|1|{[`Data`](#data)}|address to query for sent transactions| |2|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| #### Returns -{[`Data`](#data)} - return value of executed contract +{[`Quantity`](#quantity)} - number of transactions sent from the specified address #### Example @@ -1136,46 +1293,51 @@ Executes a new message call immediately without submitting a transaction to the 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" - }] + "method": "eth_getTransactionCount", + "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f", "latest"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0x" + "result": "0x1" } ``` ---
-eth_estimateGas +eth_getTransactionReceipt #### Description -Estimates the gas necessary to complete a transaction without submitting it to the network +Returns the receipt of a transaction specified by hash -**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. +**Note:** Transaction receipts are unavailable for pending transactions. #### 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"`| +|1|{[`Data`](#data)}|hash of a transaction| #### Returns -{[`Quantity`](#quantity)} - amount of gas required by transaction +{`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 +- {`Array`} `logs` - list of log objects generated by this transaction #### Example @@ -1184,44 +1346,48 @@ Estimates the gas necessary to complete a transaction without submitting it to t 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" - }] + "method": "eth_getTransactionReceipt", + "params": ["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": "0x5208" + "result": { + "blockHash": '0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b', + "blockNumber": '0xb', + "contractAddress": '0xb60e8dd61c5d32be8058bb8eb970870f07233155', + "cumulativeGasUsed": '0x33bc', + "gasUsed": '0x4dc', + "logs": [], + "logsBloom": "0x00...0", + "status": "0x1", + "transactionHash": '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', + "transactionIndex": '0x1' + } } ``` ---
-eth_getBlockByHash +eth_getUncleByBlockHashAndIndex #### Description -Returns information about a block specified by hash +Returns information about an uncle specified by block hash and uncle index position #### Parameters |#|Type|Description| |-|-|-| |1|{[`Data`](#data)}|hash of a block| -|2|{`boolean`}|`true` will pull full transaction objects, `false` will pull transaction hashes| +|2|{[`Quantity`](#quantity)}|index of uncle| #### Returns -{`null|object`} - `null` if no block is found, otherwise a block object with the following members: +{`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 @@ -1240,7 +1406,6 @@ Returns information about a block specified by hash - {[`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 -- {`Array`} `transactions` - list of transaction objects or hashes - {`Array`} `uncles` - list of uncle hashes #### Example @@ -1250,8 +1415,8 @@ Returns information about a block specified by hash curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getBlockByHash", - "params":["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true] + "method": "eth_getUncleByBlockHashAndIndex", + "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"] }' # Response @@ -1259,24 +1424,16 @@ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", "result": { - "difficulty": "0x027f07", - "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x9f759", - "gasUsed": "0x9f759", - "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", - "logsBloom": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", - "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", - "nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2", - "number": "0x1b4", - "parentHash": "0x9646252be9520f6e71339a8df9c55e4d7619deeb018d2a3f2d21fc165dde5eb5", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "size": "0x027f07", - "stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff", - "timestamp": "0x54e34e8e" - "totalDifficulty": "0x027f07", - "transactions": [] - "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "uncles": ["0x1606e5...", "0xd5145a9..."] + "blockHash": '0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b', + "blockNumber": '0xb', + "contractAddress": '0xb60e8dd61c5d32be8058bb8eb970870f07233155', + "cumulativeGasUsed": '0x33bc', + "gasUsed": '0x4dc', + "logs": [], + "logsBloom": "0x00...0", + "status": "0x1", + "transactionHash": '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', + "transactionIndex": '0x1' } } ``` @@ -1284,22 +1441,22 @@ curl -X POST --data '{
-eth_getBlockByNumber +eth_getUncleByBlockNumberAndIndex #### Description -Returns information about a block specified by number +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|{`boolean`}|`true` will pull full transaction objects, `false` will pull transaction hashes| +|2|{[`Quantity`](#quantity)}|index of uncle| #### Returns -{`null|object`} - `null` if no block is found, otherwise a block object with the following members: +{`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 @@ -1318,7 +1475,6 @@ Returns information about a block specified by number - {[`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 -- {`Array`} `transactions` - list of transaction objects or hashes - {`Array`} `uncles` - list of uncle hashes #### Example @@ -1328,8 +1484,8 @@ Returns information about a block specified by number curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getBlockByNumber", - "params":["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", true] + "method": "eth_getUncleByBlockNumberAndIndex", + "params": ["0x29c", "0x0"] }' # Response @@ -1337,24 +1493,16 @@ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", "result": { - "difficulty": "0x027f07", - "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x9f759", - "gasUsed": "0x9f759", - "hash": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", - "logsBloom": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", - "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a", - "nonce": "0xe04d296d2460cfb8472af2c5fd05b5a214109c25688d3704aed5484f9a7792f2", - "number": "0x1b4", - "parentHash": "0x9646252be9520f6e71339a8df9c55e4d7619deeb018d2a3f2d21fc165dde5eb5", - "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", - "size": "0x027f07", - "stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff", - "timestamp": "0x54e34e8e" - "totalDifficulty": "0x027f07", - "transactions": [] - "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "uncles": ["0x1606e5...", "0xd5145a9..."] + "blockHash": '0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b', + "blockNumber": '0xb', + "contractAddress": '0xb60e8dd61c5d32be8058bb8eb970870f07233155', + "cumulativeGasUsed": '0x33bc', + "gasUsed": '0x4dc', + "logs": [], + "logsBloom": "0x00...0", + "status": "0x1", + "transactionHash": '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', + "transactionIndex": '0x1' } } ``` @@ -1362,36 +1510,21 @@ curl -X POST --data '{
-eth_getTransactionByHash +eth_getUncleCountByBlockHash #### Description -Returns information about a transaction specified by hash +Returns the number of uncles in a block specified by block hash #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|hash of a transaction| +|1|{[`Data`](#data)}|hash of a 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 +{[`Quantity`](#quantity)} - number of uncles in the specified block #### Example @@ -1400,67 +1533,36 @@ Returns information about a transaction specified by hash curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getTransactionByHash", - "params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"] + "method": "eth_getUncleCountByBlockHash", + "params": ["0xc94770007dda54cF92009BFF0dE90c06F603a09f"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": { - "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", - "blockNumber": "0x5daf3b", - "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", - "gas": "0xc350", - "gasPrice": "0x4a817c800", - "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", - "input": "0x68656c6c6f21", - "nonce": "0x15", - "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", - "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c", - "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", - "transactionIndex": "0x41", - "v": "0x25", - "value": "0xf3dbb76162000" - } + "result": "0xc" } ``` ---
-eth_getTransactionByBlockHashAndIndex +eth_getUncleCountByBlockNumber #### Description -Returns information about a transaction specified by block hash and transaction index +Returns the number of uncles in a block specified by block number #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|hash of a block| -|2|{[`Quantity`](#quantity)}|index of a transaction in the specified block| +|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| #### 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 +{[`Quantity`](#quantity)} - number of uncles in the specified block #### Example @@ -1469,67 +1571,38 @@ Returns information about a transaction specified by block hash and transaction curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getTransactionByBlockHashAndIndex", - "params":["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331", "0x0"] + "method": "eth_getUncleCountByBlockNumber", + "params": ["0xe8"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": { - "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", - "blockNumber": "0x5daf3b", - "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", - "gas": "0xc350", - "gasPrice": "0x4a817c800", - "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", - "input": "0x68656c6c6f21", - "nonce": "0x15", - "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", - "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c", - "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", - "transactionIndex": "0x41", - "v": "0x25", - "value": "0xf3dbb76162000" - } + "result": "0x1" } ``` ---
-eth_getTransactionByBlockNumberAndIndex +eth_getWork #### Description -Returns information about a transaction specified by block number and transaction index +Returns a list containing relevant information for proof-of-work #### 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| +_none_ #### Returns -{`null|object`} - `null` if no transaction is found, otherwise a transaction object with the following members: +{[`Data[]`](#data)} - array with the following items: -- {[`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 +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 @@ -1538,66 +1611,38 @@ Returns information about a transaction specified by block number and transactio curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getTransactionByBlockNumberAndIndex", - "params":["0x29c", "0x0"] + "method": "eth_getWork", + "params": [] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": { - "blockHash": "0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2", - "blockNumber": "0x5daf3b", - "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d", - "gas": "0xc350", - "gasPrice": "0x4a817c800", - "hash": "0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b", - "input": "0x68656c6c6f21", - "nonce": "0x15", - "r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea", - "s": "0x4ba69724e8f69de52f0125ad8b3c5c2cef33019bac3249e2c0a2192766d1721c", - "to": "0xf02c1c8e6114b1dbe8937a39260b5b0a374432bb", - "transactionIndex": "0x41", - "v": "0x25", - "value": "0xf3dbb76162000" - } + "result": [ + "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", + "0x5EED00000000000000000000000000005EED0000000000000000000000000000", + "0xd1ff1c01710000000000000000000000d1ff1c01710000000000000000000000" + ] } ``` ---
-eth_getTransactionReceipt +eth_hashrate #### Description -Returns the receipt of a transaction specified by hash - -**Note:** Transaction receipts are unavailable for pending transactions. +Returns the number of hashes-per-second this node is mining at #### Parameters -|#|Type|Description| -|-|-|-| -|1|{[`Data`](#data)}|hash of a transaction| +_(none)_ #### 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 -- {`Array`} `logs` - list of log objects generated by this transaction +{[`Quantity`](#quantity)} - number of hashes-per-second #### Example @@ -1606,67 +1651,34 @@ Returns the receipt of a transaction specified by hash curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getTransactionReceipt", - "params": ["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"] + "method": "eth_hashrate", + "params": [] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": { - "blockHash": '0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b', - "blockNumber": '0xb', - "contractAddress": '0xb60e8dd61c5d32be8058bb8eb970870f07233155', - "cumulativeGasUsed": '0x33bc', - "gasUsed": '0x4dc', - "logs": [], - "logsBloom": "0x00...0", - "status": "0x1", - "transactionHash": '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', - "transactionIndex": '0x1' - } + "result": "0x38a" } ``` ---
-eth_getUncleByBlockHashAndIndex +eth_mining #### Description -Returns information about an uncle specified by block hash and uncle index position +Determines if this client is mining new blocks #### Parameters -|#|Type|Description| -|-|-|-| -|1|{[`Data`](#data)}|hash of a block| -|2|{[`Quantity`](#quantity)}|index of uncle| +_(none)_ #### 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 -- {`Array`} `uncles` - list of uncle hashes +{`boolean`} - `true` if this client is mining or `false` if it is not mining #### Example @@ -1675,95 +1687,51 @@ Returns information about an uncle specified by block hash and uncle index posit curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getUncleByBlockHashAndIndex", - "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"] + "method": "eth_mining", + "params": [] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": { - "blockHash": '0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b', - "blockNumber": '0xb', - "contractAddress": '0xb60e8dd61c5d32be8058bb8eb970870f07233155', - "cumulativeGasUsed": '0x33bc', - "gasUsed": '0x4dc', - "logs": [], - "logsBloom": "0x00...0", - "status": "0x1", - "transactionHash": '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', - "transactionIndex": '0x1' - } + "result": true } ``` ---
-eth_getUncleByBlockNumberAndIndex +eth_newBlockFilter #### Description -Returns information about an uncle specified by block number and uncle index position +Creates a filter to listen for new blocks that can be used with `eth_getFilterChanges` #### Parameters -|#|Type|Description| -|-|-|-| -|1|{[`Quantity`](#quantity)\|`string`}|block number, or one of `"latest"`, `"earliest"` or `"pending"`| -|2|{[`Quantity`](#quantity)}|index of uncle| +_none_ #### 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 -- {`Array`} `uncles` - list of uncle hashes +{[`Quantity`](#quantity)} - ID of the newly-created filter that can be used with `eth_getFilterChanges` #### Example ```sh # Request curl -X POST --data '{ - "id": 1337, + "id": 1337 "jsonrpc": "2.0", - "method": "eth_getUncleByBlockNumberAndIndex", - "params": ["0x29c", "0x0"] + "method": "eth_newBlockFilter", + "params": [] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": { - "blockHash": '0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b', - "blockNumber": '0xb', - "contractAddress": '0xb60e8dd61c5d32be8058bb8eb970870f07233155', - "cumulativeGasUsed": '0x33bc', - "gasUsed": '0x4dc', - "logs": [], - "logsBloom": "0x00...0", - "status": "0x1", - "transactionHash": '0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', - "transactionIndex": '0x1' - } + "result": "0x1" } ``` --- @@ -1817,11 +1785,11 @@ curl -X POST --data '{
-eth_newBlockFilter +eth_newPendingTransactionFilter #### Description -Creates a filter to listen for new blocks that can be used with `eth_getFilterChanges` +Creates a filter to listen for new pending transactions that can be used with `eth_getFilterChanges` #### Parameters @@ -1838,7 +1806,7 @@ _none_ curl -X POST --data '{ "id": 1337 "jsonrpc": "2.0", - "method": "eth_newBlockFilter", + "method": "eth_newPendingTransactionFilter", "params": [] }' @@ -1853,28 +1821,27 @@ curl -X POST --data '{
-eth_newPendingTransactionFilter +eth_protocolVersion #### Description -Creates a filter to listen for new pending transactions that can be used with `eth_getFilterChanges` +Returns the current Ethereum protocol version #### Parameters -_none_ +_(none)_ #### Returns -{[`Quantity`](#quantity)} - ID of the newly-created filter that can be used with `eth_getFilterChanges` +{`string`} - current Ethereum protocol version #### Example - ```sh # Request curl -X POST --data '{ - "id": 1337 + "id": 1337, "jsonrpc": "2.0", - "method": "eth_newPendingTransactionFilter", + "method": "eth_protocolVersion", "params": [] }' @@ -1882,30 +1849,28 @@ curl -X POST --data '{ { "id": 1337, "jsonrpc": "2.0", - "result": "0x1" + "result": "54" } ``` ---
-eth_uninstallFilter +eth_sendRawTransaction #### Description -Destroys a filter based on filter ID - -**Note:** This should only be called if a filter and its notifications are no longer needed. This will also be called automatically on a filter if its notifications are not retrieved using `eth_getFilterChanges` for a period of time. +Sends and already-signed transaction to the network #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Quantity`](#quantity)}|ID of the filter to destroy| +|1|{[`Data`](#data)}|signed transaction data| #### Returns -{`boolean`} - `true` if the filter is found and successfully destroyed or `false` if it is not +{[`Data`](#data)} - transaction hash, or the zero hash if the transaction is not yet available #### Example @@ -1914,48 +1879,36 @@ Destroys a filter based on filter ID curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_uninstallFilter", - "params": ["0xb"] + "method": "eth_sendRawTransaction", + "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": true + "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` ---
-eth_getFilterChanges +eth_sendTransaction #### Description -Returns a list of all logs based on filter ID since the last log retrieval +Creates, signs, and sends a new transaction to the network #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Quantity`](#quantity)}|ID of the filter| +|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 -{`Array`} - array of log objects with the following members: - -- {[`Data`](#data)} `address` - address from which this log originated -- {[`Data`](#data)} `blockHash` - hash of block containing this log or `null` if pending -- {[`Data`](#data)} `data` - contains the non-indexed arguments of the log -- {[`Data`](#data)} `transactionHash` - hash of the transaction that created this log or `null` if pending -- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this log or `null` if pending -- {[`Quantity`](#quantity)} `logIndex` - index of this log within its block or `null` if pending -- {[`Quantity`](#quantity)} `transactionIndex` - index of the transaction that created this log or `null` if pending -- {[`Data[]`](#data)} `topics` - list of order-dependent topics -- {`boolean`} `removed` - `true` if this filter has been destroyed and is invalid - -**Note:** The return value of `eth_getFilterChanges` when retrieving logs from `eth_newBlockFilter` and `eth_newPendingTransactionFilter` filters will be an array of hashes, not an array of Log objects. +{[`Data`](#data)} - transaction hash, or the zero hash if the transaction is not yet available #### Example @@ -1964,57 +1917,44 @@ Returns a list of all logs based on filter ID since the last log retrieval curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getFilterChanges", - "params": ["0x16"] + "method": "eth_sendTransaction", + "params": [{ + "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", + "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", + "value": "0x9184e72a" + }] }' # Response { - "id": 1337, - "jsonrpc": "2.0", - "result": [{ - "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", - "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", - "blockNumber":"0x1b4", - "data":"0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": "0x1", - "topics": [], - "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", - "transactionIndex": "0x0" - }] + "id": 1337, + "jsonrpc": "2.0", + "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` ---
-eth_getFilterLogs +eth_sign #### Description -Returns a list of all logs based on filter ID +Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))` #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Quantity`](#quantity)}|ID of the filter| +|1|{[`Data`](#data)}|address to use for signing| +|2|{[`Data`](#data)}|data to sign| #### Returns -{`Array`} - array of log objects with the following members: - -- {[`Data`](#data)} address - address from which this log originated -- {[`Data`](#data)} blockHash - hash of block containing this log or `null` if pending -- {[`Data`](#data)} data - contains the non-indexed arguments of the log -- {[`Data`](#data)} transactionHash - hash of the transaction that created this log or `null` if pending -- {[`Quantity`](#quantity)} blockNumber - number of block containing this log or `null` if pending -- {[`Quantity`](#quantity)} logIndex - index of this log within its block or `null` if pending -- {[`Quantity`](#quantity)} transactionIndex - index of the transaction that created this log or `null` if pending -- {`Array`} topics - list of order-dependent topics -- {`boolean`} removed - `true` if this filter has been destroyed and is invalid - -**Note:** The return value of `eth_getFilterLogs` when retrieving logs from `eth_newBlockFilter` and `eth_newPendingTransactionFilter` filters will be an array of hashes, not an array of Log objects. +{[`Data`](#data)} - signature hash of the provided data #### Example @@ -2023,59 +1963,36 @@ Returns a list of all logs based on filter ID curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getFilterLogs", - "params": ["0x16"] + "method": "eth_sign", + "params": ["0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "0xdeadbeaf"] }' # Response { - "id": 1337, - "jsonrpc": "2.0", - "result": [{ - "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", - "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", - "blockNumber":"0x1b4", - "data":"0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": "0x1", - "topics": [], - "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", - "transactionIndex": "0x0" - }] + "id": 1337, + "jsonrpc": "2.0", + "result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b" } ``` ---
-eth_getLogs +eth_signTransaction #### Description -Returns a list of all logs based on a filter object +Signs a transaction that can be submitted to the network at a later time using with `eth_sendRawTransaction` #### 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. +|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 -{`Array`} - array of log objects with the following members: - -- {[`Data`](#data)} `address` - address from which this log originated -- {[`Data`](#data)} `blockHash` - hash of block containing this log or `null` if pending -- {[`Data`](#data)} `data` - contains the non-indexed arguments of the log -- {[`Data`](#data)} `transactionHash` - hash of the transaction that created this log or `null` if pending -- {[`Quantity`](#quantity)} `blockNumber` - number of block containing this log or `null` if pending -- {[`Quantity`](#quantity)} `logIndex` - index of this log within its block or `null` if pending -- {[`Quantity`](#quantity)} `transactionIndex` - index of the transaction that created this log or `null` if pending -- {[`Data`](#data)} `topics` - list of order-dependent topics -- {`boolean`} `removed` - `true` if this filter has been destroyed and is invalid - -**Note:** The return value of `eth_getLogs` when retrieving logs from `eth_newBlockFilter` and `eth_newPendingTransactionFilter` filters will be an array of hashes, not an array of Log objects. +{[`Data`](#data)} - signature hash of the transaction object #### Example @@ -2084,49 +2001,136 @@ Returns a list of all logs based on a filter object curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getLogs", + "method": "eth_signTransaction", "params": [{ - "topics":["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"] + "data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", + "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", + "value": "0x9184e72a" }] }' # Response { - "id": 1337, - "jsonrpc": "2.0", - "result": [{ - "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d", - "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d", - "blockNumber":"0x1b4", - "data":"0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": "0x1", - "topics": [], - "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf", - "transactionIndex": "0x0" - }] + "id": 1337, + "jsonrpc": "2.0", + "result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b" } ``` ---
-eth_getWork +eth_signTypedData #### Description -Returns a list containing relevant information for proof-of-work +Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))` #### Parameters -_none_ +|#|Type|Description| +|-|-|-| +|1|{[`Data`](#data)}|address to use for signing| +|2|{[`Data`](#data)}|message to sign containing type information, a domain separator, and data| + +**Note:** Client developers should refer to EIP-712 for complete semantics around [encoding and signing data](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification). Dapp developers should refer to EIP-712 for the expected structure of [RPC method input parameters](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#parameters). #### Returns -{[`Data[]`](#data)} - array with the following items: +{[`Data`](#data)} - signature hash of the provided message -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_signTypedData", + "params": ["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", { + "types": { + "EIP712Domain": [{ + "name": "name", + "type": "string" + }, { + "name": "version", + "type": "string" + }, { + "name": "chainId", + "type": "uint256" + }, { + "name": "verifyingContract", + "type": "address" + }], + "Person": [{ + "name": "name", + "type": "string" + }, { + "name": "wallet", + "type": "address" + }], + "Mail": [{ + "name": "from", + "type": "Person" + }, { + "name": "to", + "type": "Person" + }, { + "name": "contents", + "type": "string" + }] + }, + "primaryType": "Mail", + "domain": { + "name": "Ether Mail", + "version": "1", + "chainId": 1, + "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" + }, + "message": { + "from": { + "name": "Cow", + "wallet": "0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" + }, + "to": { + "name": "Bob", + "wallet": "0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB" + }, + "contents": "Hello, Bob!" + } + }] +}' + +# Response +{ + "id": 1337, + "jsonrpc": "2.0", + "result": "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c" +} +``` +--- +
+ +
+eth_submitHashrate + +#### Description + +Submit a mining hashrate + +#### Parameters + +|#|Type|Description| +|-|-|-| +|1|{[`Data`](#data)}|hash rate| +|2|{[`Data`](#data)}|random ID identifying this node| + +#### Returns + +{`boolean`} - `true` if submitting went through successfully, `false` otherwise #### Example @@ -2135,19 +2139,18 @@ _none_ curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_getWork", - "params": [] + "method": "eth_submitHashrate", + "params": [ + "0x0000000000000000000000000000000000000000000000000000000000500000", + "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c" + ] }' # Response { "id": 1337, "jsonrpc": "2.0", - "result": [ - "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", - "0x5EED00000000000000000000000000005EED0000000000000000000000000000", - "0xd1ff1c01710000000000000000000000d1ff1c01710000000000000000000000" - ] + "result": true } ``` --- @@ -2197,23 +2200,69 @@ curl -X POST --data '{ ---
+
-eth_submitHashrate +eth_syncing #### Description -Submit a mining hashrate +Returns information about the status of this client's network synchronization + +#### Parameters + +_(none)_ + +#### Returns + +{`boolean|object`} - `false` if this client is not syncing with the network, otherwise an object with the following members: + +- {[`Quantity`](#quantity)} `currentBlock` - number of the most-recent block synced +- {[`Quantity`](#quantity)} `highestBlock` - number of latest block on the network +- {[`Quantity`](#quantity)} `startingBlock` - block number at which syncing started + +#### Example + +```sh +# Request +curl -X POST --data '{ + "id": 1337, + "jsonrpc": "2.0", + "method": "eth_syncing", + "params": [] +}' + +# Response +{ + "id": 1337, + "jsonrpc": "2.0", + "result": { + "currentBlock": '0x386', + "highestBlock": '0x454', + "startingBlock": '0x384' + } +} +``` +--- +
+ +
+eth_uninstallFilter + +#### Description + +Destroys a filter based on filter ID + +**Note:** This should only be called if a filter and its notifications are no longer needed. This will also be called automatically on a filter if its notifications are not retrieved using `eth_getFilterChanges` for a period of time. #### Parameters |#|Type|Description| |-|-|-| -|1|{[`Data`](#data)}|hash rate| -|2|{[`Data`](#data)}|random ID identifying this node| +|1|{[`Quantity`](#quantity)}|ID of the filter to destroy| #### Returns -{`boolean`} - `true` if submitting went through succesfully, `false` otherwise +{`boolean`} - `true` if the filter is found and successfully destroyed or `false` if it is not #### Example @@ -2222,11 +2271,8 @@ Submit a mining hashrate curl -X POST --data '{ "id": 1337, "jsonrpc": "2.0", - "method": "eth_submitHashrate", - "params": [ - "0x0000000000000000000000000000000000000000000000000000000000500000", - "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c" - ] + "method": "eth_uninstallFilter", + "params": ["0xb"] }' # Response