Skip to content

Commit 348ee66

Browse files
committed
Javadoc fixes
1 parent 0848007 commit 348ee66

File tree

11 files changed

+108
-44
lines changed

11 files changed

+108
-44
lines changed

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.github.goodforgod</groupId>
77
<artifactId>java-etherscan-api</artifactId>
8-
<version>1.0.1</version>
8+
<version>1.0.1-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

1111
<name>${project.groupId}:${project.artifactId}</name>
@@ -149,9 +149,6 @@
149149
<groupId>org.apache.maven.plugins</groupId>
150150
<artifactId>maven-javadoc-plugin</artifactId>
151151
<version>${maven-javadoc-plugin-version}</version>
152-
<configuration>
153-
<additionalOptions>-html5</additionalOptions>
154-
</configuration>
155152
<executions>
156153
<execution>
157154
<id>attach-javadocs</id>
@@ -160,6 +157,9 @@
160157
</goals>
161158
</execution>
162159
</executions>
160+
<configuration>
161+
<additionalOptions>-html5</additionalOptions>
162+
</configuration>
163163
</plugin>
164164
</plugins>
165165
</build>

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

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,61 @@
1515
*/
1616
public interface IAccountApi {
1717

18-
/** Address ETH balance */
18+
/**
19+
* Address ETH balance
20+
* @param address to look for
21+
* @return balance
22+
*/
1923
@NotNull Balance balance(String address) throws ApiException;
2024

21-
/** ERC20 token balance for address */
25+
/**
26+
* ERC20 token balance for address
27+
* @param address to look for
28+
* @param contract for token
29+
* @return token balance
30+
*/
2231
@NotNull TokenBalance balance(String address, String contract) throws ApiException;
2332

2433
/**
2534
* Maximum 20 address for single batch request
26-
* If address > 20, then there will be more than 1 request performed
35+
* If addresses more than 20, then there will be MORE than 1 request performed
36+
* @param addresses to look for
37+
* @return balance[0] for address[0], etc
2738
*/
2839
@NotNull List<Balance> balances(List<String> addresses) throws ApiException;
2940

30-
/** All txs */
41+
/**
42+
* Find all txs
43+
* @param address to look for txs
44+
* @return tx info
45+
*/
3146
@NotNull List<Tx> txs(String address) throws ApiException;
3247
@NotNull List<Tx> txs(String address, long startBlock) throws ApiException;
3348
@NotNull List<Tx> txs(String address, long startBlock, long endBlock) throws ApiException;
3449

35-
/** All internal txs */
50+
/**
51+
* All internal txs
52+
* @param address to look for
53+
* @return internal tx
54+
*/
3655
@NotNull List<TxInternal> txsInternal(String address) throws ApiException;
3756
@NotNull List<TxInternal> txsInternal(String address, long startBlock) throws ApiException;
3857
@NotNull List<TxInternal> txsInternal(String address, long startBlock, long endBlock) throws ApiException;
3958
@NotNull List<TxInternal> txsInternalByHash(String txhash);
4059

41-
/** All token txs */
60+
/**
61+
* All token txs
62+
* @param address to look for
63+
* @return token txs
64+
*/
4265
@NotNull List<TxToken> txsToken(String address) throws ApiException;
4366
@NotNull List<TxToken> txsToken(String address, long startBlock) throws ApiException;
4467
@NotNull List<TxToken> txsToken(String address, long startBlock, long endBlock) throws ApiException;
4568

46-
/** All blocks mined by address */
69+
/**
70+
* All blocks mined by address
71+
* @param address to look for
72+
* @return mined blocks
73+
*/
4774
@NotNull List<Block> minedBlocks(String address) throws ApiException;
4875
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
*/
1616
public interface IBlockApi {
1717

18-
/** Return uncle blocks */
18+
/**
19+
* Return uncle blocks
20+
* @param blockNumber block number
21+
* @return uncle block
22+
*/
1923
@NotNull Optional<UncleBlock> uncles(long blockNumber) throws ApiException;
2024
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
*/
1414
public interface IContractApi {
1515

16-
/** Get Verified Contract Sources */
16+
/**
17+
* Get Verified Contract Sources
18+
* @param address to look for
19+
* @return abi for contract
20+
*/
1721
@NotNull Abi contractAbi(String address) throws ApiException;
1822
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
public interface ILogsApi {
1818

1919
/**
20-
* alternative to the native eth_getLogs
20+
* Alternative to the native eth_getLogs
2121
* Read at EtherScan API description for full info!
22+
* @see LogQuery
23+
* @param query for logs (check etherscan specs)
24+
* @return logs
2225
*/
2326
@NotNull List<Log> logs(LogQuery query) throws ApiException;
2427
}

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,86 +21,115 @@ public interface IProxyApi {
2121
/**
2222
* Returns the number of most recent block
2323
* eth_blockNumber
24+
* @return last block number
2425
*/
2526
long blockNoLast();
2627

2728
/**
2829
* Returns information about a block by block number
2930
* eth_getBlockByNumber
31+
* @param blockNo block number
32+
* @return block info
3033
*/
3134
@NotNull Optional<BlockProxy> block(long blockNo) throws ApiException;
3235

3336
/**
3437
* Returns information about a uncle by block number
3538
* eth_getUncleByBlockNumberAndIndex
39+
* @param blockNo block number
40+
* @param index uncle block index
41+
* @return block info
3642
*/
3743
@NotNull Optional<BlockProxy> blockUncle(long blockNo, long index) throws ApiException;
3844

3945
/**
4046
* Returns the information about a transaction requested by transaction hash
4147
* eth_getTransactionByHash
48+
* @param txhash tx hash
49+
* @return tx info
4250
*/
4351
@NotNull Optional<TxProxy> tx(String txhash) throws ApiException;
4452

4553
/**
4654
* Returns information about a transaction by block number and transaction index position
4755
* eth_getTransactionByBlockNumberAndIndex
56+
* @param blockNo block number
57+
* @param index tx index in block
58+
* @return tx info
4859
*/
4960
@NotNull Optional<TxProxy> tx(long blockNo, long index) throws ApiException;
5061

5162
/**
5263
* Returns the number of transactions in a block from a block matching the given block number
5364
* eth_getBlockTransactionCountByNumber
65+
* @param blockNo block number
66+
* @return tx count in block
5467
*/
5568
int txCount(long blockNo) throws ApiException;
5669

5770
/**
5871
* Returns the number of transactions sent from an address
5972
* eth_getTransactionCount
73+
* @param address to look for
74+
* @return tx send count
6075
*/
6176
int txSendCount(String address) throws ApiException;
6277

6378
/**
6479
* Creates new message call transaction or a contract creation for signed transactions
6580
* eth_sendRawTransaction
81+
* @param hexEncodedTx tx as hex
82+
* @return result (check eth grpc info)
6683
*/
6784
@NotNull Optional<String> txSendRaw(String hexEncodedTx) throws ApiException;
6885

6986
/**
7087
* Returns the receipt of a transaction by transaction hash
7188
* eth_getTransactionReceipt
89+
* @param txhash tx hash
90+
* @return receipt
7291
*/
7392
@NotNull Optional<ReceiptProxy> txReceipt(String txhash) throws ApiException;
7493

7594
/**
7695
* Executes a new message call immediately without creating a transaction on the block chain
7796
* eth_call
97+
* @param address to look for
98+
* @param data in tx for call
99+
* @return result (check eth grpc info)
78100
*/
79101
@NotNull Optional<String> call(String address, String data) throws ApiException;
80102

81103
/**
82104
* Returns code at a given address
83105
* eth_getCode
106+
* @param address to look for
107+
* @return result (check eth grpc info)
84108
*/
85109
@NotNull Optional<String> code(String address) throws ApiException;
86110

87111
/**
88112
* (**experimental)
89113
* Returns the value from a storage position at a given address
90114
* eth_getStorageAt
115+
* @param address to look for
116+
* @param position storage position
117+
* @return result (check eth grpc info)
91118
*/
92119
@NotNull Optional<String> storageAt(String address, long position) throws ApiException;
93120

94121
/**
95122
* Returns the current price per gas in wei
96123
* eth_gasPrice
124+
* @return price
97125
*/
98126
@NotNull BigInteger gasPrice() throws ApiException;
99127

100128
/**
101129
* Makes a call or transaction, which won't be added to the blockchain and returns the used gas,
102130
* which can be used for estimating the used gas
103131
* eth_estimateGas
132+
* @return gas estimate
104133
*/
105134
@NotNull BigInteger gasEstimated() throws ApiException;
106135
@NotNull BigInteger gasEstimated(String hexData) throws ApiException;

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@
1616
*/
1717
public interface IStatisticApi {
1818

19-
/** ERC20 token total Supply */
19+
/**
20+
* ERC20 token total Supply
21+
* @param contract to look for
22+
* @return token supply
23+
*/
2024
@NotNull BigInteger supply(String contract) throws ApiException;
2125

22-
/** Eth total supply */
26+
/**
27+
* Eth total supply
28+
* @return ETH supply
29+
*/
2330
@NotNull Supply supply() throws ApiException;
2431

25-
/** Eth last USD and BTC price */
32+
/**
33+
* Eth last USD and BTC price
34+
* @return last price
35+
*/
2636
@NotNull Price lastPrice() throws ApiException;
2737
}

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@
1515
*/
1616
public interface ITransactionApi {
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 to look for
21+
* @return exec status
22+
*/
1923
@NotNull Optional<Status> execStatus(String txhash) throws ApiException;
2024

21-
/** Check Transaction Receipt Status (Only applicable for Post Byzantium fork transactions)
25+
/**
26+
* Check Transaction Receipt Status (Only applicable for Post Byzantium fork transactions)
2227
* 0 = Fail, 1 = Pass
2328
* empty value for pre-byzantium fork
24-
* */
29+
* @param txhash to look for
30+
* @return status as boolean
31+
*/
2532
@NotNull Optional<Boolean> receiptStatus(String txhash) throws ApiException;
2633
}

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,57 +83,36 @@ public EtherScanApi(final String apiKey,
8383
this.txs = new TransactionApiProvider(masterQueue, baseUrl, executor);
8484
}
8585

86-
/**
87-
* API for interactions with account and address
88-
*/
8986
@NotNull
9087
public IAccountApi account() {
9188
return account;
9289
}
9390

94-
/**
95-
* API for verifying contract ABI
96-
*/
9791
@NotNull
9892
public IContractApi contract() {
9993
return contract;
10094
}
10195

102-
/**
103-
* [BETA] API for interaction with tx statuses
104-
*/
10596
@NotNull
10697
public ITransactionApi txs() {
10798
return txs;
10899
}
109100

110-
/**
111-
* [BETA] API for getting block rewards and uncles
112-
*/
113101
@NotNull
114102
public IBlockApi block() {
115103
return block;
116104
}
117105

118-
/**
119-
* [BETA] API for interaction with eth_getLogs
120-
*/
121106
@NotNull
122107
public ILogsApi logs() {
123108
return logs;
124109
}
125110

126-
/**
127-
* API for interacting with geth/proxy etherscan
128-
*/
129111
@NotNull
130112
public IProxyApi proxy() {
131113
return proxy;
132114
}
133115

134-
/**
135-
* API for eth price and supply statistic
136-
*/
137116
@NotNull
138117
public IStatisticApi stats() {
139118
return stats;

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 is turn available
1516
*/
1617
boolean takeTurn();
1718
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public void queueManagerWithDelay() {
4343
public void queueManagerTimeout() {
4444
IQueueManager queueManager = new QueueManager(1, 3);
4545
assertTrue(queueManager.takeTurn());
46-
long start = System.currentTimeMillis();
46+
final long start = System.currentTimeMillis();
4747
queueManager.takeTurn();
48-
long end = System.currentTimeMillis();
49-
assertEquals(3, (end - start) / 1000);
48+
final long end = System.currentTimeMillis();
49+
assertEquals(3, (end - start) / 950);
5050
}
5151
}

0 commit comments

Comments
 (0)