Updated on 2026-08-14

This commit is contained in:
Tangem 2018-12-29 13:47:59 +03:00
parent 0a2272b01d
commit 07aaf3db47
3 changed files with 726 additions and 4 deletions

View file

@ -3,7 +3,6 @@ package com.tangem.data.network;
import android.support.annotation.NonNull;
import android.util.Log;
import com.tangem.App;
import com.tangem.data.network.model.InsightBody;
import com.tangem.data.network.model.InsightResponse;
@ -24,6 +23,8 @@ public class ServerApiInsight {
private int requestsCount=0;
public String lastNode;
public boolean isRequestsSequenceCompleted() {
Log.i(TAG, String.format("isRequestsSequenceCompleted: %s (%d requests left)", String.valueOf(requestsCount <= 0), requestsCount));
return requestsCount <= 0;
@ -44,8 +45,9 @@ public class ServerApiInsight {
public void insight(String method, String wallet, String tx, int nbBlocks) {
requestsCount++;
String insightURL = "http://130.185.109.17:3001/insight-api"; //TODO: make random selection
this.lastNode = insightURL; //TODO: show node instead of URL
Retrofit retrofitInsight = new Retrofit.Builder() //TODO: check
Retrofit retrofitInsight = new Retrofit.Builder() //TODO: move to NetworkModule+NetworkComponent if possible
.baseUrl(insightURL)
.addConverterFactory(GsonConverterFactory.create())
.build();

View file

@ -9,8 +9,14 @@ data class InsightResponse(
@SerializedName("id")
var id: Int? = null,
@SerializedName("result")
var result: String = "",
@SerializedName("balanceSat")
var balanceSat: Long = null,
@SerializedName("unconfirmedBalanceSat")
var unconfirmedBalanceSat: Long = null,
@SerializedName("addrStr")
var addrStr: String = "",
@SerializedName("error")
var error: String = ""