Updated on 2026-08-14

This commit is contained in:
Tangem 2022-06-14 12:03:52 +04:00
commit 93429ae1c0
42 changed files with 445 additions and 211 deletions

View file

@ -1,6 +1,7 @@
package com.tangem.tap.domain.extensions
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Blockchain.Arbitrum
import com.tangem.tap.features.wallet.models.Currency
import com.tangem.tap.network.exchangeServices.CurrencyExchangeManager
import com.tangem.tap.network.exchangeServices.CurrencyExchangeStatus
@ -19,6 +20,7 @@ fun CurrencyExchangeManager.sellIsAllowed(currency: Currency): Boolean {
fun CurrencyExchangeStatus.buyIsAllowed(currency: Currency): Boolean {
if (store.state.globalState.configManager?.config?.isTopUpEnabled == false) return false
if (currency.blockchain == Arbitrum) return false
if (!isBuyAllowed) return false
//TODO: temporary, for the 3.32 release, unlock all buy button

View file

@ -21,7 +21,7 @@ class LoadAvailableCoinsService(
if (isTestNet) {
return Result.Success(
LoadedCoins(
currencies = currenciesRepository.getTestnetCoins(),
currencies = currenciesRepository.getTestnetCoins().filter(searchInput),
moreAvailable = false,
)
)
@ -59,6 +59,15 @@ class LoadAvailableCoinsService(
)
}
private fun List<Currency>.filter(searchInput: String?): List<Currency> {
if (searchInput.isNullOrBlank()) return this
return filter{
it.symbol.contains(searchInput, ignoreCase = true) ||
it.name.contains(searchInput, ignoreCase = true)
}
}
companion object {
const val LOAD_PER_PAGE = 100
}

View file

@ -63,11 +63,17 @@ class WriteProtectedIssuerDataTask(
val counter = (readResponse.issuerDataCounter ?: 0) + 1
val data = twinPublicKey + cardSignature
val signedByIssuer = FileHashHelper.prepareHashes(
cardId, data, counter, issuerKeys.privateKey
cardId = cardId,
fileData = data,
fileCounter = counter,
fileName = null,
privateKey = issuerKeys.privateKey,
)
WriteIssuerDataCommand(
data, signedByIssuer.finalizingSignature!!,
counter, issuerKeys.publicKey
issuerData = data,
issuerDataSignature = signedByIssuer.finalizingSignature!!,
issuerDataCounter = counter,
issuerPublicKey = issuerKeys.publicKey,
).run(session, callback)
}
}