public async Task <KeyModelResponse> CreateWalletAsync() { HttpResponseMessage message = await _httpClient.PostAsync($"{_signServiceUrl}/api/wallet", new StringContent("")); string serializedResponse = await message.Content.ReadAsStringAsync(); KeyModelResponse keyModelResponse = await ConvertToOrThrow <KeyModelResponse>(serializedResponse); return(keyModelResponse); }
public async Task <WalletCreationResult> CreateWalletAsync() { KeyModelResponse response = await _internalSignServiceCaller.CreateWalletAsync(); string encryptedPrivateKey = _encryptionService.EncryptAesString(response.PrivateKey, _passwordBytes); await _walletRepository.SaveAsync(new Wallet() { EncryptedPrivateKey = encryptedPrivateKey, PublicAddress = response.PublicAddress, }); return(new WalletCreationResult() { PublicAddress = response.PublicAddress, }); }