Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Constants.ApiKey    = "";
            Constants.SecretKey = "";


            #region PublicAPI

            //Get Markets test
            List <Market> listOfMarkets = APIMethods.GetMarkets();

            //Get all supported currencies
            List <MarketCurrency> listOfCurrencies = APIMethods.GetCurrencies();

            //Get the current tick value for the specified market
            Ticker tick = APIMethods.GetTicker("BTC-LTC");

            //Gets the summary of all markets
            List <MarketSummary> listOfMarketSummaries = APIMethods.GetMarketSummaries();

            //Gets the summary of a specificed market
            MarketSummary marketSummary = APIMethods.GetMarketSummary("BTC-LTC");

            //Gets the Order book for the specified market
            OrderBook book = APIMethods.GetOrderBook("BTC-LTC", Order.Type.both);

            List <MarketHistory> marketHistory = APIMethods.GetMarketHistory("BTC-LTC");

            #endregion


            #region MarketAPI

            //APIMethods.PlaceBuyLimitOrder("BTC-LTC", 5, 0.17);

            // APIMethods.PlaceSellLimitOrder("BTC-LTC", 5, 0.17);

            APIMethods.CancelOrder("328bd88e-537e-4979-9d8b-d2e827d1a49e");

            // List<OpenOrder> orders = APIMethods.GetOpenOrders("BTC-GRS");

            #endregion

            #region AccountAPI

            //  List<Balance> balanceList = APIMethods.GetBalances();

            Balance balance = APIMethods.GetBalance("GRS");

            //APIMethods.Withdraw("GRS", 20.23222, "Address to withdraw GRS to");

            AccountOrder accountOrder = APIMethods.GetOrder("uuid here");

            List <HistoryOrder> listOfOrderHistory = APIMethods.GetOrderHistory();

            List <HistoryOrder> listOfSpecificOrderHistory = APIMethods.GetOrderHistory("BTC-LTC");


            #endregion
        }
Ejemplo n.º 2
0
        public static void OnMenuItemClick(Activity activity)
        {
            try
            {
                tick = APIMethods.GetTicker(Currency);

                //Sets the buy and sell prices
                buyTextView.Text  = tick.Bid.ToString("N8");
                sellTextView.Text = tick.Ask.ToString("N8");
                lastTextView.Text = tick.Last.ToString("N8");

                Toast.MakeText(activity, "Refreshed", ToastLength.Short).Show();
            }
            catch (Exception e)
            {
                Toast.MakeText(activity, e.Message.ToString(), ToastLength.Short).Show();
            }
        }
Ejemplo n.º 3
0
        public bool OnMenuItemClick(IMenuItem item)
        {
            if (item.ItemId == Resource.Id.menu_refresh)
            {
                //Get API data for currency
                try
                {
                    tick = APIMethods.GetTicker(currencyString);
                    //Sets the buy and sell prices
                    buyTextView.Text  = tick.Bid.ToString("0.#########");
                    sellTextView.Text = tick.Ask.ToString("0.#########");
                    lastTextView.Text = tick.Last.ToString("0.#########");

                    Toast.MakeText(activity, "Refreshed", ToastLength.Short).Show();
                    return(true);
                }
                catch (Exception e)
                {
                    Toast.MakeText(activity, e.Message.ToString(), ToastLength.Short).Show();
                    return(false);
                }
            }
            return(false);
        }