Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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")));
        }
Ejemplo n.º 3
0
        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"))
            });
        }
Ejemplo n.º 4
0
        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")));
        }