Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7.0.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -66,7 +66,7 @@ jobs:
# queries: security-extended,security-and-quality

- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v6.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
Expand All @@ -85,6 +85,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7.0.1
- name: Fetch and submit SBOM
uses: SCF-Public-Goods-Maintenance/pg-atlas-sbom-action@main
48 changes: 24 additions & 24 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ jobs:
env:
ENABLE_LOGS: true
NETWORK: local
ENABLE_SOROBAN_RPC: true
PROTOCOL_VERSION: 28
ENABLE: core,rpc
PROTOCOL_VERSION: 30
options: >-
--health-cmd "curl --no-progress-meter --fail-with-body -X POST \"http://localhost:8000/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getNetwork\"}' && curl --no-progress-meter \"http://localhost:8000/friendbot\" | grep '\"invalid_field\": \"addr\"'"
--health-cmd "curl --no-progress-meter -X POST \"http://localhost:8000/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getHealth\"}' | grep '\"status\":\"healthy\"' && curl --no-progress-meter \"http://localhost:8000/friendbot\" | grep '\"invalid_field\": \"addr\"'"
--health-interval 10s
--health-timeout 5s
--health-retries 50
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7.0.1
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v6.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Test
run: ./gradlew check
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

Expand All @@ -54,16 +54,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7.0.1
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v6.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Build
run: ./gradlew build -x test -x jacocoTestReport
- name: Persist JAR Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7.0.2
with:
name: libs
path: build/libs/*.jar
Expand All @@ -73,16 +73,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7.0.1
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v6.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Generate Documentation
run: ./gradlew javadoc
- name: Persist Documentation
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7.0.2
with:
name: javadoc
path: javadoc
Expand All @@ -101,9 +101,9 @@ jobs:
]
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v7.0.1
- name: Download JAR Artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8.0.2
with:
name: libs
path: android_test/app/libs/
Expand All @@ -112,12 +112,12 @@ jobs:
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: actions/setup-java@v4
- uses: actions/setup-java@v6.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
uses: reactivecircus/android-emulator-runner@v2.38.0
with:
working-directory: ./android_test
api-level: ${{ matrix.emulator.api-level }}
Expand All @@ -134,27 +134,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7.0.1
- name: Download JAR Artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8.0.2
with:
name: libs
path: libs
- name: Download Java Documentation
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8.0.2
with:
name: javadoc
path: javadoc
- name: Archive Documentation
run: tar -czf stellar-sdk-javadoc.tar.gz javadoc
- name: Upload artifacts to GitHub Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3.0.3
with:
files: |
libs/*.jar
stellar-sdk-javadoc.tar.gz
- name: Upload Documentation to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@v4.9.0
with:
folder: javadoc

Expand All @@ -170,11 +170,11 @@ jobs:
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7.0.1
- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@v6.1.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Publish to Maven Central
run: ./gradlew publishAllPublicationsToCentralPortal
run: ./gradlew publishAggregationToCentralPortal
2 changes: 1 addition & 1 deletion .github/workflows/xdr-generator-snapshot-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
snapshot-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7.0.1
- name: Run XDR generator snapshot tests
run: make xdr-generator-test
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
- `submitTimeout` bounds the polling loop only. Each individual request is still bounded by the `SorobanServer` HTTP timeouts.
- This applies to `submit`, `signAndSubmit`, `restoreFootprint`, and therefore to `ContractClient.invoke` when it submits.
- fix: always encode text as UTF-8 in `Scv.toString(String)`, `Sep10Challenge` (`web_auth_domain` / `client_domain`), `Util.paddedByteArray(String, int)`, and the `SorobanServer` request body. They used the JVM default charset, so non-ASCII text produced different bytes on JVMs where that is not UTF-8.
- chore: upgrade generated XDR definitions to Protocol 30.
- fix: `StrKey.decodeClaimableBalance` and `StrKey.isValidClaimableBalance` now reject a claimable balance strkey (`B...`) whose type byte is not 0, as SEP-23 requires; `CLAIMABLE_BALANCE_ID_TYPE_V0` is the only type. Such a key used to be accepted, so `new Address(...)` took it and the error only surfaced in `Address.toSCAddress`. `new Address(...)` now throws `IllegalArgumentException` up front.
- refactor: deprecate `GetEventsResponse.EventInfo.inSuccessfulContractCall`. Stellar RPC no longer returns it from `getEvents` ([stellar-rpc#1050](https://github.com/stellar/stellar-rpc/pull/1050)), so it is `null` with newer servers. It will be removed in the next major release.
- feat: add CAP-84 muxed contract address (`W...`) support.
- New `StrKey.encodeMuxedContract`, `StrKey.decodeMuxedContract`, and `StrKey.isValidMuxedContract`. The raw form is the 32-byte contract ID followed by the 8-byte big-endian ID, as specified by SEP-23.
- `Address` accepts `W...` addresses and converts `SC_ADDRESS_TYPE_MUXED_CONTRACT` to and from `SCAddress` and `SCVal`, with the new `Address.AddressType.MUXED_CONTRACT` and `Address.fromMuxedContract(byte[])`. Contract return values and events that hold a muxed contract address no longer fail to decode.
- Map keys holding muxed contract addresses are now sorted correctly when building an `SCV_MAP`.
- A muxed contract address is only valid where a muxed account (`M...`) is, such as the `to` parameter of the SAC `transfer`. The SDK now applies the Soroban host's rules up front instead of building transactions that fail at simulation or submission:
- Authorization addresses must be an account (`G...`) or a contract (`C...`), as the host requires. `Auth.authorizeInvocation`, the `forAddress` of `Auth.authorizeEntry`, `Auth.DelegateSignature`, and the credentials of an entry passed to `Auth.authorizeEntry`, `Auth.buildAuthorizationEntryPreimage`, or `Auth.buildWithDelegatesEntry` reject any other address type, including muxed accounts (`M...`), which were accepted before.
- `SorobanServer.getContractData` requires a contract address (`C...`) and rejects a `key` that contains a muxed address (`M...` or `W...`) anywhere, since the host never stores such keys.
- `TransactionBuilder.buildRestoreAssetBalanceEntryTransaction` requires `balanceOwner` to be a contract address (`C...`). Only contracts hold SAC balances in contract data; an account's balance lives in its trustline.
- feat: add `contractMuxed` and `contractMuxedId` to `ContractCreditedEffectResponse`. Horizon sets them when a Stellar Asset Contract `transfer` or `mint` goes to a muxed contract address (`W...`); `contract` is then its base contract address (`C...`). ([stellar-horizon#237](https://github.com/stellar/stellar-horizon/pull/237))

## 5.0.0

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ xdr/Stellar-transaction.x \
xdr/Stellar-types.x

# stellar-xdr commit to use, see https://github.com/stellar/stellar-xdr
XDR_COMMIT=9c9c145953e80990d6ff1ae3a6a973a0ce6d0694
XDR_COMMIT=4f524bbac80c781c06e4fb5fc93a2d0d331d6705

.PHONY: xdr xdr-clean xdr-update xdr-generator-test xdr-generator-update-snapshots

Expand Down
10 changes: 5 additions & 5 deletions android_test/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ dependencies {
// Since we are adding local jar(libs/stellar-sdk.jar) as dependency,
// gradle cannot automatically download the required third-party dependencies.
implementation(files("libs/stellar-sdk-5.0.0.jar"))
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation("com.squareup.okhttp3:okhttp-sse:4.11.0")
implementation("com.squareup.okhttp3:okhttp:4.12.1")
implementation("com.squareup.okhttp3:okhttp-sse:4.12.1")
implementation("com.moandjiezana.toml:toml4j:0.7.2")
implementation("com.google.code.gson:gson:2.11.0")
implementation("org.bouncycastle:bcprov-jdk18on:1.78.1")
implementation("commons-codec:commons-codec:1.17.1")
implementation("com.google.code.gson:gson:2.15.0")
implementation("org.bouncycastle:bcprov-jdk18on:1.86")
implementation("commons-codec:commons-codec:1.23.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha03")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
Expand Down
48 changes: 18 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ plugins {
id("signing")
id("maven-publish")
id("project-report")
id("com.diffplug.spotless") version "8.7.0"
id("com.github.ben-manes.versions") version "0.54.0"
id("io.freefair.lombok") version "9.5.0"
id("com.gradleup.nmcp").version("1.6.0")
kotlin("jvm") version "2.4.0"
id("com.diffplug.spotless") version "8.10.4"
id("io.github.ben-manes.versions") version "0.66.0"
id("io.freefair.lombok") version "9.8.2"
kotlin("jvm") version "2.4.21"
}

group = "network.lightsail"
Expand Down Expand Up @@ -38,30 +37,30 @@ spotless {
}
kotlin {
target("src/test/kotlin/**/*.kt")
ktfmt("0.56").googleStyle()
ktfmt("0.64").googleStyle()
}
}

dependencies {
val okhttpVersion = "4.12.0"
val okhttpVersion = "4.12.1"

implementation("com.squareup.okhttp3:okhttp:${okhttpVersion}")
implementation("com.squareup.okhttp3:okhttp-sse:${okhttpVersion}")
implementation("com.moandjiezana.toml:toml4j:0.7.2")
implementation("com.google.code.gson:gson:2.14.0")
implementation("org.bouncycastle:bcprov-jdk18on:1.84")
implementation("commons-codec:commons-codec:1.22.0")
implementation("com.google.code.gson:gson:2.15.0")
implementation("org.bouncycastle:bcprov-jdk18on:1.86")
implementation("commons-codec:commons-codec:1.23.0")

testImplementation(kotlin("stdlib"))
testImplementation("org.mockito:mockito-core:5.23.0")
testImplementation("org.mockito:mockito-core:5.24.0")
testImplementation("com.squareup.okhttp3:mockwebserver:${okhttpVersion}")
testImplementation("junit:junit:4.13.2")
testImplementation("org.bouncycastle:bcpkix-jdk18on:1.84") // mock https
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.11.3")
testImplementation("org.bouncycastle:bcpkix-jdk18on:1.86") // mock https
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:6.1.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

testImplementation("io.kotest:kotest-runner-junit5:6.1.11")
testImplementation("io.kotest:kotest-assertions-core:6.1.11")
testImplementation("io.kotest:kotest-runner-junit5:6.2.6")
testImplementation("io.kotest:kotest-assertions-core:6.2.6")
}

tasks {
Expand All @@ -79,12 +78,12 @@ tasks {
dependsOn(testClasses)
}

val sourcesJar by registering(Jar::class) {
val sourcesJar = register<Jar>("sourcesJar") {
archiveClassifier = "sources"
from(sourceSets.main.get().allSource)
}

val uberJar by registering(Jar::class) {
val uberJar = register<Jar>("uberJar") {
// https://docs.gradle.org/current/userguide/working_with_files.html#sec:creating_uber_jar_exampl
archiveClassifier = "uber"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
Expand All @@ -108,7 +107,7 @@ tasks {
}
}

val javadocJar by registering(Jar::class) {
val javadocJar = register<Jar>("javadocJar") {
archiveClassifier = "javadoc"
dependsOn(javadoc)
from(javadoc.get().destinationDir) // It needs to be placed after the javadoc task, otherwise it cannot read the path we set.
Expand Down Expand Up @@ -196,7 +195,7 @@ publishing {


signing {
val publishCommand = "publishAllPublicationsToCentralPortal"
val publishCommand = "publishAggregationToCentralPortal"
isRequired = gradle.startParameter.taskNames.contains(publishCommand)
println("Need to sign? $isRequired")
// https://docs.gradle.org/current/userguide/signing_plugin.html#using_in_memory_ascii_armored_openpgp_subkeys
Expand All @@ -211,14 +210,3 @@ signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}

nmcp {
publishAllPublicationsToCentralPortal {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
// publish manually from the portal
publishingType = "USER_MANAGED"
// or if you want to publish automatically
// publishingType = "AUTOMATIC"
}
}
4 changes: 2 additions & 2 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java")
id("com.diffplug.spotless") version "6.24.0"
id("com.diffplug.spotless") version "8.10.4"

}

Expand All @@ -23,7 +23,7 @@ spotless {
dependencies {
// Use https://central.sonatype.com/artifact/network.lightsail/stellar-sdk in prod.
implementation("network.lightsail:stellar-sdk:5.0.0")
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation(platform("org.junit:junit-bom:6.1.3"))
testImplementation("org.junit.jupiter:junit-jupiter")
}

Expand Down
Binary file modified examples/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 5 additions & 2 deletions examples/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#Wed Jul 03 20:45:55 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading