lnd

package
v0.0.0-...-4a24cc8 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	AddInvoice(ctx context.Context, amount, expirySeconds int64, note string) (*lnrpc.Invoice, error)
	AddHoldInvoice(ctx context.Context, amount, expirySeconds int64, note string) (*HoldInvoice, error)
	CancelHoldInvoice(ctx context.Context, hash string) error
	SettleHoldInvoice(ctx context.Context, preimage []byte) error
	LookupInvoice(ctx context.Context, paymentHash string) (*lnrpc.Invoice, error)
	SubscribeInvoice(ctx context.Context, id int64, paymentHash string) (invoicesrpc.Invoices_SubscribeSingleInvoiceClient, error)
	DecodePaymentRequest(ctx context.Context, request string) (*lnrpc.PayReq, error)
	SendPaymentSync(ctx context.Context, payReq string, amount int64) (*lnrpc.SendResponse, error)
}

func New

func New() (Client, error)

New returns a grpc client which connects to LND's rpc server.

type HoldInvoice

type HoldInvoice struct {
	Preimage []byte
	PayHash  string
	PayReq   string
}

type MockLND

type MockLND struct {
	Client
}

func (*MockLND) AddHoldInvoice

func (m *MockLND) AddHoldInvoice(ctx context.Context, amount, expirySeconds int64, note string) (*HoldInvoice, error)

func (*MockLND) AddInvoice

func (m *MockLND) AddInvoice(ctx context.Context, amount, expirySeconds int64, note string) (*lnrpc.Invoice, error)

func (*MockLND) DecodePaymentRequest

func (m *MockLND) DecodePaymentRequest(ctx context.Context, request string) (*lnrpc.PayReq, error)

func (*MockLND) SubscribeInvoice

func (m *MockLND) SubscribeInvoice(ctx context.Context, id int64, paymentHash string) (invoicesrpc.Invoices_SubscribeSingleInvoiceClient, error)

Jump to

Keyboard shortcuts

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