mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 22:46:49 +01:00
* Payout Destination Handling fixes #2765 This PR: * reactivates the BIP21 support for payouts. * allows LNUrl destinations to be reusable. * allows addresses to be reused in claims as long as the other claims are in a final state * Ensure bolt amount matches the payout amount * fixes * reduce duplicate parsing of bolt * make hash the id of bolt * better bolt11 tostring * use cached payment request from lnurl
27 lines
901 B
C#
27 lines
901 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; }
|
|
}
|
|
}
|