Documentation ¶
Index ¶
- func UseLogger(logger logging.Logger)
- type Backend
- type LND
- func (lnd *LND) Connect() error
- func (lnd *LND) GetInvoice(message string, amount int64, expiry int64) (invoice string, rHash string, err error)
- func (lnd *LND) InvoiceSettled(rHash string) (settled bool, err error)
- func (lnd *LND) KeepAliveRequest() error
- func (lnd *LND) SubscribeInvoices(publish PublishInvoiceSettled, rescan RescanPendingInvoices) error
- type PublishInvoiceSettled
- type RescanPendingInvoices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface { Connect() error // The amount is denominated in satoshis and the expiry in seconds GetInvoice(description string, amount int64, expiry int64) (invoice string, rHash string, err error) InvoiceSettled(rHash string) (settled bool, err error) SubscribeInvoices(publish PublishInvoiceSettled, rescan RescanPendingInvoices) error KeepAliveRequest() error }
Backend is an interface that would allow for different implementations of Lightning to be used as backend
type LND ¶
type LND struct { GRPCHost string `long:"grpchost" Description:"Host of the gRPC interface of LND"` CertFile string `long:"certfile" Description:"TLS certificate for the LND gRPC and REST services"` MacaroonFile string `long:"macaroonfile" Description:"Macaroon file for authentication. Set to an empty string for no macaroon"` // contains filtered or unexported fields }
LND contains all values needed to be able to connect to a node
func (*LND) GetInvoice ¶
func (lnd *LND) GetInvoice(message string, amount int64, expiry int64) (invoice string, rHash string, err error)
GetInvoice gets and invoice from a node
func (*LND) InvoiceSettled ¶
InvoiceSettled checks if an invoice is settled by looking it up
func (*LND) KeepAliveRequest ¶
KeepAliveRequest is a dummy request to make sure the connection to LND doesn't time out if LND and LightningTip are separated with a firewall
func (*LND) SubscribeInvoices ¶
func (lnd *LND) SubscribeInvoices(publish PublishInvoiceSettled, rescan RescanPendingInvoices) error
SubscribeInvoices subscribe to the invoice events of LND and calls a callback when one is settled
type PublishInvoiceSettled ¶
type PublishInvoiceSettled func(invoice string)
PublishInvoiceSettled is a callback for a settled invoice
type RescanPendingInvoices ¶
type RescanPendingInvoices func()
RescanPendingInvoices is a callbacks when reconnecting
Click to show internal directories.
Click to hide internal directories.