Ejemplo n.º 1
0
        /// <summary>
        /// Get ticker for a trading pair
        /// </summary>
        /// <param name="pairId">Id of trading pair</param>
        /// <returns>Ticker object</returns>
        public async Task <Ticker> GetTicker(int pairId)
        {
            var endpoint = $@"/v1/ticker?symbol={pairId}";

            var response = await base.GetRequest <Ticker>(endpoint);

            var asset = BilaxyHelper.GetAsset(pairId);

            response.Pair   = asset.DashedPair;
            response.PairId = asset.AssetId;

            return(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get tickers for all trading pairs
        /// </summary>
        /// <returns>Collection of Ticker objects</returns>
        public async Task <List <Ticker> > GetTickers()
        {
            var endpoint = $@"/v1/tickers";

            var response = await base.GetRequest <List <Ticker> >(endpoint);

            foreach (var item in response)
            {
                var asset = BilaxyHelper.GetAsset(item.PairId);
                if (asset != null)
                {
                    item.Pair = asset.DashedPair;
                }
            }

            return(response);
        }