@@ -28,7 +28,7 @@ class EtherscanApi {
28
28
* Creates request
29
29
* @private
30
30
* @param {object } params Query params
31
- * @return {Promise<any> }
31
+ * @return {Promise }
32
32
*/
33
33
_createRequest ( params ) {
34
34
return createRequest ( this . host , {
@@ -39,8 +39,7 @@ class EtherscanApi {
39
39
40
40
/**
41
41
* Returns Ether balance for a single address
42
- * @method getAccountBalance
43
- * @param {string } address
42
+ * @param {string } address Address
44
43
* @param {string } [unit=wei] Balance unit
45
44
* @returns {Promise<string> }
46
45
*/
@@ -61,10 +60,9 @@ class EtherscanApi {
61
60
/**
62
61
* Returns Ether balance for multiple addresses in a single call.
63
62
* Up to a maximum of 20 accounts in a single batch.
64
- * @method getAccountBalances
65
- * @param {Array<string> } addresses
63
+ * @param {Array<string> } addresses List of addresses
66
64
* @param {string } [unit=wei] Balance unit
67
- * @return {Promise<object> } Array of "{ account: string; balance: string }[]"
65
+ * @return {Promise<object> }
68
66
*/
69
67
getAccountBalances ( addresses , unit = 'wei' , tag = 'latest' ) {
70
68
return this . _createRequest ( {
@@ -89,14 +87,13 @@ class EtherscanApi {
89
87
/**
90
88
* Get a list of 'Normal' transactions by address
91
89
* Returns up to a maximum of the last 10000 transactions only
92
- * @method getTransactions
93
90
* @param {string } address Contract address
94
91
* @param {string|number } startBlock Starting block number to retrieve results
95
92
* @param {string|number } endBlock Ending block number to retrieve results
96
93
* @param {number } offset Max records to return
97
94
* @param {number } page Page number
98
95
* @param {"asc"|"desc" } sort Sort type
99
- * @returns {Promise<TransactionDescription []> }
96
+ * @returns {Promise<object []> }
100
97
*/
101
98
getTransactions ( address , startBlock , endBlock , offset , page , sort ) {
102
99
return this . _createRequest ( {
@@ -114,14 +111,13 @@ class EtherscanApi {
114
111
/**
115
112
* Returns a list of 'Internal' Transactions by Address
116
113
* Returns up to a maximum of the last 10000 transactions only
117
- * @method getInternalTransactions
118
114
* @param {string } address Contract address
119
115
* @param {string|number } startBlock Starting block number to retrieve results
120
116
* @param {string|number } endBlock Ending block number to retrieve results
121
117
* @param {string|number } offset Max records to return
122
118
* @param {string|number } page Page number
123
119
* @param {"asc"|"desc" } sort Sort type
124
- * @returns {Promise<TransactionDescription []> }
120
+ * @returns {Promise<object []> }
125
121
*/
126
122
getInternalTransactions ( address , startBlock , endBlock , offset , page , sort ) {
127
123
return this . _createRequest ( {
@@ -138,9 +134,8 @@ class EtherscanApi {
138
134
139
135
/**
140
136
* Returns a list of 'Internal' Transactions by Address
141
- * @method getInternalTransactionsByHash
142
137
* @param txhash Contract address
143
- * @returns {Promise<InternalTransactionDescription []> }
138
+ * @returns {Promise<object []> }
144
139
*/
145
140
getInternalTransactionsByHash ( txhash ) {
146
141
return this . _createRequest ( {
@@ -152,13 +147,12 @@ class EtherscanApi {
152
147
153
148
/**
154
149
* List of blocks mined by address
155
- * @method getMinedBlocks
156
150
* @param {string } address Miner address
157
151
* @param {"blocks"|"uncles" } type Type of block: blocks (full blocks only)
158
152
* or uncles (uncle blocks only)
159
153
* @param {number } offset Max records to return
160
154
* @param {number } page Page number
161
- * @returns {Promise<BlockInfo []> }
155
+ * @returns {Promise<object []> }
162
156
*/
163
157
getMinedBlocks ( address , type = 'blocks' , offset , page ) {
164
158
return this . _createRequest ( {
@@ -173,9 +167,8 @@ class EtherscanApi {
173
167
174
168
/**
175
169
* Returns Contract ABI
176
- * @method getContractAbi
177
170
* @param address
178
- * @returns {Promsie<AbiItemDescription []> }
171
+ * @returns {Promsie<object []> }
179
172
*/
180
173
getContractAbi ( address ) {
181
174
return this . _createRequest ( {
@@ -191,7 +184,6 @@ class EtherscanApi {
191
184
* Checks contract execution status (if there was an error during contract
192
185
* execution). "isError": "0" = Pass, "isError": "1" = Error during contract
193
186
* execution
194
- * @method getContractExecutionStatus
195
187
* @param {string } txhash Contract address
196
188
* @returns {Promise<object> }
197
189
*/
@@ -207,7 +199,6 @@ class EtherscanApi {
207
199
* Checks transaction receipt status (only applicable for post byzantium fork
208
200
* transactions). Status: 0 = Fail, 1 = Pass. Will return null/empty value
209
201
* for pre-byzantium fork
210
- * @method getTransactionStatus
211
202
* @param {string } txhash Transaction address
212
203
* @returns {Promise<object> }
213
204
*/
@@ -221,7 +212,6 @@ class EtherscanApi {
221
212
222
213
/**
223
214
* Get block and uncle rewards by block number
224
- * @method getBlockReward
225
215
* @param {number } blockNumber The number of the block
226
216
*/
227
217
getBlockReward ( blockNumber ) {
@@ -235,10 +225,9 @@ class EtherscanApi {
235
225
/**
236
226
* Returns events logs.
237
227
* The Event Log API was designed to provide an alternative to the native
238
- * eth_getLogs. Topic Operator (opr) choices are either ''' and' or 'or' and
228
+ * eth_getLogs. Topic Operator (opr) choices are either 'and' or 'or' and
239
229
* are restricted to the above choices only. For performance and security
240
230
* considerations, only the first 1000 results are return.
241
- * @method getEventsLogs
242
231
* @param {string } address
243
232
* @param {number } fromBlock Start block number (integer, NOT hex)
244
233
* @param {number|'latest' } toBlock End block number or "latest"
@@ -251,6 +240,7 @@ class EtherscanApi {
251
240
* @param {"and"|"or" } [topic23operator] Operator between topic2 & topic3
252
241
* @param {string } [topic3] Topic 3
253
242
* @param {"and"|"or" } [topic02operator] Operator between topic0 & topic2
243
+ * @return {Promise<object> }
254
244
*/
255
245
getEventsLogs (
256
246
address ,
@@ -283,7 +273,6 @@ class EtherscanApi {
283
273
284
274
/**
285
275
* Returns the number of the most recent block
286
- * @method getRecentBlockNumber
287
276
* @returns {Promise<number> }
288
277
*/
289
278
getRecentBlockNumber ( ) {
@@ -297,9 +286,8 @@ class EtherscanApi {
297
286
298
287
/**
299
288
* Returns information about a block by block number
300
- * @method getBlockByNumber
301
289
* @param {number } blockNumber Block number
302
- * @returns {Promise<GethBlockInfo > }
290
+ * @returns {Promise<object > }
303
291
*/
304
292
getBlockByNumber ( blockNumber ) {
305
293
return this . _createRequest ( {
@@ -312,10 +300,9 @@ class EtherscanApi {
312
300
313
301
/**
314
302
* Returns information about a uncle by block number and index
315
- * @method getUncleByBlockNumberAndIndex
316
303
* @param {number } blockNumber
317
304
* @param {number } [index=0]
318
- * @returns {Promise<GethBlockInfo > }
305
+ * @returns {Promise<object > }
319
306
*/
320
307
getUncleByBlockNumberAndIndex ( blockNumber , index = 0 ) {
321
308
return this . _createRequest ( {
@@ -329,7 +316,6 @@ class EtherscanApi {
329
316
/**
330
317
* Returns the number of transactions in a block from a block matching the
331
318
* given block number
332
- * @method getBlockTransactionCount
333
319
* @param {number } blockNumber
334
320
* @returns {Promise<number> }
335
321
*/
@@ -345,9 +331,8 @@ class EtherscanApi {
345
331
346
332
/**
347
333
* Returns the information about a transaction requested by transaction hash
348
- * @method getTransactionByHash
349
334
* @param {string } txhash Transaction hash
350
- * @returns {Promise<TransactionDescription > }
335
+ * @returns {Promise<object > }
351
336
*/
352
337
getTransactionByHash ( txhash ) {
353
338
return this . _createRequest ( {
@@ -360,10 +345,9 @@ class EtherscanApi {
360
345
/**
361
346
* Returns information about a transaction by block number and transaction
362
347
* index position
363
- * @method getTransactionByBlockNumberAndIndex
364
348
* @param {number } blockNumber
365
349
* @param {number } [index=0]
366
- * @returns {Promise<TransactionDescription > }
350
+ * @returns {Promise<object > }
367
351
*/
368
352
getTransactionByBlockNumberAndIndex ( blockNumber , index = 0 ) {
369
353
return this . _createRequest ( {
@@ -376,7 +360,6 @@ class EtherscanApi {
376
360
377
361
/**
378
362
* Returns the number of transactions sent from an address
379
- * @method getTransactionCount
380
363
* @param {string } address Transaction address
381
364
* @returns {Promise<number> }
382
365
*/
@@ -394,7 +377,6 @@ class EtherscanApi {
394
377
/**
395
378
* Creates new message call transaction or a contract creation for signed
396
379
* transactions
397
- * @method sendRawTransaction
398
380
* @param {string } hex Raw hex encoded transaction that you want to send
399
381
*/
400
382
sendRawTransaction ( hex ) {
@@ -407,9 +389,8 @@ class EtherscanApi {
407
389
408
390
/**
409
391
* Returns the receipt of a transaction by transaction hash
410
- * @method getTransactionReceipt
411
392
* @param {string } txhash Transaction hash
412
- * @returns {Promise<TransactionReceipt > }
393
+ * @returns {Promise<object > }
413
394
*/
414
395
getTransactionReceipt ( txhash ) {
415
396
return this . _createRequest ( {
@@ -422,7 +403,6 @@ class EtherscanApi {
422
403
/**
423
404
* Executes a new message call immediately without creating a transaction on
424
405
* the block chain
425
- * @method call
426
406
* @param {string } to Address to execute from
427
407
* @param {string } data Data to transfer
428
408
* @returns {Promise<string> }
@@ -439,7 +419,6 @@ class EtherscanApi {
439
419
440
420
/**
441
421
* Returns code at a given address
442
- * @method getCode
443
422
* @param {string } address
444
423
* @returns {Promise<string> }
445
424
*/
@@ -454,7 +433,6 @@ class EtherscanApi {
454
433
455
434
/**
456
435
* Returns the value from a storage position at a given address.
457
- * @method getStorageAt
458
436
* @param {string } address
459
437
* @param {number } position
460
438
* @returns {Promise<string> }
@@ -471,7 +449,6 @@ class EtherscanApi {
471
449
472
450
/**
473
451
* Returns the current price per gas (in wei by default)
474
- * @method getGasPrice
475
452
* @param {string } [unit=wei] Unit of gas
476
453
* @returns {string }
477
454
*/
@@ -496,7 +473,6 @@ class EtherscanApi {
496
473
/**
497
474
* Makes a call or transaction, which won't be added to the blockchain and
498
475
* returns the used gas, which can be used for estimating the used gas
499
- * @method estimateGas
500
476
* @param {string } to Address to get code from
501
477
* @param {string } value Storage position
502
478
* @param {string } gasPrice Gas price in wei
@@ -515,7 +491,6 @@ class EtherscanApi {
515
491
516
492
/**
517
493
* Returns ERC20-Token total supply by contract address
518
- * @method getTokenByContractAddress
519
494
* @param {string } contractAddress
520
495
* @returns {Promise<string> }
521
496
*/
@@ -529,7 +504,6 @@ class EtherscanApi {
529
504
530
505
/**
531
506
* Returns ERC20-Token account balance by token's contract address
532
- * @method getTokenBalanceByContractAddress
533
507
* @param {string } contractAddress
534
508
* @returns {Promise<string> }
535
509
*/
@@ -545,7 +519,6 @@ class EtherscanApi {
545
519
546
520
/**
547
521
* Returns total supply of Ether
548
- * @method getTotalEtherSupply
549
522
* @returns {Promise<string> }
550
523
*/
551
524
getTotalEtherSupply ( ) {
@@ -557,8 +530,7 @@ class EtherscanApi {
557
530
558
531
/**
559
532
* Returns Ether last price
560
- * @method getEtherLastPrice
561
- * @returns {Promise<EtherPrice> }
533
+ * @returns {Promise<object> }
562
534
*/
563
535
getEtherLastPrice ( ) {
564
536
return this . _createRequest ( {
0 commit comments