Documentation
¶
Overview ¶
Package lightning package seeks to provide an interoperable interface for interacting with different lightning clients (e.g. lnd, c-lightning, eclair, etc) see: https://github.com/moneysocket/py-moneysocket/tree/main/moneysocket/lightning
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lightning ¶
type Lightning interface {
// RegisterPaidRecvCb registers a PaidCallback for when an invoice is paid
RegisterPaidRecvCb(callback PaidCallback)
// GetInvoice retrieves a bolt11 invoice for a given msatAmount
GetInvoice(msatAmount int) (paymentRequest string, err error)
// PayInvoice pays a bolt11 invoice
PayInvoice(bolt11 string) (preimage []byte, msatAmount int, err error)
// RecvPaid receives a payment
RecvPaid(preimage string, msats int)
}
Lightning is an implementable interface for interacting with different lightning clients.
type Lnd ¶
type Lnd struct {
// contains filtered or unexported fields
}
Lnd is the Lightning interface for lnd.
func NewLnd ¶
NewLnd generates a new lnd client from a given config TODO use streaming for invoices.
func (*Lnd) GetInvoice ¶
GetInvoice gets an invoice (paymentRequest) fora given amount msatAmount.
func (*Lnd) PayInvoice ¶
PayInvoice sends a payment for a bolt-11 invoice.
func (*Lnd) RegisterPaidRecvCb ¶
func (l *Lnd) RegisterPaidRecvCb(callback PaidCallback)
RegisterPaidRecvCb registers the callback.
type PaidCallback ¶
PaidCallback is a function for when ln image is paid.