Skip to content

Commit 664cb72

Browse files
committed
[1.1.0-SNAPSHOT]
Error handling and error message improved RateLimitException handling added and improved HttpExecutor impl error handling improved IQueueManager contract refactored QueueManager semaphore impl added IQueueManager construct parameter added Default queue manager 1req\7 sec added as other limits throw rate limit
1 parent 33b519f commit 664cb72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+492
-379
lines changed

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

+52-25
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import java.util.List;
88

99
/**
10-
* EtherScan - API Descriptions
11-
* https://etherscan.io/apis#accounts
10+
* EtherScan - API Descriptions https://etherscan.io/apis#accounts
1211
*
1312
* @author GoodforGod
1413
* @since 28.10.2018
@@ -17,79 +16,107 @@ public interface IAccountApi {
1716

1817
/**
1918
* Address ETH balance
19+
*
2020
* @param address get balance for
2121
* @return balance
2222
* @throws ApiException parent exception class
2323
*/
24-
@NotNull Balance balance(String address) throws ApiException;
24+
@NotNull
25+
Balance balance(String address) throws ApiException;
2526

2627
/**
2728
* ERC20 token balance for address
28-
* @param address get balance for
29+
*
30+
* @param address get balance for
2931
* @param contract token contract
3032
* @return token balance for address
3133
* @throws ApiException parent exception class
3234
*/
33-
@NotNull TokenBalance balance(String address, String contract) throws ApiException;
35+
@NotNull
36+
TokenBalance balance(String address, String contract) throws ApiException;
3437

3538
/**
36-
* Maximum 20 address for single batch request
37-
* If address MORE THAN 20, then there will be more than 1 request performed
39+
* Maximum 20 address for single batch request If address MORE THAN 20, then
40+
* there will be more than 1 request performed
41+
*
3842
* @param addresses addresses to get balances for
3943
* @return list of balances
4044
* @throws ApiException parent exception class
4145
*/
42-
@NotNull List<Balance> balances(List<String> addresses) throws ApiException;
46+
@NotNull
47+
List<Balance> balances(List<String> addresses) throws ApiException;
4348

4449
/**
4550
* All txs for given address
46-
* @param address get txs for
51+
*
52+
* @param address get txs for
4753
* @param startBlock tx from this blockNumber
48-
* @param endBlock tx to this blockNumber
54+
* @param endBlock tx to this blockNumber
4955
* @return txs for address
5056
* @throws ApiException parent exception class
5157
*/
52-
@NotNull List<Tx> txs(String address, long startBlock, long endBlock) throws ApiException;
53-
@NotNull List<Tx> txs(String address, long startBlock) throws ApiException;
54-
@NotNull List<Tx> txs(String address) throws ApiException;
58+
@NotNull
59+
List<Tx> txs(String address, long startBlock, long endBlock) throws ApiException;
60+
61+
@NotNull
62+
List<Tx> txs(String address, long startBlock) throws ApiException;
63+
64+
@NotNull
65+
List<Tx> txs(String address) throws ApiException;
5566

5667
/**
5768
* All internal txs for given address
58-
* @param address get txs for
69+
*
70+
* @param address get txs for
5971
* @param startBlock tx from this blockNumber
60-
* @param endBlock tx to this blockNumber
72+
* @param endBlock tx to this blockNumber
6173
* @return txs for address
6274
* @throws ApiException parent exception class
6375
*/
64-
@NotNull List<TxInternal> txsInternal(String address, long startBlock, long endBlock) throws ApiException;
65-
@NotNull List<TxInternal> txsInternal(String address, long startBlock) throws ApiException;
66-
@NotNull List<TxInternal> txsInternal(String address) throws ApiException;
76+
@NotNull
77+
List<TxInternal> txsInternal(String address, long startBlock, long endBlock) throws ApiException;
78+
79+
@NotNull
80+
List<TxInternal> txsInternal(String address, long startBlock) throws ApiException;
81+
82+
@NotNull
83+
List<TxInternal> txsInternal(String address) throws ApiException;
6784

6885
/**
6986
* All internal tx for given transaction hash
87+
*
7088
* @param txhash transaction hash
7189
* @return internal txs list
7290
* @throws ApiException parent exception class
7391
*/
74-
@NotNull List<TxInternal> txsInternalByHash(String txhash) throws ApiException;
92+
@NotNull
93+
List<TxInternal> txsInternalByHash(String txhash) throws ApiException;
7594

7695
/**
7796
* All token txs for given address
78-
* @param address get txs for
97+
*
98+
* @param address get txs for
7999
* @param startBlock tx from this blockNumber
80-
* @param endBlock tx to this blockNumber
100+
* @param endBlock tx to this blockNumber
81101
* @return txs for address
82102
* @throws ApiException parent exception class
83103
*/
84-
@NotNull List<TxToken> txsToken(String address, long startBlock, long endBlock) throws ApiException;
85-
@NotNull List<TxToken> txsToken(String address, long startBlock) throws ApiException;
86-
@NotNull List<TxToken> txsToken(String address) throws ApiException;
104+
@NotNull
105+
List<TxToken> txsToken(String address, long startBlock, long endBlock) throws ApiException;
106+
107+
@NotNull
108+
List<TxToken> txsToken(String address, long startBlock) throws ApiException;
109+
110+
@NotNull
111+
List<TxToken> txsToken(String address) throws ApiException;
87112

88113
/**
89114
* All blocks mined by address
115+
*
90116
* @param address address to search for
91117
* @return blocks mined
92118
* @throws ApiException parent exception class
93119
*/
94-
@NotNull List<Block> minedBlocks(String address) throws ApiException;
120+
@NotNull
121+
List<Block> minedBlocks(String address) throws ApiException;
95122
}

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import java.util.Optional;
88

99
/**
10-
* EtherScan - API Descriptions
11-
* https://etherscan.io/apis#blocks
10+
* EtherScan - API Descriptions https://etherscan.io/apis#blocks
1211
*
1312
* @author GoodforGod
1413
* @since 30.10.2018
@@ -17,9 +16,11 @@ public interface IBlockApi {
1716

1817
/**
1918
* Return uncle blocks
19+
*
2020
* @param blockNumber block number form 0 to last
2121
* @return optional uncle blocks
2222
* @throws ApiException parent exception class
2323
*/
24-
@NotNull Optional<UncleBlock> uncles(long blockNumber) throws ApiException;
24+
@NotNull
25+
Optional<UncleBlock> uncles(long blockNumber) throws ApiException;
2526
}

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import org.jetbrains.annotations.NotNull;
66

77
/**
8-
* EtherScan - API Descriptions
9-
* https://etherscan.io/apis#contracts
8+
* EtherScan - API Descriptions https://etherscan.io/apis#contracts
109
*
1110
* @author GoodforGod
1211
* @since 28.10.2018
@@ -15,9 +14,11 @@ public interface IContractApi {
1514

1615
/**
1716
* Get Verified Contract Sources
17+
*
1818
* @param address to verify
1919
* @return ABI verified
2020
* @throws ApiException parent exception class
2121
*/
22-
@NotNull Abi contractAbi(String address) throws ApiException;
22+
@NotNull
23+
Abi contractAbi(String address) throws ApiException;
2324
}

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
package io.api.etherscan.core;
22

33
import io.api.etherscan.error.ApiException;
4-
import io.api.etherscan.model.Log;
54
import io.api.etherscan.model.event.IEvent;
65
import io.api.etherscan.model.query.impl.LogQuery;
76
import org.jetbrains.annotations.NotNull;
87

98
import java.util.List;
109

1110
/**
12-
* EtherScan - API Descriptions
13-
* https://etherscan.io/apis#logs
11+
* EtherScan - API Descriptions https://etherscan.io/apis#logs
1412
*/
1513
public interface IEventsApi {
1614

1715
/**
18-
* This is a high-level alternative to the ILogsApi and an alternative to the native eth_getLogs
19-
* Read at EtherScan API description for full info!
16+
* This is a high-level alternative to the ILogsApi and an alternative to the
17+
* native eth_getLogs Read at EtherScan API description for full info!
18+
*
2019
* @param query build log query
2120
* @return logs according to query
2221
* @throws ApiException parent exception class

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@
88
import java.util.List;
99

1010
/**
11-
* EtherScan - API Descriptions
12-
* https://etherscan.io/apis#logs
11+
* EtherScan - API Descriptions https://etherscan.io/apis#logs
1312
*
1413
* @author GoodforGod
1514
* @since 30.10.2018
1615
*/
1716
public interface ILogsApi {
1817

1918
/**
20-
* alternative to the native eth_getLogs
21-
* Read at EtherScan API description for full info!
19+
* alternative to the native eth_getLogs Read at EtherScan API description for
20+
* full info!
21+
*
2222
* @param query build log query
2323
* @return logs according to query
2424
* @throws ApiException parent exception class
2525
*
2626
* @see io.api.etherscan.model.query.impl.LogQueryBuilder
2727
*/
28-
@NotNull List<Log> logs(LogQuery query) throws ApiException;
28+
@NotNull
29+
List<Log> logs(LogQuery query) throws ApiException;
2930
}

0 commit comments

Comments
 (0)