ln

package
v0.0.0-...-eb10282 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LND_CLIENT_TYPE   = "LND"
	LNURL_CLIENT_TYPE = "LNURL"
)
View Source
const MSAT_PER_SAT = 1000

Variables

This section is empty.

Functions

func DoGetRequest

func DoGetRequest(Url string) ([]byte, error)

Types

type CallbackUrlResJson

type CallbackUrlResJson struct {
	PR string `json:"pr"`
}

type DecodedPR

type DecodedPR struct {
	Currency           string `json:"currency"`
	CreatedAt          int    `json:"created_at"`
	Expiry             int    `json:"expiry"`
	Payee              string `json:"payee"`
	MSatoshi           int64  `json:"msatoshi"`
	Description        string `json:"description,omitempty"`
	DescriptionHash    string `json:"description_hash,omitempty"`
	PaymentHash        string `json:"payment_hash"`
	MinFinalCLTVExpiry int    `json:"min_final_cltv_expiry"`
}

type LNClient

type LNClient interface {
	AddInvoice(ctx context.Context, lnReq *lnrpc.Invoice, httpReq *http.Request, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error)
}

func InitLnClient

func InitLnClient(lnClientConfig *LNClientConfig) (lnClient LNClient, err error)

type LNClientConfig

type LNClientConfig struct {
	LNClientType string
	LNDConfig    LNDoptions
	LNURLConfig  LNURLoptions
	RootKey      []byte
}

type LNClientConn

type LNClientConn struct {
	LNClient LNClient
}

func (*LNClientConn) GenerateInvoice

func (lnClientConn *LNClientConn) GenerateInvoice(ctx context.Context, lnInvoice lnrpc.Invoice, httpReq *http.Request) (string, lntypes.Hash, error)

type LNDWrapper

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

func NewLNDclient

func NewLNDclient(lndOptions LNDoptions) (result *LNDWrapper, err error)

func (*LNDWrapper) AddInvoice

func (wrapper *LNDWrapper) AddInvoice(ctx context.Context, req *lnrpc.Invoice, httpReq *http.Request, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error)

type LNDoptions

type LNDoptions struct {
	Address      string
	CertFile     string
	CertHex      string
	MacaroonFile string
	MacaroonHex  string
}

type LNURLoptions

type LNURLoptions struct {
	Address string
}

type LnAddressUrlResJson

type LnAddressUrlResJson struct {
	Callback       string `json:"callback"`
	MaxSendable    uint64 `json:"maxSendable"`
	MinSendable    uint64 `json:"minSendable"`
	Metadata       string `json:"metadata"`
	CommentAllowed uint   `json:"commentAllowed"`
	Tag            string `json:"tag"`
}

func NewLNURLClient

func NewLNURLClient(lnurlOptions LNURLoptions) (*LnAddressUrlResJson, error)

func (*LnAddressUrlResJson) AddInvoice

func (lnAddressUrlResJson *LnAddressUrlResJson) AddInvoice(ctx context.Context, lnInvoice *lnrpc.Invoice, httpReq *http.Request, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error)

Jump to

Keyboard shortcuts

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