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

Commit76fe479

Browse files
committed
Gorli & TOBALABA networks support
1.0.1 release
1 parent4cd9af6 commit76fe479

File tree

16 files changed

+276
-13
lines changed

16 files changed

+276
-13
lines changed

‎README.md‎

Lines changed: 10 additions & 4 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,8 +40,12 @@ 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
4650
EtherScanApi api=newEtherScanApi(EthNetwork.MAINNET);// Default
4751
EtherScanApi apiRinkeby=newEtherScanApi(EthNetwork.RINKEBY);
@@ -161,6 +165,8 @@ Token API methods migrated to [Account](#account-api) & [Stats](#stats-api) resp
161165

162166
##Version History
163167

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

166172
##License

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
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>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ public EtherScanApi(final String apiKey,
7070
:newQueueManager(5,1);
7171

7272
finalIHttpExecutorexecutor =executorSupplier.get();
73-
finalStringbaseUrl ="https://" +network.getDomain() +".etherscan.io/api" +"?apikey=" +apiKey;
73+
74+
finalStringending = (EthNetwork.TOBALABA.equals(network)) ?"com" :"io";
75+
finalStringbaseUrl ="https://" +network.getDomain() +".etherscan." +ending +"/api" +"?apikey=" +apiKey;
7476

7577
this.account =newAccountApiProvider(masterQueue,baseUrl,executor);
7678
this.block =newBlockApiProvider(masterQueue,baseUrl,executor);

‎src/main/java/io/api/etherscan/model/BaseTx.java‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,34 @@ public boolean equals(Object o) {
7777

7878
BaseTxbaseTx = (BaseTx)o;
7979

80-
returnhash !=null ?hash.equals(baseTx.hash) :baseTx.hash ==null;
80+
if (blockNumber !=baseTx.blockNumber)returnfalse;
81+
if (timeStamp !=null ? !timeStamp.equals(baseTx.timeStamp) :baseTx.timeStamp !=null)returnfalse;
82+
if (_timeStamp !=null ? !_timeStamp.equals(baseTx._timeStamp) :baseTx._timeStamp !=null)returnfalse;
83+
if (hash !=null ? !hash.equals(baseTx.hash) :baseTx.hash !=null)returnfalse;
84+
if (from !=null ? !from.equals(baseTx.from) :baseTx.from !=null)returnfalse;
85+
if (to !=null ? !to.equals(baseTx.to) :baseTx.to !=null)returnfalse;
86+
if (value !=null ? !value.equals(baseTx.value) :baseTx.value !=null)returnfalse;
87+
if (contractAddress !=null ? !contractAddress.equals(baseTx.contractAddress) :baseTx.contractAddress !=null)
88+
returnfalse;
89+
if (input !=null ? !input.equals(baseTx.input) :baseTx.input !=null)returnfalse;
90+
if (gas !=null ? !gas.equals(baseTx.gas) :baseTx.gas !=null)returnfalse;
91+
returngasUsed !=null ?gasUsed.equals(baseTx.gasUsed) :baseTx.gasUsed ==null;
8192
}
8293

8394
@Override
8495
publicinthashCode() {
85-
returnhash !=null ?hash.hashCode() :0;
96+
intresult = (int) (blockNumber ^ (blockNumber >>>32));
97+
result =31 *result + (timeStamp !=null ?timeStamp.hashCode() :0);
98+
result =31 *result + (_timeStamp !=null ?_timeStamp.hashCode() :0);
99+
result =31 *result + (hash !=null ?hash.hashCode() :0);
100+
result =31 *result + (from !=null ?from.hashCode() :0);
101+
result =31 *result + (to !=null ?to.hashCode() :0);
102+
result =31 *result + (value !=null ?value.hashCode() :0);
103+
result =31 *result + (contractAddress !=null ?contractAddress.hashCode() :0);
104+
result =31 *result + (input !=null ?input.hashCode() :0);
105+
result =31 *result + (gas !=null ?gas.hashCode() :0);
106+
result =31 *result + (gasUsed !=null ?gasUsed.hashCode() :0);
107+
returnresult;
86108
}
87109

88110
@Override

‎src/main/java/io/api/etherscan/model/EthNetwork.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public enum EthNetwork {
1010
MAINNET("api"),
1111
ROPSTEN("api-ropsten"),
1212
KOVAN("api-kovan"),
13+
TOBALABA("api-tobalaba"),
14+
GORLI("api-goerli"),
1315
RINKEBY("api-rinkeby");
1416

1517
privatefinalStringdomain;

‎src/main/java/io/api/etherscan/model/Log.java‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,55 @@ public Long getLogIndex() {
9898
}
9999
//</editor-fold>
100100

101+
@Override
102+
publicbooleanequals(Objecto) {
103+
if (this ==o)returntrue;
104+
if (o ==null ||getClass() !=o.getClass())returnfalse;
105+
106+
Loglog = (Log)o;
107+
108+
if (blockNumber !=null ? !blockNumber.equals(log.blockNumber) :log.blockNumber !=null)returnfalse;
109+
if (_blockNumber !=null ? !_blockNumber.equals(log._blockNumber) :log._blockNumber !=null)returnfalse;
110+
if (address !=null ? !address.equals(log.address) :log.address !=null)returnfalse;
111+
if (transactionHash !=null ? !transactionHash.equals(log.transactionHash) :log.transactionHash !=null)
112+
returnfalse;
113+
if (transactionIndex !=null ? !transactionIndex.equals(log.transactionIndex) :log.transactionIndex !=null)
114+
returnfalse;
115+
if (_transactionIndex !=null ? !_transactionIndex.equals(log._transactionIndex) :log._transactionIndex !=null)
116+
returnfalse;
117+
if (timeStamp !=null ? !timeStamp.equals(log.timeStamp) :log.timeStamp !=null)returnfalse;
118+
if (_timeStamp !=null ? !_timeStamp.equals(log._timeStamp) :log._timeStamp !=null)returnfalse;
119+
if (data !=null ? !data.equals(log.data) :log.data !=null)returnfalse;
120+
if (gasPrice !=null ? !gasPrice.equals(log.gasPrice) :log.gasPrice !=null)returnfalse;
121+
if (_gasPrice !=null ? !_gasPrice.equals(log._gasPrice) :log._gasPrice !=null)returnfalse;
122+
if (gasUsed !=null ? !gasUsed.equals(log.gasUsed) :log.gasUsed !=null)returnfalse;
123+
if (_gasUsed !=null ? !_gasUsed.equals(log._gasUsed) :log._gasUsed !=null)returnfalse;
124+
if (topics !=null ? !topics.equals(log.topics) :log.topics !=null)returnfalse;
125+
if (logIndex !=null ? !logIndex.equals(log.logIndex) :log.logIndex !=null)returnfalse;
126+
return_logIndex !=null ?_logIndex.equals(log._logIndex) :log._logIndex ==null;
127+
}
128+
129+
@Override
130+
publicinthashCode() {
131+
intresult =blockNumber !=null ?blockNumber.hashCode() :0;
132+
result =31 *result + (_blockNumber !=null ?_blockNumber.hashCode() :0);
133+
result =31 *result + (address !=null ?address.hashCode() :0);
134+
result =31 *result + (transactionHash !=null ?transactionHash.hashCode() :0);
135+
result =31 *result + (transactionIndex !=null ?transactionIndex.hashCode() :0);
136+
result =31 *result + (_transactionIndex !=null ?_transactionIndex.hashCode() :0);
137+
result =31 *result + (timeStamp !=null ?timeStamp.hashCode() :0);
138+
result =31 *result + (_timeStamp !=null ?_timeStamp.hashCode() :0);
139+
result =31 *result + (data !=null ?data.hashCode() :0);
140+
result =31 *result + (gasPrice !=null ?gasPrice.hashCode() :0);
141+
result =31 *result + (_gasPrice !=null ?_gasPrice.hashCode() :0);
142+
result =31 *result + (gasUsed !=null ?gasUsed.hashCode() :0);
143+
result =31 *result + (_gasUsed !=null ?_gasUsed.hashCode() :0);
144+
result =31 *result + (topics !=null ?topics.hashCode() :0);
145+
result =31 *result + (logIndex !=null ?logIndex.hashCode() :0);
146+
result =31 *result + (_logIndex !=null ?_logIndex.hashCode() :0);
147+
returnresult;
148+
}
149+
101150
@Override
102151
publicStringtoString() {
103152
return"Log{" +

‎src/main/java/io/api/etherscan/model/Price.java‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,39 @@ public LocalDateTime btcTimestamp() {
3838
return_ethbtc_timestamp;
3939
}
4040

41+
@Override
42+
publicbooleanequals(Objecto) {
43+
if (this ==o)returntrue;
44+
if (o ==null ||getClass() !=o.getClass())returnfalse;
45+
46+
Priceprice = (Price)o;
47+
48+
if (Double.compare(price.ethusd,ethusd) !=0)returnfalse;
49+
if (Double.compare(price.ethbtc,ethbtc) !=0)returnfalse;
50+
if (ethusd_timestamp !=null ? !ethusd_timestamp.equals(price.ethusd_timestamp) :price.ethusd_timestamp !=null)
51+
returnfalse;
52+
if (ethbtc_timestamp !=null ? !ethbtc_timestamp.equals(price.ethbtc_timestamp) :price.ethbtc_timestamp !=null)
53+
returnfalse;
54+
if (_ethusd_timestamp !=null ? !_ethusd_timestamp.equals(price._ethusd_timestamp) :price._ethusd_timestamp !=null)
55+
returnfalse;
56+
return_ethbtc_timestamp !=null ?_ethbtc_timestamp.equals(price._ethbtc_timestamp) :price._ethbtc_timestamp ==null;
57+
}
58+
59+
@Override
60+
publicinthashCode() {
61+
intresult;
62+
longtemp;
63+
temp =Double.doubleToLongBits(ethusd);
64+
result = (int) (temp ^ (temp >>>32));
65+
temp =Double.doubleToLongBits(ethbtc);
66+
result =31 *result + (int) (temp ^ (temp >>>32));
67+
result =31 *result + (ethusd_timestamp !=null ?ethusd_timestamp.hashCode() :0);
68+
result =31 *result + (ethbtc_timestamp !=null ?ethbtc_timestamp.hashCode() :0);
69+
result =31 *result + (_ethusd_timestamp !=null ?_ethusd_timestamp.hashCode() :0);
70+
result =31 *result + (_ethbtc_timestamp !=null ?_ethbtc_timestamp.hashCode() :0);
71+
returnresult;
72+
}
73+
4174
@Override
4275
publicStringtoString() {
4376
return"Price{" +

‎src/main/java/io/api/etherscan/model/Status.java‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ public String getErrDescription() {
2222
returnerrDescription;
2323
}
2424

25+
@Override
26+
publicbooleanequals(Objecto) {
27+
if (this ==o)returntrue;
28+
if (o ==null ||getClass() !=o.getClass())returnfalse;
29+
30+
Statusstatus = (Status)o;
31+
32+
if (isError !=status.isError)returnfalse;
33+
returnerrDescription !=null ?errDescription.equals(status.errDescription) :status.errDescription ==null;
34+
}
35+
36+
@Override
37+
publicinthashCode() {
38+
intresult =isError;
39+
result =31 *result + (errDescription !=null ?errDescription.hashCode() :0);
40+
returnresult;
41+
}
42+
2543
@Override
2644
publicStringtoString() {
2745
return"Status{" +

‎src/main/java/io/api/etherscan/model/Tx.java‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,39 @@ public long getConfirmations() {
5555
}
5656
//</editor-fold>
5757

58+
@Override
59+
publicbooleanequals(Objecto) {
60+
if (this ==o)returntrue;
61+
if (o ==null ||getClass() !=o.getClass())returnfalse;
62+
if (!super.equals(o))returnfalse;
63+
64+
Txtx = (Tx)o;
65+
66+
if (nonce !=tx.nonce)returnfalse;
67+
if (transactionIndex !=tx.transactionIndex)returnfalse;
68+
if (confirmations !=tx.confirmations)returnfalse;
69+
if (blockHash !=null ? !blockHash.equals(tx.blockHash) :tx.blockHash !=null)returnfalse;
70+
if (gasPrice !=null ? !gasPrice.equals(tx.gasPrice) :tx.gasPrice !=null)returnfalse;
71+
if (cumulativeGasUsed !=null ? !cumulativeGasUsed.equals(tx.cumulativeGasUsed) :tx.cumulativeGasUsed !=null)
72+
returnfalse;
73+
if (isError !=null ? !isError.equals(tx.isError) :tx.isError !=null)returnfalse;
74+
returntxreceipt_status !=null ?txreceipt_status.equals(tx.txreceipt_status) :tx.txreceipt_status ==null;
75+
}
76+
77+
@Override
78+
publicinthashCode() {
79+
intresult =super.hashCode();
80+
result =31 *result + (int) (nonce ^ (nonce >>>32));
81+
result =31 *result + (blockHash !=null ?blockHash.hashCode() :0);
82+
result =31 *result +transactionIndex;
83+
result =31 *result + (gasPrice !=null ?gasPrice.hashCode() :0);
84+
result =31 *result + (cumulativeGasUsed !=null ?cumulativeGasUsed.hashCode() :0);
85+
result =31 *result + (int) (confirmations ^ (confirmations >>>32));
86+
result =31 *result + (isError !=null ?isError.hashCode() :0);
87+
result =31 *result + (txreceipt_status !=null ?txreceipt_status.hashCode() :0);
88+
returnresult;
89+
}
90+
5891
@Override
5992
publicStringtoString() {
6093
return"Tx{" +

‎src/main/java/io/api/etherscan/model/TxInternal.java‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,30 @@ public String getErrCode() {
3131
}
3232
//</editor-fold>
3333

34+
@Override
35+
publicbooleanequals(Objecto) {
36+
if (this ==o)returntrue;
37+
if (o ==null ||getClass() !=o.getClass())returnfalse;
38+
if (!super.equals(o))returnfalse;
39+
40+
TxInternalthat = (TxInternal)o;
41+
42+
if (traceId !=that.traceId)returnfalse;
43+
if (isError !=that.isError)returnfalse;
44+
if (type !=null ? !type.equals(that.type) :that.type !=null)returnfalse;
45+
returnerrCode !=null ?errCode.equals(that.errCode) :that.errCode ==null;
46+
}
47+
48+
@Override
49+
publicinthashCode() {
50+
intresult =super.hashCode();
51+
result =31 *result + (type !=null ?type.hashCode() :0);
52+
result =31 *result + (int) (traceId ^ (traceId >>>32));
53+
result =31 *result +isError;
54+
result =31 *result + (errCode !=null ?errCode.hashCode() :0);
55+
returnresult;
56+
}
57+
3458
@Override
3559
publicStringtoString() {
3660
return"TxInternal{" +

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp