lnproxy

package
v0.1.1-cxl Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXPIRY_BUFFER    = 300
	FEE_BASE_MSAT    = 4000
	FEE_PPM          = 9000
	MIN_AMOUNT_MSAT  = 100000
	CLTV_DELTA_ALPHA = 3
	CLTV_DELTA_BETA  = 6
	// Should be set to the same as the node's `--max-cltv-expiry` setting (default: 2016)
	MAX_CLTV_DELTA = 2016
)

Variables

This section is empty.

Functions

func AddWrappedInvoice

func AddWrappedInvoice(p *WrappedPaymentRequest) (string, error)

func CancelWrappedInvoice

func CancelWrappedInvoice(hash []byte, wrapped_invoice string)

func Init

func Init(
	macaroonHex string,
	lndHostStr string,
	tlsCertPath string,
	invCh chan Status,
	pmntCh chan Status,
) error

func SettleWrappedInvoice

func SettleWrappedInvoice(p *WrappedPaymentRequest, paid_msat uint64, wrapped_invoice string, original_invoice string, max_fee_msat uint64)

func WatchWrappedInvoice

func WatchWrappedInvoice(p *WrappedPaymentRequest, wrapped_invoice string, original_invoice string, max_fee_msat uint64)

func Wrap

func Wrap(invoice string, max_fee_msat uint64) (string, error)

Types

type PaymentRequest

type PaymentRequest struct {
	PaymentHash     string `json:"payment_hash"`
	Timestamp       int64  `json:"timestamp,string"`
	Expiry          int64  `json:"expiry,string"`
	Description     string `json:"description"`
	DescriptionHash string `json:"description_hash"`
	NumMsat         uint64 `json:"num_msat,string"`
	CltvExpiry      int64  `json:"cltv_expiry,string"`
	Features        map[string]struct {
		Name       string `json:"name"`
		IsRequired bool   `json:"is_required"`
		IsKnown    bool   `json:"is_known"`
	} `json:"features"`
}

func DecodePaymentRequest

func DecodePaymentRequest(invoice string) (*PaymentRequest, error)

type Status

type Status struct {
	Bolt11 string
	Status string
}

type WrappedPaymentRequest

type WrappedPaymentRequest struct {
	Memo            string `json:"memo,omitempty"`
	Hash            []byte `json:"hash"`
	ValueMsat       uint64 `json:"value_msat,string"`
	DescriptionHash []byte `json:"description_hash,omitempty"`
	Expiry          int64  `json:"expiry,string"`
	CltvExpiry      int64  `json:"cltv_expiry,string"`
}

func WrapPaymentRequest

func WrapPaymentRequest(p *PaymentRequest, max_fee_msat uint64) (*WrappedPaymentRequest, error)

Jump to

Keyboard shortcuts

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