Ejemplo n.º 1
0
        public async Task <IDepositAddress> GetDepositAddress(string currency)
        {
            int    recvWindow  = 1000000;
            var    timestamp   = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
            string totalParams = string.Format("asset={0}&recvWindow={1}&timestamp={2}", currency, recvWindow, timestamp);
            string sign        = CalculateSignature(totalParams, _config.Secret);

            var data = new Dictionary <string, object> {
                { "asset", currency },
                { "recvWindow", recvWindow },
                { "timestamp", timestamp },
                { "signature", sign }
            };

            var resp = await _binance.DepositAddress(_config.ApiKey, data);

            return(new DepositAddress(resp));
        }