Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit296d156

Browse files
committed
JavaDoc Improvements
Final 1.0.0
1 parent9512b09 commit296d156

File tree

10 files changed

+161
-26
lines changed

10 files changed

+161
-26
lines changed

‎src/main/java/io/api/etherscan/core/IAccountApi.java‎

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,81 @@
1515
*/
1616
publicinterfaceIAccountApi {
1717

18-
/** Address ETH balance */
18+
/**
19+
* Address ETH balance
20+
* @param address get balance for
21+
* @return balance
22+
* @throws ApiException parent exception class
23+
*/
1924
@NotNullBalancebalance(Stringaddress)throwsApiException;
2025

21-
/** ERC20 token balance for address */
26+
/**
27+
* ERC20 token balance for address
28+
* @param address get balance for
29+
* @param contract token contract
30+
* @return token balance for address
31+
* @throws ApiException parent exception class
32+
*/
2233
@NotNullTokenBalancebalance(Stringaddress,Stringcontract)throwsApiException;
2334

2435
/**
2536
* Maximum 20 address for single batch request
26-
* If address > 20, then there will be more than 1 request performed
37+
* If address MORE THAN 20, then there will be more than 1 request performed
38+
* @param addresses addresses to get balances for
39+
* @return list of balances
40+
* @throws ApiException parent exception class
2741
*/
2842
@NotNullList<Balance>balances(List<String>addresses)throwsApiException;
2943

30-
/** All txs */
31-
@NotNullList<Tx>txs(Stringaddress)throwsApiException;
32-
@NotNullList<Tx>txs(Stringaddress,longstartBlock)throwsApiException;
44+
/**
45+
* All txs for given address
46+
* @param address get txs for
47+
* @param startBlock tx from this blockNumber
48+
* @param endBlock tx to this blockNumber
49+
* @return txs for address
50+
* @throws ApiException parent exception class
51+
*/
3352
@NotNullList<Tx>txs(Stringaddress,longstartBlock,longendBlock)throwsApiException;
53+
@NotNullList<Tx>txs(Stringaddress,longstartBlock)throwsApiException;
54+
@NotNullList<Tx>txs(Stringaddress)throwsApiException;
3455

35-
/** All internal txs */
36-
@NotNullList<TxInternal>txsInternal(Stringaddress)throwsApiException;
37-
@NotNullList<TxInternal>txsInternal(Stringaddress,longstartBlock)throwsApiException;
56+
/**
57+
* All internal txs for given address
58+
* @param address get txs for
59+
* @param startBlock tx from this blockNumber
60+
* @param endBlock tx to this blockNumber
61+
* @return txs for address
62+
* @throws ApiException parent exception class
63+
*/
3864
@NotNullList<TxInternal>txsInternal(Stringaddress,longstartBlock,longendBlock)throwsApiException;
39-
@NotNullList<TxInternal>txsInternalByHash(Stringtxhash);
65+
@NotNullList<TxInternal>txsInternal(Stringaddress,longstartBlock)throwsApiException;
66+
@NotNullList<TxInternal>txsInternal(Stringaddress)throwsApiException;
4067

41-
/** All token txs */
42-
@NotNullList<TxToken>txsToken(Stringaddress)throwsApiException;
43-
@NotNullList<TxToken>txsToken(Stringaddress,longstartBlock)throwsApiException;
68+
/**
69+
* All internal tx for given transaction hash
70+
* @param txhash transaction hash
71+
* @return internal txs list
72+
* @throws ApiException parent exception class
73+
*/
74+
@NotNullList<TxInternal>txsInternalByHash(Stringtxhash)throwsApiException;
75+
76+
/**
77+
* All token txs for given address
78+
* @param address get txs for
79+
* @param startBlock tx from this blockNumber
80+
* @param endBlock tx to this blockNumber
81+
* @return txs for address
82+
* @throws ApiException parent exception class
83+
*/
4484
@NotNullList<TxToken>txsToken(Stringaddress,longstartBlock,longendBlock)throwsApiException;
85+
@NotNullList<TxToken>txsToken(Stringaddress,longstartBlock)throwsApiException;
86+
@NotNullList<TxToken>txsToken(Stringaddress)throwsApiException;
4587

46-
/** All blocks mined by address */
88+
/**
89+
* All blocks mined by address
90+
* @param address address to search for
91+
* @return blocks mined
92+
* @throws ApiException parent exception class
93+
*/
4794
@NotNullList<Block>minedBlocks(Stringaddress)throwsApiException;
4895
}

‎src/main/java/io/api/etherscan/core/IBlockApi.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
*/
1616
publicinterfaceIBlockApi {
1717

18-
/** Return uncle blocks */
18+
/**
19+
* Return uncle blocks
20+
* @param blockNumber block number form 0 to last
21+
* @return optional uncle blocks
22+
* @throws ApiException parent exception class
23+
*/
1924
@NotNullOptional<UncleBlock>uncles(longblockNumber)throwsApiException;
2025
}

‎src/main/java/io/api/etherscan/core/IContractApi.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
*/
1414
publicinterfaceIContractApi {
1515

16-
/** Get Verified Contract Sources */
16+
/**
17+
* Get Verified Contract Sources
18+
* @param address to verify
19+
* @return ABI verified
20+
* @throws ApiException parent exception class
21+
*/
1722
@NotNullAbicontractAbi(Stringaddress)throwsApiException;
1823
}

‎src/main/java/io/api/etherscan/core/ILogsApi.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ public interface ILogsApi {
1919
/**
2020
* alternative to the native eth_getLogs
2121
* Read at EtherScan API description for full info!
22+
* @param query build log query
23+
* @return logs according to query
24+
* @throws ApiException parent exception class
25+
*
26+
* @see io.api.etherscan.model.query.impl.LogQueryBuilder
2227
*/
2328
@NotNullList<Log>logs(LogQueryquery)throwsApiException;
2429
}

‎src/main/java/io/api/etherscan/core/IProxyApi.java‎

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,87 +21,132 @@ public interface IProxyApi {
2121
/**
2222
* Returns the number of most recent block
2323
* eth_blockNumber
24+
* @return last block number
25+
* @throws ApiException parent exception class
2426
*/
2527
longblockNoLast();
2628

2729
/**
2830
* Returns information about a block by block number
2931
* eth_getBlockByNumber
32+
* @param blockNo block number from 0 to last
33+
* @return optional block result
34+
* @throws ApiException parent exception class
3035
*/
3136
@NotNullOptional<BlockProxy>block(longblockNo)throwsApiException;
3237

3338
/**
3439
* Returns information about a uncle by block number
3540
* eth_getUncleByBlockNumberAndIndex
41+
* @param blockNo block number from 0 to last
42+
* @param index uncle block index
43+
* @return optional block result
44+
* @throws ApiException parent exception class
3645
*/
3746
@NotNullOptional<BlockProxy>blockUncle(longblockNo,longindex)throwsApiException;
3847

3948
/**
4049
* Returns the information about a transaction requested by transaction hash
4150
* eth_getTransactionByHash
51+
* @param txhash transaction hash
52+
* @return optional tx result
53+
* @throws ApiException parent exception class
4254
*/
4355
@NotNullOptional<TxProxy>tx(Stringtxhash)throwsApiException;
4456

4557
/**
4658
* Returns information about a transaction by block number and transaction index position
4759
* eth_getTransactionByBlockNumberAndIndex
60+
* @param blockNo block number from 0 to last
61+
* @param index tx index in block
62+
* @return optional tx result
63+
* @throws ApiException parent exception class
4864
*/
4965
@NotNullOptional<TxProxy>tx(longblockNo,longindex)throwsApiException;
5066

5167
/**
5268
* Returns the number of transactions in a block from a block matching the given block number
5369
* eth_getBlockTransactionCountByNumber
70+
* @param blockNo block number from 0 to last
71+
* @return transaction amount in block
72+
* @throws ApiException parent exception class
5473
*/
5574
inttxCount(longblockNo)throwsApiException;
5675

5776
/**
5877
* Returns the number of transactions sent from an address
5978
* eth_getTransactionCount
79+
* @param address eth address
80+
* @return transactions send amount from address
81+
* @throws ApiException parent exception class
6082
*/
6183
inttxSendCount(Stringaddress)throwsApiException;
6284

6385
/**
6486
* Creates new message call transaction or a contract creation for signed transactions
6587
* eth_sendRawTransaction
88+
* @param hexEncodedTx encoded hex data to send
89+
* @return optional string response
90+
* @throws ApiException parent exception class
6691
*/
6792
@NotNullOptional<String>txSendRaw(StringhexEncodedTx)throwsApiException;
6893

6994
/**
7095
* Returns the receipt of a transaction by transaction hash
7196
* eth_getTransactionReceipt
97+
* @param txhash transaction hash
98+
* @return optional tx receipt
99+
* @throws ApiException parent exception class
72100
*/
73101
@NotNullOptional<ReceiptProxy>txReceipt(Stringtxhash)throwsApiException;
74102

75103
/**
76104
* Executes a new message call immediately without creating a transaction on the block chain
77105
* eth_call
106+
* @param address to call
107+
* @param data data to call address
108+
* @return optional the return value of executed contract.
109+
* @throws ApiException parent exception class
78110
*/
79111
@NotNullOptional<String>call(Stringaddress,Stringdata)throwsApiException;
80112

81113
/**
82114
* Returns code at a given address
83115
* eth_getCode
116+
* @param address get code from
117+
* @return optional the code from the given address
118+
* @throws ApiException parent exception class
84119
*/
85120
@NotNullOptional<String>code(Stringaddress)throwsApiException;
86121

87122
/**
88123
* (**experimental)
89124
* Returns the value from a storage position at a given address
90125
* eth_getStorageAt
126+
* @param address to get storage
127+
* @param position storage position
128+
* @return optional the value at this storage position
129+
* @throws ApiException parent exception class
91130
*/
92131
@NotNullOptional<String>storageAt(Stringaddress,longposition)throwsApiException;
93132

94133
/**
95134
* Returns the current price per gas in wei
96135
* eth_gasPrice
136+
* @return estimated gas price
137+
* @throws ApiException parent exception class
97138
*/
98139
@NotNullBigIntegergasPrice()throwsApiException;
99140

141+
100142
/**
101143
* Makes a call or transaction, which won't be added to the blockchain and returns the used gas,
102144
* which can be used for estimating the used gas
103145
* eth_estimateGas
146+
* @param hexData data to calc gas usage for
147+
* @return estimated gas usage
148+
* @throws ApiException parent exception class
104149
*/
105-
@NotNullBigIntegergasEstimated()throwsApiException;
106150
@NotNullBigIntegergasEstimated(StringhexData)throwsApiException;
151+
@NotNullBigIntegergasEstimated()throwsApiException;
107152
}

‎src/main/java/io/api/etherscan/core/IStatisticApi.java‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,25 @@
1616
*/
1717
publicinterfaceIStatisticApi {
1818

19-
/** ERC20 token total Supply */
19+
/**
20+
* ERC20 token total Supply
21+
* @param contract contract address
22+
* @return token supply for specified contract
23+
* @throws ApiException parent exception class
24+
*/
2025
@NotNullBigIntegersupply(Stringcontract)throwsApiException;
2126

22-
/** Eth total supply */
27+
/**
28+
* Eth total supply
29+
* @return total ETH supply for moment
30+
* @throws ApiException parent exception class
31+
*/
2332
@NotNullSupplysupply()throwsApiException;
2433

25-
/** Eth last USD and BTC price */
34+
/**
35+
* Eth last USD and BTC price
36+
* @return last usd/btc price for ETH
37+
* @throws ApiException parent exception class
38+
*/
2639
@NotNullPricelastPrice()throwsApiException;
2740
}

‎src/main/java/io/api/etherscan/core/ITransactionApi.java‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@
1515
*/
1616
publicinterfaceITransactionApi {
1717

18-
/** Check Contract Execution Status (if there was an error during contract execution) */
18+
/**
19+
* Check Contract Execution Status (if there was an error during contract execution)
20+
* @param txhash transaction hash
21+
* @return optional status result
22+
* @throws ApiException parent exception class
23+
*/
1924
@NotNullOptional<Status>execStatus(Stringtxhash)throwsApiException;
2025

21-
/** Check Transaction Receipt Status (Only applicable for Post Byzantium fork transactions)
22-
* 0 = Fail, 1 = Pass
23-
* empty value for pre-byzantium fork
24-
* */
26+
/**
27+
* Check Transaction Receipt Status (Only applicable for Post Byzantium fork transactions)
28+
* @param txhash transaction hash
29+
* @return 0 = Fail, 1 = Pass, empty value for pre-byzantium fork
30+
* @throws ApiException parent exception class
31+
*/
2532
@NotNullOptional<Boolean>receiptStatus(Stringtxhash)throwsApiException;
2633
}

‎src/main/java/io/api/etherscan/core/impl/EtherScanApi.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,48 +82,55 @@ public EtherScanApi(final String apiKey,
8282

8383
/**
8484
* API for interactions with account and address
85+
* @return account api
8586
*/
8687
publicIAccountApiaccount() {
8788
returnaccount;
8889
}
8990

9091
/**
9192
* API for verifying contract ABI
93+
* @return contract api
9294
*/
9395
publicIContractApicontract() {
9496
returncontract;
9597
}
9698

9799
/**
98100
* [BETA] API for interaction with tx statuses
101+
* @return transactions api
99102
*/
100103
publicITransactionApitxs() {
101104
returntxs;
102105
}
103106

104107
/**
105108
* [BETA] API for getting block rewards and uncles
109+
* @return block api
106110
*/
107111
publicIBlockApiblock() {
108112
returnblock;
109113
}
110114

111115
/**
112116
* [BETA] API for interaction with eth_getLogs
117+
* @return logs api
113118
*/
114119
publicILogsApilogs() {
115120
returnlogs;
116121
}
117122

118123
/**
119124
* API for interacting with geth/proxy etherscan
125+
* @return proxy api
120126
*/
121127
publicIProxyApiproxy() {
122128
returnproxy;
123129
}
124130

125131
/**
126132
* API for eth price and supply statistic
133+
* @return statistic api
127134
*/
128135
publicIStatisticApistats() {
129136
returnstats;

‎src/main/java/io/api/etherscan/manager/IQueueManager.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public interface IQueueManager {
1212

1313
/**
1414
* Waits in queue for chance to take turn
15+
* @return can or can not rake turn
1516
*/
1617
booleantakeTurn();
1718
}

‎src/test/java/io/api/manager/QueueManagerTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public void queueManagerTimeout() {
4646
longstart =System.currentTimeMillis();
4747
queueManager.takeTurn();
4848
longend =System.currentTimeMillis();
49-
assertEquals(3,(end -start) /1000);
49+
assertEquals(3,Math.round((double)(end -start)/1000));
5050
}
5151
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp