Documentation ¶
Index ¶
- Variables
- func RegisterLsps2Server(s lsps0.ServiceRegistrar, l Lsps2Server)
- type BuyRegistration
- type BuyRequest
- type BuyResponse
- type ChannelOpened
- type CleanupService
- type GetInfoRequest
- type GetInfoResponse
- type GetVersionsRequest
- type GetVersionsResponse
- type Interceptor
- type InterceptorConfig
- type Lsps2Server
- type Lsps2Store
- type OpeningFeeParams
- type OpeningMode
- type RegisterBuy
- type SavePromises
Constants ¶
This section is empty.
Variables ¶
View Source
var CleanupInterval time.Duration = time.Hour
The interval to clean unused promises and buy registrations.
View Source
var ErrNotFound = errors.New("not found")
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var ErrOverflow = fmt.Errorf("integer overflow detected")
View Source
var ErrScidExists = errors.New("scid exists")
View Source
var RelaxPeriod time.Duration = time.Hour * 24 * 14
The relax period is a period where expired promises may still be valid, if the current chainfees are cheaper than the fees in the promise itself. It is set to ~two weeks.
View Source
var SupportedVersion uint32 = 1
Functions ¶
func RegisterLsps2Server ¶
func RegisterLsps2Server(s lsps0.ServiceRegistrar, l Lsps2Server)
Types ¶
type BuyRegistration ¶
type BuyRegistration struct { Id uuid7.UUID LspId string PeerId string // TODO: Make peerId in the registration a byte array. Token string Scid lightning.ShortChannelID OpeningFeeParams common.OpeningFeeParams PaymentSizeMsat *uint64 Mode OpeningMode ChannelPoint *wire.OutPoint IsComplete bool }
func (*BuyRegistration) IsExpired ¶
func (b *BuyRegistration) IsExpired() bool
type BuyRequest ¶
type BuyRequest struct { Version uint32 `json:"version"` OpeningFeeParams OpeningFeeParams `json:"opening_fee_params"` PaymentSizeMsat *uint64 `json:"payment_size_msat,string,omitempty"` }
type BuyResponse ¶
type ChannelOpened ¶
type CleanupService ¶
type CleanupService struct {
// contains filtered or unexported fields
}
func NewCleanupService ¶
func NewCleanupService(store Lsps2Store) *CleanupService
func (*CleanupService) Start ¶
func (c *CleanupService) Start(ctx context.Context)
Periodically cleans up unused buy registrations and promises that have expired before the relax interval.
type GetInfoRequest ¶
type GetInfoResponse ¶
type GetInfoResponse struct { OpeningFeeParamsMenu []*OpeningFeeParams `json:"opening_fee_params_menu"` MinPaymentSizeMsat uint64 `json:"min_payment_size_msat,string"` MaxPaymentSizeMsat uint64 `json:"max_payment_size_msat,string"` }
type GetVersionsRequest ¶
type GetVersionsRequest struct { }
type GetVersionsResponse ¶
type GetVersionsResponse struct {
Versions []uint32 `json:"versions"`
}
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
func NewInterceptHandler ¶
func NewInterceptHandler( store Lsps2Store, historyStore history.Store, openingService common.OpeningService, client lightning.Client, feeEstimator chain.FeeEstimator, config *InterceptorConfig, ) *Interceptor
func (*Interceptor) Intercept ¶
func (i *Interceptor) Intercept(req common.InterceptRequest) common.InterceptResult
func (*Interceptor) Start ¶
func (i *Interceptor) Start(ctx context.Context)
type InterceptorConfig ¶
type Lsps2Server ¶
type Lsps2Server interface { GetVersions(ctx context.Context, request *GetVersionsRequest) (*GetVersionsResponse, error) GetInfo(ctx context.Context, request *GetInfoRequest) (*GetInfoResponse, error) Buy(ctx context.Context, request *BuyRequest) (*BuyResponse, error) }
func NewLsps2Server ¶
func NewLsps2Server( openingService common.OpeningService, nodesService common.NodesService, node *common.Node, store Lsps2Store, ) Lsps2Server
type Lsps2Store ¶
type Lsps2Store interface { SavePromises(ctx context.Context, req *SavePromises) error RegisterBuy(ctx context.Context, req *RegisterBuy) error GetBuyRegistration(ctx context.Context, scid lightning.ShortChannelID) (*BuyRegistration, error) SetChannelOpened(ctx context.Context, channelOpened *ChannelOpened) error SetCompleted(ctx context.Context, registrationId uuid7.UUID) error RemoveUnusedExpired(ctx context.Context, before time.Time) error }
type OpeningFeeParams ¶
type OpeningMode ¶
type OpeningMode int
const ( OpeningMode_NoMppVarInvoice OpeningMode = 1 OpeningMode_MppFixedInvoice OpeningMode = 2 )
type RegisterBuy ¶
type RegisterBuy struct { LspId string PeerId string Scid lightning.ShortChannelID OpeningFeeParams common.OpeningFeeParams PaymentSizeMsat *uint64 Mode OpeningMode }
type SavePromises ¶
type SavePromises struct { Menu []*common.OpeningFeeParams Token string }
Click to show internal directories.
Click to hide internal directories.