public async Task <EthereumResponse <OperationResponse> > SendCashOutAsync(Guid id, string sign, IAsset asset, string fromAddress, string toAddress, decimal amount) { var response = await _ethereumApi.ApiExchangeCashoutPostAsync(new CashoutModel { Amount = EthServiceHelpers.ConvertToContract(amount, asset.MultiplierPower, asset.Accuracy), CoinAdapterAddress = asset.AssetAddress, ToAddress = toAddress, FromAddress = fromAddress, Id = id, Sign = sign }); var error = response as ApiException; if (error != null) { return(new EthereumResponse <OperationResponse> { Error = new ErrorResponse { Code = error.Error.Code, Message = error.Error.Message } }); } var res = response as OperationIdResponse; if (res != null) { return(new EthereumResponse <OperationResponse> { Result = new OperationResponse { OperationId = res.OperationId } }); } throw new Exception("Unknown response"); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='model'> /// </param> public static object ApiExchangeCashoutPost(this IEthereumApi operations, CashoutModel model = default(CashoutModel)) { return(operations.ApiExchangeCashoutPostAsync(model).GetAwaiter().GetResult()); }