public async Task <Contracts.TransactionStatusResult> GetTransactionsStatus(Guid clientId, string walletAddress)
        {
            var task    = _service.TransactionByClientIdByClientIdWalletByWalletGetAsync(clientId.ToString(), walletAddress);
            var resTask = await TaskWithDelay(task);

            if (resTask != task)
            {
                _log.WriteWarning(nameof(ChainalysisProxyClient), nameof(GetTransactionsStatus), $"Timeout with {clientId} and {walletAddress}");
                return(null);
            }

            var result      = task.Result;
            var transaction = result as ChainalysisProxy.AutorestClient.Models.TransactionStatusResult;


            return(transaction == null ? null : new Contracts.TransactionStatusResult
            {
                Transactions = transaction.Transactions.Select(tr => new Contracts.TransactionStatus
                {
                    ClientId = tr.ClientId,
                    TransactionHash = tr.TransactionHash,
                    OutputNumber = tr.OutputNumber,
                    TransactionAmount = (decimal)tr.TransactionAmount,
                    ChainalysisName = tr.ChainalysisName,
                    ChainalysisRiskScore = (Contracts.RiskScore)(int) tr.ChainalysisRiskScore,
                    ChainalysisCategory = tr.ChainalysisCategory,
                    WalletAddress = tr.WalletAddress
                }).ToList()
            });
        }
예제 #2
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='clientId'>
 /// </param>
 /// <param name='wallet'>
 /// </param>
 public static object TransactionByClientIdByClientIdWalletByWalletGet(this IChainalysisProxyAPI operations, string clientId, string wallet)
 {
     return(operations.TransactionByClientIdByClientIdWalletByWalletGetAsync(clientId, wallet).GetAwaiter().GetResult());
 }