Updated on 2026-08-14
This commit is contained in:
parent
29dd1a6a2a
commit
a1877bfceb
6 changed files with 50 additions and 5 deletions
|
|
@ -28,7 +28,15 @@ public class Server {
|
|||
public static final String URL_INFURA = ServerURL.API_INFURA;
|
||||
|
||||
public static class Method {
|
||||
static final String MAIN = URL_INFURA + "v3/613a0b14833145968b1f656240c7d245";
|
||||
public static final String MAIN = "v3/613a0b14833145968b1f656240c7d245";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ApiInfuraTestnet {
|
||||
public static final String URL_INFURA_TESTNET = ServerURL.API_INFURA_TESTNET;
|
||||
|
||||
public static class Method {
|
||||
public static final String MAIN = "v3/613a0b14833145968b1f656240c7d245";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.util.Log;
|
|||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.tangem.App;
|
||||
import com.tangem.data.Blockchain;
|
||||
import com.tangem.data.network.model.InfuraBody;
|
||||
import com.tangem.data.network.model.InfuraResponse;
|
||||
|
||||
|
|
@ -34,6 +35,16 @@ public class ServerApiInfura {
|
|||
|
||||
private int requestsCount=0;
|
||||
|
||||
private InfuraApi infuraApi = App.Companion.getNetworkComponent().getRetrofitInfura().create(InfuraApi.class);
|
||||
|
||||
public ServerApiInfura() {}
|
||||
|
||||
public ServerApiInfura(Blockchain blockchain) {
|
||||
if (blockchain == Blockchain.EthereumTestNet) {
|
||||
infuraApi = App.Companion.getNetworkComponent().getRetrofitInfuraTestnet().create(InfuraApi.class);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isRequestsSequenceCompleted() {
|
||||
Log.i(TAG, String.format("isRequestsSequenceCompleted: %s (%d requests left)", String.valueOf(requestsCount <= 0), requestsCount));
|
||||
return requestsCount <= 0;
|
||||
|
|
@ -53,7 +64,7 @@ public class ServerApiInfura {
|
|||
|
||||
public void requestData(String method, int id, String wallet, String contract, String tx) {
|
||||
requestsCount++;
|
||||
InfuraApi infuraApi = App.Companion.getNetworkComponent().getRetrofitInfura().create(InfuraApi.class);
|
||||
|
||||
|
||||
InfuraBody infuraBody;
|
||||
switch (method) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ class ServerURL {
|
|||
static final String API_TANGEM = "https://verify.tangem.com/";
|
||||
static final String API_COINMARKETCAP = "https://pro-api.coinmarketcap.com/";
|
||||
static final String API_INFURA = "https://mainnet.infura.io/";
|
||||
static final String API_INFURA_TESTNET = "https://rinkeby.infura.io/";
|
||||
static final String API_SOCHAIN_V2 = "https://chain.so/";
|
||||
static final String API_ESTIMATEFEE = "https://estimatefee.com/";
|
||||
static final String API_UPDATE_VERSION = "https://raw.githubusercontent.com/";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue