Versions in this module Expand all Collapse all v1 v1.0.0 Jan 26, 2023 Changes in this version + const DefaultGracePeriodWithoutSubscribers + const DefaultHtlcHoldDuration + var ErrAutoSettling = errors.New("lnmux is in auto-settle mode") + var ErrEmptyHTLCSet = errors.New("cannot settle/accept empty HTLC set") + var ErrInvoiceAlreadyCanceled = errors.New("invoice already canceled") + var ErrInvoiceAmountTooLow = errors.New("paid amount less than invoice amount") + var ErrInvoiceCannotAccept = errors.New("cannot accept invoice") + var ErrInvoiceCannotOpen = errors.New("cannot move invoice to open") + var ErrInvoiceExpiryTooSoon = errors.New("invoice expiry too soon") + var ErrInvoicePreimageMismatch = errors.New("preimage does not match") + var ErrSettleRequested = errors.New("invoice settle already requested") + var ErrShuttingDown = errors.New("invoice registry shutting down") + type AcceptCallback func(lntypes.Hash, SetID) + type FailResolutionResult uint8 + const ResultAcceptTimeout + const ResultAddressMismatch + const ResultCannotSettle + const ResultExpiryTooSoon + const ResultHtlcInvoiceTypeMismatch + const ResultHtlcSetOverpayment + const ResultHtlcSetTotalMismatch + const ResultHtlcSetTotalTooLow + const ResultInvoiceExpired + const ResultInvoiceNotFound + const ResultInvoiceNotOpen + const ResultMppTimeout + const ResultNoAcceptSubscriber + func (f FailResolutionResult) FailureString() string + func (f FailResolutionResult) String() string + type HtlcFailResolution struct + Outcome FailResolutionResult + func NewFailResolution(outcome FailResolutionResult) *HtlcFailResolution + type HtlcResolution interface + type HtlcSettleResolution struct + Outcome SettleResolutionResult + Preimage lntypes.Preimage + func NewSettleResolution(preimage lntypes.Preimage, outcome SettleResolutionResult) *HtlcSettleResolution + type Invoice struct + CreationDate time.Time + PaymentRequest string + SettleDate time.Time + Settled bool + type InvoiceCallback func(update InvoiceUpdate) + type InvoiceCreator struct + func NewInvoiceCreator(cfg *InvoiceCreatorConfig) (*InvoiceCreator, error) + func (c *InvoiceCreator) Create(amtMSat int64, expiry time.Duration, memo string, descHash *lntypes.Hash, ...) (*Invoice, lntypes.Preimage, error) + func (c *InvoiceCreator) Network() *chaincfg.Params + func (c *InvoiceCreator) NodePubKeys() []*btcec.PublicKey + func (c *InvoiceCreator) PubKey() *btcec.PublicKey + type InvoiceCreatorConfig struct + ActiveNetParams *chaincfg.Params + GwPubKeys []common.PubKey + KeyRing keychain.SecretKeyRing + RoutingPolicy RoutingPolicy + type InvoiceRegistry struct + func NewRegistry(cdb *persistence.PostgresPersister, cfg *RegistryConfig) *InvoiceRegistry + func (i *InvoiceRegistry) AutoSettle() bool + func (i *InvoiceRegistry) CancelInvoice(hash lntypes.Hash, setID SetID) error + func (i *InvoiceRegistry) NotifyExitHopHtlc(h *registryHtlc) + func (i *InvoiceRegistry) RequestSettle(hash lntypes.Hash, setID SetID) error + func (i *InvoiceRegistry) Run(ctx context.Context) error + func (i *InvoiceRegistry) SubscribeAccept(callback AcceptCallback) (func(), error) + type InvoiceUpdate struct + State persistence.InvoiceState + type KeyRing struct + func NewKeyRing(key [32]byte) *KeyRing + func (b *KeyRing) DeriveKey(keyLoc keychain.KeyLocator) (keychain.KeyDescriptor, error) + func (b *KeyRing) DeriveNextKey(keyFam keychain.KeyFamily) (keychain.KeyDescriptor, error) + func (b *KeyRing) DerivePrivKey(keyDesc keychain.KeyDescriptor) (*btcec.PrivateKey, error) + func (b *KeyRing) ECDH(keyDesc keychain.KeyDescriptor, pub *btcec.PublicKey) ([32]byte, error) + func (b *KeyRing) SignMessage(keyLoc keychain.KeyLocator, msg []byte, doubleHash bool) (*ecdsa.Signature, error) + func (b *KeyRing) SignMessageCompact(keyLoc keychain.KeyLocator, msg []byte, doubleHash bool) ([]byte, error) + type Mux struct + func New(cfg *MuxConfig) (*Mux, error) + func (p *Mux) ProcessHtlc(htlc *interceptedHtlc, height int) error + func (p *Mux) Run(mainCtx context.Context) error + type MuxConfig struct + ActiveNetParams *chaincfg.Params + KeyRing keychain.SecretKeyRing + Lnd lnd.LndClient + Logger *zap.SugaredLogger + Registry *InvoiceRegistry + RoutingPolicy RoutingPolicy + SettledHandler *SettledHandler + type Payload interface + MultiPath func() *record.MPP + type RegistryConfig struct + AcceptTimeout time.Duration + AutoSettle bool + Clock clock.Clock + FinalCltvRejectDelta int32 + GracePeriodWithoutSubscribers time.Duration + HtlcHoldDuration time.Duration + Logger *zap.SugaredLogger + PrivKey [32]byte + type RoutingPolicy struct + CltvDelta int64 + FeeBaseMsat int64 + FeeRatePpm int64 + type SetID [32]byte + func (s SetID) String() string + type SettleResolutionResult uint8 + const ResultReplayToSettled + const ResultSettled + func (s SettleResolutionResult) String() string + type SettledHandler struct + func NewSettledHandler(cfg *SettledHandlerConfig) *SettledHandler + func (p *SettledHandler) WaitForInvoiceSettled(ctx context.Context, hash lntypes.Hash) error + type SettledHandlerConfig struct + Logger *zap.SugaredLogger + Persister *persistence.PostgresPersister