Пример #1
0
 public CLightningInvoiceListener(CLightningClient parent)
 {
     if (parent == null)
     {
         throw new ArgumentNullException(nameof(parent));
     }
     _Parent = parent;
 }
Пример #2
0
        public async Task <LightningInvoice> WaitInvoice(CancellationToken cancellation)
        {
            using (var cancellation2 = CancellationTokenSource.CreateLinkedTokenSource(cancellation, _Cts.Token))
            {
                var invoice = await _Parent.SendCommandAsync <CLightningInvoice>("waitanyinvoice", new object[] { lastInvoiceIndex }, cancellation : cancellation2.Token);

                lastInvoiceIndex = invoice.PayIndex.Value;
                return(CLightningClient.ToLightningInvoice(invoice));
            }
        }