예제 #1
0
        public void Place(string user_id, string key, string secret_key, decimal price, decimal amount, string type)
        {
            ApiCredentials credentials = new ApiCredentials(user_id, key, secret_key);
            CexClient      client      = new CexClient(credentials);

            if (type == "buy")
            {
                Order order = new Order(SymbolPairs.XRP_USD, price, amount, OrderType.Buy);
                client.Account.PlaceLimitOrder(order);
            }
            else
            {
                Order order = new Order(SymbolPairs.XRP_USD, price, amount, OrderType.Sell);
                client.Account.PlaceLimitOrder(order);
            }
        }
예제 #2
0
        public decimal Balance_XRP(string user_id, string key, string secret_key)
        {
            decimal        xrpBalance  = 0;
            ApiCredentials credentials = new ApiCredentials(user_id, key, secret_key);
            CexClient      client      = new CexClient(credentials);

            try
            {
                Balance balance = client.Account.GetBalanceAsync().Result;
                xrpBalance = balance.XRP.Available;
            }
            catch (AggregateException)
            {
                throw;
            }
            return(xrpBalance);
        }