Exemplo n.º 1
0
        public override async Task <AccountInfo> GetAccountInfo()
        {
            JObject fundsJson = await CallPrivate <JObject>(Method.getfunds);

            List <Wallet> wallets = BterParsers.ParseWallets(fundsJson);

            return(new AccountInfo(wallets));
        }
Exemplo n.º 2
0
        internal static BterMarketTrade ParseSingle(MarketId marketId, JObject trade)
        {
            OrderType orderType;

            switch (trade.Value <string>("type"))
            {
            case "buy":
                orderType = OrderType.Buy;
                break;

            case "sell":
                orderType = OrderType.Sell;
                break;

            default:
                throw new BterResponseException("Found unknown trade type \""
                                                + trade.Value <string>("type") + "\", expected \"buy\" or \"sell\".");
            }

            return(new BterMarketTrade(new BterTradeId(trade.Value <int>("tid")), orderType,
                                       BterParsers.ParseDateTime(trade.Value <int>("date")), trade.Value <decimal>("price"),
                                       trade.Value <decimal>("amount"), marketId));
        }
Exemplo n.º 3
0
        public override async Task <Model.Book> GetMarketDepth(MarketId marketId)
        {
            BterMarketId bterMarketId = (BterMarketId)marketId;

            return(BterParsers.ParseOrderBook(await CallPublic <JObject>(Method.depth, bterMarketId)));
        }