Updated on 2026-08-14
This commit is contained in:
commit
b76e1bbc45
219 changed files with 4585 additions and 5271 deletions
|
|
@ -93,6 +93,10 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
|
|||
"areon-network/test" -> Blockchain.AreonTestnet
|
||||
"pulsechain" -> Blockchain.PulseChain
|
||||
"pulsechain/test" -> Blockchain.PulseChainTestnet
|
||||
"nexa" -> Blockchain.Nexa // FIXME
|
||||
"nexa/testnet" -> Blockchain.NexaTestnet // FIXME
|
||||
"zksync" -> Blockchain.ZkSyncEra // FIXME
|
||||
"zksync/testnet" -> Blockchain.ZkSyncEraTestnet // FIXME
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
|
@ -187,6 +191,11 @@ fun Blockchain.toNetworkId(): String {
|
|||
Blockchain.AreonTestnet -> "areon-network/test"
|
||||
Blockchain.PulseChain -> "pulsechain"
|
||||
Blockchain.PulseChainTestnet -> "pulsechain/test"
|
||||
Blockchain.ZkSyncEra -> "zksync" // FIXME
|
||||
Blockchain.ZkSyncEraTestnet -> "zksync/testnet" // FIXME
|
||||
Blockchain.Nexa -> "nexa" // FIXME
|
||||
Blockchain.NexaTestnet -> "nexa/testnet" // FIXME
|
||||
Blockchain.Radiant -> "TODO() add" // FIXME
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -249,6 +258,11 @@ fun Blockchain.toCoinId(): String {
|
|||
Blockchain.Aurora, Blockchain.AuroraTestnet -> "aurora-ethereum"
|
||||
Blockchain.Areon, Blockchain.AreonTestnet -> "areon-network"
|
||||
Blockchain.PulseChain, Blockchain.PulseChainTestnet -> "pulsechain"
|
||||
Blockchain.ZkSyncEra -> "zksync" // FIXME
|
||||
Blockchain.ZkSyncEraTestnet -> "zksync/testnet" // FIXME
|
||||
Blockchain.Nexa -> "nexa" // FIXME
|
||||
Blockchain.NexaTestnet -> "nexa/testnet" // FIXME
|
||||
Blockchain.Radiant -> "TODO() add" // FIXME
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -276,4 +290,8 @@ private const val NODL_AMOUNT_TO_CREATE_ACCOUNT = 1.5
|
|||
private val excludedBlockchains = listOf(
|
||||
Blockchain.Unknown,
|
||||
Blockchain.Playa3ull,
|
||||
Blockchain.ZkSyncEra,
|
||||
Blockchain.ZkSyncEraTestnet,
|
||||
Blockchain.Nexa,
|
||||
Blockchain.NexaTestnet,
|
||||
)
|
||||
|
|
@ -11,6 +11,7 @@ class UserWalletBuilder(
|
|||
private val getCardImageUseCase: GetCardImageUseCase = GetCardImageUseCase(),
|
||||
) {
|
||||
private var backupCardsIds: Set<String> = emptySet()
|
||||
private var hasBackupError: Boolean = false
|
||||
|
||||
private val CardDTO.isBackupNotAllowed: Boolean
|
||||
get() = !this.settings.isBackupAllowed
|
||||
|
|
@ -41,6 +42,13 @@ class UserWalletBuilder(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if UserWallet has any backup errors (wrong curves etc). Use in onboarding
|
||||
*/
|
||||
fun hasBackupError(hasBackupError: Boolean) = this.apply {
|
||||
this.hasBackupError = hasBackupError
|
||||
}
|
||||
|
||||
suspend fun build(): UserWallet? {
|
||||
return with(scanResponse) {
|
||||
UserWalletIdBuilder.scanResponse(scanResponse)
|
||||
|
|
@ -53,6 +61,7 @@ class UserWalletBuilder(
|
|||
cardsInWallet = backupCardsIds.plus(card.cardId),
|
||||
scanResponse = this,
|
||||
isMultiCurrency = cardTypesResolver.isMultiwalletAllowed(),
|
||||
hasBackupError = hasBackupError,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.tangem.blockchain.common.address.Address
|
|||
import com.tangem.blockchain.common.address.AddressType
|
||||
import com.tangem.blockchain.common.address.EstimationFeeAddressFactory
|
||||
import com.tangem.blockchain.common.datastorage.BlockchainDataStorage
|
||||
import com.tangem.blockchain.common.logging.BlockchainSDKLogger
|
||||
import com.tangem.blockchain.common.pagination.Page
|
||||
import com.tangem.blockchain.common.transaction.Fee
|
||||
import com.tangem.blockchain.common.transaction.TransactionFee
|
||||
|
|
@ -25,6 +26,7 @@ import com.tangem.datasource.local.userwallet.UserWalletsStore
|
|||
import com.tangem.datasource.local.walletmanager.WalletManagersStore
|
||||
import com.tangem.domain.common.util.hasDerivation
|
||||
import com.tangem.domain.demo.DemoConfig
|
||||
import com.tangem.domain.feedback.FeedbackManagerFeatureToggles
|
||||
import com.tangem.domain.tokens.model.CryptoCurrency
|
||||
import com.tangem.domain.tokens.model.Network
|
||||
import com.tangem.domain.tokens.model.warnings.CryptoCurrencyWarning
|
||||
|
|
@ -53,15 +55,18 @@ class DefaultWalletManagersFacade(
|
|||
configManager: ConfigManager,
|
||||
blockchainDataStorage: BlockchainDataStorage,
|
||||
accountCreator: AccountCreator,
|
||||
blockchainSDKLogger: BlockchainSDKLogger,
|
||||
feedbackManagerFeatureToggles: FeedbackManagerFeatureToggles,
|
||||
) : WalletManagersFacade {
|
||||
|
||||
private val demoConfig by lazy { DemoConfig() }
|
||||
private val resultFactory by lazy { UpdateWalletManagerResultFactory() }
|
||||
private val walletManagerFactory by lazy {
|
||||
WalletManagerFactory(
|
||||
configManager,
|
||||
accountCreator,
|
||||
blockchainDataStorage,
|
||||
configManager = configManager,
|
||||
accountCreator = accountCreator,
|
||||
blockchainDataStorage = blockchainDataStorage,
|
||||
blockchainSDKLogger = if (feedbackManagerFeatureToggles.isLocalLogsEnabled) blockchainSDKLogger else null,
|
||||
)
|
||||
}
|
||||
private val sdkTokenConverter by lazy { SdkTokenConverter() }
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.tangem.blockchain.common.Blockchain
|
|||
import com.tangem.blockchain.common.DerivationParams
|
||||
import com.tangem.blockchain.common.WalletManager
|
||||
import com.tangem.blockchain.common.datastorage.BlockchainDataStorage
|
||||
import com.tangem.blockchain.common.logging.BlockchainSDKLogger
|
||||
import com.tangem.crypto.hdWallet.DerivationPath
|
||||
import com.tangem.datasource.config.ConfigManager
|
||||
import com.tangem.domain.common.DerivationStyleProvider
|
||||
|
|
@ -18,10 +19,16 @@ internal class WalletManagerFactory(
|
|||
configManager: ConfigManager,
|
||||
accountCreator: AccountCreator,
|
||||
blockchainDataStorage: BlockchainDataStorage,
|
||||
blockchainSDKLogger: BlockchainSDKLogger? = null,
|
||||
) {
|
||||
|
||||
private val sdkWalletManagerFactory by lazy {
|
||||
BlockchainWalletManagerFactory(configManager.config.blockchainSdkConfig, accountCreator, blockchainDataStorage)
|
||||
BlockchainWalletManagerFactory(
|
||||
config = configManager.config.blockchainSdkConfig,
|
||||
accountCreator = accountCreator,
|
||||
blockchainDataStorage = blockchainDataStorage,
|
||||
loggers = listOfNotNull(blockchainSDKLogger),
|
||||
)
|
||||
}
|
||||
|
||||
fun createWalletManager(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue