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

[3.0.0]#34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
GoodforGod merged 6 commits intomasterfromdev
Sep 8, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions.github/workflows/master.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
name: CI Master

on:
push:
branches:
- master
schedule:
- cron: 0 0 * * 0

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
name: Master Java ${{ matrix.java }} action

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'

- name: Build
run: './gradlew classes'

- name: Test
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}

- name: SonarQube
if: matrix.java == '17'
run: './gradlew sonar --info'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4 changes: 2 additions & 2 deletions.github/workflows/publish-release.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
name:CI Master
name:Release

on:
release:
Expand All@@ -23,7 +23,7 @@ jobs:
- name: Test
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PUBLISH }}

- name: SonarQube
run: './gradlew sonar --info'
Expand Down
4 changes: 2 additions & 2 deletions.github/workflows/publish-snapshot.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
name:CI Dev
name:Snapshot

on:
push:
Expand DownExpand Up@@ -33,7 +33,7 @@ jobs:
- name: Test
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_PUBLISH }}

- name: Publish Snapshot
run: './gradlew publish'
Expand Down
20 changes: 3 additions & 17 deletions.github/workflows/pull-request.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '17' ]
name: Java ${{ matrix.java }}Pull Request setup
java: [ '11' ]
name:Pull RequestJava ${{ matrix.java }}action

steps:
- uses: actions/checkout@v3
Expand All@@ -29,23 +29,9 @@ jobs:
run: './gradlew classes'

- name: Test
if: matrix.java == '11'
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_1 }}

- name: Test
if: matrix.java == '17'
run: './gradlew test jacocoTestReport'
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY_2 }}

- name: Test Report
if: matrix.java == '17'
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
**/test-results/**/*.xml
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}

- name: SonarQube
if: matrix.java == '17'
Expand Down
14 changes: 11 additions & 3 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,15 +15,15 @@ Library supports EtherScan *API* for all available *Ethereum Networks* for *ethe

**Gradle**
```groovy
implementation "com.github.goodforgod:java-etherscan-api:2.1.0"
implementation "com.github.goodforgod:java-etherscan-api:3.0.0"
```

**Maven**
```xml
<dependency>
<groupId>com.github.goodforgod</groupId>
<artifactId>java-etherscan-api</artifactId>
<version>2.1.0</version>
<version>3.0.0</version>
</dependency>
```

Expand DownExpand Up@@ -76,6 +76,14 @@ EtherScanAPI api = EtherScanAPI.builder()
.build();
```

Also you can use Java 11+ HttpClient:
```java
Supplier<EthHttpClient> ethHttpClientSupplier = () -> new JdkEthHttpClient();
EtherScanAPI api = EtherScanAPI.builder()
.withHttpClient(supplier)
.build();
```

## API Examples

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

**Get block info with proxy endpoint**
Expand Down
26 changes: 13 additions & 13 deletionsbuild.gradle
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,9 +3,9 @@ plugins {
id "java-library"
id "maven-publish"

id "org.sonarqube" version "4.3.0.3225"
id "org.sonarqube" version "6.3.1.5724"
id "com.diffplug.spotless" version "6.19.0"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}

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

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

dependencies {
compileOnly "org.jetbrains:annotations:23.0.0"
compileOnly "org.jetbrains:annotations:24.0.1"
implementation "io.goodforgod:gson-configuration:2.0.0"

testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.3"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.3"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.9.3"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.11.4"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.11.4"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.11.4"
}

test {
Expand All@@ -35,7 +35,7 @@ test {
testLogging {
events("passed", "skipped", "failed")
exceptionFormat("full")
showStandardStreams(false)
showStandardStreams(true)
}

reports {
Expand DownExpand Up@@ -71,8 +71,8 @@ nexusPublishing {
sonatype {
username = System.getenv("OSS_USERNAME")
password = System.getenv("OSS_PASSWORD")
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
Expand DownExpand Up@@ -110,8 +110,8 @@ publishing {
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
def releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/"
def snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username System.getenv("OSS_USERNAME")
Expand Down
2 changes: 1 addition & 1 deletiongradle.properties
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
groupId=com.github.goodforgod
artifactId=java-etherscan-api
artifactVersion=2.1.0-SNAPSHOT
artifactVersion=3.0.0-SNAPSHOT


##### GRADLE #####
Expand Down
Binary file modifiedgradle/wrapper/gradle-wrapper.jar
View file
Open in desktop
Binary file not shown.
3 changes: 2 additions & 1 deletiongradle/wrapper/gradle-wrapper.properties
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
37 changes: 22 additions & 15 deletionsgradlew
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand DownExpand Up@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand DownExpand Up@@ -83,10 +85,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand DownExpand Up@@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""


# Determine the Java command to use to start the JVM.
Expand All@@ -133,26 +133,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand DownExpand Up@@ -197,16 +200,20 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

# Stop when "xargs" is not available.
Expand Down
26 changes: 14 additions & 12 deletionsgradlew.bat
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if"%DEBUG%"==""@echooff
@rem ##########################################################################
Expand DownExpand Up@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version>NUL2>&1
if%ERRORLEVEL%equ0goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.1>&2
echo.1>&2
echo Please set the JAVA_HOME variable in your environment to match the1>&2
echo location of your Java installation.1>&2

goto fail

Expand All@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

ifexist"%JAVA_EXE%"goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory:%JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo.1>&2
echo ERROR: JAVA_HOME is set to an invalid directory:%JAVA_HOME%1>&2
echo.1>&2
echo Please set the JAVA_HOME variable in your environment to match the1>&2
echo location of your Java installation.1>&2

goto fail

:execute
@rem Setup the command line

setCLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
setCLASSPATH=


@rem Execute Gradle
"%JAVA_EXE%"%DEFAULT_JVM_OPTS%%JAVA_OPTS%%GRADLE_OPTS%"-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath"%CLASSPATH%"org.gradle.wrapper.GradleWrapperMain%*
"%JAVA_EXE%"%DEFAULT_JVM_OPTS%%JAVA_OPTS%%GRADLE_OPTS%"-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath"%CLASSPATH%"-jar"%APP_HOME%\gradle\wrapper\gradle-wrapper.jar"%*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp