From 54df6d44da3b3e14521274836187d28ad7a646ad Mon Sep 17 00:00:00 2001 From: bakyt Date: Mon, 27 Nov 2023 18:03:09 +0600 Subject: [PATCH] Add unknown type of ton transaction --- app/build.gradle | 2 +- .../bankwallet/core/adapters/TonAdapter.kt | 5 +++-- .../transactionInfo/TransactionInfoViewItemFactory.kt | 2 ++ .../modules/transactions/TransactionViewItemFactory.kt | 6 ++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8fa1bc55278..3723c771341 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -272,7 +272,7 @@ dependencies { debugImplementation leakCanary // Wallet kits - implementation 'com.github.horizontalsystems:ton-kit-kmm:cf26cc4' + implementation 'com.github.horizontalsystems:ton-kit-kmm:53225e6' implementation 'com.github.horizontalsystems:bitcoin-kit-android:16bfb76' implementation 'com.github.horizontalsystems:ethereum-kit-android:3a02f3a' implementation 'com.github.horizontalsystems:blockchain-fee-rate-kit-android:1d3bd49' diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/TonAdapter.kt b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/TonAdapter.kt index 92b08e5d43c..cd9c6b13543 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/TonAdapter.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/core/adapters/TonAdapter.kt @@ -153,7 +153,8 @@ class TonAdapter( val type = when (transaction.type) { TransactionType.Incoming.name -> TonTransactionRecord.Type.Incoming TransactionType.Outgoing.name -> TonTransactionRecord.Type.Outgoing - else -> TonTransactionRecord.Type.Incoming + TransactionType.Unknown.name -> TonTransactionRecord.Type.Unknown + else -> TonTransactionRecord.Type.Unknown } return TonTransactionRecord( @@ -246,6 +247,6 @@ class TonTransactionRecord( source, ) { enum class Type { - Incoming, Outgoing + Incoming, Outgoing, Unknown } } \ No newline at end of file diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt index f73972dd518..9710b676d3c 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt @@ -115,6 +115,8 @@ class TransactionInfoViewItemFactory( ) ) } + TonTransactionRecord.Type.Unknown -> { + } } } is EvmIncomingTransactionRecord -> diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionViewItemFactory.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionViewItemFactory.kt index c67886019c9..210a91f2b0c 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionViewItemFactory.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionViewItemFactory.kt @@ -5,6 +5,7 @@ import io.horizontalsystems.bankwallet.core.App import io.horizontalsystems.bankwallet.core.adapters.TonTransactionRecord import io.horizontalsystems.bankwallet.core.adapters.TonTransactionRecord.Type.Incoming import io.horizontalsystems.bankwallet.core.adapters.TonTransactionRecord.Type.Outgoing +import io.horizontalsystems.bankwallet.core.adapters.TonTransactionRecord.Type.Unknown import io.horizontalsystems.bankwallet.core.managers.BalanceHiddenManager import io.horizontalsystems.bankwallet.core.managers.EvmLabelManager import io.horizontalsystems.bankwallet.core.providers.Translator @@ -465,6 +466,11 @@ class TransactionViewItemFactory( } primaryValue = getColoredValue(record.mainValue, ColorName.Lucian) } + Unknown -> { + title = Translator.getString(R.string.Transactions_Unknown) + subtitle = Translator.getString(R.string.Transactions_Unknown_Description) + primaryValue = null + } } return TransactionViewItem(