-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathILightningClient.cs
46 lines (41 loc) · 1.65 KB
/
ILightningClient.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Threading.Tasks;
namespace LightningPay
{
/// <summary>
/// Every clients of the LightningPay package implements the interface ILightningClient
/// </summary>
public interface ILightningClient : IDisposable
{
/// <summary>Checks the connectivity.</summary>
/// <returns>
/// True of the connectivity is ok, false otherwise
/// </returns>
Task<CheckConnectivityResponse> CheckConnectivity();
/// <summary>Gets the node / wallet balance.</summary>
/// <returns>
/// Balance
/// </returns>
Task<Money> GetBalance();
/// <summary>Creates the invoice.</summary>
/// <param name="amount">The amount to receive.</param>
/// <param name="description">The description will be appears in the invoice.</param>
/// <param name="options">Invoice creation options.</param>
/// <returns>
/// The lightning invoice just created
/// </returns>
Task<LightningInvoice> CreateInvoice(Money amount, string description, CreateInvoiceOptions options = null);
/// <summary>Checks the payment of an invoice.</summary>
/// <param name="invoiceId">The invoice identifier.</param>
/// <returns>
/// True of the invoice is paid, false otherwise
/// </returns>
Task<bool> CheckPayment(string invoiceId);
/// <summary>Pay.</summary>
/// <param name="paymentRequest">The payment request (aka bolt11).</param>
/// <returns>
/// PaymentResponse
/// </returns>
Task<PaymentResponse> Pay(string paymentRequest);
}
}