예제 #1
0
        public async Task <BalancesResult> GetBalancesAsync(IEnumerable <RaiAddress> acc)
        {
            var action  = new GetBalances(acc);
            var handler = new ActionHandler <GetBalances, BalancesResult>(_node);

            return(await handler.Handle(action));
        }
예제 #2
0
        public async Task Start()
        {
            Client       = new Client();
            balance      = new GetBalances();
            marketOrder  = new MarketOrder();
            quantity     = new TotalToVolume();
            currentPrice = new GetCurrentPrice();
            // Output window
            outputData = new Strategy1Data();

            Dispatcher.CurrentDispatcher.Invoke(() =>
            {
                Client.PoloniexClient.Live.Start();
            });

            // Override this method on sub classes
            dispatcherTimer.TickTask = async() =>
            {
                await OnBar();
            };
            dispatcherTimer.Start();


            await GetTickerData();

            // Start method
            OnStart();
        }
        //***************************************************************************************

        public async Task GetBalanceAsync()
        {
            GetBalances balance = new GetBalances();

            var btcAvailable = await balance.GetBalance("BTC");

            var btcTotalAll = await balance.GetBalance();

            ShowBalanceStatus.Text = btcAvailable.ToStringNormalized() + " BTC";

            TotalBalanceAll.Text = btcTotalAll.ToString();
        }