You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: public/content/developers/docs/apis/json-rpc/index.md
+62-1Lines changed: 62 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,8 @@ You can use the [playground tool](https://ethereum-json-rpc.com) to discover and
143
143
144
144
Returns the current client version.
145
145
146
+
[](https://ethereum-json-rpc.com/?method=web3_clientVersion)
147
+
146
148
**Parameters**
147
149
148
150
None
@@ -168,6 +170,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],
168
170
169
171
Returns Keccak-256 (_not_ the standardized SHA3-256) of the given data.
170
172
173
+
[](https://ethereum-json-rpc.com/?method=web3_sha3)
174
+
171
175
**Parameters**
172
176
173
177
1.`DATA` - The data to convert into a SHA3 hash
@@ -197,6 +201,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["0x68656c6c
197
201
198
202
Returns the current network id.
199
203
204
+
[](https://ethereum-json-rpc.com/?method=net_version)
205
+
200
206
**Parameters**
201
207
202
208
None
@@ -228,6 +234,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"net_version","params":[],"id":67
228
234
229
235
Returns `true` if client is actively listening for network connections.
230
236
237
+
[](https://ethereum-json-rpc.com/?method=net_listening)
238
+
231
239
**Parameters**
232
240
233
241
None
@@ -253,6 +261,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"net_listening","params":[],"id":
253
261
254
262
Returns number of peers currently connected to the client.
255
263
264
+
[](https://ethereum-json-rpc.com/?method=net_peerCount)
265
+
256
266
**Parameters**
257
267
258
268
None
@@ -278,6 +288,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":
278
288
279
289
Returns the current Ethereum protocol version. Note that this method is [not available in Geth](https://github.com/ethereum/go-ethereum/pull/22064#issuecomment-788682924).
280
290
291
+
[](https://ethereum-json-rpc.com/?method=eth_protocolVersion)
292
+
281
293
**Parameters**
282
294
283
295
None
@@ -303,6 +315,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_protocolVersion","params":[]
303
315
304
316
Returns an object with data about the sync status or `false`.
305
317
318
+
[](https://ethereum-json-rpc.com/?method=eth_syncing)
319
+
306
320
**Parameters**
307
321
308
322
None
@@ -387,6 +401,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}
387
401
388
402
Returns the client coinbase address.
389
403
404
+
[](https://ethereum-json-rpc.com/?method=eth_coinbase)
405
+
390
406
> **Note:** This method has been deprecated as of **v1.14.0** and is no longer supported. Attempting to use this method will result in a "Method not supported" error.
391
407
392
408
**Parameters**
@@ -414,6 +430,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_coinbase","params":[],"id":6
414
430
415
431
Returns the chain ID used for signing replay-protected transactions.
416
432
433
+
[](https://ethereum-json-rpc.com/?method=eth_chainId)
434
+
417
435
**Parameters**
418
436
419
437
None
@@ -439,6 +457,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":67
439
457
440
458
Returns `true` if client is actively mining new blocks. This can only return `true` for proof-of-work networks and may not be available in some clients since [The Merge](/roadmap/merge/).
441
459
460
+
[](https://ethereum-json-rpc.com/?method=eth_mining)
461
+
442
462
**Parameters**
443
463
444
464
None
@@ -464,6 +484,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_mining","params":[],"id":71}
464
484
465
485
Returns the number of hashes per second that the node is mining with. This can only return `true` for proof-of-work networks and may not be available in some clients since [The Merge](/roadmap/merge/).
466
486
487
+
[](https://ethereum-json-rpc.com/?method=eth_hashrate)
488
+
467
489
**Parameters**
468
490
469
491
None
@@ -489,6 +511,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":7
489
511
490
512
Returns an estimate of the current price per gas in wei. For example, the Besu client examines the last 100 blocks and returns the median gas unit price by default.
491
513
514
+
[](https://ethereum-json-rpc.com/?method=eth_gasPrice)
515
+
492
516
**Parameters**
493
517
494
518
None
@@ -510,10 +534,14 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":7
510
534
}
511
535
```
512
536
537
+
538
+
513
539
### eth_accounts {#eth_accounts}
514
540
515
541
Returns a list of addresses owned by client.
516
542
543
+
[](https://ethereum-json-rpc.com/?method=eth_accounts)
544
+
517
545
**Parameters**
518
546
519
547
None
@@ -538,6 +566,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1
538
566
### eth_blockNumber {#eth_blocknumber}
539
567
540
568
Returns the number of most recent block.
569
+
570
+
[](https://ethereum-json-rpc.com/?method=eth_blockNumber)
541
571
542
572
**Parameters**
543
573
@@ -564,6 +594,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id
564
594
565
595
Returns the balance of the account of given address.
566
596
597
+
[](https://ethereum-json-rpc.com/?method=eth_getBalance)
598
+
567
599
**Parameters**
568
600
569
601
1.`DATA`, 20 Bytes - address to check for balance.
@@ -594,6 +626,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x407
594
626
595
627
Returns the value from a storage position at a given address.
596
628
629
+
[](https://ethereum-json-rpc.com/?method=eth_getStorageAt)
630
+
597
631
**Parameters**
598
632
599
633
1.`DATA`, 20 Bytes - address of the storage.
@@ -695,6 +729,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params
695
729
696
730
Returns the number of transactions in a block from a block matching the given block hash.
697
731
732
+
[](https://ethereum-json-rpc.com/?method=eth_getBlockTransactionCountByHash)
733
+
698
734
**Parameters**
699
735
700
736
1.`DATA`, 32 Bytes - hash of a block
@@ -724,6 +760,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHa
724
760
725
761
Returns the number of transactions in a block matching the given block number.
726
762
763
+
[](https://ethereum-json-rpc.com/?method=eth_getBlockTransactionCountByNumber)
764
+
727
765
**Parameters**
728
766
729
767
1.`QUANTITY|TAG` - integer of a block number, or the string `"earliest"`, `"latest"`, `"pending"`, `"safe"` or `"finalized"`, as in the [default block parameter](/developers/docs/apis/json-rpc/#default-block).
@@ -755,6 +793,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNu
755
793
756
794
Returns the number of uncles in a block from a block matching the given block hash.
757
795
796
+
[](https://ethereum-json-rpc.com/?method=eth_getUncleCountByBlockHash)
797
+
758
798
**Parameters**
759
799
760
800
1.`DATA`, 32 Bytes - hash of a block
@@ -784,6 +824,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockHash","p
784
824
785
825
Returns the number of uncles in a block from a block matching the given block number.
786
826
827
+
[](https://ethereum-json-rpc.com/?method=eth_getUncleCountByBlockNumber)
787
828
**Parameters**
788
829
789
830
1.`QUANTITY|TAG` - integer of a block number, or the string `"latest"`, `"earliest"`, `"pending"`, `"safe"` or `"finalized"`, see the [default block parameter](/developers/docs/apis/json-rpc/#default-block)
@@ -815,6 +856,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getUncleCountByBlockNumber",
815
856
816
857
Returns code at a given address.
817
858
859
+
[](https://ethereum-json-rpc.com/?method=eth_getCode)
860
+
818
861
**Parameters**
819
862
820
863
1.`DATA`, 20 Bytes - address
@@ -994,6 +1037,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params"
994
1037
995
1038
Executes a new message call immediately without creating a transaction on the blockchain. Often used for executing read-only smart contract functions, for example the `balanceOf` for an ERC-20 contract.
996
1039
1040
+
[](https://ethereum-json-rpc.com/?method=eth_call)
1041
+
997
1042
**Parameters**
998
1043
999
1044
1.`Object` - The transaction call object
@@ -1028,6 +1073,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{see above}]
1028
1073
1029
1074
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance.
1030
1075
1076
+
[](https://ethereum-json-rpc.com/?method=eth_estimateGas)
1077
+
1031
1078
**Parameters**
1032
1079
1033
1080
See [eth_call](#eth_call) parameters, except that all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit.
@@ -1053,6 +1100,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{see
1053
1100
1054
1101
Returns information about a block by hash.
1055
1102
1103
+
[](https://ethereum-json-rpc.com/?method=eth_getBlockByHash)
1104
+
1056
1105
**Parameters**
1057
1106
1058
1107
1.`DATA`, 32 Bytes - Hash of a block.
@@ -1105,7 +1154,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0
@@ -1130,6 +1179,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0
1130
1179
1131
1180
Returns information about a block by block number.
1132
1181
1182
+
[](https://ethereum-json-rpc.com/?method=eth_getBlockByNumber)
1183
+
1133
1184
**Parameters**
1134
1185
1135
1186
1. `QUANTITY|TAG` - integer of a block number, or the string `"earliest"`, `"latest"`, `"pending"`, `"safe"` or `"finalized"`, as in the [default block parameter](/developers/docs/apis/json-rpc/#default-block).
@@ -1158,6 +1209,8 @@ Result see [eth_getBlockByHash](#eth_getblockbyhash)
1158
1209
1159
1210
Returns the information about a transaction requested by transaction hash.
1160
1211
1212
+
[](https://ethereum-json-rpc.com/?method=eth_getTransactionByHash)
1213
+
1161
1214
**Parameters**
1162
1215
1163
1216
1. `DATA`, 32 Bytes - hash of a transaction
@@ -1217,6 +1270,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","param
1217
1270
1218
1271
Returns information about a transaction by block hash and transaction index position.
1219
1272
1273
+
[](https://ethereum-json-rpc.com/?method=eth_getTransactionByBlockHashAndIndex)
1220
1274
**Parameters**
1221
1275
1222
1276
1. `DATA`, 32 Bytes - hash of a block.
@@ -1245,6 +1299,8 @@ Result see [eth_getTransactionByHash](#eth_gettransactionbyhash)
1245
1299
1246
1300
Returns information about a transaction by block number and transaction index position.
1247
1301
1302
+
[](https://ethereum-json-rpc.com/?method=eth_getTransactionByBlockNumberAndIndex)
1303
+
1248
1304
**Parameters**
1249
1305
1250
1306
1. `QUANTITY|TAG` - a block number, or the string `"earliest"`, `"latest"`, `"pending"`, `"safe"` or `"finalized"`, as in the [default block parameter](/developers/docs/apis/json-rpc/#default-block).
@@ -1341,6 +1397,8 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","para
1341
1397
1342
1398
Returns information about a uncle of a block by hash and uncle index position.
1343
1399
1400
+
[](https://ethereum-json-rpc.com/?method=eth_getUncleByBlockHashAndIndex)
1401
+
1344
1402
**Parameters**
1345
1403
1346
1404
1. `DATA`, 32 Bytes - The hash of a block.
@@ -1371,6 +1429,8 @@ Result see [eth_getBlockByHash](#eth_getblockbyhash)
1371
1429
1372
1430
Returns information about a uncle of a block by number and uncle index position.
1373
1431
1432
+
[](https://ethereum-json-rpc.com/?method=eth_getUncleByBlockNumberAndIndex)
1433
+
1374
1434
**Parameters**
1375
1435
1376
1436
1. `QUANTITY|TAG` - a block number, or the string `"earliest"`, `"latest"`, `"pending"`, `"safe"`, `"finalized"`, as in the [default block parameter](/developers/docs/apis/json-rpc/#default-block).
@@ -1589,6 +1649,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":[
1589
1649
1590
1650
Returns an array of all logs matching filter with given id.
0 commit comments