From 96bbbc4a638aa6bce042b58092e59040309712ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D0=B5=D0=B3=20=D0=9B=D0=B5=D0=BE=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2?= Date: Fri, 14 Nov 2025 23:19:35 +0700 Subject: [PATCH 1/2] Update wallet SDK dependency and add JitPack repository --- settings.gradle | 1 + stellarkit/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index e59207f..23b8d54 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,6 +16,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + maven { url 'https://jitpack.io' } } } diff --git a/stellarkit/build.gradle b/stellarkit/build.gradle index 45d3765..ea0aceb 100644 --- a/stellarkit/build.gradle +++ b/stellarkit/build.gradle @@ -36,7 +36,7 @@ dependencies { implementation "androidx.room:room-ktx:$room_version" ksp "androidx.room:room-compiler:$room_version" - api 'org.stellar:wallet-sdk:2.0.0' + api 'com.github.piratecash:kotlin-wallet-sdk:169a2d4' implementation 'androidx.core:core-ktx:1.16.0' implementation 'androidx.appcompat:appcompat:1.7.0' From c2b79942db5ebe1523888f039736be9fec9e6e35 Mon Sep 17 00:00:00 2001 From: Oleg Leonov Date: Fri, 6 Mar 2026 20:48:54 +0700 Subject: [PATCH 2/2] Add signTransaction method to Signer interface and update transaction signing logic --- .../main/java/io/horizontalsystems/stellarkit/Signer.kt | 2 ++ .../java/io/horizontalsystems/stellarkit/StellarKit.kt | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/stellarkit/src/main/java/io/horizontalsystems/stellarkit/Signer.kt b/stellarkit/src/main/java/io/horizontalsystems/stellarkit/Signer.kt index 83c01aa..ea31088 100644 --- a/stellarkit/src/main/java/io/horizontalsystems/stellarkit/Signer.kt +++ b/stellarkit/src/main/java/io/horizontalsystems/stellarkit/Signer.kt @@ -1,9 +1,11 @@ package io.horizontalsystems.stellarkit +import org.stellar.sdk.Transaction import org.stellar.sdk.xdr.DecoratedSignature interface Signer { val publicKey: ByteArray fun canSign(): Boolean suspend fun sign(hash: ByteArray): DecoratedSignature + suspend fun signTransaction(transaction: Transaction): DecoratedSignature? = null } \ No newline at end of file diff --git a/stellarkit/src/main/java/io/horizontalsystems/stellarkit/StellarKit.kt b/stellarkit/src/main/java/io/horizontalsystems/stellarkit/StellarKit.kt index 43aa967..fa28a47 100644 --- a/stellarkit/src/main/java/io/horizontalsystems/stellarkit/StellarKit.kt +++ b/stellarkit/src/main/java/io/horizontalsystems/stellarkit/StellarKit.kt @@ -231,8 +231,8 @@ class StellarKit( private suspend fun sendTransaction(transaction: Transaction): TransactionResponse { if (!signer.canSign()) throw WalletError.WatchOnly - val txHash = transaction.hash() - val signature = signer.sign(txHash) + val signature = signer.signTransaction(transaction) + ?: signer.sign(transaction.hash()) transaction.addSignature(signature) return try { @@ -256,8 +256,8 @@ class StellarKit( val transaction = Transaction.fromEnvelopeXdr(transactionEnvelope, stellarNetwork) if (!signer.canSign()) throw WalletError.WatchOnly - val txHash = transaction.hash() - val signature = signer.sign(txHash) + val signature = (transaction as? Transaction)?.let { signer.signTransaction(it) } + ?: signer.sign(transaction.hash()) transaction.addSignature(signature) return transaction.toEnvelopeXdrBase64()