Updated on 2026-08-14
This commit is contained in:
parent
61b848204f
commit
930e6ffc72
8 changed files with 20 additions and 17 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit 78be297b0f09bc2be1e9b0fbab9384f17bf94c37
|
Subproject commit 5ba0959d72f41e49a22f792e9a3d53e5e24e7713
|
||||||
|
|
@ -63,13 +63,8 @@ internal class DefaultAuthProvider(
|
||||||
return ProviderSuspend {
|
return ProviderSuspend {
|
||||||
when (apiEnvironment.invoke()) {
|
when (apiEnvironment.invoke()) {
|
||||||
ApiEnvironment.DEV,
|
ApiEnvironment.DEV,
|
||||||
ApiEnvironment.DEV_2,
|
-> environmentConfigStorage.getConfigSync().gaslessTxApiKeyDev
|
||||||
ApiEnvironment.DEV_3,
|
ApiEnvironment.PROD -> environmentConfigStorage.getConfigSync().gaslessTxApiKey
|
||||||
-> environmentConfigStorage.getConfigSync().tangemApiKeyDev // TODO add gaslessTxApiKeyDev
|
|
||||||
ApiEnvironment.STAGE,
|
|
||||||
ApiEnvironment.STAGE_2,
|
|
||||||
-> environmentConfigStorage.getConfigSync().tangemApiKeyStage // TODO add gaslessTxApiKeyStage
|
|
||||||
ApiEnvironment.PROD -> environmentConfigStorage.getConfigSync().tangemApiKey // TODO add gaslessTxApiKey
|
|
||||||
else -> error("No gasless tx api config provided for ${apiEnvironment.invoke()}")
|
else -> error("No gasless tx api config provided for ${apiEnvironment.invoke()}")
|
||||||
} ?: error("No gasless tx api config provided")
|
} ?: error("No gasless tx api config provided")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ internal class GaslessTxService(
|
||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
private const val PROD_BASE_URL = "https://api.tangem.org/"
|
private const val PROD_BASE_URL = "https://gasless.tangem.org/"
|
||||||
private const val DEV_BASE_URL = "[REDACTED_ENV_URL]"
|
private const val DEV_BASE_URL = "[REDACTED_ENV_URL]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -25,4 +25,6 @@ data class EnvironmentConfig(
|
||||||
val yieldModuleApiKey: String? = null,
|
val yieldModuleApiKey: String? = null,
|
||||||
val yieldModuleApiKeyDev: String? = null,
|
val yieldModuleApiKeyDev: String? = null,
|
||||||
val bffStaticToken: String? = null,
|
val bffStaticToken: String? = null,
|
||||||
|
val gaslessTxApiKeyDev: String? = null,
|
||||||
|
val gaslessTxApiKey: String? = null,
|
||||||
)
|
)
|
||||||
|
|
@ -33,6 +33,8 @@ internal object EnvironmentConfigConverter : Converter<EnvironmentConfigModel, E
|
||||||
yieldModuleApiKey = value.yieldModuleApiKey,
|
yieldModuleApiKey = value.yieldModuleApiKey,
|
||||||
yieldModuleApiKeyDev = value.yieldModuleApiKeyDev,
|
yieldModuleApiKeyDev = value.yieldModuleApiKeyDev,
|
||||||
bffStaticToken = value.bffStaticToken,
|
bffStaticToken = value.bffStaticToken,
|
||||||
|
gaslessTxApiKeyDev = value.gaslessTxApiKeyDev,
|
||||||
|
gaslessTxApiKey = value.gaslessTxApiKey,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -52,6 +52,8 @@ class EnvironmentConfigModel(
|
||||||
@Json(name = "blinkApiKey") val blinkApiKey: String?,
|
@Json(name = "blinkApiKey") val blinkApiKey: String?,
|
||||||
@Json(name = "tatumApiKey") val tatumApiKey: String?,
|
@Json(name = "tatumApiKey") val tatumApiKey: String?,
|
||||||
@Json(name = "bffStaticToken") val bffStaticToken: String?,
|
@Json(name = "bffStaticToken") val bffStaticToken: String?,
|
||||||
|
@Json(name = "gaslessTxApiKeyDev") val gaslessTxApiKeyDev: String?,
|
||||||
|
@Json(name = "gaslessTxApiKey") val gaslessTxApiKey: String?,
|
||||||
)
|
)
|
||||||
|
|
||||||
@JsonClass(generateAdapter = true)
|
@JsonClass(generateAdapter = true)
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ internal class ProdApiConfigsManagerTest {
|
||||||
INTERNAL_BUILD_TYPE,
|
INTERNAL_BUILD_TYPE,
|
||||||
EXTERNAL_BUILD_TYPE,
|
EXTERNAL_BUILD_TYPE,
|
||||||
RELEASE_BUILD_TYPE,
|
RELEASE_BUILD_TYPE,
|
||||||
-> ApiEnvironment.PROD to "https://tangem.com/"
|
-> ApiEnvironment.PROD to "https://gasless.tangem.org/"
|
||||||
else -> error("Unknown build type [${BuildConfig.BUILD_TYPE}]")
|
else -> error("Unknown build type [${BuildConfig.BUILD_TYPE}]")
|
||||||
}
|
}
|
||||||
return TestModel(
|
return TestModel(
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@ package com.tangem.data.transaction.di
|
||||||
|
|
||||||
import com.tangem.data.common.currency.ResponseCryptoCurrenciesFactory
|
import com.tangem.data.common.currency.ResponseCryptoCurrenciesFactory
|
||||||
import com.tangem.data.transaction.DefaultFeeRepository
|
import com.tangem.data.transaction.DefaultFeeRepository
|
||||||
|
import com.tangem.data.transaction.DefaultGaslessTransactionRepository
|
||||||
import com.tangem.data.transaction.DefaultTransactionRepository
|
import com.tangem.data.transaction.DefaultTransactionRepository
|
||||||
import com.tangem.data.transaction.DefaultWalletAddressServiceRepository
|
import com.tangem.data.transaction.DefaultWalletAddressServiceRepository
|
||||||
import com.tangem.data.transaction.MockedGaslessTransactionRepository
|
|
||||||
import com.tangem.data.transaction.error.DefaultFeeErrorResolver
|
import com.tangem.data.transaction.error.DefaultFeeErrorResolver
|
||||||
|
import com.tangem.datasource.api.gasless.GaslessTxServiceApi
|
||||||
import com.tangem.datasource.api.tangemTech.TangemTechApi
|
import com.tangem.datasource.api.tangemTech.TangemTechApi
|
||||||
import com.tangem.datasource.local.walletmanager.WalletManagersStore
|
import com.tangem.datasource.local.walletmanager.WalletManagersStore
|
||||||
import com.tangem.domain.demo.models.DemoConfig
|
import com.tangem.domain.demo.models.DemoConfig
|
||||||
|
|
@ -73,12 +74,13 @@ internal object TransactionDataModule {
|
||||||
@Singleton
|
@Singleton
|
||||||
fun provideGaslessTransactionRepository(
|
fun provideGaslessTransactionRepository(
|
||||||
responseCryptoCurrenciesFactory: ResponseCryptoCurrenciesFactory,
|
responseCryptoCurrenciesFactory: ResponseCryptoCurrenciesFactory,
|
||||||
|
gaslessTxServiceApi: GaslessTxServiceApi,
|
||||||
|
coroutineDispatcherProvider: CoroutineDispatcherProvider,
|
||||||
): GaslessTransactionRepository {
|
): GaslessTransactionRepository {
|
||||||
return MockedGaslessTransactionRepository(responseCryptoCurrenciesFactory)
|
return DefaultGaslessTransactionRepository(
|
||||||
// return DefaultGaslessTransactionRepository(
|
gaslessTxServiceApi,
|
||||||
// gaslessTxServiceApi,
|
coroutineDispatcherProvider,
|
||||||
// coroutineDispatcherProvider,
|
responseCryptoCurrenciesFactory,
|
||||||
// responseCryptoCurrenciesFactory,
|
)
|
||||||
// )
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue