lnd

package module
v0.0.0-...-36ff2a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 8 Imported by: 0

README

LND

This package provides a wrapper for LND

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddInvoiceResponse

type AddInvoiceResponse struct {
	Res *lnrpc.AddInvoiceResponse
}

AddInvoiceResponse -

type ChannelGraphListener

type ChannelGraphListener func(update *ChannelGraphUpdate, err error)

ChannelGraphListener - Callback to handle channel graph update or error

type ChannelGraphUpdate

type ChannelGraphUpdate struct {
	Update *lnrpc.GraphTopologyUpdate
}

ChannelGraphUpdate - Content of the channel graph update

type Client

type Client interface {
	Connect(
		nodeURL string,
		macaroonPath string,
		certPath string,
	) error
	//GetInfo - info of the current node
	GetInfo(
		ctx context.Context,
	) (*GetInfoResponse, error)
	//ListPeers - Peers of the current node
	ListPeers(
		ctx context.Context,
	) (*ListPeersResponse, error)
	//VerifyMessage - verify a message from a member in the network
	VerifyMessage(
		ctx context.Context,
		message string,
		sign string,
	) (*VerifyMessageResponse, error)
	//AddInvoice - Add invoice on current node
	AddInvoice(
		ctx context.Context,
		memo string,
		valueSats int64,
		fallbackAddr string,
	) (*AddInvoiceResponse, error)
	//GetNodeInfo - Get info on a remote node
	GetNodeInfo(
		ctx context.Context,
		pubkey string,
		includeChannels bool,
	) (*GetNodeInfoResponse, error)
	SubscribeGraphAsync(
		ctx context.Context,
		Listener ChannelGraphListener,
	) error
	SubscribeInvoicesAsync(
		ctx context.Context,
		Listener InvoicesListener,
	) error
	SubscribeOpenChannel(
		ctx context.Context,
		pubkey string,
		capacity int64,
		Listener OpenChannelListener,
	) error
}

Client - The client interface with all implemented requests and subs ~WIP

func NewLndClient

func NewLndClient() Client

NewLndClient - return a new LND client, call Connect after creation

type GetInfoResponse

type GetInfoResponse struct {
	Res *lnrpc.GetInfoResponse
}

GetInfoResponse - Info about current node

type GetNodeInfoResponse

type GetNodeInfoResponse struct {
	Res *lnrpc.NodeInfo
}

GetNodeInfoResponse - Info about remote node

type InvoicesListener

type InvoicesListener func(update *InvoicesUpdate, err error)

InvoicesListener - Callback to handle invoice update

type InvoicesUpdate

type InvoicesUpdate struct {
	Update *lnrpc.Invoice
}

InvoicesUpdate - Content of invoice update

type ListChannelsResponse

type ListChannelsResponse struct {
	Res *lnrpc.ListChannelsResponse
}

ListChannelsResponse - List open channels

type ListPeersResponse

type ListPeersResponse struct {
	Res *lnrpc.ListPeersResponse
}

ListPeersResponse - Info about current node's peers

type OpenChannelListener

type OpenChannelListener func(update *OpenChannelUpdate, err error)

OpenChannelListener - Callback to handle open channel update

type OpenChannelUpdate

type OpenChannelUpdate struct {
	Update *lnrpc.OpenStatusUpdate
}

OpenChannelUpdate - Content of open channel update

type VerifyMessageResponse

type VerifyMessageResponse struct {
	Res *lnrpc.VerifyMessageResponse
}

VerifyMessageResponse - Message owner if exists

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL