From 4af9f71723fffd20560aeba4b0609eb656723244 Mon Sep 17 00:00:00 2001 From: Evgeniy Lebedev Date: Fri, 10 Mar 2023 00:23:18 +0400 Subject: [PATCH] issue-81 Fixed issue with transfer from not initialized account --- .../kotlin/org/ton/contract/wallet/WalletV4R2Contract.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ton-kotlin-contract/src/commonMain/kotlin/org/ton/contract/wallet/WalletV4R2Contract.kt b/ton-kotlin-contract/src/commonMain/kotlin/org/ton/contract/wallet/WalletV4R2Contract.kt index ff8dd021..d4d02261 100644 --- a/ton-kotlin-contract/src/commonMain/kotlin/org/ton/contract/wallet/WalletV4R2Contract.kt +++ b/ton-kotlin-contract/src/commonMain/kotlin/org/ton/contract/wallet/WalletV4R2Contract.kt @@ -70,8 +70,8 @@ public class WalletV4R2Contract private constructor( validUntil: Instant, vararg transfers: WalletTransfer ): Unit = coroutineScope { - val seqno = getSeqno() - val walletId = getSubWalletId() + val seqno = if (state !is AccountActive) 0 else getSeqno() + val walletId = if (state !is AccountActive) DEFAULT_WALLET_ID else getSubWalletId() val message = createTransferMessage( address = address, stateInit = if (state !is AccountActive) createStateInit(privateKey.publicKey(), walletId) else null,