public OrderBook GetOrderBook(Asset amountAsset, Asset priceAsset) { string path = $"{_host}/matcher/orderbook/{amountAsset.Id}/{priceAsset.Id}"; var json = Http.GetObject(path); return(OrderBook.CreateFromJson(json, amountAsset, priceAsset)); }
public long GetLastPrice(Asset amountAsset, Asset priceAsset) { var path = $"{_host}/matcher/orderbook/{amountAsset.Id}/{priceAsset.Id}/status"; var json = Http.GetObject(path); return((long)json["lastPrice"]); }
public Dictionary <Asset, decimal> GetTradableBalance(string address, Asset amountAsset, Asset priceAsset) { var url = $"{_host}/matcher/orderbook/{amountAsset.Id}/{priceAsset.Id}/tradableBalance/{address}"; var response = Http.GetObject(url); return(new Dictionary <Asset, decimal> { { amountAsset, amountAsset.LongToAmount(response.GetLong(amountAsset.Id)) }, { priceAsset, priceAsset.LongToAmount(response.GetLong(priceAsset.Id)) }, }); }
public DictionaryObject GetObject(string url, params object[] args) { return(Http.GetObject($"{_host}/{url}", args)); }
public long TransactionsCount(long height) { return(Http.GetObject($"{_host}/blocks/headers/at/{height}").GetInt("transactionCount")); }
public long GetBlockTotalFee(long height) { var t = Http.GetObject($"{_host}/blocks/headers/at/{height}"); return(t.GetLong("totalFee")); }
public long GetBlockTimestamp(long height) { return(Http.GetObject($"{_host}/blocks/headers/at/{height}").GetLong("timestamp")); }