Updated on 2026-08-14

This commit is contained in:
Tangem 2023-01-24 15:07:35 +03:00
parent d59797b53b
commit 385f8e3f04
5 changed files with 197 additions and 149 deletions

View file

@ -6,10 +6,12 @@ import com.tangem.common.hdWallet.DerivationPath
import com.tangem.domain.common.util.UserWalletId
import com.tangem.tap.domain.model.WalletStoreModel.WalletRent
import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.models.Currency
import java.math.BigDecimal
/**
* Contains info about the blockchain and its currencies
*
* @param userWalletId ID of the associated [UserWallet]
* @param blockchain [Blockchain] of this WalletStore
* @param derivationPath [DerivationPath] of this store, null if the card does not support the
@ -21,6 +23,9 @@ import java.math.BigDecimal
* TODO: Remove after WalletMiddleware refactoring
* @param walletManager [WalletManager], may be null if it fails to create this manager.
* TODO: Remove after WalletMiddleware refactoring
*
* @property blockchainWalletData Returns the [WalletDataModel] of the blockchain of this wallet store
* or throw [NoSuchElementException] if this wallet store not contains [WalletDataModel] of the blockchain
* */
data class WalletStoreModel(
val userWalletId: UserWalletId,
@ -34,6 +39,9 @@ data class WalletStoreModel(
val walletManager: WalletManager?,
) {
val blockchainWalletData: WalletDataModel
get() = walletsData.first { it.currency is Currency.Blockchain }
/**
* Represents wallet blockchain rent
* @param rent Amount that will be charged in overtime if the blockchain does not have an amount greater than