mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 06:47:50 +01:00
* Histograms: Add Lightning data and API endpoints Ported over from the mobile-working-branch. Adds histogram data for Lightning and exposes the wallet/lightning histogram data via the API. It also add a dashboard graph for the Lightning balance. Caveat: The Lightning histogram is calculated by using the current channel balance and going backwards through as much invoices and transactions as we have. The "start" of the LN graph data might not be accurate though. That's because we don't track (and not even have) the LN onchain data. It is calculated by using the current channel balance and going backwards through as much invoices and transactions as we have. So the historic graph data for LN is basically a best effort of trying to reconstruct it with what we have: The LN channel transactions. * More timeframes * Refactoring: Remove redundant WalletHistogram types * Remove store property from dashboard tile view models * JS error fixes
26 lines
938 B
C#
26 lines
938 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BTCPayServer.Client.Models;
|
|
using BTCPayServer.Lightning;
|
|
using BTCPayServer.Services.Rates;
|
|
using NBitcoin;
|
|
using StoreData = BTCPayServer.Data.StoreData;
|
|
|
|
namespace BTCPayServer.Components.StoreLightningBalance;
|
|
|
|
public class StoreLightningBalanceViewModel
|
|
{
|
|
public string StoreId { get; set; }
|
|
public string CryptoCode { get; set; }
|
|
public string DefaultCurrency { get; set; }
|
|
public CurrencyData CurrencyData { get; set; }
|
|
public Money TotalOnchain { get; set; }
|
|
public LightMoney TotalOffchain { get; set; }
|
|
public LightningNodeBalance Balance { get; set; }
|
|
public string ProblemDescription { get; set; }
|
|
public bool InitialRendering { get; set; } = true;
|
|
public HistogramType Type { get; set; }
|
|
public IList<DateTimeOffset> Labels { get; set; }
|
|
public IList<decimal> Series { get; set; }
|
|
public string DataUrl { get; set; }
|
|
}
|