public async Task <IActionResult> SetExpired([FromBody] BlockchainWalletExpiredRequest request) { bool isValid = await _blockchainAddressValidator.Execute(request.WalletAddress, request.Blockchain); if (!isValid) { return(BadRequest(ErrorResponse.Create("Wallet address is not valid"))); } try { bool released = await _bcnWalletUsageService.ReleaseAsync(request.WalletAddress, request.Blockchain); if (released) { return(Ok()); } return(BadRequest(ErrorResponse.Create("Couldn't set wallet as expired"))); } catch (Exception ex) { await _log.WriteErrorAsync(nameof(WalletsController), nameof(SetExpired), request.ToJson(), ex); throw; } }
public async Task <IActionResult> SetExpired([FromBody] BlockchainWalletExpiredRequest request) { bool isValid; try { isValid = await _blockchainAddressValidator.Execute(request.WalletAddress, request.Blockchain); } catch (BlockchainTypeNotSupported) { isValid = true; } if (!isValid) { return(BadRequest(ErrorResponse.Create("Wallet address is not valid"))); } bool released = await _bcnWalletUsageService.ReleaseAsync(request.WalletAddress, request.Blockchain); if (released) { return(Ok()); } return(BadRequest(ErrorResponse.Create("Couldn't set wallet as expired"))); }