Updated on 2026-08-14

This commit is contained in:
Tangem 2019-04-17 18:04:03 +03:00
parent 5dd2ef6776
commit ef75cfed25
10 changed files with 626 additions and 208 deletions

View file

@ -29,6 +29,9 @@ interface NetworkComponent {
@get:Named(Server.ApiRootstock.URL_ROOTSTOCK)
val retrofitRootstock: Retrofit
@get:Named(Server.ApiBlockcypher.URL_BLOCKCYPHER)
val retrofitBlockcypher: Retrofit
@get:Named("socket")
val socket: Socket

View file

@ -84,6 +84,19 @@ internal class NetworkModule {
return builder.build()
}
@Singleton
@Provides
@Named(Server.ApiBlockcypher.URL_BLOCKCYPHER)
fun provideRetrofitBlockcypher(): Retrofit {
val builder = Retrofit.Builder()
.baseUrl(Server.ApiBlockcypher.URL_BLOCKCYPHER)
.addConverterFactory(GsonConverterFactory.create())
.client(createOkHttpClient())
if (BuildConfig.DEBUG)
builder.client(createOkHttpClient())
return builder.build()
}
private fun createOkHttpClient(): OkHttpClient {
return OkHttpClient.Builder().addInterceptor(createHttpLoggingInterceptor()).build()
}