2021-10-18 05:37:59 +02:00
|
|
|
using System;
|
|
|
|
using BTCPayServer.Lightning;
|
|
|
|
using NBitcoin;
|
|
|
|
|
|
|
|
namespace BTCPayServer.Data.Payouts.LightningLike
|
|
|
|
{
|
|
|
|
public class BoltInvoiceClaimDestination : ILightningLikeLikeClaimDestination
|
|
|
|
{
|
2021-10-21 17:43:02 +02:00
|
|
|
public BoltInvoiceClaimDestination(string bolt11, BOLT11PaymentRequest paymentRequest)
|
2021-10-18 05:37:59 +02:00
|
|
|
{
|
2021-10-21 17:43:02 +02:00
|
|
|
Bolt11 = bolt11 ?? throw new ArgumentNullException(nameof(bolt11));
|
|
|
|
PaymentRequest = paymentRequest;
|
|
|
|
PaymentHash = paymentRequest.Hash;
|
|
|
|
Amount = paymentRequest.MinimumAmount.ToDecimal(LightMoneyUnit.BTC);
|
2021-10-18 05:37:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
{
|
2021-10-21 17:43:02 +02:00
|
|
|
return Bolt11;
|
2021-10-18 05:37:59 +02:00
|
|
|
}
|
2021-10-21 17:43:02 +02:00
|
|
|
public string Bolt11 { get; }
|
|
|
|
public BOLT11PaymentRequest PaymentRequest { get; }
|
|
|
|
public uint256 PaymentHash { get; }
|
|
|
|
public string Id => PaymentHash.ToString();
|
|
|
|
public decimal? Amount { get; }
|
2021-10-18 05:37:59 +02:00
|
|
|
}
|
|
|
|
}
|