Updated on 2026-08-14
This commit is contained in:
parent
ff22469cde
commit
68917838a4
7 changed files with 84 additions and 25 deletions
39
app/src/main/java/com/tangem/di/NetworkModule.java
Normal file
39
app/src/main/java/com/tangem/di/NetworkModule.java
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package com.tangem.di;
|
||||
|
||||
import com.tangem.data.network.Server;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
@Module
|
||||
class NetworkModule {
|
||||
|
||||
final static String PROVIDE_RETROFIT_INFURA = "provideRetrofitInfura";
|
||||
final static String PROVIDE_RETROFIT_ESTIMATEFEE = "provideRetrofitEstimatefee";
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
@Named(PROVIDE_RETROFIT_INFURA)
|
||||
Retrofit provideRetrofitInfura() {
|
||||
return new Retrofit.Builder()
|
||||
.baseUrl(Server.ApiInfura.URL_INFURA)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
@Named(PROVIDE_RETROFIT_ESTIMATEFEE)
|
||||
Retrofit provideRetrofitEstimatefee() {
|
||||
return new Retrofit.Builder()
|
||||
.baseUrl(Server.ApiEstimatefee.URL_ESTIMATEFEE)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue