Updated on 2026-08-14

This commit is contained in:
Tangem 2019-07-08 12:26:22 +03:00
commit ed97044507
11 changed files with 915 additions and 331 deletions

View file

@ -35,6 +35,9 @@ interface NetworkComponent {
@get:Named(Server.ApiBlockcypher.URL_BLOCKCYPHER)
val retrofitBlockcypher: Retrofit
@get:Named(Server.ApiSoChain.URL)
val retrofitSoChain: Retrofit
@get:Named("socket")
val socket: Socket

View file

@ -109,6 +109,18 @@ internal class NetworkModule {
return builder.build()
}
@Singleton
@Provides
@Named(Server.ApiSoChain.URL)
fun provideRetrofitSoChain(): Retrofit {
val builder = Retrofit.Builder()
.baseUrl(Server.ApiSoChain.URL)
.addConverterFactory(GsonConverterFactory.create())
if (BuildConfig.DEBUG)
builder.client(createOkHttpClient())
return builder.build()
}
private fun createOkHttpClient(): OkHttpClient {
return OkHttpClient.Builder().addInterceptor(createHttpLoggingInterceptor()).build()
}