Updated on 2026-08-14
This commit is contained in:
parent
ff985dec4e
commit
cd78832ff1
30 changed files with 89 additions and 23 deletions
|
|
@ -11,7 +11,7 @@ import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
|||
import com.tangem.domain.common.util.hasDerivation
|
||||
import com.tangem.domain.demo.DemoConfig
|
||||
import com.tangem.domain.tokens.model.CryptoCurrency
|
||||
import com.tangem.domain.tokens.model.Network
|
||||
import com.tangem.domain.tokens.models.Network
|
||||
import com.tangem.domain.walletmanager.model.UpdateWalletManagerResult
|
||||
import com.tangem.domain.walletmanager.utils.SdkTokenConverter
|
||||
import com.tangem.domain.walletmanager.utils.UpdateWalletManagerResultFactory
|
||||
|
|
@ -46,6 +46,23 @@ class DefaultWalletManagersFacade(
|
|||
return getAndUpdateWalletManager(userWallet, blockchain, extraTokens)
|
||||
}
|
||||
|
||||
override suspend fun getExploreUrl(userWalletId: UserWalletId, networkId: Network.ID): String {
|
||||
val userWallet = requireNotNull(userWalletsStore.getSyncOrNull(userWalletId)) {
|
||||
"Unable to find a user wallet with provided ID: $userWalletId"
|
||||
}
|
||||
|
||||
val blockchain = Blockchain.fromId(networkId.value)
|
||||
|
||||
return getOrCreateWalletManager(
|
||||
userWallet = userWallet,
|
||||
blockchain = blockchain,
|
||||
derivationPath = blockchain.derivationPath(userWallet.scanResponse.card.derivationStyle),
|
||||
)
|
||||
?.wallet
|
||||
?.getExploreUrl()
|
||||
.orEmpty()
|
||||
}
|
||||
|
||||
private suspend fun getAndUpdateWalletManager(
|
||||
userWallet: UserWallet,
|
||||
blockchain: Blockchain,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.tangem.domain.walletmanager
|
||||
|
||||
import com.tangem.domain.tokens.model.CryptoCurrency
|
||||
import com.tangem.domain.tokens.model.Network
|
||||
import com.tangem.domain.tokens.models.Network
|
||||
import com.tangem.domain.walletmanager.model.UpdateWalletManagerResult
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
|
||||
|
|
@ -24,4 +24,6 @@ interface WalletManagersFacade {
|
|||
networkId: Network.ID,
|
||||
extraTokens: Set<CryptoCurrency.Token>,
|
||||
): UpdateWalletManagerResult
|
||||
|
||||
suspend fun getExploreUrl(userWalletId: UserWalletId, networkId: Network.ID): String
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue