Documentation ¶
Index ¶
- Constants
- Variables
- func CreateMockInvoice(amountSats int64, description string, network chaincfg.Params, expiry int64) (string, error)
- func GetAverageRouteFee(routes []*lnrpc.Route) uint64
- type Backend
- type CLNGRPCWallet
- func (f CLNGRPCWallet) ActiveMPP() bool
- func (l CLNGRPCWallet) CheckPayed(quote string) (PaymentStatus, string, error)
- func (f CLNGRPCWallet) GetNetwork() *chaincfg.Params
- func (f CLNGRPCWallet) LightningType() Backend
- func (l CLNGRPCWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, ...) (PaymentResponse, error)
- func (l CLNGRPCWallet) QueryFees(invoice string, zpayInvoice *zpay32.Invoice, mpp bool, amount_sat uint64) (uint64, error)
- func (l CLNGRPCWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
- func (l *CLNGRPCWallet) SetupGrpc(host string, caCert string, clientCert string, clientKey string, ...) error
- func (l CLNGRPCWallet) WalletBalance() (uint64, error)
- type FakeWallet
- func (f FakeWallet) ActiveMPP() bool
- func (f FakeWallet) CheckPayed(quote string) (PaymentStatus, string, error)
- func (f FakeWallet) GetNetwork() *chaincfg.Params
- func (f FakeWallet) LightningType() Backend
- func (f FakeWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, ...) (PaymentResponse, error)
- func (f FakeWallet) QueryFees(invoice string, zpayInvoice *zpay32.Invoice, mpp bool, amount_sat uint64) (uint64, error)
- func (f FakeWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
- func (f FakeWallet) WalletBalance() (uint64, error)
- type FakeWalletError
- type InvoiceResponse
- type LNBitsDetailErrorData
- type LNBitsPaymentStatus
- type LNBitsPaymentStatusDetail
- type LightningBackend
- type LnbitsWallet
- func (f LnbitsWallet) ActiveMPP() bool
- func (l LnbitsWallet) CheckPayed(quote string) (PaymentStatus, string, error)
- func (f LnbitsWallet) GetNetwork() *chaincfg.Params
- func (f LnbitsWallet) LightningType() Backend
- func (l *LnbitsWallet) LnbitsRequest(method string, endpoint string, reqBody any, responseType any) error
- func (l LnbitsWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, ...) (PaymentResponse, error)
- func (l LnbitsWallet) QueryFees(invoice string, zpayInvoice *zpay32.Invoice, mpp bool, amount_sat uint64) (uint64, error)
- func (l LnbitsWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
- func (l LnbitsWallet) WalletBalance() (uint64, error)
- type LndGrpcWallet
- func (f LndGrpcWallet) ActiveMPP() bool
- func (l LndGrpcWallet) CheckPayed(quote string) (PaymentStatus, string, error)
- func (f LndGrpcWallet) GetNetwork() *chaincfg.Params
- func (f LndGrpcWallet) LightningType() Backend
- func (l LndGrpcWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, ...) (PaymentResponse, error)
- func (l LndGrpcWallet) QueryFees(invoice string, zpayInvoice *zpay32.Invoice, mpp bool, amount_sat uint64) (uint64, error)
- func (l LndGrpcWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
- func (l *LndGrpcWallet) SetupGrpc(host string, macaroon string, tlsCrt string) error
- func (l LndGrpcWallet) WalletBalance() (uint64, error)
- type PaymentResponse
- type PaymentStatus
Constants ¶
View Source
const ( NONE = 0 FailPaymentPending = iota + 1 FailPaymentFailed = iota + 2 FailPaymentUnknown = iota + 3 FailQueryPending = iota + 4 FailQueryFailed = iota + 5 FailQueryUnknown = iota + 6 )
View Source
const ( MAINNET = "mainnet" REGTEST = "regtest" TESTNET = "testnet" SIGNET = "signet" )
Variables ¶
View Source
var (
ErrAlreadyPaid = errors.New("Invoice already paid")
)
View Source
var ErrLnbitsFailedPayment = errors.New("failed payment")
Functions ¶
func CreateMockInvoice ¶
func GetAverageRouteFee ¶
Types ¶
type CLNGRPCWallet ¶
func (CLNGRPCWallet) ActiveMPP ¶
func (f CLNGRPCWallet) ActiveMPP() bool
func (CLNGRPCWallet) CheckPayed ¶
func (l CLNGRPCWallet) CheckPayed(quote string) (PaymentStatus, string, error)
func (CLNGRPCWallet) GetNetwork ¶
func (f CLNGRPCWallet) GetNetwork() *chaincfg.Params
func (CLNGRPCWallet) LightningType ¶
func (f CLNGRPCWallet) LightningType() Backend
func (CLNGRPCWallet) PayInvoice ¶
func (l CLNGRPCWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, amount_sat uint64) (PaymentResponse, error)
func (CLNGRPCWallet) RequestInvoice ¶
func (l CLNGRPCWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
func (CLNGRPCWallet) WalletBalance ¶
func (l CLNGRPCWallet) WalletBalance() (uint64, error)
type FakeWallet ¶
type FakeWallet struct { Network chaincfg.Params UnpurposeErrors []FakeWalletError }
func (FakeWallet) ActiveMPP ¶
func (f FakeWallet) ActiveMPP() bool
func (FakeWallet) CheckPayed ¶
func (f FakeWallet) CheckPayed(quote string) (PaymentStatus, string, error)
func (FakeWallet) GetNetwork ¶
func (f FakeWallet) GetNetwork() *chaincfg.Params
func (FakeWallet) LightningType ¶
func (f FakeWallet) LightningType() Backend
func (FakeWallet) PayInvoice ¶
func (f FakeWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, amount_sat uint64) (PaymentResponse, error)
func (FakeWallet) RequestInvoice ¶
func (f FakeWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
func (FakeWallet) WalletBalance ¶
func (f FakeWallet) WalletBalance() (uint64, error)
type FakeWalletError ¶
type FakeWalletError int
type InvoiceResponse ¶
type LNBitsDetailErrorData ¶
type LNBitsPaymentStatus ¶
type LNBitsPaymentStatus struct { Paid bool `json:"paid"` Pending bool `json:"pending"` Preimage string `json:"preimage"` Details LNBitsPaymentStatusDetail }
type LightningBackend ¶
type LightningBackend interface { PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, amount_sat uint64) (PaymentResponse, error) CheckPayed(quote string) (PaymentStatus, string, error) QueryFees(invoice string, zpayInvoice *zpay32.Invoice, mpp bool, amount_sat uint64) (uint64, error) RequestInvoice(amount int64) (InvoiceResponse, error) WalletBalance() (uint64, error) LightningType() Backend GetNetwork() *chaincfg.Params ActiveMPP() bool }
type LnbitsWallet ¶
func (LnbitsWallet) ActiveMPP ¶
func (f LnbitsWallet) ActiveMPP() bool
func (LnbitsWallet) CheckPayed ¶
func (l LnbitsWallet) CheckPayed(quote string) (PaymentStatus, string, error)
func (LnbitsWallet) GetNetwork ¶
func (f LnbitsWallet) GetNetwork() *chaincfg.Params
func (LnbitsWallet) LightningType ¶
func (f LnbitsWallet) LightningType() Backend
func (*LnbitsWallet) LnbitsRequest ¶
func (LnbitsWallet) PayInvoice ¶
func (l LnbitsWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, amount_sat uint64) (PaymentResponse, error)
func (LnbitsWallet) RequestInvoice ¶
func (l LnbitsWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
func (LnbitsWallet) WalletBalance ¶
func (l LnbitsWallet) WalletBalance() (uint64, error)
type LndGrpcWallet ¶
func (LndGrpcWallet) ActiveMPP ¶
func (f LndGrpcWallet) ActiveMPP() bool
func (LndGrpcWallet) CheckPayed ¶
func (l LndGrpcWallet) CheckPayed(quote string) (PaymentStatus, string, error)
func (LndGrpcWallet) GetNetwork ¶
func (f LndGrpcWallet) GetNetwork() *chaincfg.Params
func (LndGrpcWallet) LightningType ¶
func (f LndGrpcWallet) LightningType() Backend
func (LndGrpcWallet) PayInvoice ¶
func (l LndGrpcWallet) PayInvoice(invoice string, zpayInvoice *zpay32.Invoice, feeReserve uint64, mpp bool, amount_sat uint64) (PaymentResponse, error)
func (LndGrpcWallet) RequestInvoice ¶
func (l LndGrpcWallet) RequestInvoice(amount int64) (InvoiceResponse, error)
func (*LndGrpcWallet) SetupGrpc ¶
func (l *LndGrpcWallet) SetupGrpc(host string, macaroon string, tlsCrt string) error
func (LndGrpcWallet) WalletBalance ¶
func (l LndGrpcWallet) WalletBalance() (uint64, error)
type PaymentResponse ¶
type PaymentResponse struct { Preimage string PaymentRequest string PaymentState PaymentStatus Rhash string PaidFeeSat int64 }
type PaymentStatus ¶
type PaymentStatus uint
const FAILED PaymentStatus = iota + 2
const PENDING PaymentStatus = iota + 3
const SETTLED PaymentStatus = iota + 1
const UNKNOWN PaymentStatus = iota + 999
Source Files ¶
Click to show internal directories.
Click to hide internal directories.