From 2c1f974fc72015450173e0ff8eb6e266941d2d67 Mon Sep 17 00:00:00 2001 From: polstianka Date: Sat, 5 Oct 2024 14:13:43 -0700 Subject: [PATCH] burn --- .../main/java/com/tonapps/wallet/api/API.kt | 4 ++ .../tonapps/wallet/api/entity/ConfigEntity.kt | 7 +++- .../tonkeeper/core/history/HistoryHelper.kt | 38 +++++++++++++++++-- .../tonkeeper/ui/screen/nft/NftScreen.kt | 27 +++++++++++++ .../tonkeeper/ui/screen/nft/NftViewModel.kt | 26 +++++++++++++ .../ui/screen/token/viewer/TokenScreen.kt | 28 +++++++++++++- .../ui/screen/token/viewer/TokenViewModel.kt | 4 ++ .../src/main/res/values-bg/strings.xml | 18 +++++++++ .../src/main/res/values-es/strings.xml | 18 +++++++++ .../src/main/res/values-in/strings.xml | 18 +++++++++ .../src/main/res/values-ru/strings.xml | 12 ++++++ .../src/main/res/values-tr/strings.xml | 18 +++++++++ .../src/main/res/values-uk/strings.xml | 18 +++++++++ .../src/main/res/values-uz/strings.xml | 18 +++++++++ .../src/main/res/values-zh/strings.xml | 18 +++++++++ .../src/main/res/values/strings.xml | 1 + .../blockchain/ton/extensions/AddrStd.kt | 6 ++- .../main/res/drawable/ic_fire_badge_16.xml | 13 +++++++ 18 files changed, 284 insertions(+), 8 deletions(-) create mode 100644 ui/uikit/icon/src/main/res/drawable/ic_fire_badge_16.xml diff --git a/apps/wallet/api/src/main/java/com/tonapps/wallet/api/API.kt b/apps/wallet/api/src/main/java/com/tonapps/wallet/api/API.kt index 85343c958..6018d8577 100644 --- a/apps/wallet/api/src/main/java/com/tonapps/wallet/api/API.kt +++ b/apps/wallet/api/src/main/java/com/tonapps/wallet/api/API.kt @@ -237,6 +237,10 @@ class API( return defaultHttpClient.get(url, headers) } + fun getBurnAddress() = config.burnZeroDomain.ifBlank { + "UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ" + } + fun getEvents( accountId: String, testnet: Boolean, diff --git a/apps/wallet/api/src/main/java/com/tonapps/wallet/api/entity/ConfigEntity.kt b/apps/wallet/api/src/main/java/com/tonapps/wallet/api/entity/ConfigEntity.kt index 078b77d51..4004d6812 100644 --- a/apps/wallet/api/src/main/java/com/tonapps/wallet/api/entity/ConfigEntity.kt +++ b/apps/wallet/api/src/main/java/com/tonapps/wallet/api/entity/ConfigEntity.kt @@ -45,6 +45,7 @@ data class ConfigEntity( val tonapiSSEEndpoint: String, val tonapiSSETestnetEndpoint: String, val iapPackages: List, + val burnZeroDomain: String, ): Parcelable { val swapUri: Uri @@ -97,7 +98,8 @@ data class ConfigEntity( tonapiSSETestnetEndpoint = json.optString("tonapi_sse_testnet_endpoint", "https://rt-testnet.tonapi.io"), iapPackages = json.optJSONArray("iap_packages")?.let { array -> (0 until array.length()).map { IAPPackageEntity(array.getJSONObject(it)) } - } ?: emptyList() + } ?: emptyList(), + burnZeroDomain = json.optString("burnZeroDomain", "tonkeeper-zero.ton") ) constructor() : this( @@ -138,7 +140,8 @@ data class ConfigEntity( stakingInfoUrl = "https://ton.org/stake", tonapiSSEEndpoint = "https://rt.tonapi.io", tonapiSSETestnetEndpoint = "https://rt-testnet.tonapi.io", - iapPackages = emptyList() + iapPackages = emptyList(), + burnZeroDomain = "tonkeeper-zero.ton" ) companion object { diff --git a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/core/history/HistoryHelper.kt b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/core/history/HistoryHelper.kt index dad4a5b9e..94a7668c6 100644 --- a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/core/history/HistoryHelper.kt +++ b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/core/history/HistoryHelper.kt @@ -3,6 +3,8 @@ package com.tonapps.tonkeeper.core.history import android.content.Context import android.util.Log import androidx.collection.arrayMapOf +import com.tonapps.blockchain.ton.extensions.equalsAddress +import com.tonapps.blockchain.ton.extensions.toRawAddress import com.tonapps.icu.Coins import com.tonapps.blockchain.ton.extensions.toUserFriendly import com.tonapps.extensions.max24 @@ -35,6 +37,7 @@ import com.tonapps.tonkeeper.helper.DateHelper import com.tonapps.tonkeeper.ui.screen.dialog.encrypted.EncryptedCommentScreen import com.tonapps.tonkeeper.usecase.emulation.Emulated import com.tonapps.uikit.list.ListCell +import com.tonapps.wallet.api.API import com.tonapps.wallet.api.entity.TokenEntity import com.tonapps.wallet.data.account.AccountRepository import com.tonapps.wallet.data.account.entities.WalletEntity @@ -47,6 +50,7 @@ import com.tonapps.wallet.data.rates.RatesRepository import com.tonapps.wallet.data.rates.entity.RatesEntity import com.tonapps.wallet.data.settings.SettingsRepository import com.tonapps.wallet.localization.Localization +import io.tonapi.models.Account import io.tonapi.models.JettonVerificationType import io.tonapi.models.MessageConsequences import kotlinx.coroutines.flow.Flow @@ -75,6 +79,7 @@ class HistoryHelper( private val settingsRepository: SettingsRepository, private val eventsRepository: EventsRepository, private val passcodeManager: PasscodeManager, + private val api: API, ) { private val currency: WalletCurrency @@ -119,6 +124,14 @@ class HistoryHelper( } } + private fun isBurnAccount(account: AccountAddress): Boolean { + val burnAddress = api.getBurnAddress() + if (burnAddress.equalsAddress(account.address) || (account.name != null && burnAddress == account.name)) { + return true + } + return "UQCNzZIsoe75gjl8KIwUJW1Fawt-7IbsFwd0ubGIFkig159E".equalsAddress(account.address) + } + private fun sort(list: List): List { return list .filterIsInstance() @@ -471,13 +484,21 @@ class HistoryHelper( val symbol = jettonTransfer.jetton.symbol val isOut = !wallet.isMyAddress(jettonTransfer.recipient?.address ?: "") + val isBurn = jettonTransfer.recipient?.let { + isBurnAccount(it) + } ?: false + val amount = Coins.ofNano(jettonTransfer.amount, jettonTransfer.jetton.decimals) var value = CurrencyFormatter.format(symbol, amount, 2) val itemAction: ActionType val accountAddress: AccountAddress? - if (isOut) { + if (isBurn) { + itemAction = ActionType.JettonBurn + accountAddress = jettonTransfer.recipient + value = value.withMinus + } else if (isOut) { itemAction = ActionType.Send accountAddress = jettonTransfer.recipient value = value.withMinus @@ -502,7 +523,11 @@ class HistoryHelper( iconURL = accountAddress?.iconURL ?: "", action = itemAction, title = simplePreview.name, - subtitle = accountAddress?.getNameOrAddress(wallet.testnet, true) ?: "", + subtitle = if (!isBurn) { + accountAddress?.getNameOrAddress(wallet.testnet, true) ?: "" + } else { + api.getBurnAddress() + }, comment = comment, value = value, tokenCode = "", @@ -602,12 +627,19 @@ class HistoryHelper( val isOut = !wallet.isMyAddress(nftItemTransfer.recipient?.address ?: "-") val sender = nftItemTransfer.sender ?: action.simplePreview.accounts.firstOrNull() + val isBurn = nftItemTransfer.recipient?.let { + isBurnAccount(it) + } ?: false val itemAction: ActionType val iconURL: String? val subtitle: String - if (isOut) { + if (isBurn) { + itemAction = ActionType.JettonBurn + iconURL = nftItemTransfer.recipient?.iconURL + subtitle = api.getBurnAddress() + } else if (isOut) { itemAction = ActionType.NftSend iconURL = nftItemTransfer.recipient?.iconURL subtitle = sender?.getNameOrAddress(wallet.testnet, true) ?: "" diff --git a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftScreen.kt b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftScreen.kt index 2f5945535..bbcf1b1ca 100644 --- a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftScreen.kt +++ b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftScreen.kt @@ -9,9 +9,13 @@ import android.widget.Button import androidx.appcompat.widget.AppCompatTextView import androidx.core.net.toUri import androidx.core.widget.NestedScrollView +import androidx.lifecycle.lifecycleScope +import com.tonapps.blockchain.ton.extensions.toWalletAddress import com.tonapps.extensions.getParcelableCompat import com.tonapps.extensions.short4 import com.tonapps.tonkeeper.extensions.copyWithToast +import com.tonapps.tonkeeper.extensions.showToast +import com.tonapps.tonkeeper.extensions.toastLoading import com.tonapps.tonkeeper.koin.remoteConfig import com.tonapps.tonkeeper.koin.walletViewModel import com.tonapps.tonkeeper.popup.ActionSheet @@ -29,6 +33,11 @@ import com.tonapps.wallet.data.account.entities.WalletEntity import com.tonapps.wallet.data.collectibles.entities.NftEntity import com.tonapps.wallet.data.core.Trust import com.tonapps.wallet.localization.Localization +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.catch +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach +import kotlinx.coroutines.launch import org.koin.core.parameter.parametersOf import uikit.base.BaseFragment import uikit.dialog.alert.AlertDialog @@ -190,6 +199,15 @@ class NftScreen(wallet: WalletEntity): WalletContextScreen(R.layout.fragment_nft } } + private fun burn() { + navigation?.add(SendScreen.newInstance( + wallet = wallet, + targetAddress = viewModel.burnAddress, + nftAddress = nftEntity.address + )) + finish() + } + private fun mustOpenButtonDApp(url: String) { navigation?.add(DAppScreen.newInstance(wallet, url = url.toUri())) finish() @@ -215,11 +233,15 @@ class NftScreen(wallet: WalletEntity): WalletContextScreen(R.layout.fragment_nft actionSheet.addItem(HIDE_NFT_ID, Localization.hide_collection, UIKitIcon.ic_eye_disable_16) actionSheet.addItem(HIDE_AND_REPORT_ID, Localization.hide_and_report_collection, UIKitIcon.ic_block_16) actionSheet.addItem(VIEWER_ID, Localization.open_tonviewer, UIKitIcon.ic_globe_16) + if (!nftEntity.inSale && !nftEntity.isTrusted) { + actionSheet.addItem(BURN_ID, Localization.burn, UIKitIcon.ic_fire_badge_16) + } actionSheet.doOnItemClick = { item -> when (item.id) { HIDE_NFT_ID -> hideCollection() HIDE_AND_REPORT_ID -> reportSpam(true) VIEWER_ID -> openTonViewer() + BURN_ID -> burn() } } actionSheet.show(view) @@ -229,10 +251,14 @@ class NftScreen(wallet: WalletEntity): WalletContextScreen(R.layout.fragment_nft val actionSheet = ActionSheet(requireContext()) actionSheet.addItem(HIDE_NFT_ID, Localization.hide_collection, UIKitIcon.ic_eye_disable_16) actionSheet.addItem(VIEWER_ID, Localization.open_tonviewer, UIKitIcon.ic_globe_16) + if (!nftEntity.inSale && !nftEntity.isTrusted) { + actionSheet.addItem(BURN_ID, Localization.burn, UIKitIcon.ic_fire_badge_16) + } actionSheet.doOnItemClick = { item -> when (item.id) { HIDE_NFT_ID -> hideCollection() VIEWER_ID -> openTonViewer() + BURN_ID -> burn() } } actionSheet.show(view) @@ -306,6 +332,7 @@ class NftScreen(wallet: WalletEntity): WalletContextScreen(R.layout.fragment_nft private const val HIDE_NFT_ID = 1L private const val HIDE_AND_REPORT_ID = 2L private const val VIEWER_ID = 3L + private const val BURN_ID = 4L private const val ARG_ENTITY = "entity" diff --git a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftViewModel.kt b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftViewModel.kt index fde5319d2..57b118fc2 100644 --- a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftViewModel.kt +++ b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/nft/NftViewModel.kt @@ -1,20 +1,42 @@ package com.tonapps.tonkeeper.ui.screen.nft import android.app.Application +import android.content.Context import androidx.lifecycle.viewModelScope +import com.tonapps.blockchain.ton.TonNetwork +import com.tonapps.blockchain.ton.TonTransferHelper +import com.tonapps.blockchain.ton.extensions.EmptyPrivateKeyEd25519 +import com.tonapps.blockchain.ton.extensions.base64 +import com.tonapps.blockchain.ton.extensions.toAccountId +import com.tonapps.icu.Coins +import com.tonapps.tonkeeper.core.entities.SendMetadataEntity +import com.tonapps.tonkeeper.core.entities.TransferEntity +import com.tonapps.tonkeeper.extensions.toGrams import com.tonapps.tonkeeper.ui.base.BaseWalletVM +import com.tonapps.tonkeeper.ui.screen.send.main.helper.SendNftHelper +import com.tonapps.tonkeeper.ui.screen.send.transaction.SendTransactionScreen import com.tonapps.wallet.api.API +import com.tonapps.wallet.api.entity.TokenEntity import com.tonapps.wallet.data.account.AccountRepository import com.tonapps.wallet.data.account.entities.WalletEntity import com.tonapps.wallet.data.collectibles.entities.NftEntity +import com.tonapps.wallet.data.core.entity.RawMessageEntity +import com.tonapps.wallet.data.core.entity.SignRequestEntity import com.tonapps.wallet.data.settings.SettingsRepository import com.tonapps.wallet.data.settings.entities.TokenPrefsEntity +import com.tonapps.wallet.data.token.TokenRepository +import com.tonapps.wallet.data.token.entities.AccountTokenEntity +import io.tonapi.models.Account import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.async +import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.take import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import org.ton.block.AddrStd +import java.math.BigInteger class NftViewModel( app: Application, @@ -24,6 +46,10 @@ class NftViewModel( private val api: API, ): BaseWalletVM(app) { + val burnAddress: String by lazy { + api.getBurnAddress() + } + fun reportSpam(spam: Boolean, callback: () -> Unit) { viewModelScope.launch(Dispatchers.IO) { val state = if (spam) TokenPrefsEntity.State.SPAM else TokenPrefsEntity.State.TRUST diff --git a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/token/viewer/TokenScreen.kt b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/token/viewer/TokenScreen.kt index 1b4d61ea5..8f5904d77 100644 --- a/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/token/viewer/TokenScreen.kt +++ b/apps/wallet/instance/app/src/main/java/com/tonapps/tonkeeper/ui/screen/token/viewer/TokenScreen.kt @@ -14,6 +14,7 @@ import com.tonapps.tonkeeper.koin.walletViewModel import com.tonapps.tonkeeper.popup.ActionSheet import com.tonapps.tonkeeper.ui.base.BaseListWalletScreen import com.tonapps.tonkeeper.ui.base.ScreenContext +import com.tonapps.tonkeeper.ui.screen.send.main.SendScreen import com.tonapps.tonkeeper.ui.screen.token.unverified.TokenUnverifiedScreen import com.tonapps.tonkeeper.ui.screen.token.viewer.list.TokenAdapter import com.tonapps.tonkeeperx.R @@ -115,12 +116,35 @@ class TokenScreen(wallet: WalletEntity): BaseListWalletScreen(null) val tokenFlow = _tokenFlow.asStateFlow().filterNotNull() diff --git a/apps/wallet/localization/src/main/res/values-bg/strings.xml b/apps/wallet/localization/src/main/res/values-bg/strings.xml index 15ce370ba..90277deda 100644 --- a/apps/wallet/localization/src/main/res/values-bg/strings.xml +++ b/apps/wallet/localization/src/main/res/values-bg/strings.xml @@ -64,10 +64,23 @@ Всички активи Сортирано по цена Спам + Изгори + Вземете теглене + Сума за теглене + %1$s не е заложен след края на цикъла + Изтекла връзка + Методът на плащане не е наличен + Приложението не е намерено + Недостатъчно средства в портфейла + Изисква се за такси за блокчейн: %1$s.\\nВашето салдо: %2$s. + За плащане: %1$s.\\nВашето салдо: %2$s. MAX APY Минимален депозит %1$s. Опции Докоснете, за да платите в %1$s + Едно таксуване покрива средната такса за транзакция. Някои транзакции може да струват повече. + Възстановяване на покупките + Заредена батерия APY Минимален депозит Стейкингът е базиран на умни договори от трети страни. Tonkeeper не носи отговорност за изживяването по време на стейкинг. @@ -141,6 +154,9 @@ Портфейлът е инициализиран Залог Тема + Голям + Среден + Малък Вашият баланс е %1$s и е защитен само от фраза за възстановяване, която още не сте записали. Архивирайте фразата, за да избегнете загуба на средства в случай на проблеми с устройството. Testnet Искане за изтегляне на стейк @@ -390,6 +406,7 @@ Относно Signer Отворете Signer на това устройство По-късно + Купете TON Signer Изберете портфейл Изберете портфейли, които искате да добавите. @@ -479,4 +496,5 @@ ≈ %1$s трансфера на токен или + Презареждане на батерията diff --git a/apps/wallet/localization/src/main/res/values-es/strings.xml b/apps/wallet/localization/src/main/res/values-es/strings.xml index f13548352..133664246 100644 --- a/apps/wallet/localization/src/main/res/values-es/strings.xml +++ b/apps/wallet/localization/src/main/res/values-es/strings.xml @@ -419,6 +419,9 @@ Código promocional Reembolso Toque para pagar en %1$s + Grande + Medio + Pequeño Tu saldo es %1$s y solo está protegido por una frase de recuperación que aún no has escrito. Haz una copia de seguridad de la frase para evitar perder fondos en caso de problemas con el dispositivo. @@ -434,4 +437,19 @@ ≈ %1$s transferencias de tokens o + Un cargo cubre la tarifa de transacción promedio. Algunas transacciones pueden costar más. + Restaurar compras + Batería recargada + Quemar + Obtener retiro + Monto del retiro + %1$s no se han apostado después del final del ciclo + Enlace caducado + Método de pago no disponible + Aplicación no encontrada + Fondos insuficientes en la billetera + Requerido para las tarifas de blockchain: %1$s.\\nSu saldo: %2$s. + A pagar: %1$s.\\nSu saldo: %2$s. + Comprar TON + Recargar la batería \ No newline at end of file diff --git a/apps/wallet/localization/src/main/res/values-in/strings.xml b/apps/wallet/localization/src/main/res/values-in/strings.xml index 93b3de634..556cf1540 100644 --- a/apps/wallet/localization/src/main/res/values-in/strings.xml +++ b/apps/wallet/localization/src/main/res/values-in/strings.xml @@ -417,6 +417,9 @@ Kode Promo Pengembalian Ketuk untuk membayar dalam %1$s + Besar + Sedang + Kecil Saldo Anda adalah %1$s, dan saldo tersebut hanya dilindungi oleh frasa pemulihan yang belum Anda tulis. Cadangkan frasa tersebut untuk menghindari kehilangan dana jika terjadi masalah pada perangkat. @@ -429,4 +432,19 @@ ≈ %1$s transfer token atau + Satu biaya mencakup biaya transaksi rata-rata. Beberapa transaksi mungkin lebih mahal. + Pulihkan Pembelian + Baterai diisi ulang + Membakar + Dapatkan penarikan + Jumlah penarikan + %1$s tidak dipertaruhkan setelah akhir siklus + Tautan kedaluwarsa + Metode pembayaran tidak tersedia + Aplikasi tidak ditemukan + Dana tidak mencukupi di dompet + Diperlukan untuk biaya blockchain: %1$s.\\nSaldo Anda: %2$s. + Yang akan dibayar: %1$s.\\nSaldo Anda: %2$s. + Beli TON + Isi Ulang Baterai \ No newline at end of file diff --git a/apps/wallet/localization/src/main/res/values-ru/strings.xml b/apps/wallet/localization/src/main/res/values-ru/strings.xml index 40b0cf307..95bc7d0a4 100644 --- a/apps/wallet/localization/src/main/res/values-ru/strings.xml +++ b/apps/wallet/localization/src/main/res/values-ru/strings.xml @@ -519,4 +519,16 @@ Один заряд покрывает среднюю комиссию за транзакцию. Некоторые транзакции могут стоить дороже. Восстановить покупки Батарейка заряжена + Сжечь + Получить вывод + Сумма вывода + %1$s не будет поставлен после окончания цикла + Ссылка просрочена + Способ оплаты недоступен + Приложение не найдено + Недостаточно средств в кошельке + Требуется для оплаты комиссии блокчейна: %1$s.\\nВаш баланс: %2$s. + К оплате: %1$s.\\nВаш баланс: %2$s. + Купить TON + Перезарядка батарейки \ No newline at end of file diff --git a/apps/wallet/localization/src/main/res/values-tr/strings.xml b/apps/wallet/localization/src/main/res/values-tr/strings.xml index d4bd4a28d..9e5482233 100644 --- a/apps/wallet/localization/src/main/res/values-tr/strings.xml +++ b/apps/wallet/localization/src/main/res/values-tr/strings.xml @@ -419,6 +419,9 @@ Promosyon Kodu Geri ödemek %1$s ile ödeme yapmak için dokunun + Büyük + Orta + Küçük Bakiyeniz %1$s ve henüz yazmadığınız bir kurtarma ifadesiyle korunuyor. Cihaz sorunları durumunda para kaybetmemek için ifadeyi yedekleyin. @@ -434,4 +437,19 @@ ≈ %1$s token transferi veya + Bir ücret ortalama işlem ücretini kapsar. Bazı işlemler daha pahalı olabilir. + Satın Alımları Geri Yükle + Pil yeniden dolduruldu + Yakmak + Para çekme işlemini gerçekleştirin + Çekilecek miktar + Döngünün sonunda %1$s stake edilmedi + Süresi dolmuş bağlantı + Ödeme yöntemi mevcut değil + Uygulama bulunamadı + Cüzdanda yetersiz bakiye + Blockchain ücretleri için gerekli: %1$s.\\nBakiyeniz: %2$s. + Ödenecek tutar: %1$s.\\nBakiyeniz: %2$s. + TON satın al + Aküyü şarj edin \ No newline at end of file diff --git a/apps/wallet/localization/src/main/res/values-uk/strings.xml b/apps/wallet/localization/src/main/res/values-uk/strings.xml index 802d0f795..3ec7acc75 100644 --- a/apps/wallet/localization/src/main/res/values-uk/strings.xml +++ b/apps/wallet/localization/src/main/res/values-uk/strings.xml @@ -423,6 +423,9 @@ Промокод Повернення Торкніться, щоб оплатити %1$s + Великий + Середній + Маленький Ваш баланс становить %1$s, і він захищений лише фразою відновлення, яку ви ще не записали. Створіть резервну копію фрази, щоб уникнути втрати коштів у разі проблем із пристроєм. @@ -444,4 +447,19 @@ ≈ %1$s переказів токена або + Одне стягнення покриває середню комісію за транзакцію. Деякі транзакції можуть коштувати дорожче. + Відновити покупки + Батарея заправлена + Спалити + Отримати зняття + Сума зняття + %1$s знято зі ставок після завершення циклу + Термін дії посилання закінчився + Спосіб оплати недоступний + Додаток не знайдено + Недостатньо коштів у гаманці + Необхідно для комісій за блокчейн: %1$s.\\nВаш баланс: %2$s. + До оплати: %1$s.\\nВаш баланс: %2$s. + Купити TON + Перезарядіть батарею \ No newline at end of file diff --git a/apps/wallet/localization/src/main/res/values-uz/strings.xml b/apps/wallet/localization/src/main/res/values-uz/strings.xml index a14aaa0d0..bb9047634 100644 --- a/apps/wallet/localization/src/main/res/values-uz/strings.xml +++ b/apps/wallet/localization/src/main/res/values-uz/strings.xml @@ -419,6 +419,9 @@ Kupon kodi To\'lovni qaytarish %1$s orqali toʻlash uchun bosing + Katta + O\'rta + Kichik Balansingiz %1$s va u faqat siz hali yozmagan tiklash iborasi bilan himoyalangan. Qurilma bilan bog\'liq muammolarda mablag\'ni yo\'qotmaslik uchun iborani zaxiralang. @@ -434,4 +437,19 @@ ≈ %1$s ta token uzatish yoki + Bitta toʻlov oʻrtacha tranzaksiya toʻlovini qoplaydi. Ayrim tranzaksiyalar koʻproq xarajat boʻlishi mumkin. + Xaridlarni tiklash + Batareya qayta to\'ldirilgan + Kuyish + Chiqib oling + Olib tashlash miqdori + Tsikl tugaganidan keyin %1$s hisobdan chiqarildi + Muddati tugagan havola + Toʻlov usuli mavjud emas + Ilova topilmadi + Hamyonda mablag\' yetarli emas + Blokcheyn to‘lovlari uchun talab qilinadi: %1$s.\\nBalansingiz: %2$s. + Toʻlanishi kerak: %1$s.\\nBalansingiz: %2$s. + TON sotib oling + Batareyani qayta zaryadlash \ No newline at end of file diff --git a/apps/wallet/localization/src/main/res/values-zh/strings.xml b/apps/wallet/localization/src/main/res/values-zh/strings.xml index 4b36167a1..84c14e07f 100644 --- a/apps/wallet/localization/src/main/res/values-zh/strings.xml +++ b/apps/wallet/localization/src/main/res/values-zh/strings.xml @@ -417,6 +417,9 @@ 促销代码 退款 %1$s 后即可轻触付款 + 大的 + 中等的 + 小的 您的余额为 %1$s,并且仅受您尚未记下的恢复短语保护。请备份该短语,以免在设备出现问题时丢失资金。 @@ -429,4 +432,19 @@ ≈ %1$s 代币转移 + 一次收费即可涵盖平均交易费用。某些交易可能收费更高。 + 恢复购买 + 电池已充满 + 烧伤 + 获取提款 + 提款金额 + 周期结束后,%1$s 被取消质押 + 链接已过期 + 付款方式不可用 + 未找到应用程序 + 钱包资金不足 + 区块链费用所需:%1$s。\\n您的余额:%2$s。 + 待付款:%1$s。\\n您的余额:%2$s。 + 购买 TON + 给电池充电 \ No newline at end of file diff --git a/apps/wallet/localization/src/main/res/values/strings.xml b/apps/wallet/localization/src/main/res/values/strings.xml index ec6c94ab7..42f150e05 100644 --- a/apps/wallet/localization/src/main/res/values/strings.xml +++ b/apps/wallet/localization/src/main/res/values/strings.xml @@ -15,6 +15,7 @@ %1$s ready. Tap co collect. %1$s will be deposited in %2$s %1$s will be
withdrawn in %2$s + Burn Get withdraw Withdrawal amount %1$s unstaked after the end of the cycle diff --git a/lib/blockchain/src/main/java/com/tonapps/blockchain/ton/extensions/AddrStd.kt b/lib/blockchain/src/main/java/com/tonapps/blockchain/ton/extensions/AddrStd.kt index 6467a8d2f..ef2bc473b 100644 --- a/lib/blockchain/src/main/java/com/tonapps/blockchain/ton/extensions/AddrStd.kt +++ b/lib/blockchain/src/main/java/com/tonapps/blockchain/ton/extensions/AddrStd.kt @@ -51,5 +51,9 @@ fun String.isValidTonAddress(): Boolean { } fun String.equalsAddress(other: String): Boolean { - return toRawAddress().equals(other.toRawAddress(), ignoreCase = true) + return try { + toRawAddress().equals(other.toRawAddress(), ignoreCase = true) + } catch (e: Throwable) { + false + } } \ No newline at end of file diff --git a/ui/uikit/icon/src/main/res/drawable/ic_fire_badge_16.xml b/ui/uikit/icon/src/main/res/drawable/ic_fire_badge_16.xml new file mode 100644 index 000000000..479e4a4cb --- /dev/null +++ b/ui/uikit/icon/src/main/res/drawable/ic_fire_badge_16.xml @@ -0,0 +1,13 @@ + + + + + +