Updated on 2026-08-14

This commit is contained in:
Tangem 2023-06-27 20:20:07 +03:00
parent 982bd4130e
commit 122d654f29
5 changed files with 5 additions and 44 deletions

View file

@ -9,8 +9,8 @@ import com.tangem.datasource.utils.RequestHeader.*
import com.tangem.datasource.utils.addHeaders
import com.tangem.datasource.utils.addLazyHeaders
import com.tangem.datasource.utils.allowLogging
import com.tangem.lib.auth.AuthProvider
import com.tangem.lib.auth.BuildConfig
import com.tangem.lib.auth.LazyAuthProvider
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
@ -63,7 +63,7 @@ class NetworkModule {
@Provides
@Singleton
@PromotionOneInch
fun providePromotionOneInchApi(authProvider: LazyAuthProvider, @NetworkMoshi moshi: Moshi): PromotionApi {
fun providePromotionOneInchApi(authProvider: AuthProvider, @NetworkMoshi moshi: Moshi): PromotionApi {
val okClient = OkHttpClient.Builder()
.addLazyHeaders(
LazyRequestHeader.LazyAuthenticationHeader(authProvider),

View file

@ -1,7 +1,6 @@
package com.tangem.datasource.utils
import com.tangem.lib.auth.AuthProvider
import com.tangem.lib.auth.LazyAuthProvider
/**
* Presentation of request header
@ -25,8 +24,8 @@ sealed class LazyRequestHeader(vararg pairs: Pair<String, () -> String>) {
val values: List<Pair<String, () -> String>> = pairs.toList()
class LazyAuthenticationHeader(authProvider: LazyAuthProvider) : LazyRequestHeader(
"card_id" to authProvider.getCardIdProvider(),
"card_public_key" to authProvider.getCardPublicKeyProvider(),
class LazyAuthenticationHeader(authProvider: AuthProvider) : LazyRequestHeader(
"card_id" to { authProvider.getCardId() },
"card_public_key" to { authProvider.getCardPublicKey() },
)
}