Updated on 2026-08-14
This commit is contained in:
parent
8ef0c9f5a6
commit
6d697e05c1
15 changed files with 217 additions and 83 deletions
|
|
@ -9,6 +9,7 @@ import com.tangem.blockchain.common.WalletManagerFactory
|
|||
import com.tangem.domain.common.CardDTO
|
||||
import com.tangem.domain.common.TapWorkarounds.derivationStyle
|
||||
import com.tangem.domain.common.extensions.fromNetworkId
|
||||
import com.tangem.domain.common.extensions.toCoinId
|
||||
import com.tangem.domain.common.extensions.toNetworkId
|
||||
import com.tangem.lib.crypto.UserWalletManager
|
||||
import com.tangem.lib.crypto.models.Currency
|
||||
|
|
@ -59,6 +60,16 @@ class UserWalletManagerImpl(
|
|||
}
|
||||
}
|
||||
|
||||
override fun getNativeTokenForNetwork(networkId: String): Currency {
|
||||
val blockchain = requireNotNull(Blockchain.fromNetworkId(networkId)) { "blockchain not found" }
|
||||
return NativeToken(
|
||||
id = blockchain.toCoinId(),
|
||||
name = blockchain.fullName,
|
||||
symbol = blockchain.currency,
|
||||
networkId = networkId,
|
||||
)
|
||||
}
|
||||
|
||||
override fun getWalletId(): String {
|
||||
return appStateHolder.getActualCard()?.let {
|
||||
UserWalletIdBuilder.card(it)
|
||||
|
|
@ -148,11 +159,6 @@ class UserWalletManagerImpl(
|
|||
)
|
||||
}
|
||||
|
||||
override fun getCurrencyByNetworkId(networkId: String): String {
|
||||
val blockchain = requireNotNull(Blockchain.fromNetworkId(networkId)) { "blockchain not found" }
|
||||
return blockchain.currency
|
||||
}
|
||||
|
||||
private fun addNativeTokenToWalletAction(token: NativeToken, card: CardDTO): Action {
|
||||
val blockchain = Blockchain.fromNetworkId(token.networkId)
|
||||
val scanResponse = appStateHolder.scanResponse
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue