Documentation ¶
Index ¶
- Constants
- func CreateFakeInvoice(amount uint64, failPayment bool) (string, string, string, error)
- type Client
- type FakeBackend
- func (fb *FakeBackend) ConnectionStatus() error
- func (fb *FakeBackend) CreateInvoice(amount uint64) (Invoice, error)
- func (fb *FakeBackend) FeeReserve(amount uint64) uint64
- func (fb *FakeBackend) InvoiceStatus(hash string) (Invoice, error)
- func (fb *FakeBackend) OutgoingPaymentStatus(ctx context.Context, hash string) (PaymentStatus, error)
- func (fb *FakeBackend) PayPartialAmount(ctx context.Context, request string, amountMsat, maxFee uint64) (PaymentStatus, error)
- func (fb *FakeBackend) SendPayment(ctx context.Context, request string, maxFee uint64) (PaymentStatus, error)
- func (fb *FakeBackend) SetInvoiceStatus(hash string, status State)
- func (fb *FakeBackend) SubscribeInvoice(paymentHash string) (InvoiceSubscriptionClient, error)
- type FakeBackendInvoice
- type FakeInvoiceSub
- type Invoice
- type InvoiceSubscriptionClient
- type LndClient
- func (lnd *LndClient) ConnectionStatus() error
- func (lnd *LndClient) CreateInvoice(amount uint64) (Invoice, error)
- func (lnd *LndClient) FeeReserve(amount uint64) uint64
- func (lnd *LndClient) InvoiceStatus(hash string) (Invoice, error)
- func (lnd *LndClient) OutgoingPaymentStatus(ctx context.Context, hash string) (PaymentStatus, error)
- func (lnd *LndClient) PayPartialAmount(ctx context.Context, request string, amountMsat uint64, maxFee uint64) (PaymentStatus, error)
- func (lnd *LndClient) SendPayment(ctx context.Context, request string, maxFee uint64) (PaymentStatus, error)
- func (lnd *LndClient) SubscribeInvoice(paymentHash string) (InvoiceSubscriptionClient, error)
- type LndConfig
- type LndInvoiceSub
- type PaymentStatus
- type State
Constants ¶
View Source
const ( FakePreimage = "0000000000000000" FailPaymentDescription = "fail the payment" )
View Source
const ( // 1 hour InvoiceExpiryTime = 3600 FeePercent float64 = 0.01 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { ConnectionStatus() error CreateInvoice(amount uint64) (Invoice, error) InvoiceStatus(hash string) (Invoice, error) SendPayment(ctx context.Context, request string, maxFee uint64) (PaymentStatus, error) PayPartialAmount(ctx context.Context, request string, amountMsat uint64, maxFee uint64) (PaymentStatus, error) OutgoingPaymentStatus(ctx context.Context, hash string) (PaymentStatus, error) FeeReserve(amount uint64) uint64 SubscribeInvoice(paymentHash string) (InvoiceSubscriptionClient, error) }
Client interface to interact with a Lightning backend
type FakeBackend ¶ added in v0.3.0
type FakeBackend struct { Invoices []FakeBackendInvoice PaymentDelay int64 }
func (*FakeBackend) ConnectionStatus ¶ added in v0.3.0
func (fb *FakeBackend) ConnectionStatus() error
func (*FakeBackend) CreateInvoice ¶ added in v0.3.0
func (fb *FakeBackend) CreateInvoice(amount uint64) (Invoice, error)
func (*FakeBackend) FeeReserve ¶ added in v0.3.0
func (fb *FakeBackend) FeeReserve(amount uint64) uint64
func (*FakeBackend) InvoiceStatus ¶ added in v0.3.0
func (fb *FakeBackend) InvoiceStatus(hash string) (Invoice, error)
func (*FakeBackend) OutgoingPaymentStatus ¶ added in v0.3.0
func (fb *FakeBackend) OutgoingPaymentStatus(ctx context.Context, hash string) (PaymentStatus, error)
func (*FakeBackend) PayPartialAmount ¶ added in v0.4.0
func (fb *FakeBackend) PayPartialAmount(ctx context.Context, request string, amountMsat, maxFee uint64) (PaymentStatus, error)
func (*FakeBackend) SendPayment ¶ added in v0.3.0
func (fb *FakeBackend) SendPayment(ctx context.Context, request string, maxFee uint64) (PaymentStatus, error)
func (*FakeBackend) SetInvoiceStatus ¶ added in v0.4.0
func (fb *FakeBackend) SetInvoiceStatus(hash string, status State)
func (*FakeBackend) SubscribeInvoice ¶ added in v0.4.0
func (fb *FakeBackend) SubscribeInvoice(paymentHash string) (InvoiceSubscriptionClient, error)
type FakeBackendInvoice ¶ added in v0.4.0
type FakeBackendInvoice struct { PaymentRequest string PaymentHash string Preimage string Status State Amount uint64 }
func (*FakeBackendInvoice) ToInvoice ¶ added in v0.4.0
func (i *FakeBackendInvoice) ToInvoice() Invoice
type FakeInvoiceSub ¶ added in v0.4.0
type FakeInvoiceSub struct {
// contains filtered or unexported fields
}
func (*FakeInvoiceSub) Recv ¶ added in v0.4.0
func (fakeSub *FakeInvoiceSub) Recv() (Invoice, error)
type InvoiceSubscriptionClient ¶ added in v0.4.0
type InvoiceSubscriptionClient interface { // This blocks until there is an update Recv() (Invoice, error) }
InvoiceSubscriptionClient subscribes to get updates on the status of an invoice
type LndClient ¶
type LndClient struct {
// contains filtered or unexported fields
}
func SetupLndClient ¶ added in v0.2.0
func (*LndClient) ConnectionStatus ¶ added in v0.3.0
func (*LndClient) CreateInvoice ¶
func (*LndClient) FeeReserve ¶
func (*LndClient) InvoiceStatus ¶ added in v0.2.0
func (*LndClient) OutgoingPaymentStatus ¶ added in v0.3.0
func (*LndClient) PayPartialAmount ¶ added in v0.4.0
func (*LndClient) SendPayment ¶
func (*LndClient) SubscribeInvoice ¶ added in v0.4.0
func (lnd *LndClient) SubscribeInvoice(paymentHash string) (InvoiceSubscriptionClient, error)
type LndConfig ¶ added in v0.2.0
type LndConfig struct { GRPCHost string Cert credentials.TransportCredentials Macaroon macaroons.MacaroonCredential }
type LndInvoiceSub ¶ added in v0.4.0
type LndInvoiceSub struct {
// contains filtered or unexported fields
}
func (*LndInvoiceSub) Recv ¶ added in v0.4.0
func (lndSub *LndInvoiceSub) Recv() (Invoice, error)
type PaymentStatus ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.