Skip to content

Commit de595d2

Browse files
committed
codestyle.xml 80->100 comment per line
Gradle wrapper updated yo 7.2 build.gradle updated and cleanup Code style applied
1 parent 5030e1c commit de595d2

File tree

12 files changed

+105
-110
lines changed

12 files changed

+105
-110
lines changed

README.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,23 @@
1111
Library supports all available EtherScan *API* calls for all available *Ethereum Networks* for *etherscan.io*
1212

1313
## Dependency :rocket:
14+
15+
**Gradle**
16+
```groovy
17+
dependencies {
18+
compile "com.github.goodforgod:java-etherscan-api:1.1.1"
19+
}
20+
```
21+
1422
**Maven**
1523
```xml
1624
<dependency>
1725
<groupId>com.github.goodforgod</groupId>
1826
<artifactId>java-etherscan-api</artifactId>
19-
<version>1.1.0</version>
27+
<version>1.1.1</version>
2028
</dependency>
2129
```
2230

23-
**Gradle**
24-
```groovy
25-
dependencies {
26-
compile 'com.github.goodforgod:java-etherscan-api:1.1.0'
27-
}
28-
```
29-
3031
## Content
3132
- [Ethereum Networks](#mainnet-and-testnets)
3233
- [Custom HttpClient](#custom-httpclient)
@@ -42,6 +43,7 @@ dependencies {
4243
- [Version History](#version-history)
4344

4445
## Mainnet and Testnets
46+
4547
API support Ethereum: *[MAINNET](https://etherscan.io),
4648
[ROPSTEN](https://ropsten.etherscan.io),
4749
[KOVAN](https://kovan.etherscan.io),
@@ -88,14 +90,18 @@ EtherScanApi api = new EtherScanApi("YourApiKey");
8890
Below are examples for each API category.
8991

9092
### Account Api
93+
9194
**Get Ether Balance for a single Address**
95+
9296
```java
9397
EtherScanApi api = new EtherScanApi();
9498
Balance balance = api.account().balance("0x8d4426f94e42f721C7116E81d6688cd935cB3b4F");
9599
```
96100

97101
### Block Api
102+
98103
**Get uncles block for block height**
104+
99105
```java
100106
EtherScanApi api = new EtherScanApi();
101107
Optional<UncleBlock> uncles = api.block().uncles(200000);
@@ -109,7 +115,9 @@ Abi abi = api.contract().contractAbi("0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413
109115
```
110116

111117
### Logs Api
118+
112119
**Get event logs for single topic**
120+
113121
```java
114122
EtherScanApi api = new EtherScanApi();
115123
LogQuery query = LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c")
@@ -119,6 +127,7 @@ List<Log> logs = api.logs().logs(query);
119127
```
120128

121129
**Get event logs for 3 topics with respectful operations**
130+
122131
```java
123132
EtherScanApi api = new EtherScanApi();
124133
LogQuery query = LogQueryBuilder.with("0x33990122638b9132ca29c723bdf037f1a891a70c", 379224, 400000)
@@ -134,47 +143,45 @@ List<Log> logs = api.logs().logs(query);
134143
```
135144

136145
### Proxy Api
146+
137147
**Get tx detailds with proxy endpoint**
148+
138149
```java
139150
EtherScanApi api = new EtherScanApi(EthNetwork.MAINNET);
140151
Optional<TxProxy> tx = api.proxy().tx("0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1");
141152
```
142153

143154
**Get block info with proxy endpoint**
155+
144156
```java
145157
EtherScanApi api = new EtherScanApi(EthNetwork.MAINNET);
146158
Optional<BlockProxy> block = api.proxy().block(15215);
147159
```
148160

149161
### Stats Api
162+
150163
**Statistic about last price**
164+
151165
```java
152166
EtherScanApi api = new EtherScanApi();
153167
Price price = api.stats().lastPrice();
154168
```
155169

156170
### Transaction Api
171+
157172
**Request receipt status for tx**
173+
158174
```java
159175
EtherScanApi api = new EtherScanApi();
160176
Optional<Boolean> status = api.txs().receiptStatus("0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76");
161177
```
162178

163179
### Token Api
180+
164181
You can read about token API [here](https://etherscan.io/apis#tokens)
165182

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

168-
## Version History
169-
170-
**1.1.0** - Improved error handling, QueueManager improved, Gradle 6.7 instead of Maven, GitHub CI, Sonarcloud analyzer, dependencies updated.
171-
172-
**1.0.2** - Minor http client improvements.
173-
174-
**1.0.1** - Gorli & TOBALABA networks support.
175-
176-
**1.0.0** - Initial project with all API functionality, for all available networks, with tests coverage for all cases.
177-
178185
## License
179186

180187
This project licensed under the MIT - see the [LICENSE](LICENSE) file for details.

build.gradle

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,57 @@
11
plugins {
2-
id 'jacoco'
3-
id 'java-library'
4-
id 'maven-publish'
2+
id "jacoco"
3+
id "java-library"
4+
id "maven-publish"
55

6-
id 'org.sonarqube' version '3.1.1'
7-
id 'com.diffplug.spotless' version '5.11.0'
6+
id "org.sonarqube" version "3.3"
7+
id "com.diffplug.spotless" version "5.14.3"
88
}
99

1010
repositories {
1111
mavenLocal()
1212
mavenCentral()
13-
jcenter()
1413
}
1514

1615
group = groupId
1716
version = artifactVersion
1817

19-
sourceCompatibility = 1.8
20-
targetCompatibility = 1.8
18+
sourceCompatibility = JavaVersion.VERSION_1_8
19+
targetCompatibility = JavaVersion.VERSION_1_8
2120

2221
spotless {
2322
java {
24-
encoding 'UTF-8'
23+
encoding "UTF-8"
2524
removeUnusedImports()
2625
eclipse().configFile "${projectDir}/config/codestyle.xml"
2726
}
2827
}
2928

3029
sonarqube {
3130
properties {
32-
property 'sonar.host.url', 'https://sonarcloud.io'
33-
property 'sonar.organization', 'goodforgod'
34-
property 'sonar.projectKey', 'GoodforGod_java-etherscan-api'
31+
property "sonar.host.url", "https://sonarcloud.io"
32+
property "sonar.organization", "goodforgod"
33+
property "sonar.projectKey", "GoodforGod_java-etherscan-api"
3534
}
3635
}
3736

3837
dependencies {
39-
implementation 'org.jetbrains:annotations:20.1.0'
40-
implementation 'com.google.code.gson:gson:2.8.6'
38+
implementation "org.jetbrains:annotations:22.0.0"
39+
implementation "com.google.code.gson:gson:2.8.8"
4140

42-
testImplementation 'junit:junit:4.13.1'
41+
testImplementation "junit:junit:4.13.1"
4342
}
4443

4544
test {
46-
failFast = true
47-
4845
useJUnit()
4946
testLogging {
50-
events "passed", "skipped", "failed"
51-
exceptionFormat "full"
47+
events("passed", "skipped", "failed")
48+
exceptionFormat("full")
5249
}
53-
}
5450

55-
tasks.withType(JavaCompile) {
56-
options.encoding = 'UTF-8'
57-
options.incremental = true
58-
options.fork = true
59-
}
60-
61-
tasks.withType(Test) {
62-
reports.html.enabled = false
63-
reports.junitXml.enabled = false
64-
}
65-
66-
java {
67-
withJavadocJar()
68-
withSourcesJar()
51+
reports {
52+
html.enabled(false)
53+
junitXml.enabled(false)
54+
}
6955
}
7056

7157
publishing {
@@ -74,27 +60,27 @@ publishing {
7460
from components.java
7561

7662
pom {
77-
name = 'Java Etherscan API'
78-
url = 'https://github.com/GoodforGod/java-etherscan-api'
79-
description = 'Library is a wrapper for EtherScan API.'
63+
name = "Java Etherscan API"
64+
url = "https://github.com/GoodforGod/java-etherscan-api"
65+
description = "Library is a wrapper for EtherScan API."
8066

8167
license {
82-
name = 'MIT License'
83-
url = 'https://github.com/GoodforGod/java-etherscan-api/blob/master/LICENSE'
84-
distribution = 'repo'
68+
name = "MIT License"
69+
url = "https://github.com/GoodforGod/java-etherscan-api/blob/master/LICENSE"
70+
distribution = "repo"
8571
}
8672

8773
developer {
88-
id = 'GoodforGod'
89-
name = 'Anton Kurako'
90-
email = 'goodforgod.dev@gmail.com'
91-
url = 'https://github.com/GoodforGod'
74+
id = "GoodforGod"
75+
name = "Anton Kurako"
76+
email = "goodforgod.dev@gmail.com"
77+
url = "https://github.com/GoodforGod"
9278
}
9379

9480
scm {
95-
connection = 'scm:git:git://github.com/GoodforGod/java-etherscan-api.git'
96-
developerConnection = 'scm:git:ssh://GoodforGod/java-etherscan-api.git'
97-
url = 'https://github.com/GoodforGod/java-etherscan-api/tree/master'
81+
connection = "scm:git:git://github.com/GoodforGod/java-etherscan-api.git"
82+
developerConnection = "scm:git:ssh://GoodforGod/java-etherscan-api.git"
83+
url = "https://github.com/GoodforGod/java-etherscan-api/tree/master"
9884
}
9985
}
10086
}
@@ -103,7 +89,7 @@ publishing {
10389
maven {
10490
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
10591
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
106-
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
92+
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
10793
credentials {
10894
username System.getenv("OSS_USERNAME")
10995
password System.getenv("OSS_PASSWORD")
@@ -112,6 +98,17 @@ publishing {
11298
}
11399
}
114100

101+
java {
102+
withJavadocJar()
103+
withSourcesJar()
104+
}
105+
106+
tasks.withType(JavaCompile) {
107+
options.encoding("UTF-8")
108+
options.incremental(true)
109+
options.fork = true
110+
}
111+
115112
check.dependsOn jacocoTestReport
116113
jacocoTestReport {
117114
reports {
@@ -120,16 +117,16 @@ jacocoTestReport {
120117
}
121118
}
122119

120+
javadoc {
121+
options.encoding = "UTF-8"
122+
if (JavaVersion.current().isJava9Compatible()) {
123+
options.addBooleanOption("html5", true)
124+
}
125+
}
126+
123127
if (project.hasProperty("signing.keyId")) {
124-
apply plugin: 'signing'
128+
apply plugin: "signing"
125129
signing {
126130
sign publishing.publications.mavenJava
127131
}
128132
}
129-
130-
javadoc {
131-
options.encoding = "UTF-8"
132-
if (JavaVersion.current().isJava9Compatible()) {
133-
options.addBooleanOption('html5', true)
134-
}
135-
}

config/codestyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
7575
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
7676
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
77-
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
77+
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
7878
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
7979
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_if_empty"/>
8080
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>

gradle/wrapper/gradle-wrapper.jar

333 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ case "`uname`" in
7272
Darwin* )
7373
darwin=true
7474
;;
75-
MINGW* )
75+
MSYS* | MINGW* )
7676
msys=true
7777
;;
7878
NONSTOP* )

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public interface IAccountApi {
3636
TokenBalance balance(String address, String contract) throws ApiException;
3737

3838
/**
39-
* Maximum 20 address for single batch request If address MORE THAN 20, then
40-
* there will be more than 1 request performed
39+
* Maximum 20 address for single batch request If address MORE THAN 20, then there will be more than
40+
* 1 request performed
4141
*
4242
* @param addresses addresses to get balances for
4343
* @return list of balances

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
public interface ILogsApi {
1717

1818
/**
19-
* alternative to the native eth_getLogs Read at EtherScan API description for
20-
* full info!
19+
* alternative to the native eth_getLogs Read at EtherScan API description for full info!
2120
*
2221
* @param query build log query
2322
* @return logs according to query

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy