Skip to content

Commit 1503e9b

Browse files
authored
Merge pull request #34 from GoodforGod/dev
[3.0.0]
2 parents 3de7b24 + 03b70d3 commit 1503e9b

File tree

69 files changed

+1110
-431
lines changed

Some content is hidden

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

69 files changed

+1110
-431
lines changed

β€Ž.github/workflows/master.ymlβ€Ž

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI Master
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
schedule:
8+
- cron: 0 0 * * 0
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
java: [ '11' ]
16+
name: Master Java ${{ matrix.java }} action
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up JDK
21+
uses: actions/setup-java@v3
22+
with:
23+
java-version: ${{ matrix.java }}
24+
distribution: 'adopt'
25+
26+
- name: Build
27+
run: './gradlew classes'
28+
29+
- name: Test
30+
run: './gradlew test jacocoTestReport'
31+
env:
32+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
33+
34+
- name: SonarQube
35+
if: matrix.java == '17'
36+
run: './gradlew sonar --info'
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

β€Ž.github/workflows/publish-release.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI Master
1+
name: Release
22

33
on:
44
release:
@@ -23,7 +23,7 @@ jobs:
2323
- name: Test
2424
run: './gradlew test jacocoTestReport'
2525
env:
26-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}
26+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PUBLISH }}
2727

2828
- name: SonarQube
2929
run: './gradlew sonar --info'

β€Ž.github/workflows/publish-snapshot.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI Dev
1+
name: Snapshot
22

33
on:
44
push:
@@ -33,7 +33,7 @@ jobs:
3333
- name: Test
3434
run: './gradlew test jacocoTestReport'
3535
env:
36-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}
36+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PUBLISH }}
3737

3838
- name: Publish Snapshot
3939
run: './gradlew publish'

β€Ž.github/workflows/pull-request.ymlβ€Ž

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
java: [ '11', '17' ]
15-
name: Java ${{ matrix.java }} Pull Request setup
14+
java: [ '11' ]
15+
name: Pull Request Java ${{ matrix.java }} action
1616

1717
steps:
1818
- uses: actions/checkout@v3
@@ -29,23 +29,9 @@ jobs:
2929
run: './gradlew classes'
3030

3131
- name: Test
32-
if: matrix.java == '11'
3332
run: './gradlew test jacocoTestReport'
3433
env:
35-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_1 }}
36-
37-
- name: Test
38-
if: matrix.java == '17'
39-
run: './gradlew test jacocoTestReport'
40-
env:
41-
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}
42-
43-
- name: Test Report
44-
if: matrix.java == '17'
45-
uses: EnricoMi/publish-unit-test-result-action@v2
46-
with:
47-
files: |
48-
**/test-results/**/*.xml
34+
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
4935

5036
- name: SonarQube
5137
if: matrix.java == '17'

β€ŽREADME.mdβ€Ž

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Library supports EtherScan *API* for all available *Ethereum Networks* for *ethe
1515

1616
**Gradle**
1717
```groovy
18-
implementation "com.github.goodforgod:java-etherscan-api:2.1.0"
18+
implementation "com.github.goodforgod:java-etherscan-api:3.0.0"
1919
```
2020

2121
**Maven**
2222
```xml
2323
<dependency>
2424
<groupId>com.github.goodforgod</groupId>
2525
<artifactId>java-etherscan-api</artifactId>
26-
<version>2.1.0</version>
26+
<version>3.0.0</version>
2727
</dependency>
2828
```
2929

@@ -76,6 +76,14 @@ EtherScanAPI api = EtherScanAPI.builder()
7676
.build();
7777
```
7878

79+
Also you can use Java 11+ HttpClient:
80+
```java
81+
Supplier<EthHttpClient> ethHttpClientSupplier = () -> new JdkEthHttpClient();
82+
EtherScanAPI api = EtherScanAPI.builder()
83+
.withHttpClient(supplier)
84+
.build();
85+
```
86+
7987
## API Examples
8088

8189
You can read about all API methods on [Etherscan](https://docs.etherscan.io/api-endpoints/accounts)
@@ -149,7 +157,7 @@ List<Log> logs = api.logs().logs(query);
149157
**Get tx details with proxy endpoint**
150158
```java
151159
EtherScanAPI api = EtherScanAPI.builder().build();
152-
Optional<TxProxy> tx = api.proxy().tx("0x1e2910a262b1008d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1");
160+
Optional<TxProxy> tx = api.proxy().tx("0x1e2910a263.0.08d0616a0beb24c1a491d78771baa54a33e66065e03b1f46bc1");
153161
```
154162

155163
**Get block info with proxy endpoint**

β€Žbuild.gradleβ€Ž

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ plugins {
33
id "java-library"
44
id "maven-publish"
55

6-
id "org.sonarqube" version "4.3.0.3225"
6+
id "org.sonarqube" version "6.3.1.5724"
77
id "com.diffplug.spotless" version "6.19.0"
8-
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
8+
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
99
}
1010

1111
repositories {
@@ -17,16 +17,16 @@ group = groupId
1717
var ver = System.getenv().getOrDefault("RELEASE_VERSION", artifactVersion)
1818
version = ver.startsWith("v") ? ver.substring(1) : ver
1919

20-
sourceCompatibility = JavaVersion.VERSION_1_8
21-
targetCompatibility = JavaVersion.VERSION_1_8
20+
sourceCompatibility = JavaVersion.VERSION_11
21+
targetCompatibility = JavaVersion.VERSION_11
2222

2323
dependencies {
24-
compileOnly "org.jetbrains:annotations:23.0.0"
24+
compileOnly "org.jetbrains:annotations:24.0.1"
2525
implementation "io.goodforgod:gson-configuration:2.0.0"
2626

27-
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.3"
28-
testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.3"
29-
testImplementation "org.junit.jupiter:junit-jupiter-params:5.9.3"
27+
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.11.4"
28+
testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.4"
29+
testImplementation "org.junit.jupiter:junit-jupiter-params:5.11.4"
3030
}
3131

3232
test {
@@ -35,7 +35,7 @@ test {
3535
testLogging {
3636
events("passed", "skipped", "failed")
3737
exceptionFormat("full")
38-
showStandardStreams(false)
38+
showStandardStreams(true)
3939
}
4040

4141
reports {
@@ -71,8 +71,8 @@ nexusPublishing {
7171
sonatype {
7272
username = System.getenv("OSS_USERNAME")
7373
password = System.getenv("OSS_PASSWORD")
74-
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
75-
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
74+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
75+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
7676
}
7777
}
7878
}
@@ -110,8 +110,8 @@ publishing {
110110
}
111111
repositories {
112112
maven {
113-
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
114-
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
113+
def releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/"
114+
def snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
115115
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
116116
credentials {
117117
username System.getenv("OSS_USERNAME")

β€Žgradle.propertiesβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
groupId=com.github.goodforgod
22
artifactId=java-etherscan-api
3-
artifactVersion=2.1.0-SNAPSHOT
3+
artifactVersion=3.0.0-SNAPSHOT
44

55

66
##### GRADLE #####
-17.4 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

β€Žgradlewβ€Ž

Lines changed: 22 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)