You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
769 B

4 years ago
require "lnrpc"
lnd = # use defaults for credentials, macaraoon and address
get_info_res = lnd.lightning.get_info
4 years ago
puts get_info_res.alias
puts lnd.lightning.wallet_balance.total_balance
4 years ago
pay_request = "lntb50u1pw9mmndpp5nvnff958pxc9eqknwntyxapjw7l5grt5e2y70cmmnu0lljfa0sdqdpsgfkx7cmtwd68yetpd5s9xct5v4kxc6t5v5s8yatz0ysxwetdcqzysxqyz5vqjkhlyn40z76gyn7dx32p9j58dftve9xrlvnqqazht7w2fdauukhyhr9y4k3ngjn8s6srglj8swk7tm70ng54wdkq47ahytpwffvaeusp500csz" # or:
lnd.router.send_payment_v2(payment_request: pay_request)
4 years ago
invoice_res = lnd.lightning.add_invoice(value: 1000, memo: 'I :heart: ruby')
4 years ago
puts invoice_res.payment_request
lnd.lightning.subscribe_invoices(settle_index: 1).each do |invoice|
puts invoice.payment_request