diff --git a/src/Angor/Client/Pages/Investor.razor b/src/Angor/Client/Pages/Investor.razor index 5e447c58..d03d5e66 100644 --- a/src/Angor/Client/Pages/Investor.razor +++ b/src/Angor/Client/Pages/Investor.razor @@ -243,8 +243,6 @@ } - - diff --git a/src/Angor/Client/Pages/Wallet.razor b/src/Angor/Client/Pages/Wallet.razor index ed822503..0afab735 100644 --- a/src/Angor/Client/Pages/Wallet.razor +++ b/src/Angor/Client/Pages/Wallet.razor @@ -1,12 +1,13 @@ @page "/wallet" + @using System.Text.Json @using Angor.Client.Storage @using Angor.Shared @using Angor.Shared.Models @using Blockcore.NBitcoin @using Blockcore.Networks - +@inherits BaseComponent @inject HttpClient _httpClient; @inject IClientStorage storage; @inject ICacheStorage _cacheStorage; @@ -19,7 +20,7 @@ @inject NavMenuState NavMenuState @inject IEncryptionService _encryptionService @inject IClipboardService ClipboardService -@inherits BaseComponent + Wallet and balances @@ -471,8 +472,8 @@ else var outpointStr = addressUtxoItem.outpoint.ToString(); var outpointLength = outpointStr.Length; var shortenedOutpoint = outpointLength > 20 - ? $"{outpointStr.Substring(0, 10)} ... {outpointStr.Substring(outpointLength - 10)}" - : outpointStr; + ? $"{outpointStr.Substring(0, 10)} ... {outpointStr.Substring(outpointLength - 10)}" + : outpointStr; var valueInBTC = Money.Satoshis(addressUtxoItem.value).ToUnit(MoneyUnit.BTC); var coinTicker = network.CoinTicker; @@ -487,7 +488,7 @@ else @@ -619,6 +620,7 @@ else Amount Path UTXO count + View Raw Json @@ -631,17 +633,17 @@ else { @addressInfo.Address - - @Money.Satoshis(total).ToUnit(MoneyUnit.BTC) @network.CoinTicker - + @Money.Satoshis(total).ToUnit(MoneyUnit.BTC) @network.CoinTicker @addressInfo.HdPath @count + + + - @if (IsExpanded(addressInfo.Address)) { - +
@@ -721,6 +723,9 @@ else private int FeePosition = 1; private SendInfo _sendInfo = new(); + private bool showRawTransactionModal; + private string rawTransactionJson = string.Empty; + private readonly AccountBalanceInfo accountBalanceInfo = new(); private readonly FeeEstimations FeeEstimations = new(); @@ -1243,7 +1248,7 @@ else } catch (Exception ex) { - Logger.LogError(ex, $"Failed to read clipboard contents"); + Logger.LogError(ex, "Failed to read clipboard contents"); } } @@ -1289,4 +1294,52 @@ else } + private void ShowRawTransactionJson(AddressInfo addressInfo) + { + rawTransactionJson = GetRawTransactionJson(addressInfo); + showRawTransactionModal = true; + } + + private string GetRawTransactionJson(AddressInfo addressInfo) + { + var options = new JsonSerializerOptions + { + WriteIndented = true + }; + return JsonSerializer.Serialize(addressInfo, options); + } + + private async Task CopyStringToClipboard(string msg) + { + await _clipboardService.WriteTextAsync(msg); + notificationComponent.ShowNotificationMessage("Copied to clipboard!", 3); + StateHasChanged(); + } + + +} + + +@if (showRawTransactionModal) +{ + } \ No newline at end of file