Class: BtcPay::Client::Api::LightningNode

Inherits:
Base
  • Object
show all
Defined in:
lib/btcpay/client/api/lightning_node.rb

Constant Summary collapse

PATH =
'/server/lightning/'

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from BtcPay::Client::Service

Instance Method Details

#channels(crypto_code, **opts) ⇒ Object Also known as: get_channels



20
21
22
# File 'lib/btcpay/client/api/lightning_node.rb', line 20

def channels(crypto_code, **opts)
  client.get(path(crypto_code, 'channels'), options: opts)
end

#connect(crypto_code, payload, **opts) ⇒ Object



15
16
17
# File 'lib/btcpay/client/api/lightning_node.rb', line 15

def connect(crypto_code, payload, **opts)
  client.post(path(crypto_code, 'connect'), payload: payload, options: opts)
end

#create_invoice(crypto_code, payload, **opts) ⇒ Object



55
56
57
# File 'lib/btcpay/client/api/lightning_node.rb', line 55

def create_invoice(crypto_code, payload, **opts)
  client.post(path(crypto_code, 'invoices'), payload: payload, options: opts)
end

#deposit_address(crypto_code, payload, **opts) ⇒ Object Also known as: address



34
35
36
# File 'lib/btcpay/client/api/lightning_node.rb', line 34

def deposit_address(crypto_code, payload, **opts)
  client.post(path(crypto_code, 'address'), payload: payload, options: opts)
end

#info(crypto_code, **opts) ⇒ Object



10
11
12
# File 'lib/btcpay/client/api/lightning_node.rb', line 10

def info(crypto_code, **opts)
  client.get(path(crypto_code, 'info'), options: opts)
end

#invoice(crypto_code, invoice_id, **opts) ⇒ Object Also known as: get_invoice



41
42
43
# File 'lib/btcpay/client/api/lightning_node.rb', line 41

def invoice(crypto_code, invoice_id, **opts)
  client.get(path(crypto_code, 'invoices', invoice_id), options: opts)
end

#open(crypto_code, payload, **opts) ⇒ Object Also known as: open_channels



27
28
29
# File 'lib/btcpay/client/api/lightning_node.rb', line 27

def open(crypto_code, payload, **opts)
  client.post(path(crypto_code, 'channels'), payload: payload, options: opts)
end

#pay(crypto_code, payload, **opts) ⇒ Object Also known as: pay_invoice



48
49
50
# File 'lib/btcpay/client/api/lightning_node.rb', line 48

def pay(crypto_code, payload, **opts)
  client.post(path(crypto_code, 'invoices', 'pay'), payload: payload, options: opts)
end