Wallet transactions: Add label manager (#4796)

* Wallet transactions: Add label manager

* Update BTCPayServer/Views/UIWallets/WalletTransactions.cshtml

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Add rich label info

* Fixes

* support labels in wallet send

* add labels to tx info page

* Remove noscript parts

* Allow click on transaction label info

* update psbt info labelstyling

* revert red pixel fix as it broke all

---------

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
This commit is contained in:
d11n
2023-03-26 13:42:38 +02:00
committed by GitHub
parent 8635fcfe84
commit 95f3e429b4
18 changed files with 453 additions and 227 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using BTCPayServer.Services.Labels;
namespace BTCPayServer.Models.WalletViewModels
{
@@ -15,10 +14,10 @@ namespace BTCPayServer.Models.WalletViewModels
public string Link { get; set; }
public bool Positive { get; set; }
public string Balance { get; set; }
public HashSet<TransactionTagModel> Tags { get; set; } = new HashSet<TransactionTagModel>();
public HashSet<TransactionTagModel> Tags { get; set; } = new ();
}
public HashSet<(string Text, string Color, string TextColor)> Labels { get; set; } = new HashSet<(string Text, string Color, string TextColor)>();
public List<TransactionViewModel> Transactions { get; set; } = new List<TransactionViewModel>();
public HashSet<(string Text, string Color, string TextColor)> Labels { get; set; } = new ();
public List<TransactionViewModel> Transactions { get; set; } = new ();
public override int CurrentPageCount => Transactions.Count;
public string CryptoCode { get; set; }
}

View File

@@ -16,6 +16,7 @@ namespace BTCPayServer.Models.WalletViewModels
public bool Positive { get; set; }
public string Destination { get; set; }
public string Balance { get; set; }
public Dictionary<string, string> Labels { get; set; } = new();
}
public class InputViewModel
@@ -24,6 +25,7 @@ namespace BTCPayServer.Models.WalletViewModels
public string Error { get; set; }
public bool Positive { get; set; }
public string BalanceChange { get; set; }
public Dictionary<string, string> Labels { get; set; } = new();
}
public bool HasErrors => Inputs.Count == 0 || Inputs.Any(i => !string.IsNullOrEmpty(i.Error));
public string BalanceChange { get; set; }

View File

@@ -34,6 +34,8 @@ namespace BTCPayServer.Models.WalletViewModels
public bool SubtractFeesFromOutput { get; set; }
public string PayoutId { get; set; }
public string[] Labels { get; set; } = Array.Empty<string>();
}
public decimal CurrentBalance { get; set; }
public decimal ImmatureBalance { get; set; }