예제 #1
0
        public MarketPair(API api, json.MarketCall.Pair jsonMarketPair)
        {
            this.api = api;

            @base = api.GetCurrency(jsonMarketPair.@base);
            other = api.GetCurrency(jsonMarketPair.other);
            volume = new Amount(jsonMarketPair.volume, @base.DecimalsInternal);
            lastPrice = new Amount(jsonMarketPair.lastprice, @base.DecimalsInternal);
            bestAsk = new Amount(jsonMarketPair.bestask, @base.DecimalsInternal);
            bestBid = new Amount(jsonMarketPair.bestbid, @base.DecimalsInternal);
            depthAsk = new Amount(jsonMarketPair.depthask, other.DecimalsInternal);
            depthBid = new Amount(jsonMarketPair.depthbid, @base.DecimalsInternal);
            feeBase = int.Parse(jsonMarketPair.feebase, System.Globalization.NumberStyles.HexNumber) / 100;
            feeOther = int.Parse(jsonMarketPair.feeother, System.Globalization.NumberStyles.HexNumber) / 100;
            decimalsOrder = jsonMarketPair.decimals_order;
            minimumBase = new Amount(jsonMarketPair.minbase, @base.DecimalsInternal);
            minimumOther = new Amount(jsonMarketPair.minother, other.DecimalsInternal);
        }
예제 #2
0
파일: User.cs 프로젝트: RAWX/csharp-lib
            public Order(API api, json.UserCall.Order userOrder)
            {
                this.api = api;

                id = userOrder.id;
                marketPair = api.GetMarketPair(userOrder.pair);
                time = Utils.UnixTimeStampToDateTime(userOrder.time);
                amount = new Amount(userOrder.amount, api.GetCurrency(userOrder.side).DecimalsInternal);
                price = new Amount(userOrder.price, marketPair.Base.DecimalsInternal);
                bid = userOrder.side == marketPair.Base.TLA;
            }
예제 #3
0
파일: User.cs 프로젝트: RAWX/csharp-lib
            public Balance(API api, json.UserCall.Balance userBalance)
            {
                this.api = api;

                currency = api.GetCurrency(userBalance.tla);
                total = new Amount(userBalance.total, currency.DecimalsInternal);
                available = new Amount(userBalance.avail, currency.DecimalsInternal);
                address = userBalance.address;
            }