public static AccountInfo Parse(JObject jsonObj) { DateTime systemTime = CoinsEParsers.ParseTime(jsonObj.Value <int>("systime")); List <Wallet> wallets = jsonObj.Value <JObject>("wallets").Properties().Select( wallet => (Wallet)CoinsEWallet.Parse(wallet.Name, wallet.First.Value <JObject>()) ).ToList(); return(new CoinsEAccountInfo(wallets, systemTime)); }
public static CoinsEMarketTrade Parse(JObject jObject) { CoinsETradeId tradeId = new CoinsETradeId(jObject.Value <string>("id")); CoinsEMarketId marketId = new CoinsEMarketId(jObject.Value <string>("pair")); CoinsEOrderNumber buyOrderId = new CoinsEOrderNumber(jObject.Value <long>("buy_order_no")); CoinsEOrderNumber sellOrderId = new CoinsEOrderNumber(jObject.Value <long>("sell_order_no")); DateTime dateTime = CoinsEParsers.ParseTime(jObject.Value <int>("created")); return(new CoinsEMarketTrade(tradeId, dateTime, jObject.Value <decimal>("rate"), jObject.Value <decimal>("quantity"), marketId, buyOrderId, sellOrderId, jObject.Value <string>("status"))); }
public static CoinsEMyOrder Parse(JObject json) { DateTime dateTime = CoinsEParsers.ParseTime(json.Value <int>("created")); CoinsEMarketId marketId = new CoinsEMarketId(json.Value <string>("pair")); return(new CoinsEMyOrder(new CoinsEOrderId(marketId, json.Value <string>("id")), CoinsEParsers.ParseOrderType(json.Value <string>("order_type")), dateTime, json.Value <decimal>("rate"), json.Value <decimal>("quantity_remaining"), json.Value <decimal>("quantity"), marketId ) { IsOpen = json.Value <bool>("is_open"), Status = CoinsEParsers.ParseOrderStatus(json.Value <string>("status")) }); }
public override async Task <Book> GetMarketDepth(MarketId marketId) { JObject responseJson = await CallPublic(this.GetMarketUrl(marketId) + MARKET_DEPTH_PATH); return(CoinsEParsers.ParseMarketDepth(responseJson.Value <JObject>("marketdepth"))); }