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

Commit1559a3f

Browse files
added support for txsToken with contract address too
1 parentcafcdff commit1559a3f

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,25 @@ public interface IAccountApi {
110110
@NotNull
111111
List<TxToken>txsToken(Stringaddress)throwsApiException;
112112

113+
/**
114+
* All ERC-20 token txs for given address and contract address
115+
*
116+
* @param address get txs for
117+
* @param contractAddress contract address to get txs for
118+
* @param startBlock tx from this blockNumber
119+
* @param endBlock tx to this blockNumber
120+
* @return txs for address
121+
* @throws ApiException parent exception class
122+
*/
123+
@NotNull
124+
List<TxToken>txsToken(Stringaddress,StringcontractAddress,longstartBlock,longendBlock)throwsApiException;
125+
126+
@NotNull
127+
List<TxToken>txsToken(Stringaddress,StringcontractAddress,longstartBlock)throwsApiException;
128+
129+
@NotNull
130+
List<TxToken>txsToken(Stringaddress,StringcontractAddress)throwsApiException;
131+
113132
/**
114133
* All ERC-721 (NFT) token txs for given address
115134
*

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,32 @@ public List<TxToken> txsToken(final String address, final long startBlock, final
230230
returngetRequestUsingOffset(urlParams,TxTokenResponseTO.class);
231231
}
232232

233+
@NotNull
234+
@Override
235+
publicList<TxToken>txsToken(finalStringaddress,finalStringcontractAddress)throwsApiException {
236+
returntxsToken(address,contractAddress,MIN_START_BLOCK);
237+
}
238+
239+
@NotNull
240+
@Override
241+
publicList<TxToken>txsToken(finalStringaddress,finalStringcontractAddress,finallongstartBlock)throwsApiException {
242+
returntxsToken(address,contractAddress,startBlock,MAX_END_BLOCK);
243+
}
244+
245+
@NotNull
246+
@Override
247+
publicList<TxToken>txsToken(finalStringaddress,finalStringcontractAddress,finallongstartBlock,finallongendBlock)throwsApiException {
248+
BasicUtils.validateAddress(address);
249+
finalBlockParamblocks =BasicUtils.compensateBlocks(startBlock,endBlock);
250+
251+
finalStringoffsetParam =PAGE_PARAM +"%s" +OFFSET_PARAM +OFFSET_MAX;
252+
finalStringblockParam =START_BLOCK_PARAM +blocks.start() +END_BLOCK_PARAM +blocks.end();
253+
finalStringurlParams =ACT_TX_TOKEN_ACTION +offsetParam +ADDRESS_PARAM +address
254+
+CONTRACT_PARAM +contractAddress +blockParam +SORT_ASC_PARAM;
255+
256+
returngetRequestUsingOffset(urlParams,TxTokenResponseTO.class);
257+
}
258+
233259
@NotNull
234260
@Override
235261
publicList<TxToken>txsNftToken(Stringaddress)throwsApiException {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp