Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-13 12:13:11 +04:00
parent 8d43a9eed3
commit 16a83cf56d
13 changed files with 13 additions and 10 deletions

View file

@ -1,78 +0,0 @@
package com.tangem.data.common.currency
import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.network.Network
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.wallet.UserWalletId
/**
* Factory for creating list of [CryptoCurrency] for selected card
*
[REDACTED_AUTHOR]
*/
interface CardCryptoCurrencyFactory {
/**
* Universal method for creating list of [CryptoCurrency] in [network] for any card
*
* @param userWalletId user wallet id that determines type of card
* @param network network
*/
@Throws
suspend fun create(userWalletId: UserWalletId, network: Network): List<CryptoCurrency> {
return create(userWalletId = userWalletId, networks = setOf(network))[network].orEmpty()
}
/**
* Universal method for creating list of [CryptoCurrency] in [networks] for any card
*
* @param userWalletId user wallet id that determines type of card
* @param networks networks
*/
@Throws
suspend fun create(userWalletId: UserWalletId, networks: Set<Network>): Map<Network, List<CryptoCurrency>>
/**
* Universal method for creating list of [CryptoCurrency] in [network] for any card
*
* @param userWalletId user wallet id that determines type of card
* @param network network
*/
@Throws
suspend fun createByRawId(userWalletId: UserWalletId, network: Network.RawID): List<CryptoCurrency>
/**
* Create currencies for multi currency card
*
* @param userWallet user wallet
* @param networks networks
*/
@Throws
suspend fun createCurrenciesForMultiCurrencyCard(
userWallet: UserWallet,
networks: Set<Network>,
): Map<Network, List<CryptoCurrency>>
/**
* Create default coins for multi currency card
*
* @param userWallet user wallet
*/
fun createDefaultCoinsForMultiCurrencyWallet(userWallet: UserWallet): List<CryptoCurrency.Coin>
/**
* Create primary currency for single currency card
*
* @param userWallet user wallet
*/
@Throws
fun createPrimaryCurrencyForSingleCurrencyCard(userWallet: UserWallet.Cold): CryptoCurrency
/**
* Create currencies for single currency card with token (like, NODL)
*
* @param userWallet user wallet
*/
@Throws
fun createCurrenciesForSingleCurrencyCardWithToken(userWallet: UserWallet.Cold): List<CryptoCurrency>
}

View file

@ -1,6 +1,7 @@
package com.tangem.data.common.currency
import com.tangem.blockchainsdk.utils.ExcludedBlockchains
import com.tangem.domain.common.tokens.CardCryptoCurrencyFactory
import com.tangem.blockchainsdk.utils.toBlockchain
import com.tangem.blockchainsdk.utils.toNetworkId
import com.tangem.data.common.account.WalletAccountsFetcher

View file

@ -5,6 +5,7 @@ import com.tangem.data.common.account.WalletAccountsFetcher
import com.tangem.data.common.cache.etag.DefaultETagsStore
import com.tangem.data.common.cache.etag.ETagsStore
import com.tangem.data.common.currency.*
import com.tangem.domain.common.tokens.CardCryptoCurrencyFactory
import com.tangem.data.common.quote.DefaultQuotesFetcher
import com.tangem.data.common.quote.QuotesFetcher
import com.tangem.data.common.wallet.DefaultWalletServerBinder