Skip to content

Commit 53468fd

Browse files
committed
Add ILnBotClient interface and implement it
Introduce ILnBotClient to expose strongly-typed API resources (Wallets, Invoices, Payments, Addresses, Transactions, Webhooks, Keys, Events, Backup, Restore) and document DI registration. Update LnBotClient to implement ILnBotClient (replacing the direct IDisposable declaration) so consumers can depend on the interface.
1 parent 0441448 commit 53468fd

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

src/LnBot/ILnBotClient.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using LnBot.Resources;
2+
3+
namespace LnBot;
4+
5+
/// <summary>
6+
/// Interface for the LnBot API client. Register in DI as a singleton or scoped service.
7+
/// </summary>
8+
public interface ILnBotClient : IDisposable
9+
{
10+
/// <summary>Wallet management.</summary>
11+
WalletsResource Wallets { get; }
12+
13+
/// <summary>Create and query invoices.</summary>
14+
InvoicesResource Invoices { get; }
15+
16+
/// <summary>Send payments.</summary>
17+
PaymentsResource Payments { get; }
18+
19+
/// <summary>Lightning address management.</summary>
20+
AddressesResource Addresses { get; }
21+
22+
/// <summary>Transaction history.</summary>
23+
TransactionsResource Transactions { get; }
24+
25+
/// <summary>Webhook endpoints.</summary>
26+
WebhooksResource Webhooks { get; }
27+
28+
/// <summary>API key management.</summary>
29+
KeysResource Keys { get; }
30+
31+
/// <summary>Real-time event stream.</summary>
32+
EventsResource Events { get; }
33+
34+
/// <summary>Backup wallet access.</summary>
35+
BackupResource Backup { get; }
36+
37+
/// <summary>Restore wallet access.</summary>
38+
RestoreResource Restore { get; }
39+
}

src/LnBot/LnBotClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace LnBot;
1010
/// <summary>
1111
/// The official .NET client for the LnBot API.
1212
/// </summary>
13-
public sealed class LnBotClient : IDisposable
13+
public sealed class LnBotClient : ILnBotClient
1414
{
1515
internal const string Version = "0.4.0";
1616
internal static readonly string DefaultBaseUrl = "https://api.ln.bot";

0 commit comments

Comments
 (0)