Documentation ¶
Index ¶
- Variables
- func NewExtraFeeRecord(feeMsat *uint64) tlv.Record
- type CombinedHandler
- type InterceptAction
- type InterceptFailureCode
- type InterceptHandler
- type InterceptRequest
- type InterceptResult
- type Node
- type NodesService
- type OpeningFeeParams
- type OpeningFeeParamsSetting
- type OpeningService
- type OpeningStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNodeNotFound = errors.New("node not found")
View Source
var ExtraFeeTlvType tlv.Type = 65536
Functions ¶
func NewExtraFeeRecord ¶
Types ¶
type CombinedHandler ¶
type CombinedHandler struct {
// contains filtered or unexported fields
}
func NewCombinedHandler ¶
func NewCombinedHandler(handlers ...InterceptHandler) *CombinedHandler
func (*CombinedHandler) Intercept ¶
func (c *CombinedHandler) Intercept(req InterceptRequest) InterceptResult
type InterceptAction ¶
type InterceptAction int
const ( INTERCEPT_RESUME InterceptAction = 0 INTERCEPT_RESUME_WITH_ONION InterceptAction = 1 INTERCEPT_FAIL_HTLC_WITH_CODE InterceptAction = 2 INTERCEPT_IGNORE InterceptAction = 3 )
type InterceptFailureCode ¶
type InterceptFailureCode uint16
var ( FAILURE_TEMPORARY_CHANNEL_FAILURE InterceptFailureCode = 0x1007 FAILURE_AMOUNT_BELOW_MINIMUM InterceptFailureCode = 0x100B FAILURE_INCORRECT_CLTV_EXPIRY InterceptFailureCode = 0x100D FAILURE_TEMPORARY_NODE_FAILURE InterceptFailureCode = 0x2002 FAILURE_UNKNOWN_NEXT_PEER InterceptFailureCode = 0x400A FAILURE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS InterceptFailureCode = 0x400F )
type InterceptHandler ¶
type InterceptHandler interface {
Intercept(req InterceptRequest) InterceptResult
}
type InterceptRequest ¶
type InterceptRequest struct { // Identifier that uniquely identifies this htlc. // For cln, that's hash of the next onion or the shared secret. Identifier string Scid lightning.ShortChannelID PaymentHash []byte IncomingAmountMsat uint64 OutgoingAmountMsat uint64 IncomingExpiry uint32 OutgoingExpiry uint32 }
func (*InterceptRequest) HtlcId ¶
func (r *InterceptRequest) HtlcId() string
func (*InterceptRequest) PaymentId ¶
func (r *InterceptRequest) PaymentId() string
func (*InterceptRequest) String ¶
func (r *InterceptRequest) String() string
type InterceptResult ¶
type InterceptResult struct { Action InterceptAction FailureCode InterceptFailureCode Destination []byte AmountMsat uint64 FeeMsat *uint64 TotalAmountMsat uint64 ChannelPoint *wire.OutPoint Scid lightning.ShortChannelID PaymentSecret []byte UseLegacyOnionBlob bool }
func (*InterceptResult) String ¶
func (r *InterceptResult) String() string
type Node ¶
type Node struct { NodeId []byte Client lightning.Client NodeConfig *config.NodeConfig PrivateKey *btcec.PrivateKey PublicKey *btcec.PublicKey EciesPrivateKey *ecies.PrivateKey EciesPublicKey *ecies.PublicKey OpenChannelReqGroup singleflight.Group Tokens []string }
type NodesService ¶
func NewNodesService ¶
func NewNodesService(nodes []*Node) (NodesService, error)
type OpeningFeeParams ¶
type OpeningFeeParamsSetting ¶
type OpeningFeeParamsSetting struct { Validity time.Duration Params *OpeningFeeParams }
type OpeningService ¶
type OpeningService interface { GetFeeParamsMenu(token string, privateKey *btcec.PrivateKey) ([]*OpeningFeeParams, error) ValidateOpeningFeeParams(params *OpeningFeeParams, publicKey *btcec.PublicKey) bool IsCurrentChainFeeCheaper(token string, params *OpeningFeeParams) bool }
func NewOpeningService ¶
func NewOpeningService( store OpeningStore, nodesService NodesService, ) OpeningService
type OpeningStore ¶
type OpeningStore interface {
GetFeeParamsSettings(token string) ([]*OpeningFeeParamsSetting, error)
}
Click to show internal directories.
Click to hide internal directories.