public async Task <IActionResult> MultisigConfirmationsAsync(DestinationChain destinationChain, int transactionId) { try { if (!this.ethCompatibleClientProvider.IsChainSupportedAndEnabled(destinationChain)) { return(this.Json($"{destinationChain} not enabled or supported!")); } IETHClient client = this.ethCompatibleClientProvider.GetClientForChain(destinationChain); List <string> owners = await client.GetOwnersAsync().ConfigureAwait(false); var ownersConfirmed = new List <string>(); foreach (string multisig in owners) { bool confirmed = await client.AddressConfirmedTransactionAsync(transactionId, multisig).ConfigureAwait(false); if (confirmed) { ownersConfirmed.Add(multisig); } } return(this.Json(ownersConfirmed)); } catch (Exception e) { this.logger.LogError("Exception occurred: {0}", e.ToString()); return(ErrorHelpers.BuildErrorResponse(HttpStatusCode.BadRequest, e.Message, e.ToString())); } }
public IActionResult Owners(DestinationChain destinationChain) { try { if (!this.ethCompatibleClientProvider.IsChainSupportedAndEnabled(destinationChain)) { return(this.Json($"{destinationChain} not enabled or supported!")); } IETHClient client = this.ethCompatibleClientProvider.GetClientForChain(destinationChain); return(this.Json(client.GetOwnersAsync().GetAwaiter().GetResult())); } catch (Exception e) { this.logger.Error("Exception occurred: {0}", e.ToString()); return(ErrorHelpers.BuildErrorResponse(HttpStatusCode.BadRequest, e.Message, e.ToString())); } }