diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a77dab0d3..baad0f33c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -31,7 +31,7 @@ jobs:
runs-on: client-sdk-linux-medium
steps:
- name: Harden Runner
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
@@ -45,7 +45,7 @@ jobs:
java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
+ uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
with:
cache-read-only: false
@@ -59,7 +59,7 @@ jobs:
- build
steps:
- name: Harden Runner
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
@@ -80,7 +80,7 @@ jobs:
java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
+ uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- name: Install Local Node
run: npm install @hashgraph/hedera-local
@@ -104,7 +104,7 @@ jobs:
- name: Upload coverage to Codecov
if: ${{ github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') }}
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
+ uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
- name: Stop the local node
run: npx @hashgraph/hedera-local stop
@@ -116,7 +116,7 @@ jobs:
- build
steps:
- name: Harden Runner
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
@@ -138,7 +138,7 @@ jobs:
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3.2.2
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
+ uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- name: Install Local Node
run: npm install @hashgraph/hedera-local
@@ -171,7 +171,7 @@ jobs:
- build
steps:
- name: Harden Runner
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
@@ -192,7 +192,7 @@ jobs:
java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
+ uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- name: Install Local Node
run: npm install @hashgraph/hedera-local
diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml
index b7499cebf..e84271725 100644
--- a/.github/workflows/pages.yml
+++ b/.github/workflows/pages.yml
@@ -24,7 +24,7 @@ jobs:
runs-on: client-sdk-linux-medium
steps:
- name: Harden Runner
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
@@ -38,7 +38,7 @@ jobs:
java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
+ uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- name: Compile SDK
run: ./gradlew compileJava --scan
diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml
index 1d1731fb4..a04f48204 100644
--- a/.github/workflows/release-artifacts.yml
+++ b/.github/workflows/release-artifacts.yml
@@ -30,7 +30,7 @@ jobs:
runs-on: client-sdk-linux-medium
steps:
- name: Harden Runner
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
@@ -54,7 +54,7 @@ jobs:
java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
+ uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
with:
cache-read-only: false
@@ -80,7 +80,7 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
@@ -116,7 +116,7 @@ jobs:
java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
+ uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
with:
cache-read-only: false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0c583bd38..34fcdd034 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## 2.45.0-beta.1
+
+### Fixed
+- Fixed a bug where optional fields for `NodeUpdateTransaction` were being set as default values.
+
## 2.44.0
### Fixed
diff --git a/docs/android-app/android-app-quickstart.md b/docs/android-app/android-app-quickstart.md
index f267cebc6..e250f5abc 100644
--- a/docs/android-app/android-app-quickstart.md
+++ b/docs/android-app/android-app-quickstart.md
@@ -6,7 +6,7 @@ To get started with an Android project, you'll need to add the following **two**
1. **Hederaâ„¢ Java SDK:**
```groovy
-implementation 'com.hedera.hashgraph:sdk:2.44.0'
+implementation 'com.hedera.hashgraph:sdk:2.45.0-beta.1'
```
2. **gRPC implementation:**
diff --git a/docs/java-app/java-app-quickstart.md b/docs/java-app/java-app-quickstart.md
index e1a06eb6c..7e1395f1f 100644
--- a/docs/java-app/java-app-quickstart.md
+++ b/docs/java-app/java-app-quickstart.md
@@ -8,7 +8,7 @@ To get started with a Java project, you'll need to add the following **three** d
_Gradle:_
```groovy
-implementation 'com.hedera.hashgraph:sdk:2.44.0'
+implementation 'com.hedera.hashgraph:sdk:2.45.0-beta.1'
```
_Maven:_
@@ -16,7 +16,7 @@ _Maven:_
com.hedera.hashgraph
sdk
- 2.44.0
+ 2.45.0-beta.1
```
diff --git a/example-android/app/build.gradle.kts b/example-android/app/build.gradle.kts
index a3f456c74..0f6afdd40 100644
--- a/example-android/app/build.gradle.kts
+++ b/example-android/app/build.gradle.kts
@@ -68,7 +68,7 @@ dependencies {
implementation(platform("com.hedera.hashgraph:sdk-dependency-versions"))
// ---------------------------------------------
- implementation("com.hedera.hashgraph:sdk:2.44.0")
+ implementation("com.hedera.hashgraph:sdk:2.45.0-beta.1")
implementation("com.google.android.material:material:1.11.0")
diff --git a/examples/build.gradle.kts b/examples/build.gradle.kts
index 303c7504b..4bb73c207 100644
--- a/examples/build.gradle.kts
+++ b/examples/build.gradle.kts
@@ -28,6 +28,6 @@ mainModuleInfo {
}
dependencies.constraints {
- implementation("com.hedera.hashgraph:sdk:2.44.0")
- implementation("com.hedera.hashgraph:sdk-full:2.44.0")
+ implementation("com.hedera.hashgraph:sdk:2.45.0-beta.1")
+ implementation("com.hedera.hashgraph:sdk-full:2.45.0-beta.1")
}
diff --git a/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java
new file mode 100644
index 000000000..20ba0e68b
--- /dev/null
+++ b/examples/src/main/java/com/hedera/hashgraph/sdk/examples/InitializeClientWithMirrorNetworkExample.java
@@ -0,0 +1,92 @@
+/*-
+ *
+ * Hedera Java SDK
+ *
+ * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.hedera.hashgraph.sdk.examples;
+
+import com.hedera.hashgraph.sdk.AccountCreateTransaction;
+import com.hedera.hashgraph.sdk.AccountId;
+import com.hedera.hashgraph.sdk.Client;
+import com.hedera.hashgraph.sdk.Hbar;
+import com.hedera.hashgraph.sdk.PrivateKey;
+import com.hedera.hashgraph.sdk.logger.LogLevel;
+import com.hedera.hashgraph.sdk.logger.Logger;
+import io.github.cdimascio.dotenv.Dotenv;
+import java.util.List;
+import java.util.Objects;
+
+public class InitializeClientWithMirrorNetworkExample {
+ /*
+ * See .env.sample in the examples folder root for how to specify values below
+ * or set environment variables with the same names.
+ */
+
+ /**
+ * Operator's account ID. Used to sign and pay for operations on Hedera.
+ */
+ private static final AccountId OPERATOR_ID = AccountId.fromString(
+ Objects.requireNonNull(Dotenv.load().get("OPERATOR_ID")));
+
+ /**
+ * Operator's private key.
+ */
+ private static final PrivateKey OPERATOR_KEY = PrivateKey.fromString(
+ Objects.requireNonNull(Dotenv.load().get("OPERATOR_KEY")));
+
+ /**
+ * SDK_LOG_LEVEL defaults to SILENT if not specified in dotenv file. Log levels can be: TRACE, DEBUG, INFO, WARN,
+ * ERROR, SILENT.
+ *
+ * Important pre-requisite: set simple logger log level to same level as the SDK_LOG_LEVEL, for example via VM
+ * options: -Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace
+ */
+ private static final String SDK_LOG_LEVEL = Dotenv.load().get("SDK_LOG_LEVEL", "SILENT");
+
+ public static void main(String[] args) throws Exception {
+ /*
+ * Step 0:
+ * Create and configure the SDK Client.
+ */
+ Client client = Client.forMirrorNetwork(List.of("testnet.mirrornode.hedera.com:443"));
+ // All generated transactions will be paid by this account and signed by this key.
+ client.setOperator(OPERATOR_ID, OPERATOR_KEY);
+ // Attach logger to the SDK Client.
+ client.setLogger(new Logger(LogLevel.valueOf(SDK_LOG_LEVEL)));
+
+ /*
+ * Step 1:
+ * Generate ED25519 key pair.
+ */
+ System.out.println("Generating ED25519 key pair...");
+ PrivateKey privateKey = PrivateKey.generateED25519();
+
+ /*
+ * Step 2:
+ * Create account
+ */
+ AccountId aliceId = new AccountCreateTransaction()
+ .setKey(privateKey)
+ .setInitialBalance(Hbar.from(5))
+ .execute(client)
+ .getReceipt(client)
+ .accountId;
+ Objects.requireNonNull(aliceId);
+ System.out.println("Alice's account ID: " + aliceId);
+ }
+}
diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.examples.java.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.examples.java.gradle.kts
index 220ceb189..e90786ea4 100644
--- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.examples.java.gradle.kts
+++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.examples.java.gradle.kts
@@ -69,6 +69,7 @@ abstract class RunAllExample : DefaultTask() {
.map { it.name.replace(".java", "") }
.filter { it != "ValidateChecksumExample" } // disabled this example, because it needs user input (but it WORKS)
.filter { it != "ConsensusPubSubChunkedExample" } // is flaky on local-node env, will be investigated
+ .filter { it != "InitializeClientWithMirrorNetworkExample" } // disabled - cannot run on localnode
.toList()
exampleClasses.forEach { className ->
diff --git a/gradle/plugins/src/main/kotlin/com.hedera.gradle.patch-modules.gradle.kts b/gradle/plugins/src/main/kotlin/com.hedera.gradle.patch-modules.gradle.kts
index 6282658cb..913408e8b 100644
--- a/gradle/plugins/src/main/kotlin/com.hedera.gradle.patch-modules.gradle.kts
+++ b/gradle/plugins/src/main/kotlin/com.hedera.gradle.patch-modules.gradle.kts
@@ -62,9 +62,13 @@ jvmDependencyConflicts.patch {
extraJavaModuleInfo {
failOnAutomaticModules = true // Only allow Jars with 'module-info' on all module paths
- module("com.esaulpaugh:headlong", "headlong")
+ module("com.esaulpaugh:headlong", "com.esaulpaugh.headlong")
module("com.github.spotbugs:spotbugs-annotations", "com.github.spotbugs.annotations")
- module("com.google.errorprone:error_prone_annotations", "com.google.errorprone.annotations")
+ module("com.google.errorprone:error_prone_annotations", "com.google.errorprone.annotations") {
+ patchRealModule()
+ exportAllPackages()
+ requireAllDefinedDependencies()
+ }
module("com.google.guava:failureaccess", "com.google.common.util.concurrent.internal")
module("com.google.guava:guava", "com.google.common") {
exportAllPackages()
diff --git a/sdk-dependency-versions/build.gradle.kts b/sdk-dependency-versions/build.gradle.kts
index 220dd22b0..ac383fd11 100644
--- a/sdk-dependency-versions/build.gradle.kts
+++ b/sdk-dependency-versions/build.gradle.kts
@@ -23,7 +23,7 @@ plugins {
}
dependencies.constraints {
- api("com.esaulpaugh:headlong:12.1.0") {
+ api("com.esaulpaugh:headlong:12.3.3") {
because("headlong")
}
api("com.google.code.gson:gson:2.10.1") {
@@ -37,19 +37,19 @@ dependencies.constraints {
// shouldn't be updated for now (breaking changes after 4.x.x)
because("com.google.protobuf")
}
- api("io.grpc:grpc-api:1.64.0") {
+ api("io.grpc:grpc-api:1.68.1") {
because("io.grpc")
}
- api("io.grpc:grpc-inprocess:1.64.0") {
+ api("io.grpc:grpc-inprocess:1.67.1") {
because("io.grpc.protobuf")
}
- api("io.grpc:grpc-protobuf:1.64.0") {
+ api("io.grpc:grpc-protobuf:1.68.1") {
because("io.grpc.protobuf")
}
- api("io.grpc:grpc-protobuf-lite:1.64.0") {
+ api("io.grpc:grpc-protobuf-lite:1.68.1") {
because("io.grpc.protobuf")
}
- api("io.grpc:grpc-stub:1.64.0") {
+ api("io.grpc:grpc-stub:1.68.1") {
because("io.grpc.stub")
}
api("com.google.code.findbugs:jsr305:3.0.2") {
diff --git a/sdk-full/src/main/java/module-info.java b/sdk-full/src/main/java/module-info.java
index 515c7989e..b82a169e1 100644
--- a/sdk-full/src/main/java/module-info.java
+++ b/sdk-full/src/main/java/module-info.java
@@ -21,9 +21,9 @@
module com.hedera.hashgraph.sdk.full {
requires transitive com.google.protobuf;
+ requires com.esaulpaugh.headlong;
requires com.google.common;
requires com.google.gson;
- requires headlong;
requires io.grpc.inprocess;
requires io.grpc.protobuf;
requires io.grpc.stub;
diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/Client.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/Client.java
index da66b5aa8..957b14ba5 100644
--- a/sdk/src/main/java/com/hedera/hashgraph/sdk/Client.java
+++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/Client.java
@@ -185,6 +185,24 @@ public static Client forNetwork(Map networkMap) {
return new Client(executor, network, mirrorNetwork, null, true, null);
}
+ /**
+ * Set up the client from selected mirror network.
+ *
+ * @param mirrorNetworkList
+ * @return
+ */
+ public static Client forMirrorNetwork(List mirrorNetworkList) throws InterruptedException, TimeoutException {
+ var executor = createExecutor();
+ var network = Network.forNetwork(executor, new HashMap<>());
+ var mirrorNetwork = MirrorNetwork.forNetwork(executor, mirrorNetworkList);
+ var client = new Client(executor, network, mirrorNetwork, null, true, null);
+ var addressBook = new AddressBookQuery()
+ .setFileId(FileId.ADDRESS_BOOK)
+ .execute(client);
+ client.setNetworkFromAddressBook(addressBook);
+ return client;
+ }
+
/**
* Set up the client for the selected network.
*
@@ -1418,8 +1436,8 @@ private Client toClient() throws Exception, InterruptedException {
private Client initializeWithNetwork() throws Exception {
if (network == null) {
throw new Exception("Network is not set in provided json object");
- }
-
+ }
+
Client client;
if (network.isJsonObject()) {
client = clientFromNetworkJson();
@@ -1501,7 +1519,6 @@ private void setOperatorOn(Client client) {
if (operator != null) {
AccountId operatorAccount = AccountId.fromString(operator.accountId);
PrivateKey privateKey = PrivateKey.fromString(operator.privateKey);
-
client.setOperator(operatorAccount, privateKey);
}
}
diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeCreateTransaction.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeCreateTransaction.java
index 3f3be13b0..5779d3fe0 100644
--- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeCreateTransaction.java
+++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeCreateTransaction.java
@@ -194,7 +194,6 @@ public AccountId getAccountId() {
* @return {@code this}
*/
public NodeCreateTransaction setAccountId(AccountId accountId) {
- Objects.requireNonNull(accountId);
requireNotFrozen();
this.accountId = accountId;
return this;
@@ -215,7 +214,6 @@ public String getDescription() {
*/
public NodeCreateTransaction setDescription(String description) {
requireNotFrozen();
- Objects.requireNonNull(description);
this.description = description;
return this;
}
@@ -288,7 +286,7 @@ public NodeCreateTransaction addServiceEndpoint(Endpoint serviceEndpoint) {
*/
@Nullable
public byte[] getGossipCaCertificate() {
- return gossipCaCertificate != null ? Arrays.copyOf(gossipCaCertificate, gossipCaCertificate.length) : null;
+ return gossipCaCertificate;
}
/**
@@ -299,9 +297,8 @@ public byte[] getGossipCaCertificate() {
* @return {@code this}
*/
public NodeCreateTransaction setGossipCaCertificate(byte[] gossipCaCertificate) {
- Objects.requireNonNull(gossipCaCertificate);
requireNotFrozen();
- this.gossipCaCertificate = Arrays.copyOf(gossipCaCertificate, gossipCaCertificate.length);
+ this.gossipCaCertificate = gossipCaCertificate;
return this;
}
@@ -311,7 +308,7 @@ public NodeCreateTransaction setGossipCaCertificate(byte[] gossipCaCertificate)
*/
@Nullable
public byte[] getGrpcCertificateHash() {
- return grpcCertificateHash != null ? Arrays.copyOf(grpcCertificateHash, grpcCertificateHash.length) : null;
+ return grpcCertificateHash;
}
/**
@@ -322,9 +319,8 @@ public byte[] getGrpcCertificateHash() {
* @return {@code this}
*/
public NodeCreateTransaction setGrpcCertificateHash(byte[] grpcCertificateHash) {
- Objects.requireNonNull(grpcCertificateHash);
requireNotFrozen();
- this.grpcCertificateHash = Arrays.copyOf(grpcCertificateHash, grpcCertificateHash.length);
+ this.grpcCertificateHash = grpcCertificateHash;
return this;
}
@@ -343,7 +339,6 @@ public Key getAdminKey() {
* @return {@code this}
*/
public NodeCreateTransaction setAdminKey(Key adminKey) {
- Objects.requireNonNull(adminKey);
requireNotFrozen();
this.adminKey = adminKey;
return this;
@@ -406,9 +401,11 @@ void initFromTransactionBody() {
serviceEndpoints.add(Endpoint.fromProtobuf(serviceEndpoint));
}
- gossipCaCertificate = body.getGossipCaCertificate().toByteArray();
+ var protobufGossipCert = body.getGossipCaCertificate();
+ gossipCaCertificate = protobufGossipCert.equals(ByteString.empty()) ? null : protobufGossipCert.toByteArray();
- grpcCertificateHash = body.getGrpcCertificateHash().toByteArray();
+ var protobufGrpcCert = body.getGrpcCertificateHash();
+ grpcCertificateHash = protobufGrpcCert.equals(ByteString.empty()) ? null : protobufGrpcCert.toByteArray();
if (body.hasAdminKey()) {
adminKey = Key.fromProtobufKey(body.getAdminKey());
diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java
index 7875b2410..de5a31575 100644
--- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java
+++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java
@@ -240,7 +240,6 @@ public AccountId getAccountId() {
* @return {@code this}
*/
public NodeUpdateTransaction setAccountId(AccountId accountId) {
- Objects.requireNonNull(accountId);
requireNotFrozen();
this.accountId = accountId;
return this;
@@ -262,7 +261,6 @@ public String getDescription() {
*/
public NodeUpdateTransaction setDescription(String description) {
requireNotFrozen();
- Objects.requireNonNull(description);
this.description = description;
return this;
}
@@ -345,7 +343,7 @@ public NodeUpdateTransaction addServiceEndpoint(Endpoint serviceEndpoint) {
*/
@Nullable
public byte[] getGossipCaCertificate() {
- return gossipCaCertificate != null ? Arrays.copyOf(gossipCaCertificate, gossipCaCertificate.length) : null;
+ return gossipCaCertificate;
}
/**
@@ -356,9 +354,8 @@ public byte[] getGossipCaCertificate() {
* @return {@code this}
*/
public NodeUpdateTransaction setGossipCaCertificate(byte[] gossipCaCertificate) {
- Objects.requireNonNull(gossipCaCertificate);
requireNotFrozen();
- this.gossipCaCertificate = Arrays.copyOf(gossipCaCertificate, gossipCaCertificate.length);
+ this.gossipCaCertificate = gossipCaCertificate;
return this;
}
@@ -368,7 +365,7 @@ public NodeUpdateTransaction setGossipCaCertificate(byte[] gossipCaCertificate)
*/
@Nullable
public byte[] getGrpcCertificateHash() {
- return grpcCertificateHash != null ? Arrays.copyOf(grpcCertificateHash, grpcCertificateHash.length) : null;
+ return grpcCertificateHash;
}
/**
@@ -379,9 +376,8 @@ public byte[] getGrpcCertificateHash() {
* @return {@code this}
*/
public NodeUpdateTransaction setGrpcCertificateHash(byte[] grpcCertificateHash) {
- Objects.requireNonNull(grpcCertificateHash);
requireNotFrozen();
- this.grpcCertificateHash = Arrays.copyOf(grpcCertificateHash, grpcCertificateHash.length);
+ this.grpcCertificateHash = grpcCertificateHash;
return this;
}
@@ -400,7 +396,6 @@ public Key getAdminKey() {
* @return {@code this}
*/
public NodeUpdateTransaction setAdminKey(Key adminKey) {
- Objects.requireNonNull(adminKey);
requireNotFrozen();
this.adminKey = adminKey;
return this;
@@ -459,7 +454,9 @@ void initFromTransactionBody() {
accountId = AccountId.fromProtobuf(body.getAccountId());
}
- description = body.getDescription().getValue();
+ if (body.hasDescription()) {
+ description = body.getDescription().getValue();
+ }
for (var gossipEndpoint : body.getGossipEndpointList()) {
gossipEndpoints.add(Endpoint.fromProtobuf(gossipEndpoint));
@@ -469,9 +466,13 @@ void initFromTransactionBody() {
serviceEndpoints.add(Endpoint.fromProtobuf(serviceEndpoint));
}
- gossipCaCertificate = body.getGossipCaCertificate().getValue().toByteArray();
+ if (body.hasGossipCaCertificate()) {
+ gossipCaCertificate = body.getGossipCaCertificate().getValue().toByteArray();
+ }
- grpcCertificateHash = body.getGrpcCertificateHash().getValue().toByteArray();
+ if (body.hasGrpcCertificateHash()) {
+ grpcCertificateHash = body.getGrpcCertificateHash().getValue().toByteArray();
+ }
if (body.hasAdminKey()) {
adminKey = Key.fromProtobufKey(body.getAdminKey());
diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateTransaction.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateTransaction.java
index 39a27fba0..ef130ff01 100644
--- a/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateTransaction.java
+++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/TokenUpdateTransaction.java
@@ -142,6 +142,8 @@ public class TokenUpdateTransaction extends Transaction
*/
@Nullable
private Instant expirationTime = null;
+ private Duration expirationTimeDuration = null;
+
/**
* The new interval at which the auto-renew account will be charged to
* extend the token's expiry.
@@ -488,6 +490,16 @@ public TokenUpdateTransaction setExpirationTime(Instant expirationTime) {
requireNotFrozen();
autoRenewPeriod = null;
this.expirationTime = expirationTime;
+ this.expirationTimeDuration = null;
+ return this;
+ }
+
+ public TokenUpdateTransaction setExpirationTime(Duration expirationTime) {
+ Objects.requireNonNull(expirationTime);
+ requireNotFrozen();
+ autoRenewPeriod = null;
+ this.expirationTime = null;
+ this.expirationTimeDuration = expirationTime;
return this;
}
@@ -717,6 +729,9 @@ TokenUpdateTransactionBody.Builder build() {
if (expirationTime != null) {
builder.setExpiry(InstantConverter.toProtobuf(expirationTime));
}
+ if (expirationTimeDuration != null) {
+ builder.setExpiry(InstantConverter.toProtobuf(expirationTimeDuration));
+ }
if (autoRenewPeriod != null) {
builder.setAutoRenewPeriod(DurationConverter.toProtobuf(autoRenewPeriod));
}
diff --git a/sdk/src/main/java/module-info.java b/sdk/src/main/java/module-info.java
index d9f19f2fe..7dfbc187f 100644
--- a/sdk/src/main/java/module-info.java
+++ b/sdk/src/main/java/module-info.java
@@ -21,9 +21,9 @@
module com.hedera.hashgraph.sdk {
requires transitive com.google.protobuf;
+ requires com.esaulpaugh.headlong;
requires com.google.common;
requires com.google.gson;
- requires headlong;
requires io.grpc.inprocess;
requires io.grpc.protobuf.lite;
requires io.grpc.stub;
diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.java
index 4760e728e..3c4577b2d 100644
--- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.java
+++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeCreateTransactionTest.java
@@ -122,6 +122,27 @@ void fromScheduledTransaction() {
assertThat(tx).isInstanceOf(NodeCreateTransaction.class);
}
+ @Test
+ void testSerializeDeserialize() throws Exception {
+ var tx = new NodeCreateTransaction().setDescription(TEST_DESCRIPTION);
+ var tx2 = new NodeCreateTransaction().setDescription(TEST_DESCRIPTION);
+ var tx2Bytes = tx2.toBytes();
+ NodeCreateTransaction deserializedTx2 = (NodeCreateTransaction) Transaction.fromBytes(tx2Bytes);
+ assertThat(tx.getGossipCaCertificate()).isEqualTo(deserializedTx2.getGossipCaCertificate());
+ assertThat(tx.getGrpcCertificateHash()).isEqualTo(deserializedTx2.getGrpcCertificateHash());
+ }
+
+ @Test
+ void testSetNull() {
+ new NodeCreateTransaction()
+ .setDescription(null)
+ .setAccountId(null)
+ .setGossipCaCertificate(null)
+ .setGrpcCertificateHash(null)
+ .setAdminKey(null);
+ }
+
+
@Test
void constructNodeCreateTransactionFromTransactionBodyProtobuf() {
var transactionBodyBuilder = NodeCreateTransactionBody.newBuilder();
diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java
index b07b52c90..f56474b57 100644
--- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java
+++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java
@@ -99,7 +99,6 @@ private NodeUpdateTransaction spawnTestTransaction() {
.setTransactionId(TransactionId.withValidStart(AccountId.fromString("0.0.5006"), TEST_VALID_START))
.setNodeId(TEST_NODE_ID)
.setAccountId(TEST_ACCOUNT_ID)
- .setAccountId(TEST_ACCOUNT_ID)
.setDescription(TEST_DESCRIPTION)
.setGossipEndpoints(TEST_GOSSIP_ENDPOINTS)
.setServiceEndpoints(TEST_SERVICE_ENDPOINTS)
@@ -118,6 +117,37 @@ void shouldBytes() throws Exception {
assertThat(tx2.toString()).isEqualTo(tx.toString());
}
+ @Test
+ void testNullOptionalValues() throws Exception {
+ var tx = new NodeUpdateTransaction();
+ var tx2Bytes = tx.toBytes();
+ NodeUpdateTransaction deserializedTx = (NodeUpdateTransaction) Transaction.fromBytes(tx2Bytes);
+ assertThat(deserializedTx.getGossipCaCertificate()).isNull();
+ assertThat(deserializedTx.getGrpcCertificateHash()).isNull();
+ assertThat(deserializedTx.getDescription()).isNull();
+ }
+
+ @Test
+ void testEmptyCertificates() throws Exception {
+ var tx = new NodeUpdateTransaction()
+ .setGossipCaCertificate(new byte[]{})
+ .setGrpcCertificateHash(new byte[]{});
+ var tx2Bytes = tx.toBytes();
+ NodeUpdateTransaction deserializedTx = (NodeUpdateTransaction) Transaction.fromBytes(tx2Bytes);
+ assertThat(deserializedTx.getGossipCaCertificate()).isEqualTo(new byte[]{});
+ assertThat(deserializedTx.getGrpcCertificateHash()).isEqualTo(new byte[]{});
+ }
+
+ @Test
+ void testSetNull() {
+ new NodeUpdateTransaction()
+ .setDescription(null)
+ .setAccountId(null)
+ .setGossipCaCertificate(null)
+ .setGrpcCertificateHash(null)
+ .setAdminKey(null);
+ }
+
@Test
void fromScheduledTransaction() {
var transactionBody = SchedulableTransactionBody.newBuilder()
diff --git a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java
index 5ec000e6b..08da7ffbb 100644
--- a/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java
+++ b/sdk/src/testIntegration/java/com/hedera/hashgraph/sdk/test/integration/ClientIntegrationTest.java
@@ -21,6 +21,7 @@
import com.hedera.hashgraph.sdk.*;
import java.util.Collections;
+import java.util.List;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.time.Duration;
@@ -248,4 +249,17 @@ void pingAllAsync() throws Exception {
}
}
+
+ @Test
+ @DisplayName("`forMirrorNetwork()`")
+ void testClientInitWithMirrorNetwork() throws Exception {
+ var mirrorNetworkString = "testnet.mirrornode.hedera.com:443";
+ var client = Client.forMirrorNetwork(List.of(mirrorNetworkString));
+ var mirrorNetwork = client.getMirrorNetwork();
+
+ assertThat(mirrorNetwork).hasSize(1);
+ assertThat(mirrorNetwork.get(0)).isEqualTo(mirrorNetworkString);
+ assertThat(client.getNetwork()).isNotNull();
+ assertThat(client.getNetwork()).isNotEmpty();
+ }
}
diff --git a/sdk/src/testIntegration/java/module-info.java b/sdk/src/testIntegration/java/module-info.java
index 90228b96c..8fbf5e58a 100644
--- a/sdk/src/testIntegration/java/module-info.java
+++ b/sdk/src/testIntegration/java/module-info.java
@@ -20,7 +20,7 @@
open module com.hedera.hashgraph.sdk.test.integration {
requires com.hedera.hashgraph.sdk;
- requires headlong;
+ requires com.esaulpaugh.headlong;
requires org.assertj.core;
requires org.bouncycastle.provider;
requires org.junit.jupiter.api;
diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/TokenService.java b/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/TokenService.java
index c2bcbc861..832678f27 100644
--- a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/TokenService.java
+++ b/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/TokenService.java
@@ -27,14 +27,18 @@
import com.hedera.hashgraph.sdk.CustomRoyaltyFee;
import com.hedera.hashgraph.sdk.Status;
import com.hedera.hashgraph.sdk.TokenCreateTransaction;
+import com.hedera.hashgraph.sdk.TokenDeleteTransaction;
import com.hedera.hashgraph.sdk.TokenId;
import com.hedera.hashgraph.sdk.TokenSupplyType;
import com.hedera.hashgraph.sdk.TokenType;
+import com.hedera.hashgraph.sdk.TokenUpdateTransaction;
import com.hedera.hashgraph.sdk.TransactionReceipt;
import com.hedera.hashgraph.tck.annotation.JSONRPC2Method;
import com.hedera.hashgraph.tck.annotation.JSONRPC2Service;
import com.hedera.hashgraph.tck.methods.AbstractJSONRPC2Service;
import com.hedera.hashgraph.tck.methods.sdk.param.TokenCreateParams;
+import com.hedera.hashgraph.tck.methods.sdk.param.TokenDeleteParams;
+import com.hedera.hashgraph.tck.methods.sdk.param.TokenUpdateParams;
import com.hedera.hashgraph.tck.methods.sdk.response.TokenResponse;
import com.hedera.hashgraph.tck.util.KeyUtils;
import java.time.Duration;
@@ -233,4 +237,123 @@ public TokenResponse createToken(final TokenCreateParams params) throws Exceptio
return new TokenResponse(tokenId, transactionReceipt.status);
}
+
+ @JSONRPC2Method("updateToken")
+ public TokenResponse updateToken(final TokenUpdateParams params) throws Exception {
+ TokenUpdateTransaction tokenUpdateTransaction = new TokenUpdateTransaction();
+
+ params.getTokenId().ifPresent(tokenId -> tokenUpdateTransaction.setTokenId(TokenId.fromString(tokenId)));
+
+ params.getAdminKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setAdminKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getKycKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setKycKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getFreezeKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setFreezeKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getWipeKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setWipeKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getSupplyKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setSupplyKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getFeeScheduleKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setFeeScheduleKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getPauseKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setPauseKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getMetadataKey().ifPresent(key -> {
+ try {
+ tokenUpdateTransaction.setMetadataKey(KeyUtils.getKeyFromString(key));
+ } catch (InvalidProtocolBufferException e) {
+ throw new IllegalArgumentException(e);
+ }
+ });
+
+ params.getName().ifPresent(tokenUpdateTransaction::setTokenName);
+ params.getSymbol().ifPresent(tokenUpdateTransaction::setTokenSymbol);
+
+ params.getTreasuryAccountId()
+ .ifPresent(treasuryAccountId ->
+ tokenUpdateTransaction.setTreasuryAccountId(AccountId.fromString(treasuryAccountId)));
+
+ params.getExpirationTime()
+ .ifPresent(expirationTime ->
+ tokenUpdateTransaction.setExpirationTime(Duration.ofSeconds(Long.parseLong(expirationTime))));
+
+ params.getAutoRenewAccountId()
+ .ifPresent(autoRenewAccountId ->
+ tokenUpdateTransaction.setAutoRenewAccountId(AccountId.fromString(autoRenewAccountId)));
+
+ params.getAutoRenewPeriod()
+ .ifPresent(autoRenewPeriodSeconds -> tokenUpdateTransaction.setAutoRenewPeriod(
+ Duration.ofSeconds(Long.parseLong(autoRenewPeriodSeconds))));
+
+ params.getMemo().ifPresent(tokenUpdateTransaction::setTokenMemo);
+
+ params.getMetadata().ifPresent(metadata -> tokenUpdateTransaction.setTokenMetadata(metadata.getBytes()));
+
+ params.getCommonTransactionParams()
+ .ifPresent(commonTransactionParams ->
+ commonTransactionParams.fillOutTransaction(tokenUpdateTransaction, sdkService.getClient()));
+
+ TransactionReceipt transactionReceipt =
+ tokenUpdateTransaction.execute(sdkService.getClient()).getReceipt(sdkService.getClient());
+
+ return new TokenResponse("", transactionReceipt.status);
+ }
+
+ @JSONRPC2Method("deleteToken")
+ public TokenResponse deleteToken(final TokenDeleteParams params) throws Exception {
+ TokenDeleteTransaction tokenDeleteTransaction = new TokenDeleteTransaction();
+
+ params.getTokenId().ifPresent(tokenId -> tokenDeleteTransaction.setTokenId(TokenId.fromString(tokenId)));
+
+ params.getCommonTransactionParams()
+ .ifPresent(commonTransactionParams ->
+ commonTransactionParams.fillOutTransaction(tokenDeleteTransaction, sdkService.getClient()));
+
+ TransactionReceipt transactionReceipt =
+ tokenDeleteTransaction.execute(sdkService.getClient()).getReceipt(sdkService.getClient());
+
+ return new TokenResponse("", transactionReceipt.status);
+ }
}
diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenDeleteParams.java b/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenDeleteParams.java
new file mode 100644
index 000000000..b65dd5d7e
--- /dev/null
+++ b/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenDeleteParams.java
@@ -0,0 +1,52 @@
+/*-
+ *
+ * Hedera Java SDK
+ *
+ * Copyright (C) 2024 Hedera Hashgraph, LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.hedera.hashgraph.tck.methods.sdk.param;
+
+import com.hedera.hashgraph.tck.methods.JSONRPC2Param;
+import java.util.Map;
+import java.util.Optional;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import net.minidev.json.JSONObject;
+
+/**
+ * TokenDeleteParams for token delete method
+ */
+@Getter
+@AllArgsConstructor
+@NoArgsConstructor
+public class TokenDeleteParams extends JSONRPC2Param {
+ private Optional tokenId;
+ private Optional commonTransactionParams;
+
+ @Override
+ public JSONRPC2Param parse(Map jrpcParams) throws Exception {
+ var parsedTokenId = Optional.ofNullable((String) jrpcParams.get("tokenId"));
+ Optional parsedCommonTransactionParams = Optional.empty();
+ if (jrpcParams.containsKey("commonTransactionParams")) {
+ JSONObject jsonObject = (JSONObject) jrpcParams.get("commonTransactionParams");
+ parsedCommonTransactionParams = Optional.of(CommonTransactionParams.parse(jsonObject));
+ }
+
+ return new TokenDeleteParams(parsedTokenId, parsedCommonTransactionParams);
+ }
+}
diff --git a/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenUpdateParams.java b/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenUpdateParams.java
new file mode 100644
index 000000000..01902fc8e
--- /dev/null
+++ b/tck/src/main/java/com/hedera/hashgraph/tck/methods/sdk/param/TokenUpdateParams.java
@@ -0,0 +1,103 @@
+/*-
+ *
+ * Hedera Java SDK
+ *
+ * Copyright (C) 2024 Hedera Hashgraph, LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.hedera.hashgraph.tck.methods.sdk.param;
+
+import com.hedera.hashgraph.tck.methods.JSONRPC2Param;
+import java.util.Map;
+import java.util.Optional;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import net.minidev.json.JSONObject;
+
+/**
+ * TokenUpdateParams for token update method
+ */
+@Getter
+@AllArgsConstructor
+@NoArgsConstructor
+public class TokenUpdateParams extends JSONRPC2Param {
+ private Optional tokenId;
+ private Optional name;
+ private Optional symbol;
+ private Optional treasuryAccountId;
+ private Optional adminKey;
+ private Optional kycKey;
+ private Optional freezeKey;
+ private Optional wipeKey;
+ private Optional supplyKey;
+ private Optional feeScheduleKey;
+ private Optional pauseKey;
+ private Optional metadataKey;
+ private Optional expirationTime;
+ private Optional autoRenewAccountId;
+ private Optional autoRenewPeriod;
+ private Optional memo;
+ private Optional metadata;
+ private Optional commonTransactionParams;
+
+ @Override
+ public JSONRPC2Param parse(Map jrpcParams) throws Exception {
+ var parsedTokenId = Optional.ofNullable((String) jrpcParams.get("tokenId"));
+ var parsedName = Optional.ofNullable((String) jrpcParams.get("name"));
+ var parsedSymbol = Optional.ofNullable((String) jrpcParams.get("symbol"));
+ var parsedTreasuryAccountId = Optional.ofNullable((String) jrpcParams.get("treasuryAccountId"));
+ var parsedAdminKey = Optional.ofNullable((String) jrpcParams.get("adminKey"));
+ var parsedKycKey = Optional.ofNullable((String) jrpcParams.get("kycKey"));
+ var parsedFreezeKey = Optional.ofNullable((String) jrpcParams.get("freezeKey"));
+ var parsedWipeKey = Optional.ofNullable((String) jrpcParams.get("wipeKey"));
+ var parsedSupplyKey = Optional.ofNullable((String) jrpcParams.get("supplyKey"));
+ var parsedFeeScheduleKey = Optional.ofNullable((String) jrpcParams.get("feeScheduleKey"));
+ var parsedPauseKey = Optional.ofNullable((String) jrpcParams.get("pauseKey"));
+ var parsedMetadataKey = Optional.ofNullable((String) jrpcParams.get("metadataKey"));
+ var parsedExpirationTime = Optional.ofNullable((String) jrpcParams.get("expirationTime"));
+ var parsedAutoRenewAccountId = Optional.ofNullable((String) jrpcParams.get("autoRenewAccountId"));
+ var parsedAutoRenewPeriod = Optional.ofNullable((String) jrpcParams.get("autoRenewPeriod"));
+ var parsedMemo = Optional.ofNullable((String) jrpcParams.get("memo"));
+ var parsedMetadata = Optional.ofNullable((String) jrpcParams.get("metadata"));
+
+ Optional parsedCommonTransactionParams = Optional.empty();
+ if (jrpcParams.containsKey("commonTransactionParams")) {
+ JSONObject jsonObject = (JSONObject) jrpcParams.get("commonTransactionParams");
+ parsedCommonTransactionParams = Optional.of(CommonTransactionParams.parse(jsonObject));
+ }
+
+ return new TokenUpdateParams(
+ parsedTokenId,
+ parsedName,
+ parsedSymbol,
+ parsedTreasuryAccountId,
+ parsedAdminKey,
+ parsedKycKey,
+ parsedFreezeKey,
+ parsedWipeKey,
+ parsedSupplyKey,
+ parsedFeeScheduleKey,
+ parsedPauseKey,
+ parsedMetadataKey,
+ parsedExpirationTime,
+ parsedAutoRenewAccountId,
+ parsedAutoRenewPeriod,
+ parsedMemo,
+ parsedMetadata,
+ parsedCommonTransactionParams);
+ }
+}
diff --git a/version.txt b/version.txt
index 3e197472e..06a5f8e8c 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-2.44.0
+2.45.0-beta.1