Esempio n. 1
0
 public IEnumerable <string> GetAddresses(BlockchainWalletResponse wallet)
 {
     if (IsValidAddress(wallet.Address))
     {
         yield return(wallet.Address);
     }
 }
        public async Task <IActionResult> GetWallet([FromRoute] string blockchainType, [FromRoute] string address)
        {
            if (!ValidateRequest(blockchainType, address, out var badRequest))
            {
                return(badRequest);
            }

            var wallet = await _walletService.TryGetWalletAsync(blockchainType, address);

            if (wallet == null)
            {
                return(NoContent());
            }

            var response = new BlockchainWalletResponse
            {
                Address          = wallet.Address,
                AddressExtension = wallet.AddressExtension,
                BaseAddress      = wallet.BaseAddress,
                BlockchainType   = wallet.BlockchainType,
                ClientId         = wallet.ClientId,
                CreatedBy        = wallet.CreatorType
            };

            return(Ok(response));
        }