Updated on 2026-08-14
This commit is contained in:
parent
5dd2ef6776
commit
ef75cfed25
10 changed files with 626 additions and 208 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue