Class: Node::Payments

Inherits:
Object
  • Object
show all
Includes:
Lnd
Defined in:
lib/node.rb

Instance Method Summary collapse

Instance Method Details

#add_invoice(value, memo = "") ⇒ Object



29
30
31
# File 'lib/node.rb', line 29

def add_invoice(value, memo="")
  stub.add_invoice(Lnrpc::Invoice.new(value: value, memo: memo))
end

#decode_pay_req(pay_req) ⇒ Object



19
20
21
# File 'lib/node.rb', line 19

def decode_pay_req(pay_req)
  stub.decode_pay_req(Lnrpc::PayReqString.new(pay_req: pay_req))
end

#list_invoicesObject



7
8
9
10
# File 'lib/node.rb', line 7

def list_invoices
  response = stub.list_invoices(Lnrpc::ListInvoiceRequest.new())
  response.invoices
end

#list_paymentsObject



12
13
14
15
# File 'lib/node.rb', line 12

def list_payments
  response = stub.list_payments(Lnrpc::ListPaymentRequest.new())
  response.payments
end

#lookup_invoice(payment_hash) ⇒ Object



23
24
25
# File 'lib/node.rb', line 23

def lookup_invoice(payment_hash)
  stub.lookup_invoice(Lnrpc::PaymentHash.new(payment_hash))
end

#send_payment(payment_request) ⇒ Object



33
34
35
# File 'lib/node.rb', line 33

def send_payment(payment_request)
  r = stub.send_payment_sync(Lnrpc::SendRequest.new(payment_request: payment_request))
end