예제 #1
0
        public async Task <IEnumerable <CexOrderArchive> > GetArchivedOrders(Pair pair, CancellationToken token = default(CancellationToken))
        {
            try
            {
                WaitResourceFreeSignal();

                var data = await RetryHelper.DoAsync(async() =>
                {
                    var nonce     = GetNonce();
                    var signature = GetSignature(nonce, _userName, _key, _secret);

                    return(await PrivateQuery <List <CexOrderArchive> >(
                               ApiUrl + "archived_orders/" + PairConvertorHelper.DashToDrkPair(pair),
                               new Dictionary <string, string>
                    {
                        { "key", _key },
                        { "signature", signature.ToUpper() },
                        { "nonce", Convert.ToString(nonce) },
                        { "limit", Convert.ToString(LimitMax) },
                        { "dateFrom", Convert.ToString(UnixTime.GetNowAddDays(-3)) },
                        { "dateTo", Convert.ToString(UnixTime.GetNowAddDays(1)) }
                    }, token, RequestCategory.OrderHistory));
                }, TimeSpan.FromMilliseconds(Constant.DefaultRetryInterval), 1);

                return(data);
            }
            finally
            {
                AutoResetEventSet();
            }
        }