Updated on 2026-08-14
This commit is contained in:
commit
6b9fc4a3ce
1058 changed files with 48197 additions and 12718 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.data.common.currency
|
||||
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchainsdk.utils.toCoinId
|
||||
import com.tangem.blockchainsdk.utils.toNetworkId
|
||||
import com.tangem.data.common.network.NetworkFactory
|
||||
|
|
@ -54,9 +55,14 @@ class UserTokensResponseFactory @Inject constructor() {
|
|||
userWallet: UserWallet?,
|
||||
networkFactory: NetworkFactory,
|
||||
accountId: AccountId?,
|
||||
extraBlockchains: List<Blockchain> = emptyList(),
|
||||
): UserTokensResponse {
|
||||
val tokens = if (userWallet != null) {
|
||||
getDefaultWalletBlockchains(userWallet = userWallet, demoConfig = DemoConfig)
|
||||
getDefaultWalletBlockchains(
|
||||
userWallet = userWallet,
|
||||
demoConfig = DemoConfig,
|
||||
extraBlockchains = extraBlockchains,
|
||||
)
|
||||
.map { blockchain ->
|
||||
val derivationPath = networkFactory.createDerivationPath(
|
||||
blockchain = blockchain,
|
||||
|
|
|
|||
|
|
@ -375,6 +375,7 @@ class NetworkFactory @Inject constructor(
|
|||
Blockchain.Linea, Blockchain.LineaTestnet,
|
||||
Blockchain.ArbitrumNova,
|
||||
Blockchain.Plasma, Blockchain.PlasmaTestnet,
|
||||
Blockchain.Adi, Blockchain.AdiTestnet,
|
||||
Blockchain.SeiEvm, Blockchain.SeiEvmTestnet,
|
||||
Blockchain.Monad, Blockchain.MonadTestnet,
|
||||
-> Network.TransactionExtrasType.NONE
|
||||
|
|
|
|||
|
|
@ -8,10 +8,16 @@ import com.tangem.domain.models.wallet.UserWallet
|
|||
/**
|
||||
* Returns the default blockchains for the multi-currency wallet.
|
||||
*
|
||||
* @param userWallet The user's wallet, which can be either a cold or hot wallet.
|
||||
* @param demoConfig Configuration for demo cards, which may specify different default blockchains.
|
||||
* @param userWallet The user's wallet, which can be either a cold or hot wallet.
|
||||
* @param demoConfig Configuration for demo cards, which may specify different default blockchains.
|
||||
* @param extraBlockchains Additional blockchains appended on top of the standard defaults for non-demo cold wallets
|
||||
* (e.g. batch- or promo-specific entries resolved by the caller).
|
||||
*/
|
||||
fun getDefaultWalletBlockchains(userWallet: UserWallet, demoConfig: DemoConfig): Collection<Blockchain> {
|
||||
fun getDefaultWalletBlockchains(
|
||||
userWallet: UserWallet,
|
||||
demoConfig: DemoConfig,
|
||||
extraBlockchains: List<Blockchain> = emptyList(),
|
||||
): Collection<Blockchain> {
|
||||
return when (userWallet) {
|
||||
is UserWallet.Cold -> {
|
||||
val card = userWallet.scanResponse.card
|
||||
|
|
@ -19,7 +25,7 @@ fun getDefaultWalletBlockchains(userWallet: UserWallet, demoConfig: DemoConfig):
|
|||
var blockchainsInternal = if (demoConfig.isDemoCardId(card.cardId)) {
|
||||
demoConfig.getDemoBlockchains(card.cardId)
|
||||
} else {
|
||||
listOf(Blockchain.Bitcoin, Blockchain.Ethereum)
|
||||
listOf(Blockchain.Bitcoin, Blockchain.Ethereum) + extraBlockchains
|
||||
}
|
||||
|
||||
if (card.isTestCard) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue