first commit

This commit is contained in:
2025-12-08 11:45:58 +01:00
commit e1135a15a7
27 changed files with 3236 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using BTCPayServer.Lightning;
using NBitcoin;
namespace BTCPayServer.Plugins.Breez;
public class BreezLightningConnectionStringHandler : ILightningConnectionStringHandler
{
private readonly BreezService _breezService;
public BreezLightningConnectionStringHandler(BreezService breezService)
{
_breezService = breezService;
}
public ILightningClient? Create(string connectionString, Network network, out string? error)
{
var kv = LightningConnectionStringHelper.ExtractValues(connectionString, out var type);
if (type != "breez")
{
error = null;
return null;
}
if (!kv.TryGetValue("key", out var key))
{
error = $"The key 'key' is mandatory for breez connection strings";
return null;
}
error = null;
return _breezService.GetClientByPaymentKey(key);
}
}