예제 #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
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            //Loads the assets of the application
            assets = this.Assets;

            //Get the list of currencies
            currencies           = APIMethods.GetMarkets();
            currenciesStringList = new List <string>();

            foreach (var currency in currencies)
            {
                currenciesStringList.Add(currency.MarketName);
            }

            Constants.ApiKey    = LoginData.APIKey;
            Constants.SecretKey = LoginData.SecretKey;

            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            //Set the toolbar
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            toolbar.SetTitleTextColor(Android.Graphics.Color.White);
            SetActionBar(toolbar);
            ActionBar.Title = "Bittrex";

            //Initialise the adapter and search view
            _adapter = new SearchableAdapter(this, currenciesStringList);

            _listView         = this.FindViewById <ListView>(Resource.Id.listView);
            _listView.Adapter = _adapter;

            _listView.ItemClick += _listView_ItemClick;

            var searchView = (SearchView)FindViewById(Resource.Id.searchView);

            _searchView = searchView.JavaCast <SearchView>();

            _searchView.SetIconifiedByDefault(false);
            _searchView.SetBackgroundColor(Android.Graphics.Color.White);
            _searchView.SetQueryHint("Search currencies");

            _searchView.QueryTextChange += (s, e) => _adapter.Filter.InvokeFilter(new Java.Lang.String(e.NewText));
        }