lightning

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LND_HOST          = "LND_REST_HOST"
	LND_CERT_PATH     = "LND_CERT_PATH"
	LND_MACAROON_PATH = "LND_MACAROON_PATH"
)
View Source
const (
	InvoiceExpiryMins = 10
	FeePercent        = 1
)
View Source
const (
	LND = "Lnd"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	CreateInvoice(amount uint64) (Invoice, error)
	InvoiceSettled(hash string) bool
	FeeReserve(request string) (uint64, uint64, error)
	SendPayment(request string) (string, error)
}

Client interface to interact with a Lightning backend

func NewLightningClient

func NewLightningClient() Client

type Invoice

type Invoice struct {
	Id             string // random id generated by mint
	PaymentRequest string
	PaymentHash    string
	Settled        bool
	Redeemed       bool
	Amount         uint64
	Expiry         int64 // in unix timestamp
}

type LndClient

type LndClient struct {
	// contains filtered or unexported fields
}

func CreateLndClient

func CreateLndClient() (*LndClient, error)

func (*LndClient) CreateInvoice

func (lnd *LndClient) CreateInvoice(amount uint64) (Invoice, error)

func (*LndClient) FeeReserve

func (lnd *LndClient) FeeReserve(request string) (uint64, uint64, error)

func (*LndClient) InvoiceSettled

func (lnd *LndClient) InvoiceSettled(hash string) bool

func (*LndClient) SendPayment

func (lnd *LndClient) SendPayment(request string) (string, error)

Jump to

Keyboard shortcuts

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