Documentation
¶
Overview ¶
Package ln contains the Lightning Network-related code.
There should be no need to use this package when implementing a web service that uses ln-paywall.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultLNDoptions = LNDoptions{
Address: "localhost:10009",
CertFile: "tls.cert",
MacaroonFile: "invoice.macaroon",
}
DefaultLNDoptions provides default values for LNDoptions.
Functions ¶
func HashPreimage ¶
HashPreimage hashes the Base64 preimage and encodes the hash in Base64. It's the same format that's being shown by lncli listinvoices (preimage as well as hash).
Types ¶
type LNDclient ¶ added in v0.3.0
type LNDclient struct {
// contains filtered or unexported fields
}
LNDclient is an implementation of the wall.Client interface for the lnd Lightning Network node implementation.
func NewLNDclient ¶ added in v0.3.0
func NewLNDclient(lndOptions LNDoptions) (LNDclient, error)
NewLNDclient creates a new LNDclient instance.
func (LNDclient) CheckInvoice ¶ added in v0.3.0
CheckInvoice takes a Base64 encoded preimage, fetches the corresponding invoice, and checks if the invoice was settled. An error is returned if the preimage contains invalid Base64 characters or if no corresponding invoice was found. False is returned if the invoice isn't settled.
type LNDoptions ¶ added in v0.4.0
type LNDoptions struct {
// Address of your LND node, including the port.
// Optional ("localhost:10009" by default).
Address string
// Path to the "tls.cert" file that your LND node uses.
// Optional ("tls.cert" by default).
CertFile string
// Path to the "invoice.macaroon" file that your LND node uses.
// Optional ("invoice.macaroon" by default).
MacaroonFile string
}
LNDoptions are the options for the connection to the lnd node.