コード例 #1
0
        public async Task <string> AddInvoice(int amount, string memo = "")
        {
            var request = new Invoice()
            {
                Value = amount, Memo = memo
            };
            var response = await lndClient.AddInvoiceAsync(request);

            return(response.PaymentRequest);
        }
コード例 #2
0
        public async Task <string> AddInvoice(string description, long amount)
        {
            var res = await lightningClient.AddInvoiceAsync(new Invoice
            {
                Memo  = description,
                Value = amount
            });

            return(res.PaymentRequest);
        }
コード例 #3
0
        public async Task <Invoice> GetPayReq(ulong amt)
        {
            Console.WriteLine("LIGHTNINGLOG: GetPayReq " + amt);

            long fee = (long)(amt * (feePercentage / 100f));

            if (fee < 1 && feePercentage != 0)
            {
                fee = 1;
            }
            FeeEarned.Inc(fee);
            var payreq = await client.AddInvoiceAsync(new Invoice
            {
                Value = (long)amt + fee
            });

            var res = await client.LookupInvoiceAsync(new PaymentHash
            {
                RHash = payreq.RHash
            });

            return(res);
        }