Updated on 2026-08-14

This commit is contained in:
Tangem 2023-03-30 19:47:08 +05:00
parent d2baa177a4
commit 698cd7f003
6 changed files with 42 additions and 0 deletions

View file

@ -148,6 +148,17 @@
}
]
},
{
"id": "the-open-network",
"symbol": "TON",
"name": "The Open Network",
"networks":
[
{
"networkId": "the-open-network/test"
}
]
},
{
"id" : "Tangem Coin A-TCA",
"symbol" : "TCA",

View file

@ -154,6 +154,8 @@ class TapApplication : Application(), ImageLoaderFactory {
initConfigManager(configLoader, ::initWithConfigDependency)
initWarningMessagesManager()
loadNativeLibraries()
if (LogConfig.network.blockchainSdkNetwork) {
BlockchainSdkRetrofitBuilder.interceptors = listOf(
HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY },
@ -188,6 +190,10 @@ class TapApplication : Application(), ImageLoaderFactory {
)
}
private fun loadNativeLibraries() {
System.loadLibrary("TrustWalletCore")
}
private fun initConfigManager(loader: FeaturesLocalLoader, onComplete: (Config) -> Unit) {
configManager.load(loader) { config ->
store.dispatch(GlobalAction.SetConfigManager(configManager))

View file

@ -6,6 +6,7 @@ import com.tangem.blockchain.common.BlockscoutCredentials
import com.tangem.blockchain.common.GetBlockCredentials
import com.tangem.blockchain.common.NowNodeCredentials
import com.tangem.blockchain.common.QuickNodeCredentials
import com.tangem.blockchain.common.TonCenterCredentials
import com.tangem.datasource.config.ConfigManager.Companion.IS_CREATING_TWIN_CARDS_ALLOWED
import com.tangem.datasource.config.ConfigManager.Companion.IS_SENDING_TO_PAY_ID_ENABLED
import com.tangem.datasource.config.ConfigManager.Companion.IS_TOP_UP_ENABLED
@ -103,6 +104,10 @@ internal class ConfigManagerImpl @Inject constructor() : ConfigManager {
nowNodeCredentials = NowNodeCredentials(configValues.nowNodesApiKey),
getBlockCredentials = GetBlockCredentials(configValues.getBlockApiKey),
kaspaSecondaryApiUrl = configValues.kaspaSecondaryApiUrl,
tonCenterCredentials = TonCenterCredentials(
mainnetApiKey = configValues.tonCenterKeys.mainnet,
testnetApiKey = configValues.tonCenterKeys.testnet,
),
),
appsFlyerDevKey = configValues.appsFlyer.appsFlyerDevKey,
amplitudeApiKey = configValues.amplitudeApiKey,

View file

@ -1,5 +1,7 @@
package com.tangem.datasource.config.models
import com.squareup.moshi.Json
/**
[REDACTED_AUTHOR]
*/
@ -26,6 +28,7 @@ class ConfigValueModel(
val bscQuiknodeApiKey: String,
val nowNodesApiKey: String,
val getBlockApiKey: String,
@Json(name = "tonCenterApiKey") val tonCenterKeys: TonCenterKeys,
val blockcypherTokens: Set<String>?,
val infuraProjectId: String?,
val appsFlyer: AppsFlyer,

View file

@ -0,0 +1,12 @@
package com.tangem.datasource.config.models
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class TonCenterKeys(
@Json(name = "mainnet")
val mainnet: String,
@Json(name = "testnet")
val testnet: String,
)

View file

@ -50,6 +50,8 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
"dash" -> Blockchain.Dash
"sxdai" -> Blockchain.SaltPay
"kaspa" -> Blockchain.Kaspa
"the-open-network" -> Blockchain.TON
"the-open-network/test" -> Blockchain.TONTestnet
else -> null
}
}
@ -104,6 +106,8 @@ fun Blockchain.toNetworkId(): String {
Blockchain.Dash -> "dash"
Blockchain.SaltPay -> "sxdai"
Blockchain.Kaspa -> "kaspa"
Blockchain.TON -> "the-open-network"
Blockchain.TONTestnet -> "the-open-network/test"
}
}
@ -138,6 +142,7 @@ fun Blockchain.toCoinId(): String {
Blockchain.Dash -> "dash"
Blockchain.SaltPay -> "xdai"
Blockchain.Kaspa -> "kaspa"
Blockchain.TON, Blockchain.TONTestnet -> "the-open-network"
Blockchain.Unknown -> "unknown"
}
}