-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathAccountAPI.java
216 lines (185 loc) Β· 7.26 KB
/
AccountAPI.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
package io.goodforgod.api.etherscan;
import io.goodforgod.api.etherscan.error.EtherScanException;
import io.goodforgod.api.etherscan.model.*;
import java.util.List;
import org.jetbrains.annotations.NotNull;
/**
* EtherScan - API Descriptions <a href="https://docs.etherscan.io/api-endpoints/accounts">...</a>
*
* @author GoodforGod
* @since 28.10.2018
*/
public interface AccountAPI {
/**
* Address ETH balance
*
* @param address get balance for
* @return balance
* @throws EtherScanException parent exception class
*/
@NotNull
Balance balance(@NotNull String address) throws EtherScanException;
/**
* ERC20 token balance for address
*
* @param address get balance for
* @param contract token contract
* @return token balance for address
* @throws EtherScanException parent exception class
*/
@NotNull
TokenBalance balance(@NotNull String address, @NotNull String contract) throws EtherScanException;
/**
* Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than
* 1 request performed
*
* @param addresses addresses to get balances for
* @return list of balances
* @throws EtherScanException parent exception class
*/
@NotNull
List<Balance> balances(@NotNull List<String> addresses) throws EtherScanException;
/**
* All txs for given address
*
* @param address get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<Tx> txs(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
@NotNull
List<Tx> txs(@NotNull String address, long startBlock) throws EtherScanException;
@NotNull
List<Tx> txs(@NotNull String address) throws EtherScanException;
/**
* All internal txs for given address
*
* @param address get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxInternal> txsInternal(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
@NotNull
List<TxInternal> txsInternal(@NotNull String address, long startBlock) throws EtherScanException;
@NotNull
List<TxInternal> txsInternal(@NotNull String address) throws EtherScanException;
/**
* All internal tx for given transaction hash
*
* @param txhash transaction hash
* @return internal txs list
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxInternal> txsInternalByHash(@NotNull String txhash) throws EtherScanException;
/**
* All ERC-20 token txs for given address
*
* @param address get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxErc20> txsErc20(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
@NotNull
List<TxErc20> txsErc20(@NotNull String address, long startBlock) throws EtherScanException;
@NotNull
List<TxErc20> txsErc20(@NotNull String address) throws EtherScanException;
/**
* All ERC-20 token txs for given address and contract address
*
* @param address get txs for
* @param contractAddress contract address to get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)
throws EtherScanException;
@NotNull
List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;
@NotNull
List<TxErc20> txsErc20(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;
/**
* All ERC-721 (NFT) token txs for given address
*
* @param address get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxErc721> txsErc721(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
@NotNull
List<TxErc721> txsErc721(@NotNull String address, long startBlock) throws EtherScanException;
@NotNull
List<TxErc721> txsErc721(@NotNull String address) throws EtherScanException;
/**
* All ERC-721 (NFT) token txs for given address
*
* @param address get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)
throws EtherScanException;
@NotNull
List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress, long startBlock) throws EtherScanException;
@NotNull
List<TxErc721> txsErc721(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;
/**
* All ERC-721 (NFT) token txs for given address
*
* @param address get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxErc1155> txsErc1155(@NotNull String address, long startBlock, long endBlock) throws EtherScanException;
@NotNull
List<TxErc1155> txsErc1155(@NotNull String address, long startBlock) throws EtherScanException;
@NotNull
List<TxErc1155> txsErc1155(@NotNull String address) throws EtherScanException;
/**
* All ERC-721 (NFT) token txs for given address
*
* @param address get txs for
* @param startBlock tx from this blockNumber
* @param endBlock tx to this blockNumber
* @return txs for address
* @throws EtherScanException parent exception class
*/
@NotNull
List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock, long endBlock)
throws EtherScanException;
@NotNull
List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress, long startBlock)
throws EtherScanException;
@NotNull
List<TxErc1155> txsErc1155(@NotNull String address, @NotNull String contractAddress) throws EtherScanException;
/**
* All blocks mined by address
*
* @param address address to search for
* @return blocks mined
* @throws EtherScanException parent exception class
*/
@NotNull
List<Block> blocksMined(@NotNull String address) throws EtherScanException;
}