mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 06:35:13 +01:00
* Support accepting 0 amount bolt 11 invoices for payouts * add test * handle validation better * fix case when we just want pp to provide amt * Update BTCPayServer/HostedServices/PullPaymentHostedService.cs * Update BTCPayServer/HostedServices/PullPaymentHostedService.cs * Update BTCPayServer/Data/Payouts/LightningLike/UILightningLikePayoutController.cs * Update UILightningLikePayoutController.cs * fix null * fix payments of payouts on cln * add comment * bump lightning lib --------- Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
28 lines
954 B
C#
28 lines
954 B
C#
using System;
|
|
using BTCPayServer.Lightning;
|
|
using NBitcoin;
|
|
|
|
namespace BTCPayServer.Data.Payouts.LightningLike
|
|
{
|
|
public class BoltInvoiceClaimDestination : ILightningLikeLikeClaimDestination
|
|
{
|
|
public BoltInvoiceClaimDestination(string bolt11, BOLT11PaymentRequest paymentRequest)
|
|
{
|
|
Bolt11 = bolt11 ?? throw new ArgumentNullException(nameof(bolt11));
|
|
PaymentRequest = paymentRequest;
|
|
PaymentHash = paymentRequest.Hash;
|
|
Amount = paymentRequest.MinimumAmount.ToDecimal(LightMoneyUnit.BTC);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Bolt11;
|
|
}
|
|
public string Bolt11 { get; }
|
|
public BOLT11PaymentRequest PaymentRequest { get; }
|
|
public uint256 PaymentHash { get; }
|
|
public string Id => PaymentHash.ToString();
|
|
public decimal? Amount { get; }
|
|
public bool IsExplicitAmountMinimum => true;
|
|
}
|
|
}
|