mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-28 10:24:22 +01:00
* Add Lightning payout support * Adjust Greenfield API to allow other payment types for Payouts * Pull payment view: Improve payment method select * Pull payments view: Update JS * Pull payments view: Table improvements * Pull payment form: Remove duplicate name field * Cleanup Lightning branch after rebasing * Update swagger documnetation for Lightning support * Remove required requirement for amount in pull payments * Adapt Refund endpoint to support multiple playment methods * Support LNURL Pay for Pull Payments * Revert "Remove required requirement for amount in pull payments" This reverts commit 96cb78939d43b7be61ee2d257800ccd1cce45c4c. * Support Lightning address payout claims * Fix lightning claim handling and provide better error messages * Fix tests Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using System;
|
|
using BTCPayServer.Lightning;
|
|
using NBitcoin;
|
|
|
|
namespace BTCPayServer.Data.Payouts.LightningLike
|
|
{
|
|
public class BoltInvoiceClaimDestination : ILightningLikeLikeClaimDestination
|
|
{
|
|
private readonly string _bolt11;
|
|
private readonly decimal _amount;
|
|
|
|
public BoltInvoiceClaimDestination(string bolt11, Network network)
|
|
{
|
|
_bolt11 = bolt11 ?? throw new ArgumentNullException(nameof(bolt11));
|
|
_amount = BOLT11PaymentRequest.Parse(bolt11, network).MinimumAmount.ToDecimal(LightMoneyUnit.BTC);
|
|
}
|
|
|
|
public BoltInvoiceClaimDestination(string bolt11, BOLT11PaymentRequest invoice)
|
|
{
|
|
_bolt11 = bolt11 ?? throw new ArgumentNullException(nameof(bolt11));
|
|
_amount = invoice?.MinimumAmount.ToDecimal(LightMoneyUnit.BTC) ?? throw new ArgumentNullException(nameof(invoice));
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return _bolt11;
|
|
}
|
|
|
|
public decimal? Amount => _amount;
|
|
}
|
|
}
|