public override async Task <OperationResult <AccountHistoryResponse[]> > GetAccountHistory(string userName, CancellationToken ct)
        {
            var isConnected = await TryReconnectChain(ct);

            if (!isConnected)
            {
                return(new OperationResult <AccountHistoryResponse[]>(new ValidationException(LocalizationKeys.EnableConnectToBlockchain)));
            }

            var result = new OperationResult <AccountHistoryResponse[]>();

            var args = new GetAccountHistoryArgs
            {
                Account = userName,
                Start   = ulong.MaxValue,
                Limit   = 1000
            };
            var resp = await _operationManager.CondenserGetAccountHistory(args, CancellationToken.None);

            if (resp.IsError)
            {
                result.Exception = new RequestException(resp);
                return(result);
            }

            var vestsExchangeRatio = await GetVestsExchangeRatio(ct);

            if (!vestsExchangeRatio.IsSuccess)
            {
                return(new OperationResult <AccountHistoryResponse[]>(vestsExchangeRatio.Exception));
            }

            result.Result = resp.Result.History.Where(Filter).Select(pair => Transform(pair, vestsExchangeRatio.Result)).OrderByDescending(x => x.DateTime).ToArray();
            return(result);
        }
Exemple #2
0
        public async Task get_account_history()
        {
            var args = new GetAccountHistoryArgs
            {
                Account = User.Login
            };
            var resp = await Api.GetAccountHistoryAsync(args, CancellationToken.None).ConfigureAwait(false);

            TestPropetries(resp);
        }
        public async Task get_account_history()
        {
            var args = new GetAccountHistoryArgs
            {
                Account = User.Login,
                Limit   = 1,
                Start   = 1
            };
            var resp = await Api.CondenserGetAccountHistory(args, CancellationToken.None);

            TestPropetries(resp);
        }
Exemple #4
0
        public void get_account_history()
        {
            var args = new GetAccountHistoryArgs()
            {
                Account = User.Login
            };
            var resp = Api.GetAccountHistory(args, CancellationToken.None);

            WriteLine(resp);
            Assert.IsFalse(resp.IsError);

            var obj = Api.CustomGetRequest <JObject>(KnownApiNames.AccountHistoryApi, "get_account_history", args, CancellationToken.None);

            TestPropetries(resp.Result.GetType(), obj.Result);
            WriteLine("----------------------------------------------------------------------------");
            WriteLine(obj);
        }
Exemple #5
0
 /// <summary>
 /// API name: get_account_history
 ///
 /// </summary>
 /// <param name="args">API type: get_account_history_args</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <returns>API type: get_account_history_return</returns>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <GetAccountHistoryReturn> > GetAccountHistory(GetAccountHistoryArgs args, CancellationToken token)
 {
     return(CustomGetRequest <GetAccountHistoryReturn>(KnownApiNames.AccountHistoryApi, "get_account_history", args, token));
 }
Exemple #6
0
 /// <summary>
 /// API name: get_account_history
 ///
 /// </summary>
 /// <param name="args">API type: get_account_history_args</param>
 /// <param name="token">Throws a <see cref="T:System.OperationCanceledException" /> if this token has had cancellation requested.</param>
 /// <returns>API type: get_account_history_return</returns>
 /// <exception cref="T:System.OperationCanceledException">The token has had cancellation requested.</exception>
 public Task <JsonRpcResponse <GetAccountHistoryReturn> > CondenserGetAccountHistoryAsync(GetAccountHistoryArgs args, CancellationToken token)
 {
     return(CondenserCustomGetRequestAsync <GetAccountHistoryReturn>(KnownApiNames.CondenserApi, "get_account_history", args, token));
 }