Updated on 2026-08-14

This commit is contained in:
Tangem 2024-10-23 20:01:15 +03:00
commit cab30e9431
186 changed files with 3729 additions and 2030 deletions

View file

@ -39,10 +39,6 @@ internal class DefaultBlockchainSDKFactory(
private val mainScope = CoroutineScope(dispatchers.main)
private val walletManagerFactory: Flow<WalletManagerFactory?> = createWalletManagerFactory()
// TODO: [REDACTED_JIRA]
// private val walletManagerFactory: Flow<WalletManagerFactory?> by lazy(LazyThreadSafetyMode.NONE) {
// createWalletManagerFactory()
// }
override suspend fun init() {
coroutineScope {
@ -59,7 +55,7 @@ internal class DefaultBlockchainSDKFactory(
// flow3 = subscribe on feature toggles changes, TODO: [REDACTED_JIRA]
transform = walletManagerFactoryCreator::create,
)
.stateIn(scope = mainScope, started = SharingStarted.Eagerly, initialValue = null)
.stateIn(scope = mainScope, started = SharingStarted.Lazily, initialValue = null)
}
private fun CoroutineScope.updateBlockchainProviderTypes() {

View file

@ -136,6 +136,8 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"add_later_test" -> Blockchain.CasperTestnet
"core" -> Blockchain.Core
"core/test" -> Blockchain.CoreTestnet
"casper-network" -> Blockchain.Casper
"casper-network/test" -> Blockchain.CasperTestnet
else -> null
}
}
@ -269,8 +271,8 @@ fun Blockchain.toNetworkId(): String {
Blockchain.EnergyWebChainTestnet -> "energy-web-chain/test"
Blockchain.EnergyWebX -> "energy-web-x"
Blockchain.EnergyWebXTestnet -> "energy-web-x/test"
Blockchain.Casper -> "add_later"
Blockchain.CasperTestnet -> "add_later_test"
Blockchain.Casper -> "casper-network"
Blockchain.CasperTestnet -> "casper-network/test"
Blockchain.Core -> "core"
Blockchain.CoreTestnet -> "core/test"
}
@ -360,8 +362,7 @@ fun Blockchain.toCoinId(): String {
Blockchain.Sui, Blockchain.SuiTestnet -> "sui"
Blockchain.EnergyWebChain, Blockchain.EnergyWebChainTestnet -> "energy-web-token"
Blockchain.EnergyWebX, Blockchain.EnergyWebXTestnet -> "energy-web-token"
Blockchain.Casper -> "add_later"
Blockchain.CasperTestnet -> "add_later_test"
Blockchain.Casper, Blockchain.CasperTestnet -> "casper-network"
Blockchain.Core, Blockchain.CoreTestnet -> "coredaoorg"
}
}
@ -386,6 +387,7 @@ fun Blockchain.amountToCreateAccount(token: Token? = null): BigDecimal? {
Blockchain.Near, Blockchain.NearTestnet -> 0.00182.toBigDecimal()
Blockchain.Aptos, Blockchain.AptosTestnet,
Blockchain.Filecoin,
Blockchain.Casper, Blockchain.CasperTestnet,
-> BigDecimal.ZERO
else -> null
}