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

Commit9394bb4

Browse files
committed
Merge branch 'develop'
2 parents9512b09 +9a34b3e commit9394bb4

File tree

58 files changed

+1016
-257
lines changed

Some content is hidden

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

58 files changed

+1016
-257
lines changed

‎README.md‎

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ Library supports all available EtherScan *API* calls for all available *Ethereum
1414
<dependency>
1515
<groupId>com.github.goodforgod</groupId>
1616
<artifactId>java-etherscan-api</artifactId>
17-
<version>1.0.0</version>
17+
<version>1.0.1</version>
1818
</dependency>
1919
```
2020

2121
**Gradle**
2222
```groovy
2323
dependencies {
24-
compile 'com.github.goodforgod:java-etherscan-api:1.0.0'
24+
compile 'com.github.goodforgod:java-etherscan-api:1.0.1'
2525
}
2626
```
2727

@@ -40,12 +40,17 @@ dependencies {
4040
-[Version History](#version-history)
4141

4242
##Mainnet and Testnets
43-
API support Ethereum:*[MAINNET](https://etherscan.io),[ROPSTEN](https://ropsten.etherscan.io),
44-
[KOVAN](https://kovan.etherscan.io),[RINKEBY](https://rinkeby.etherscan.io)* networks.
43+
API support Ethereum:*[MAINNET](https://etherscan.io),
44+
[ROPSTEN](https://ropsten.etherscan.io),
45+
[KOVAN](https://kovan.etherscan.io),
46+
[RINKEBY](https://rinkeby.etherscan.io),
47+
[GORLI](https://goerli.etherscan.io),
48+
[TOBALABA](https://tobalaba.etherscan.com)* networks.
4549
```java
46-
EtherScanApi api=newEtherScanApi(EthNetwork.MAINTNET);
47-
EtherScanApi api=newEtherScanApi(EthNetwork.RINKEBY);
48-
EtherScanApi api=newEtherScanApi("YourApiKey",EthNetwork.KOVAN);
50+
EtherScanApi api=newEtherScanApi(EthNetwork.MAINNET);// Default
51+
EtherScanApi apiRinkeby=newEtherScanApi(EthNetwork.RINKEBY);
52+
EtherScanApi apiRopsten=newEtherScanApi(EthNetwork.ROPSTEN);
53+
EtherScanApi apiKovan=newEtherScanApi("YourApiKey",EthNetwork.KOVAN);
4954
```
5055

5156
##Custom HttpClient
@@ -56,10 +61,10 @@ just implement **IHttpExecutor** by your self or initialize it with your values.
5661
```java
5762
int connectionTimeout=10000;
5863
int readTimeout=7000;
64+
5965
Supplier<IHttpExecutor> supplier= ()->newHttpExecutor(connectionTimeout);
6066
Supplier<IHttpExecutor> supplierFull= ()->newHttpExecutor(connectionTimeout, readTimeout);
61-
62-
67+
6368
EtherScanApi api=newEtherScanApi(EthNetwork.RINKEBY, supplier);
6469
EtherScanApi apiWithKey=newEtherScanApi("YourApiKey",EthNetwork.MAINNET, supplierFull);
6570
```
@@ -70,14 +75,15 @@ You can read about all API methods on [Etherscan](https://etherscan.io/apis)
7075

7176
*Library support all available EtherScan API.*
7277

73-
You can use API with you key or without key as well (Check API request\sec restrictions).
74-
Library support limit when used without key and will limit requests up to*5 req/sec by itself*.
78+
You can use library*with or without* API key*([Check API request\sec restrictions when used without API key](https://ethereum.stackexchange.com/questions/34190/does-etherscan-require-the-use-of-an-api-key))*.
79+
80+
Library will automatically limit requests up to**5 req/sec** when used*without* key.
7581
```java
7682
EtherScanApi api=newEtherScanApi();
7783
EtherScanApi api=newEtherScanApi("YourApiKey");
7884
```
7985

80-
Belowthereare examples for each API category.
86+
Below are examples for each API category.
8187

8288
###Account Api
8389
**Get Ether Balance for a single Address**
@@ -121,6 +127,7 @@ LogQuery query = LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70
121127
.setOpTopic0_2(LogOp.OR)
122128
.setOpTopic1_2(LogOp.AND)
123129
.build();
130+
124131
List<Log> logs= api.logs().logs(query);
125132
```
126133

@@ -152,12 +159,14 @@ Optional<Boolean> status = api.txs().receiptStatus("0x513c1ba0bebf66436b5fed86ab
152159
```
153160

154161
###Token Api
155-
You can read token API[here](https://etherscan.io/apis#tokens)
162+
You can readabouttoken API[here](https://etherscan.io/apis#tokens)
156163

157164
Token API methods migrated to[Account](#account-api) &[Stats](#stats-api) respectfully.
158165

159166
##Version History
160167

168+
**1.0.1** - Gorli & TOBALABA networks support.
169+
161170
**1.0.0** - Initial project with all API functionality, for all available networks, with tests coverage for all cases.
162171

163172
##License

‎pom.xml‎

Lines changed: 5 additions & 2 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.0</version>
8+
<version>1.0.1</version>
99
<packaging>jar</packaging>
1010

1111
<name>${project.groupId}:${project.artifactId}</name>
@@ -53,7 +53,7 @@
5353
<maven-build-plugin-version>3.0.2</maven-build-plugin-version>
5454
<maven-gpg-plugin-version>1.6</maven-gpg-plugin-version>
5555
<maven-source-plugin-version>3.0.1</maven-source-plugin-version>
56-
<maven-javadoc-plugin-version>2.10.4</maven-javadoc-plugin-version>
56+
<maven-javadoc-plugin-version>3.0.1</maven-javadoc-plugin-version>
5757
<maven-nexus-staging-maven-plugin-version>1.6.8</maven-nexus-staging-maven-plugin-version>
5858
<cobertura-plugin-version>2.7</cobertura-plugin-version>
5959

@@ -157,6 +157,9 @@
157157
</goals>
158158
</execution>
159159
</executions>
160+
<configuration>
161+
<additionalOptions>-html5</additionalOptions>
162+
</configuration>
160163
</plugin>
161164
</plugins>
162165
</build>

‎src/main/java/io/api/etherscan/App.java‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎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
publicinterfaceIAccountApi {
1717

18-
/** Address ETH balance */
18+
/**
19+
* Address ETH balance
20+
* @param address to look for
21+
* @return balance
22+
*/
1923
@NotNullBalancebalance(Stringaddress)throwsApiException;
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
@NotNullTokenBalancebalance(Stringaddress,Stringcontract)throwsApiException;
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
@NotNullList<Balance>balances(List<String>addresses)throwsApiException;
2940

30-
/** All txs */
41+
/**
42+
* Find all txs
43+
* @param address to look for txs
44+
* @return tx info
45+
*/
3146
@NotNullList<Tx>txs(Stringaddress)throwsApiException;
3247
@NotNullList<Tx>txs(Stringaddress,longstartBlock)throwsApiException;
3348
@NotNullList<Tx>txs(Stringaddress,longstartBlock,longendBlock)throwsApiException;
3449

35-
/** All internal txs */
50+
/**
51+
* All internal txs
52+
* @param address to look for
53+
* @return internal tx
54+
*/
3655
@NotNullList<TxInternal>txsInternal(Stringaddress)throwsApiException;
3756
@NotNullList<TxInternal>txsInternal(Stringaddress,longstartBlock)throwsApiException;
3857
@NotNullList<TxInternal>txsInternal(Stringaddress,longstartBlock,longendBlock)throwsApiException;
3958
@NotNullList<TxInternal>txsInternalByHash(Stringtxhash);
4059

41-
/** All token txs */
60+
/**
61+
* All token txs
62+
* @param address to look for
63+
* @return token txs
64+
*/
4265
@NotNullList<TxToken>txsToken(Stringaddress)throwsApiException;
4366
@NotNullList<TxToken>txsToken(Stringaddress,longstartBlock)throwsApiException;
4467
@NotNullList<TxToken>txsToken(Stringaddress,longstartBlock,longendBlock)throwsApiException;
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
@NotNullList<Block>minedBlocks(Stringaddress)throwsApiException;
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
publicinterfaceIBlockApi {
1717

18-
/** Return uncle blocks */
18+
/**
19+
* Return uncle blocks
20+
* @param blockNumber block number
21+
* @return uncle block
22+
*/
1923
@NotNullOptional<UncleBlock>uncles(longblockNumber)throwsApiException;
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
publicinterfaceIContractApi {
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
@NotNullAbicontractAbi(Stringaddress)throwsApiException;
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
publicinterfaceILogsApi {
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
@NotNullList<Log>logs(LogQueryquery)throwsApiException;
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
longblockNoLast();
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
@NotNullOptional<BlockProxy>block(longblockNo)throwsApiException;
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
@NotNullOptional<BlockProxy>blockUncle(longblockNo,longindex)throwsApiException;
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
@NotNullOptional<TxProxy>tx(Stringtxhash)throwsApiException;
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
@NotNullOptional<TxProxy>tx(longblockNo,longindex)throwsApiException;
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
inttxCount(longblockNo)throwsApiException;
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
inttxSendCount(Stringaddress)throwsApiException;
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
@NotNullOptional<String>txSendRaw(StringhexEncodedTx)throwsApiException;
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
@NotNullOptional<ReceiptProxy>txReceipt(Stringtxhash)throwsApiException;
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
@NotNullOptional<String>call(Stringaddress,Stringdata)throwsApiException;
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
@NotNullOptional<String>code(Stringaddress)throwsApiException;
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
@NotNullOptional<String>storageAt(Stringaddress,longposition)throwsApiException;
93120

94121
/**
95122
* Returns the current price per gas in wei
96123
* eth_gasPrice
124+
* @return price
97125
*/
98126
@NotNullBigIntegergasPrice()throwsApiException;
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
@NotNullBigIntegergasEstimated()throwsApiException;
106135
@NotNullBigIntegergasEstimated(StringhexData)throwsApiException;

‎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
publicinterfaceIStatisticApi {
1818

19-
/** ERC20 token total Supply */
19+
/**
20+
* ERC20 token total Supply
21+
* @param contract to look for
22+
* @return token supply
23+
*/
2024
@NotNullBigIntegersupply(Stringcontract)throwsApiException;
2125

22-
/** Eth total supply */
26+
/**
27+
* Eth total supply
28+
* @return ETH supply
29+
*/
2330
@NotNullSupplysupply()throwsApiException;
2431

25-
/** Eth last USD and BTC price */
32+
/**
33+
* Eth last USD and BTC price
34+
* @return last price
35+
*/
2636
@NotNullPricelastPrice()throwsApiException;
2737
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp