change url of the bitshares api server
This commit is contained in:
parent
2afd7ec47a
commit
f6340de2e4
1 changed files with 17 additions and 8 deletions
|
@ -57,8 +57,11 @@ public abstract class GrapheneApiGenerator {
|
||||||
|
|
||||||
//TODO network connections
|
//TODO network connections
|
||||||
//TODO make to work with all Graphene type, not only bitshares
|
//TODO make to work with all Graphene type, not only bitshares
|
||||||
public static String url = "http://128.0.69.157:8090";
|
//public static String url = "http://128.0.69.157:8090";
|
||||||
private static String equivalentUrl = "http://128.0.69.157:8090";
|
//private static String equivalentUrl = "http://128.0.69.157:8090";
|
||||||
|
public static String url = "wss://bitshares.openledger.info/ws";
|
||||||
|
private static String equivalentUrl = "wss://bitshares.openledger.info/ws";
|
||||||
|
|
||||||
|
|
||||||
// The message broker for bitshares
|
// The message broker for bitshares
|
||||||
private static SubscriptionMessagesHub bitsharesSubscriptionHub = new SubscriptionMessagesHub("", "", true, new NodeErrorListener() {
|
private static SubscriptionMessagesHub bitsharesSubscriptionHub = new SubscriptionMessagesHub("", "", true, new NodeErrorListener() {
|
||||||
|
@ -595,12 +598,18 @@ public abstract class GrapheneApiGenerator {
|
||||||
//TODO indirect equivalent value
|
//TODO indirect equivalent value
|
||||||
}
|
}
|
||||||
for(LimitOrder order : orders){
|
for(LimitOrder order : orders){
|
||||||
if(order.getSellPrice().base.getAsset().getBitassetId().equals(baseAsset.getBitsharesId())) {
|
try {
|
||||||
Converter converter = new Converter();
|
//if (order.getSellPrice().base.getAsset().getBitassetId().equals(baseAsset.getBitsharesId())) {
|
||||||
double equiValue = converter.getConversionRate(order.getSellPrice(), Converter.BASE_TO_QUOTE);
|
Converter converter = new Converter();
|
||||||
CryptoCurrencyEquivalence equivalence = new CryptoCurrencyEquivalence(baseAsset.getId(), quoteAsset.getId(), (int) (Math.pow(10, baseAsset.getPrecision()) * equiValue), new Date());
|
order.getSellPrice().base.getAsset().setPrecision(baseAsset.getPrecision());
|
||||||
CrystalDatabase.getAppDatabase(context).cryptoCurrencyEquivalenceDao().insertCryptoCurrencyEquivalence(equivalence);
|
order.getSellPrice().quote.getAsset().setPrecision(quoteAsset.getPrecision());
|
||||||
break;
|
double equiValue = converter.getConversionRate(order.getSellPrice(), Converter.BASE_TO_QUOTE);
|
||||||
|
CryptoCurrencyEquivalence equivalence = new CryptoCurrencyEquivalence(baseAsset.getId(), quoteAsset.getId(), (int) (Math.pow(10, baseAsset.getPrecision()) * equiValue), new Date());
|
||||||
|
CrystalDatabase.getAppDatabase(context).cryptoCurrencyEquivalenceDao().insertCryptoCurrencyEquivalence(equivalence);
|
||||||
|
break;
|
||||||
|
//}
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue