sqlc

package
v1.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddV1ChannelProofParams added in v1.0.11

type AddV1ChannelProofParams struct {
	Scid              []byte
	Node1Signature    []byte
	Node2Signature    []byte
	Bitcoin1Signature []byte
	Bitcoin2Signature []byte
}

type AddV2ChannelProofParams added in v1.0.13

type AddV2ChannelProofParams struct {
	Scid      []byte
	Signature []byte
}

type AmpSubInvoice

type AmpSubInvoice struct {
	SetID       []byte
	State       int16
	CreatedAt   time.Time
	SettledAt   sql.NullTime
	SettleIndex sql.NullInt64
	InvoiceID   int64
}

type AmpSubInvoiceHtlc

type AmpSubInvoiceHtlc struct {
	InvoiceID  int64
	SetID      []byte
	HtlcID     int64
	RootShare  []byte
	ChildIndex int64
	Hash       []byte
	Preimage   []byte
}

type ChainParam added in v1.0.13

type ChainParam struct {
	SingleRow bool
	Network   string
}

type ChannelAndNodeIDs added in v1.0.11

type ChannelAndNodeIDs interface {
	// Channel returns the GraphChannel associated with this interface.
	Channel() GraphChannel

	// Node1Pub returns the public key of the first node as a byte slice.
	Node1Pub() []byte

	// Node2Pub returns the public key of the second node as a byte slice.
	Node2Pub() []byte
}

ChannelAndNodeIDs is an interface that provides access to a channel and its two node public keys.

type ChannelAndNodes added in v1.0.11

type ChannelAndNodes interface {
	// Channel returns the GraphChannel associated with this interface.
	Channel() GraphChannel

	// Node1 returns the first GraphNode associated with this channel.
	Node1() GraphNode

	// Node2 returns the second GraphNode associated with this channel.
	Node2() GraphNode
}

ChannelAndNodes is an interface that provides access to a channel and its two nodes.

type CreateChannelParams added in v1.0.10

type CreateChannelParams struct {
	Version           int16
	Scid              []byte
	NodeID1           int64
	NodeID2           int64
	Outpoint          string
	Capacity          sql.NullInt64
	BitcoinKey1       []byte
	BitcoinKey2       []byte
	Node1Signature    []byte
	Node2Signature    []byte
	Bitcoin1Signature []byte
	Bitcoin2Signature []byte
	Signature         []byte
	FundingPkScript   []byte
	MerkleRootHash    []byte
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteExtraNodeTypeParams added in v1.0.10

type DeleteExtraNodeTypeParams struct {
	NodeID int64
	Type   int64
}

type DeleteInvoiceParams

type DeleteInvoiceParams struct {
	AddIndex    sql.NullInt64
	Hash        []byte
	SettleIndex sql.NullInt64
	PaymentAddr []byte
}

type DeleteNodeByPubKeyParams added in v1.0.10

type DeleteNodeByPubKeyParams struct {
	PubKey  []byte
	Version int16
}

type DeleteNodeFeatureParams added in v1.0.10

type DeleteNodeFeatureParams struct {
	NodeID     int64
	FeatureBit int32
}

type DeletePruneLogEntriesInRangeParams added in v1.0.11

type DeletePruneLogEntriesInRangeParams struct {
	StartHeight int64
	EndHeight   int64
}

type DeleteZombieChannelParams added in v1.0.11

type DeleteZombieChannelParams struct {
	Scid    []byte
	Version int16
}

type FailAttemptParams added in v1.0.13

type FailAttemptParams struct {
	AttemptIndex       int64
	ResolutionTime     time.Time
	ResolutionType     int32
	FailureSourceIndex sql.NullInt32
	HtlcFailReason     sql.NullInt32
	FailureMsg         []byte
}

type FailPaymentParams added in v1.0.13

type FailPaymentParams struct {
	FailReason        sql.NullInt32
	PaymentIdentifier []byte
}

type FetchAMPSubInvoiceHTLCsParams

type FetchAMPSubInvoiceHTLCsParams struct {
	InvoiceID int64
	SetID     []byte
}

type FetchAMPSubInvoiceHTLCsRow

type FetchAMPSubInvoiceHTLCsRow struct {
	SetID        []byte
	RootShare    []byte
	ChildIndex   int64
	Hash         []byte
	Preimage     []byte
	ID           int64
	ChanID       string
	HtlcID       int64
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type FetchAMPSubInvoicesParams

type FetchAMPSubInvoicesParams struct {
	InvoiceID int64
	SetID     []byte
}

type FetchHopsForAttemptsRow added in v1.0.13

type FetchHopsForAttemptsRow struct {
	ID                  int64
	HtlcAttemptIndex    int64
	HopIndex            int32
	PubKey              []byte
	Scid                string
	OutgoingTimeLock    int32
	AmtToForward        int64
	MetaData            []byte
	MppPaymentAddr      []byte
	MppTotalMsat        sql.NullInt64
	AmpRootShare        []byte
	AmpSetID            []byte
	AmpChildIndex       sql.NullInt32
	EncryptedData       []byte
	BlindingPoint       []byte
	BlindedPathTotalAmt sql.NullInt64
}

type FetchHtlcAttemptResolutionsForPaymentsRow added in v1.0.13

type FetchHtlcAttemptResolutionsForPaymentsRow struct {
	PaymentID      int64
	ResolutionType sql.NullInt32
}

type FetchHtlcAttemptsForPaymentsRow added in v1.0.13

type FetchHtlcAttemptsForPaymentsRow struct {
	ID                 int64
	AttemptIndex       int64
	PaymentID          int64
	SessionKey         []byte
	AttemptTime        time.Time
	PaymentHash        []byte
	FirstHopAmountMsat int64
	RouteTotalTimeLock int32
	RouteTotalAmount   int64
	RouteSourceKey     []byte
	ResolutionType     sql.NullInt32
	ResolutionTime     sql.NullTime
	FailureSourceIndex sql.NullInt32
	HtlcFailReason     sql.NullInt32
	FailureMsg         []byte
	SettlePreimage     []byte
}

type FetchNonTerminalPaymentsParams added in v1.0.13

type FetchNonTerminalPaymentsParams struct {
	ID    int64
	Limit int32
}

type FetchNonTerminalPaymentsRow added in v1.0.13

type FetchNonTerminalPaymentsRow struct {
	ID                int64
	AmountMsat        int64
	CreatedAt         time.Time
	PaymentIdentifier []byte
	FailReason        sql.NullInt32
	IntentType        sql.NullInt16
	IntentPayload     []byte
}

func (FetchNonTerminalPaymentsRow) GetPayment added in v1.0.13

func (r FetchNonTerminalPaymentsRow) GetPayment() Payment

GetPayment returns the Payment associated with this interface.

NOTE: This method is part of the PaymentAndIntent interface.

func (FetchNonTerminalPaymentsRow) GetPaymentIntent added in v1.0.13

func (r FetchNonTerminalPaymentsRow) GetPaymentIntent() PaymentIntent

GetPaymentIntent returns the PaymentIntent associated with this payment. If the payment has no intent (IntentType is NULL), this returns a zero-value PaymentIntent.

NOTE: This method is part of the PaymentAndIntent interface.

type FetchPaymentRow added in v1.0.13

type FetchPaymentRow struct {
	Payment       Payment
	IntentType    sql.NullInt16
	IntentPayload []byte
}

func (FetchPaymentRow) GetPayment added in v1.0.13

func (r FetchPaymentRow) GetPayment() Payment

GetPayment returns the Payment associated with this interface.

NOTE: This method is part of the PaymentAndIntent interface.

func (FetchPaymentRow) GetPaymentIntent added in v1.0.13

func (r FetchPaymentRow) GetPaymentIntent() PaymentIntent

GetPaymentIntent returns the PaymentIntent associated with this payment. If the payment has no intent (IntentType is NULL), this returns a zero-value PaymentIntent.

NOTE: This method is part of the PaymentAndIntent interface.

type FetchPaymentsByIDsMigRow added in v1.0.13

type FetchPaymentsByIDsMigRow struct {
	ID                int64
	AmountMsat        int64
	CreatedAt         time.Time
	PaymentIdentifier []byte
	FailReason        sql.NullInt32
	HtlcAttemptCount  int64
}

type FetchPaymentsByIDsRow added in v1.0.13

type FetchPaymentsByIDsRow struct {
	ID                int64
	AmountMsat        int64
	CreatedAt         time.Time
	PaymentIdentifier []byte
	FailReason        sql.NullInt32
	IntentType        sql.NullInt16
	IntentPayload     []byte
}

func (FetchPaymentsByIDsRow) GetPayment added in v1.0.13

func (r FetchPaymentsByIDsRow) GetPayment() Payment

func (FetchPaymentsByIDsRow) GetPaymentIntent added in v1.0.13

func (r FetchPaymentsByIDsRow) GetPaymentIntent() PaymentIntent

type FetchPendingInvoicesParams added in v1.0.13

type FetchPendingInvoicesParams struct {
	IDCursor int64
	NumLimit int32
}

type FetchSettledAMPSubInvoicesParams

type FetchSettledAMPSubInvoicesParams struct {
	SettleIndexGet sql.NullInt64
	SettleIndexLet sql.NullInt64
}

type FetchSettledAMPSubInvoicesRow

type FetchSettledAMPSubInvoicesRow struct {
	SetID              []byte
	AmpSettleIndex     sql.NullInt64
	AmpSettledAt       sql.NullTime
	ID                 int64
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type FilterInvoicesByAddIndexParams added in v1.0.13

type FilterInvoicesByAddIndexParams struct {
	AddIndexGet int64
	NumLimit    int32
}

type FilterInvoicesBySettleIndexParams added in v1.0.13

type FilterInvoicesBySettleIndexParams struct {
	SettleIndexGet sql.NullInt64
	IDCursor       int64
	NumLimit       int32
}

type FilterInvoicesForwardParams added in v1.0.13

type FilterInvoicesForwardParams struct {
	AddIndexGet   int64
	PendingOnly   interface{}
	CreatedAfter  time.Time
	CreatedBefore time.Time
	NumLimit      int32
}

type FilterInvoicesReverseParams added in v1.0.13

type FilterInvoicesReverseParams struct {
	AddIndexLet   int64
	PendingOnly   interface{}
	CreatedAfter  time.Time
	CreatedBefore time.Time
	NumLimit      int32
}

type FilterPaymentsDescParams added in v1.0.13

type FilterPaymentsDescParams struct {
	IndexOffsetGet sql.NullInt64
	IndexOffsetLet sql.NullInt64
	CreatedAfter   time.Time
	CreatedBefore  time.Time
	IntentType     sql.NullInt16
	NumLimit       int32
}

type FilterPaymentsDescRow added in v1.0.13

type FilterPaymentsDescRow struct {
	Payment       Payment
	IntentType    sql.NullInt16
	IntentPayload []byte
}

type FilterPaymentsParams added in v1.0.13

type FilterPaymentsParams struct {
	IndexOffsetGet sql.NullInt64
	IndexOffsetLet sql.NullInt64
	CreatedAfter   time.Time
	CreatedBefore  time.Time
	IntentType     sql.NullInt16
	NumLimit       int32
}

type FilterPaymentsRow added in v1.0.13

type FilterPaymentsRow struct {
	Payment       Payment
	IntentType    sql.NullInt16
	IntentPayload []byte
}

func (FilterPaymentsRow) GetPayment added in v1.0.13

func (r FilterPaymentsRow) GetPayment() Payment

GetPayment returns the Payment associated with this interface.

NOTE: This method is part of the PaymentAndIntent interface.

func (FilterPaymentsRow) GetPaymentIntent added in v1.0.13

func (r FilterPaymentsRow) GetPaymentIntent() PaymentIntent

GetPaymentIntent returns the PaymentIntent associated with this payment. If the payment has no intent (IntentType is NULL), this returns a zero-value PaymentIntent.

NOTE: This method is part of the PaymentAndIntent interface.

type GetChannelAndNodesBySCIDParams added in v1.0.11

type GetChannelAndNodesBySCIDParams struct {
	Scid    []byte
	Version int16
}

type GetChannelAndNodesBySCIDRow added in v1.0.11

type GetChannelAndNodesBySCIDRow struct {
	ID                int64
	Version           int16
	Scid              []byte
	NodeID1           int64
	NodeID2           int64
	Outpoint          string
	Capacity          sql.NullInt64
	BitcoinKey1       []byte
	BitcoinKey2       []byte
	Node1Signature    []byte
	Node2Signature    []byte
	Bitcoin1Signature []byte
	Bitcoin2Signature []byte
	Signature         []byte
	FundingPkScript   []byte
	MerkleRootHash    []byte
	Node1PubKey       []byte
	Node2PubKey       []byte
}

type GetChannelByOutpointWithPoliciesParams added in v1.0.11

type GetChannelByOutpointWithPoliciesParams struct {
	Outpoint string
	Version  int16
}

type GetChannelByOutpointWithPoliciesRow added in v1.0.11

type GetChannelByOutpointWithPoliciesRow struct {
	GraphChannel                   GraphChannel
	Node1Pubkey                    []byte
	Node2Pubkey                    []byte
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type GetChannelBySCIDParams added in v1.0.10

type GetChannelBySCIDParams struct {
	Scid    []byte
	Version int16
}

type GetChannelBySCIDWithPoliciesParams added in v1.0.11

type GetChannelBySCIDWithPoliciesParams struct {
	Scid    []byte
	Version int16
}

type GetChannelBySCIDWithPoliciesRow added in v1.0.11

type GetChannelBySCIDWithPoliciesRow struct {
	GraphChannel                   GraphChannel
	GraphNode                      GraphNode
	GraphNode_2                    GraphNode
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type GetChannelPolicyByChannelAndNodeParams added in v1.0.11

type GetChannelPolicyByChannelAndNodeParams struct {
	ChannelID int64
	NodeID    int64
	Version   int16
}

type GetChannelPolicyExtraTypesBatchRow added in v1.0.11

type GetChannelPolicyExtraTypesBatchRow struct {
	PolicyID int64
	Type     int64
	Value    []byte
}

type GetChannelsByIDsRow added in v1.0.11

type GetChannelsByIDsRow struct {
	GraphChannel                   GraphChannel
	Node1ID                        int64
	Node1PubKey                    []byte
	Node2ID                        int64
	Node2PubKey                    []byte
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type GetChannelsByOutpointsRow added in v1.0.11

type GetChannelsByOutpointsRow struct {
	GraphChannel GraphChannel
	Node1Pubkey  []byte
	Node2Pubkey  []byte
}

func (GetChannelsByOutpointsRow) Channel added in v1.0.11

Channel returns the GraphChannel associated with this interface.

NOTE: This method is part of the ChannelAndNodeIDs interface.

func (GetChannelsByOutpointsRow) Node1Pub added in v1.0.11

func (r GetChannelsByOutpointsRow) Node1Pub() []byte

Node1Pub returns the public key of the first node as a byte slice.

NOTE: This method is part of the ChannelAndNodeIDs interface.

func (GetChannelsByOutpointsRow) Node2Pub added in v1.0.11

func (r GetChannelsByOutpointsRow) Node2Pub() []byte

Node2Pub returns the public key of the second node as a byte slice.

NOTE: This method is part of the ChannelAndNodeIDs interface.

type GetChannelsByPolicyBlockRangeParams added in v1.0.13

type GetChannelsByPolicyBlockRangeParams struct {
	Version         int16
	StartHeight     sql.NullInt64
	EndHeight       sql.NullInt64
	LastBlockHeight sql.NullInt64
	LastID          sql.NullInt64
	MaxResults      interface{}
}

type GetChannelsByPolicyBlockRangeRow added in v1.0.13

type GetChannelsByPolicyBlockRangeRow struct {
	GraphChannel                   GraphChannel
	GraphNode                      GraphNode
	GraphNode_2                    GraphNode
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type GetChannelsByPolicyLastUpdateRangeParams added in v1.0.11

type GetChannelsByPolicyLastUpdateRangeParams struct {
	Version        int16
	StartTime      sql.NullInt64
	EndTime        sql.NullInt64
	LastUpdateTime sql.NullInt64
	LastID         sql.NullInt64
	MaxResults     interface{}
}

type GetChannelsByPolicyLastUpdateRangeRow added in v1.0.11

type GetChannelsByPolicyLastUpdateRangeRow struct {
	GraphChannel                   GraphChannel
	GraphNode                      GraphNode
	GraphNode_2                    GraphNode
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

func (GetChannelsByPolicyLastUpdateRangeRow) Channel added in v1.0.11

Channel returns the GraphChannel associated with this interface.

NOTE: This method is part of the ChannelAndNodes interface.

func (GetChannelsByPolicyLastUpdateRangeRow) Node1 added in v1.0.11

Node1 returns the first GraphNode associated with this channel.

NOTE: This method is part of the ChannelAndNodes interface.

func (GetChannelsByPolicyLastUpdateRangeRow) Node2 added in v1.0.11

Node2 returns the second GraphNode associated with this channel.

NOTE: This method is part of the ChannelAndNodes interface.

type GetChannelsBySCIDRangeParams added in v1.0.11

type GetChannelsBySCIDRangeParams struct {
	StartScid []byte
	EndScid   []byte
}

type GetChannelsBySCIDRangeRow added in v1.0.11

type GetChannelsBySCIDRangeRow struct {
	GraphChannel GraphChannel
	Node1PubKey  []byte
	Node2PubKey  []byte
}

func (GetChannelsBySCIDRangeRow) Channel added in v1.0.11

Channel returns the GraphChannel associated with this interface.

NOTE: This method is part of the ChannelAndNodeIDs interface.

func (GetChannelsBySCIDRangeRow) Node1Pub added in v1.0.11

func (r GetChannelsBySCIDRangeRow) Node1Pub() []byte

Node1Pub returns the public key of the first node as a byte slice.

NOTE: This method is part of the ChannelAndNodeIDs interface.

func (GetChannelsBySCIDRangeRow) Node2Pub added in v1.0.11

func (r GetChannelsBySCIDRangeRow) Node2Pub() []byte

Node2Pub returns the public key of the second node as a byte slice.

NOTE: This method is part of the ChannelAndNodeIDs interface.

type GetChannelsBySCIDWithPoliciesParams added in v1.0.11

type GetChannelsBySCIDWithPoliciesParams struct {
	Version int16
	Scids   [][]byte
}

type GetChannelsBySCIDWithPoliciesRow added in v1.0.11

type GetChannelsBySCIDWithPoliciesRow struct {
	GraphChannel                   GraphChannel
	GraphNode                      GraphNode
	GraphNode_2                    GraphNode
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

func (GetChannelsBySCIDWithPoliciesRow) Channel added in v1.0.11

Channel returns the GraphChannel associated with this interface.

NOTE: This method is part of the ChannelAndNodeIDs interface.

func (GetChannelsBySCIDWithPoliciesRow) Node1 added in v1.0.11

Node1 returns the first GraphNode associated with this channel.

NOTE: This method is part of the ChannelAndNodes interface.

func (GetChannelsBySCIDWithPoliciesRow) Node1Pub added in v1.0.11

func (r GetChannelsBySCIDWithPoliciesRow) Node1Pub() []byte

Node1Pub returns the public key of the first node as a byte slice.

NOTE: This method is part of the ChannelAndNodeIDs interface.

func (GetChannelsBySCIDWithPoliciesRow) Node2 added in v1.0.11

Node2 returns the second GraphNode associated with this channel.

NOTE: This method is part of the ChannelAndNodes interface.

func (GetChannelsBySCIDWithPoliciesRow) Node2Pub added in v1.0.11

func (r GetChannelsBySCIDWithPoliciesRow) Node2Pub() []byte

Node2Pub returns the public key of the second node as a byte slice.

NOTE: This method is part of the ChannelAndNodeIDs interface.

type GetChannelsBySCIDsParams added in v1.0.11

type GetChannelsBySCIDsParams struct {
	Version int16
	Scids   [][]byte
}

type GetInvoiceHTLCCustomRecordsRow

type GetInvoiceHTLCCustomRecordsRow struct {
	HtlcID int64
	Key    int64
	Value  []byte
}

type GetNodeAddressesRow added in v1.0.11

type GetNodeAddressesRow struct {
	Type    int16
	Address string
}

type GetNodeByPubKeyParams added in v1.0.10

type GetNodeByPubKeyParams struct {
	PubKey  []byte
	Version int16
}

type GetNodeFeaturesByPubKeyParams added in v1.0.10

type GetNodeFeaturesByPubKeyParams struct {
	PubKey  []byte
	Version int16
}

type GetNodeIDByPubKeyParams added in v1.0.11

type GetNodeIDByPubKeyParams struct {
	PubKey  []byte
	Version int16
}

type GetNodesByBlockHeightRangeParams added in v1.0.13

type GetNodesByBlockHeightRangeParams struct {
	Version         int16
	StartHeight     sql.NullInt64
	EndHeight       sql.NullInt64
	LastBlockHeight sql.NullInt64
	LastPubKey      []byte
	OnlyPublic      interface{}
	MaxResults      interface{}
}

type GetNodesByLastUpdateRangeParams added in v1.0.10

type GetNodesByLastUpdateRangeParams struct {
	StartTime  sql.NullInt64
	EndTime    sql.NullInt64
	LastUpdate sql.NullInt64
	LastPubKey []byte
	MaxResults interface{}
}

type GetPublicNodesByLastUpdateRangeParams added in v1.0.13

type GetPublicNodesByLastUpdateRangeParams struct {
	StartTime  sql.NullInt64
	EndTime    sql.NullInt64
	LastUpdate sql.NullInt64
	LastPubKey []byte
	MaxResults interface{}
}

type GetPublicV1ChannelsBySCIDParams added in v1.0.11

type GetPublicV1ChannelsBySCIDParams struct {
	StartScid []byte
	EndScid   []byte
}

type GetPublicV2ChannelsBySCIDParams added in v1.0.13

type GetPublicV2ChannelsBySCIDParams struct {
	StartScid []byte
	EndScid   []byte
}

type GetSCIDByOutpointParams added in v1.0.11

type GetSCIDByOutpointParams struct {
	Outpoint string
	Version  int16
}

type GetSourceNodesByVersionRow added in v1.0.10

type GetSourceNodesByVersionRow struct {
	NodeID int64
	PubKey []byte
}

type GetZombieChannelParams added in v1.0.11

type GetZombieChannelParams struct {
	Scid    []byte
	Version int16
}

type GetZombieChannelsSCIDsParams added in v1.0.11

type GetZombieChannelsSCIDsParams struct {
	Version int16
	Scids   [][]byte
}

type GraphChannel added in v1.0.11

type GraphChannel struct {
	ID                int64
	Version           int16
	Scid              []byte
	NodeID1           int64
	NodeID2           int64
	Outpoint          string
	Capacity          sql.NullInt64
	BitcoinKey1       []byte
	BitcoinKey2       []byte
	Node1Signature    []byte
	Node2Signature    []byte
	Bitcoin1Signature []byte
	Bitcoin2Signature []byte
	Signature         []byte
	FundingPkScript   []byte
	MerkleRootHash    []byte
}

type GraphChannelExtraType added in v1.0.11

type GraphChannelExtraType struct {
	ChannelID int64
	Type      int64
	Value     []byte
}

type GraphChannelFeature added in v1.0.11

type GraphChannelFeature struct {
	ChannelID  int64
	FeatureBit int32
}

type GraphChannelPolicy added in v1.0.11

type GraphChannelPolicy struct {
	ID                      int64
	Version                 int16
	ChannelID               int64
	NodeID                  int64
	Timelock                int32
	FeePpm                  int64
	BaseFeeMsat             int64
	MinHtlcMsat             int64
	MaxHtlcMsat             sql.NullInt64
	LastUpdate              sql.NullInt64
	Disabled                sql.NullBool
	InboundBaseFeeMsat      sql.NullInt64
	InboundFeeRateMilliMsat sql.NullInt64
	MessageFlags            sql.NullInt16
	ChannelFlags            sql.NullInt16
	Signature               []byte
	BlockHeight             sql.NullInt64
	DisableFlags            sql.NullInt16
}

type GraphChannelPolicyExtraType added in v1.0.11

type GraphChannelPolicyExtraType struct {
	ChannelPolicyID int64
	Type            int64
	Value           []byte
}

type GraphClosedScid added in v1.0.11

type GraphClosedScid struct {
	Scid []byte
}

type GraphNode added in v1.0.11

type GraphNode struct {
	ID          int64
	Version     int16
	PubKey      []byte
	Alias       sql.NullString
	LastUpdate  sql.NullInt64
	Color       sql.NullString
	Signature   []byte
	BlockHeight sql.NullInt64
}

type GraphNodeAddress added in v1.0.11

type GraphNodeAddress struct {
	NodeID   int64
	Type     int16
	Position int32
	Address  string
}

type GraphNodeExtraType added in v1.0.11

type GraphNodeExtraType struct {
	NodeID int64
	Type   int64
	Value  []byte
}

type GraphNodeFeature added in v1.0.11

type GraphNodeFeature struct {
	NodeID     int64
	FeatureBit int32
}

type GraphPruneLog added in v1.0.11

type GraphPruneLog struct {
	BlockHeight int64
	BlockHash   []byte
}

type GraphSourceNode added in v1.0.11

type GraphSourceNode struct {
	NodeID int64
}

type GraphZombieChannel added in v1.0.11

type GraphZombieChannel struct {
	Scid     []byte
	Version  int16
	NodeKey1 []byte
	NodeKey2 []byte
}

type InsertAMPSubInvoiceHTLCParams

type InsertAMPSubInvoiceHTLCParams struct {
	InvoiceID  int64
	SetID      []byte
	HtlcID     int64
	RootShare  []byte
	ChildIndex int64
	Hash       []byte
	Preimage   []byte
}

type InsertAMPSubInvoiceParams added in v1.0.7

type InsertAMPSubInvoiceParams struct {
	SetID       []byte
	State       int16
	CreatedAt   time.Time
	SettledAt   sql.NullTime
	SettleIndex sql.NullInt64
	InvoiceID   int64
}

type InsertChannelFeatureParams added in v1.0.10

type InsertChannelFeatureParams struct {
	ChannelID  int64
	FeatureBit int32
}

type InsertChannelMigParams added in v1.0.11

type InsertChannelMigParams struct {
	Version           int16
	Scid              []byte
	NodeID1           int64
	NodeID2           int64
	Outpoint          string
	Capacity          sql.NullInt64
	BitcoinKey1       []byte
	BitcoinKey2       []byte
	Node1Signature    []byte
	Node2Signature    []byte
	Bitcoin1Signature []byte
	Bitcoin2Signature []byte
}

type InsertEdgePolicyMigParams added in v1.0.11

type InsertEdgePolicyMigParams struct {
	Version                 int16
	ChannelID               int64
	NodeID                  int64
	Timelock                int32
	FeePpm                  int64
	BaseFeeMsat             int64
	MinHtlcMsat             int64
	LastUpdate              sql.NullInt64
	Disabled                sql.NullBool
	MaxHtlcMsat             sql.NullInt64
	InboundBaseFeeMsat      sql.NullInt64
	InboundFeeRateMilliMsat sql.NullInt64
	MessageFlags            sql.NullInt16
	ChannelFlags            sql.NullInt16
	Signature               []byte
}

type InsertHtlcAttemptParams added in v1.0.13

type InsertHtlcAttemptParams struct {
	PaymentID          int64
	AttemptIndex       int64
	SessionKey         []byte
	AttemptTime        time.Time
	PaymentHash        []byte
	FirstHopAmountMsat int64
	RouteTotalTimeLock int32
	RouteTotalAmount   int64
	RouteSourceKey     []byte
}

type InsertInvoiceFeatureParams

type InsertInvoiceFeatureParams struct {
	InvoiceID int64
	Feature   int32
}

type InsertInvoiceHTLCCustomRecordParams

type InsertInvoiceHTLCCustomRecordParams struct {
	Key    int64
	Value  []byte
	HtlcID int64
}

type InsertInvoiceHTLCParams

type InsertInvoiceHTLCParams struct {
	HtlcID       int64
	ChanID       string
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type InsertInvoiceParams

type InsertInvoiceParams struct {
	Hash               []byte
	Preimage           []byte
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type InsertKVInvoiceKeyAndAddIndexParams added in v1.0.7

type InsertKVInvoiceKeyAndAddIndexParams struct {
	ID       int64
	AddIndex int64
}

type InsertMigratedInvoiceParams added in v1.0.7

type InsertMigratedInvoiceParams struct {
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type InsertNodeFeatureParams added in v1.0.10

type InsertNodeFeatureParams struct {
	NodeID     int64
	FeatureBit int32
}

type InsertNodeMigParams added in v1.0.11

type InsertNodeMigParams struct {
	Version    int16
	PubKey     []byte
	Alias      sql.NullString
	LastUpdate sql.NullInt64
	Color      sql.NullString
	Signature  []byte
}

type InsertPaymentAttemptFirstHopCustomRecordParams added in v1.0.13

type InsertPaymentAttemptFirstHopCustomRecordParams struct {
	HtlcAttemptIndex int64
	Key              int64
	Value            []byte
}

type InsertPaymentDuplicateMigParams added in v1.0.13

type InsertPaymentDuplicateMigParams struct {
	PaymentID      int64
	AmountMsat     int64
	CreatedAt      time.Time
	FailReason     sql.NullInt32
	SettlePreimage []byte
	SettleTime     sql.NullTime
}

type InsertPaymentFirstHopCustomRecordParams added in v1.0.13

type InsertPaymentFirstHopCustomRecordParams struct {
	PaymentID int64
	Key       int64
	Value     []byte
}

type InsertPaymentHopCustomRecordParams added in v1.0.13

type InsertPaymentHopCustomRecordParams struct {
	HopID int64
	Key   int64
	Value []byte
}

type InsertPaymentIntentParams added in v1.0.13

type InsertPaymentIntentParams struct {
	PaymentID     int64
	IntentType    int16
	IntentPayload []byte
}

type InsertPaymentMigParams added in v1.0.13

type InsertPaymentMigParams struct {
	AmountMsat        int64
	CreatedAt         time.Time
	PaymentIdentifier []byte
	FailReason        sql.NullInt32
}

type InsertPaymentParams added in v1.0.13

type InsertPaymentParams struct {
	AmountMsat        int64
	CreatedAt         time.Time
	PaymentIdentifier []byte
}

type InsertRouteHopAmpParams added in v1.0.13

type InsertRouteHopAmpParams struct {
	HopID      int64
	RootShare  []byte
	SetID      []byte
	ChildIndex int32
}

type InsertRouteHopBlindedParams added in v1.0.13

type InsertRouteHopBlindedParams struct {
	HopID               int64
	EncryptedData       []byte
	BlindingPoint       []byte
	BlindedPathTotalAmt sql.NullInt64
}

type InsertRouteHopMppParams added in v1.0.13

type InsertRouteHopMppParams struct {
	HopID       int64
	PaymentAddr []byte
	TotalMsat   int64
}

type InsertRouteHopParams added in v1.0.13

type InsertRouteHopParams struct {
	HtlcAttemptIndex int64
	HopIndex         int32
	PubKey           []byte
	Scid             string
	OutgoingTimeLock int32
	AmtToForward     int64
	MetaData         []byte
}

type Invoice

type Invoice struct {
	ID                 int64
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type InvoiceEvent

type InvoiceEvent struct {
	ID        int64
	AddedAt   time.Time
	EventType int32
	InvoiceID int64
	SetID     []byte
}

type InvoiceEventType

type InvoiceEventType struct {
	ID          int64
	Description string
}

type InvoiceFeature

type InvoiceFeature struct {
	Feature   int32
	InvoiceID int64
}

type InvoiceHtlc

type InvoiceHtlc struct {
	ID           int64
	ChanID       string
	HtlcID       int64
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type InvoiceHtlcCustomRecord

type InvoiceHtlcCustomRecord struct {
	Key    int64
	Value  []byte
	HtlcID int64
}

type InvoicePaymentHash added in v1.0.7

type InvoicePaymentHash struct {
	ID       int64
	AddIndex int64
	Hash     []byte
}

type InvoiceSequence

type InvoiceSequence struct {
	Name         string
	CurrentValue int64
}

type IsZombieChannelParams added in v1.0.11

type IsZombieChannelParams struct {
	Scid    []byte
	Version int16
}

type ListChannelsByNodeIDParams added in v1.0.11

type ListChannelsByNodeIDParams struct {
	Version int16
	NodeID1 int64
}

type ListChannelsByNodeIDRow added in v1.0.11

type ListChannelsByNodeIDRow struct {
	GraphChannel                   GraphChannel
	Node1Pubkey                    []byte
	Node2Pubkey                    []byte
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type ListChannelsForNodeIDsParams added in v1.0.11

type ListChannelsForNodeIDsParams struct {
	Version  int16
	Node1Ids []int64
	Node2Ids []int64
}

type ListChannelsForNodeIDsRow added in v1.0.11

type ListChannelsForNodeIDsRow struct {
	GraphChannel                   GraphChannel
	Node1Pubkey                    []byte
	Node2Pubkey                    []byte
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type ListChannelsPaginatedParams added in v1.0.11

type ListChannelsPaginatedParams struct {
	Version int16
	ID      int64
	Limit   int32
}

type ListChannelsPaginatedRow added in v1.0.11

type ListChannelsPaginatedRow struct {
	ID          int64
	BitcoinKey1 []byte
	BitcoinKey2 []byte
	Outpoint    string
}

type ListChannelsPaginatedV2Params added in v1.0.13

type ListChannelsPaginatedV2Params struct {
	ID    int64
	Limit int32
}

type ListChannelsPaginatedV2Row added in v1.0.13

type ListChannelsPaginatedV2Row struct {
	ID              int64
	Outpoint        string
	FundingPkScript []byte
}

type ListChannelsWithPoliciesForCachePaginatedParams added in v1.0.11

type ListChannelsWithPoliciesForCachePaginatedParams struct {
	Version int16
	ID      int64
	Limit   int32
}

type ListChannelsWithPoliciesForCachePaginatedRow added in v1.0.11

type ListChannelsWithPoliciesForCachePaginatedRow struct {
	ID                             int64
	Scid                           []byte
	Capacity                       sql.NullInt64
	Node1Pubkey                    []byte
	Node2Pubkey                    []byte
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type ListChannelsWithPoliciesPaginatedParams added in v1.0.11

type ListChannelsWithPoliciesPaginatedParams struct {
	Version int16
	ID      int64
	Limit   int32
}

type ListChannelsWithPoliciesPaginatedRow added in v1.0.11

type ListChannelsWithPoliciesPaginatedRow struct {
	GraphChannel                   GraphChannel
	Node1Pubkey                    []byte
	Node2Pubkey                    []byte
	Policy1ID                      sql.NullInt64
	Policy1NodeID                  sql.NullInt64
	Policy1Version                 sql.NullInt16
	Policy1Timelock                sql.NullInt32
	Policy1FeePpm                  sql.NullInt64
	Policy1BaseFeeMsat             sql.NullInt64
	Policy1MinHtlcMsat             sql.NullInt64
	Policy1MaxHtlcMsat             sql.NullInt64
	Policy1LastUpdate              sql.NullInt64
	Policy1Disabled                sql.NullBool
	Policy1InboundBaseFeeMsat      sql.NullInt64
	Policy1InboundFeeRateMilliMsat sql.NullInt64
	Policy1MessageFlags            sql.NullInt16
	Policy1ChannelFlags            sql.NullInt16
	Policy1BlockHeight             sql.NullInt64
	Policy1DisableFlags            sql.NullInt16
	Policy1Signature               []byte
	Policy2ID                      sql.NullInt64
	Policy2NodeID                  sql.NullInt64
	Policy2Version                 sql.NullInt16
	Policy2Timelock                sql.NullInt32
	Policy2FeePpm                  sql.NullInt64
	Policy2BaseFeeMsat             sql.NullInt64
	Policy2MinHtlcMsat             sql.NullInt64
	Policy2MaxHtlcMsat             sql.NullInt64
	Policy2LastUpdate              sql.NullInt64
	Policy2Disabled                sql.NullBool
	Policy2InboundBaseFeeMsat      sql.NullInt64
	Policy2InboundFeeRateMilliMsat sql.NullInt64
	Policy2MessageFlags            sql.NullInt16
	Policy2ChannelFlags            sql.NullInt16
	Policy2Signature               []byte
	Policy2BlockHeight             sql.NullInt64
	Policy2DisableFlags            sql.NullInt16
}

type ListNodeIDsAndPubKeysParams added in v1.0.11

type ListNodeIDsAndPubKeysParams struct {
	Version int16
	ID      int64
	Limit   int32
}

type ListNodeIDsAndPubKeysRow added in v1.0.11

type ListNodeIDsAndPubKeysRow struct {
	ID     int64
	PubKey []byte
}

type ListNodesPaginatedParams added in v1.0.11

type ListNodesPaginatedParams struct {
	Version int16
	ID      int64
	Limit   int32
}

type MigrationTracker added in v1.0.7

type MigrationTracker struct {
	Version       int32
	MigrationTime time.Time
}

type NodeExistsParams added in v1.0.13

type NodeExistsParams struct {
	PubKey  []byte
	Version int16
}

type OnAMPSubInvoiceCanceledParams

type OnAMPSubInvoiceCanceledParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnAMPSubInvoiceCreatedParams

type OnAMPSubInvoiceCreatedParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnAMPSubInvoiceSettledParams

type OnAMPSubInvoiceSettledParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnInvoiceCanceledParams

type OnInvoiceCanceledParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type OnInvoiceCreatedParams

type OnInvoiceCreatedParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type OnInvoiceSettledParams

type OnInvoiceSettledParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type Payment added in v1.0.13

type Payment struct {
	ID                int64
	AmountMsat        int64
	CreatedAt         time.Time
	PaymentIdentifier []byte
	FailReason        sql.NullInt32
}

type PaymentAndIntent added in v1.0.13

type PaymentAndIntent interface {
	// GetPayment returns the Payment associated with this interface.
	GetPayment() Payment

	// GetPaymentIntent returns the PaymentIntent associated with this payment.
	GetPaymentIntent() PaymentIntent
}

PaymentAndIntent is an interface that provides access to a payment and its associated payment intent.

type PaymentAttemptFirstHopCustomRecord added in v1.0.13

type PaymentAttemptFirstHopCustomRecord struct {
	ID               int64
	HtlcAttemptIndex int64
	Key              int64
	Value            []byte
}

type PaymentDuplicate added in v1.0.13

type PaymentDuplicate struct {
	ID             int64
	PaymentID      int64
	AmountMsat     int64
	CreatedAt      time.Time
	FailReason     sql.NullInt32
	SettlePreimage []byte
	SettleTime     sql.NullTime
}

type PaymentFirstHopCustomRecord added in v1.0.13

type PaymentFirstHopCustomRecord struct {
	ID        int64
	PaymentID int64
	Key       int64
	Value     []byte
}

type PaymentHopCustomRecord added in v1.0.13

type PaymentHopCustomRecord struct {
	ID    int64
	HopID int64
	Key   int64
	Value []byte
}

type PaymentHtlcAttempt added in v1.0.13

type PaymentHtlcAttempt struct {
	ID                 int64
	AttemptIndex       int64
	PaymentID          int64
	SessionKey         []byte
	AttemptTime        time.Time
	PaymentHash        []byte
	FirstHopAmountMsat int64
	RouteTotalTimeLock int32
	RouteTotalAmount   int64
	RouteSourceKey     []byte
}

type PaymentHtlcAttemptResolution added in v1.0.13

type PaymentHtlcAttemptResolution struct {
	AttemptIndex       int64
	ResolutionTime     time.Time
	ResolutionType     int32
	SettlePreimage     []byte
	FailureSourceIndex sql.NullInt32
	HtlcFailReason     sql.NullInt32
	FailureMsg         []byte
}

type PaymentIntent added in v1.0.13

type PaymentIntent struct {
	ID            int64
	PaymentID     int64
	IntentType    int16
	IntentPayload []byte
}

type PaymentRouteHop added in v1.0.13

type PaymentRouteHop struct {
	ID               int64
	HtlcAttemptIndex int64
	HopIndex         int32
	PubKey           []byte
	Scid             string
	OutgoingTimeLock int32
	AmtToForward     int64
	MetaData         []byte
}

type PaymentRouteHopAmp added in v1.0.13

type PaymentRouteHopAmp struct {
	HopID      int64
	RootShare  []byte
	SetID      []byte
	ChildIndex int32
}

type PaymentRouteHopBlinded added in v1.0.13

type PaymentRouteHopBlinded struct {
	HopID               int64
	EncryptedData       []byte
	BlindingPoint       []byte
	BlindedPathTotalAmt sql.NullInt64
}

type PaymentRouteHopMpp added in v1.0.13

type PaymentRouteHopMpp struct {
	HopID       int64
	PaymentAddr []byte
	TotalMsat   int64
}

type Querier

type Querier interface {
	AddSourceNode(ctx context.Context, nodeID int64) error
	AddV1ChannelProof(ctx context.Context, arg AddV1ChannelProofParams) (sql.Result, error)
	AddV2ChannelProof(ctx context.Context, arg AddV2ChannelProofParams) (sql.Result, error)
	ClearKVInvoiceHashIndex(ctx context.Context) error
	CountPayments(ctx context.Context) (int64, error)
	CountZombieChannels(ctx context.Context, version int16) (int64, error)
	CreateChannel(ctx context.Context, arg CreateChannelParams) (int64, error)
	DeleteCanceledInvoices(ctx context.Context) (sql.Result, error)
	DeleteChannelPolicyExtraTypes(ctx context.Context, channelPolicyID int64) error
	DeleteChannels(ctx context.Context, ids []int64) error
	DeleteExtraNodeType(ctx context.Context, arg DeleteExtraNodeTypeParams) error
	// Delete all failed HTLC attempts for the given payment. Resolution type 2
	// indicates a failed attempt. Uses EXISTS to scope the resolution lookup to
	// only this payment's attempts, avoiding an O(N) scan of all failed
	// resolutions across all payments.
	DeleteFailedAttempts(ctx context.Context, paymentID int64) error
	DeleteInvoice(ctx context.Context, arg DeleteInvoiceParams) (sql.Result, error)
	DeleteNode(ctx context.Context, id int64) error
	DeleteNodeAddresses(ctx context.Context, nodeID int64) error
	DeleteNodeByPubKey(ctx context.Context, arg DeleteNodeByPubKeyParams) (sql.Result, error)
	DeleteNodeFeature(ctx context.Context, arg DeleteNodeFeatureParams) error
	DeletePayment(ctx context.Context, id int64) error
	DeletePruneLogEntriesInRange(ctx context.Context, arg DeletePruneLogEntriesInRangeParams) error
	DeleteUnconnectedNodes(ctx context.Context) ([][]byte, error)
	DeleteZombieChannel(ctx context.Context, arg DeleteZombieChannelParams) (sql.Result, error)
	FailAttempt(ctx context.Context, arg FailAttemptParams) error
	FailPayment(ctx context.Context, arg FailPaymentParams) (sql.Result, error)
	FetchAMPSubInvoiceHTLCs(ctx context.Context, arg FetchAMPSubInvoiceHTLCsParams) ([]FetchAMPSubInvoiceHTLCsRow, error)
	FetchAMPSubInvoices(ctx context.Context, arg FetchAMPSubInvoicesParams) ([]AmpSubInvoice, error)
	FetchHopLevelCustomRecords(ctx context.Context, hopIds []int64) ([]PaymentHopCustomRecord, error)
	FetchHopsForAttempts(ctx context.Context, htlcAttemptIndices []int64) ([]FetchHopsForAttemptsRow, error)
	// Batch query to fetch only HTLC resolution status for multiple payments.
	// We don't need to order by payment_id and attempt_time because we will
	// group the resolutions by payment_id in the background.
	FetchHtlcAttemptResolutionsForPayments(ctx context.Context, paymentIds []int64) ([]FetchHtlcAttemptResolutionsForPaymentsRow, error)
	FetchHtlcAttemptsForPayments(ctx context.Context, paymentIds []int64) ([]FetchHtlcAttemptsForPaymentsRow, error)
	// Fetch all non-terminal payments using pagination. A payment is
	// non-terminal if it has an unresolved attempt, or if it has not been
	// permanently failed and has no settled attempt yet.
	FetchNonTerminalPayments(ctx context.Context, arg FetchNonTerminalPaymentsParams) ([]FetchNonTerminalPaymentsRow, error)
	FetchPayment(ctx context.Context, paymentIdentifier []byte) (FetchPaymentRow, error)
	// Fetch all duplicate payment records from the payment_duplicates table for
	// a given payment ID.
	FetchPaymentDuplicates(ctx context.Context, paymentID int64) ([]PaymentDuplicate, error)
	FetchPaymentLevelFirstHopCustomRecords(ctx context.Context, paymentIds []int64) ([]PaymentFirstHopCustomRecord, error)
	// Batch fetch payment and intent data for a set of payment IDs.
	// Used to avoid fetching redundant payment data when processing multiple
	// attempts for the same payment.
	FetchPaymentsByIDs(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsRow, error)
	// Migration-specific batch fetch that returns payment data along with HTLC
	// attempt counts for structural validation during KV to SQL migration.
	FetchPaymentsByIDsMig(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsMigRow, error)
	// FetchPendingInvoices returns all invoices in a pending state (open or
	// accepted). The invoices_state_idx index on the state column makes this a
	// fast index scan rather than a full table scan. id_cursor is an exclusive
	// lower bound on the primary key used for cursor-based pagination; the caller
	// must supply 0 when starting from the beginning.
	FetchPendingInvoices(ctx context.Context, arg FetchPendingInvoicesParams) ([]Invoice, error)
	FetchRouteLevelFirstHopCustomRecords(ctx context.Context, htlcAttemptIndices []int64) ([]PaymentAttemptFirstHopCustomRecord, error)
	FetchSettledAMPSubInvoices(ctx context.Context, arg FetchSettledAMPSubInvoicesParams) ([]FetchSettledAMPSubInvoicesRow, error)
	// FilterInvoicesByAddIndex returns invoices whose add_index (primary key id)
	// is greater than or equal to the given value, ordered by id. Because id is
	// the primary key, this is always an efficient range scan on the clustered
	// index. For cursor-based pagination the caller advances add_index_get to
	// last_returned_id + 1 on each subsequent page.
	FilterInvoicesByAddIndex(ctx context.Context, arg FilterInvoicesByAddIndexParams) ([]Invoice, error)
	// FilterInvoicesBySettleIndex returns settled invoices whose settle_index is
	// greater than or equal to the given value, ordered by id. The caller must
	// always supply a concrete lower bound so the invoices_settle_index_idx index
	// can be used. id_cursor is an exclusive lower bound on the primary key used
	// for cursor-based pagination; the caller must supply 0 when starting from
	// the beginning.
	FilterInvoicesBySettleIndex(ctx context.Context, arg FilterInvoicesBySettleIndexParams) ([]Invoice, error)
	// FilterInvoicesForward returns invoices in ascending id order. All parameters
	// are non-nullable so the planner always sees plain range predicates and can
	// use the primary-key index. For cursor-based pagination the caller advances
	// add_index_get to last_returned_id + 1 on each subsequent page. The caller
	// is responsible for supplying Go-side defaults when a filter is not needed:
	//   add_index_get  → 1                             (first valid invoice id)
	//   created_after  → time.Unix(0, 0).UTC()         (epoch – before any invoice)
	//   created_before → time.Date(9999, …)             (far future – no upper cap)
	//   pending_only   → false                          (include all states)
	FilterInvoicesForward(ctx context.Context, arg FilterInvoicesForwardParams) ([]Invoice, error)
	// FilterInvoicesReverse is the descending counterpart of FilterInvoicesForward.
	// It returns invoices in descending id order. For cursor-based pagination the
	// caller advances add_index_let to last_returned_id - 1 on each subsequent
	// page; pass math.MaxInt64 to start from the most recent invoice. See
	// FilterInvoicesForward for the expected Go-side defaults.
	FilterInvoicesReverse(ctx context.Context, arg FilterInvoicesReverseParams) ([]Invoice, error)
	FilterPayments(ctx context.Context, arg FilterPaymentsParams) ([]FilterPaymentsRow, error)
	FilterPaymentsDesc(ctx context.Context, arg FilterPaymentsDescParams) ([]FilterPaymentsDescRow, error)
	GetAMPInvoiceID(ctx context.Context, setID []byte) (int64, error)
	GetChainNetwork(ctx context.Context) (string, error)
	GetChannelAndNodesBySCID(ctx context.Context, arg GetChannelAndNodesBySCIDParams) (GetChannelAndNodesBySCIDRow, error)
	GetChannelByOutpointWithPolicies(ctx context.Context, arg GetChannelByOutpointWithPoliciesParams) (GetChannelByOutpointWithPoliciesRow, error)
	GetChannelBySCID(ctx context.Context, arg GetChannelBySCIDParams) (GraphChannel, error)
	GetChannelBySCIDWithPolicies(ctx context.Context, arg GetChannelBySCIDWithPoliciesParams) (GetChannelBySCIDWithPoliciesRow, error)
	GetChannelExtrasBatch(ctx context.Context, chanIds []int64) ([]GraphChannelExtraType, error)
	GetChannelFeaturesBatch(ctx context.Context, chanIds []int64) ([]GraphChannelFeature, error)
	GetChannelPolicyByChannelAndNode(ctx context.Context, arg GetChannelPolicyByChannelAndNodeParams) (GraphChannelPolicy, error)
	GetChannelPolicyExtraTypesBatch(ctx context.Context, policyIds []int64) ([]GetChannelPolicyExtraTypesBatchRow, error)
	GetChannelsByIDs(ctx context.Context, ids []int64) ([]GetChannelsByIDsRow, error)
	GetChannelsByOutpoints(ctx context.Context, outpoints []string) ([]GetChannelsByOutpointsRow, error)
	GetChannelsByPolicyBlockRange(ctx context.Context, arg GetChannelsByPolicyBlockRangeParams) ([]GetChannelsByPolicyBlockRangeRow, error)
	GetChannelsByPolicyLastUpdateRange(ctx context.Context, arg GetChannelsByPolicyLastUpdateRangeParams) ([]GetChannelsByPolicyLastUpdateRangeRow, error)
	GetChannelsBySCIDRange(ctx context.Context, arg GetChannelsBySCIDRangeParams) ([]GetChannelsBySCIDRangeRow, error)
	GetChannelsBySCIDWithPolicies(ctx context.Context, arg GetChannelsBySCIDWithPoliciesParams) ([]GetChannelsBySCIDWithPoliciesRow, error)
	GetChannelsBySCIDs(ctx context.Context, arg GetChannelsBySCIDsParams) ([]GraphChannel, error)
	GetClosedChannelsSCIDs(ctx context.Context, scids [][]byte) ([][]byte, error)
	GetDatabaseVersion(ctx context.Context) (int32, error)
	GetExtraNodeTypes(ctx context.Context, nodeID int64) ([]GraphNodeExtraType, error)
	GetInvoiceByAddr(ctx context.Context, paymentAddr []byte) (Invoice, error)
	GetInvoiceByHash(ctx context.Context, hash []byte) (Invoice, error)
	// TODO(ziggie): This query can only return one invoice if the set_id is
	// the primary key of amp_sub_invoices table.
	GetInvoiceBySetID(ctx context.Context, setID []byte) ([]Invoice, error)
	GetInvoiceFeatures(ctx context.Context, invoiceID int64) ([]InvoiceFeature, error)
	GetInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int64) ([]GetInvoiceHTLCCustomRecordsRow, error)
	GetInvoiceHTLCs(ctx context.Context, invoiceID int64) ([]InvoiceHtlc, error)
	GetKVInvoicePaymentHashByAddIndex(ctx context.Context, addIndex int64) ([]byte, error)
	GetMigration(ctx context.Context, version int32) (time.Time, error)
	GetNodeAddresses(ctx context.Context, nodeID int64) ([]GetNodeAddressesRow, error)
	GetNodeAddressesBatch(ctx context.Context, ids []int64) ([]GraphNodeAddress, error)
	GetNodeByPubKey(ctx context.Context, arg GetNodeByPubKeyParams) (GraphNode, error)
	GetNodeExtraTypesBatch(ctx context.Context, ids []int64) ([]GraphNodeExtraType, error)
	GetNodeFeatures(ctx context.Context, nodeID int64) ([]GraphNodeFeature, error)
	GetNodeFeaturesBatch(ctx context.Context, ids []int64) ([]GraphNodeFeature, error)
	GetNodeFeaturesByPubKey(ctx context.Context, arg GetNodeFeaturesByPubKeyParams) ([]int32, error)
	GetNodeIDByPubKey(ctx context.Context, arg GetNodeIDByPubKeyParams) (int64, error)
	GetNodesByBlockHeightRange(ctx context.Context, arg GetNodesByBlockHeightRangeParams) ([]GraphNode, error)
	GetNodesByIDs(ctx context.Context, ids []int64) ([]GraphNode, error)
	GetNodesByLastUpdateRange(ctx context.Context, arg GetNodesByLastUpdateRangeParams) ([]GraphNode, error)
	GetPruneEntriesForHeights(ctx context.Context, heights []int64) ([]GraphPruneLog, error)
	GetPruneHashByHeight(ctx context.Context, blockHeight int64) ([]byte, error)
	GetPruneTip(ctx context.Context) (GraphPruneLog, error)
	// Returns only public V1 nodes within the given last_update range. A V1 node
	// is public if it has at least one channel with a bitcoin_1_signature set. The
	// public check uses two separate EXISTS probes (one per node_id column)
	// instead of a single OR on node_id_1/node_id_2 so the planner can use the
	// channel node-id indexes directly.
	GetPublicNodesByLastUpdateRange(ctx context.Context, arg GetPublicNodesByLastUpdateRangeParams) ([]GraphNode, error)
	GetPublicV1ChannelsBySCID(ctx context.Context, arg GetPublicV1ChannelsBySCIDParams) ([]GraphChannel, error)
	GetPublicV2ChannelsBySCID(ctx context.Context, arg GetPublicV2ChannelsBySCIDParams) ([]GraphChannel, error)
	GetSCIDByOutpoint(ctx context.Context, arg GetSCIDByOutpointParams) ([]byte, error)
	GetSourceNodesByVersion(ctx context.Context, version int16) ([]GetSourceNodesByVersionRow, error)
	// NOTE: this is V1 specific since for V1, disabled is a
	// simple, single boolean. The proposed V2 policy
	// structure will have a more complex disabled bit vector
	// and so the query for V2 may differ.
	GetV1DisabledSCIDs(ctx context.Context) ([][]byte, error)
	// NOTE: this is V2 specific since V2 uses a disable flag
	// bit vector instead of a single boolean.
	GetV2DisabledSCIDs(ctx context.Context) ([][]byte, error)
	GetZombieChannel(ctx context.Context, arg GetZombieChannelParams) (GraphZombieChannel, error)
	GetZombieChannelsSCIDs(ctx context.Context, arg GetZombieChannelsSCIDsParams) ([]GraphZombieChannel, error)
	HighestSCID(ctx context.Context, version int16) ([]byte, error)
	InsertAMPSubInvoice(ctx context.Context, arg InsertAMPSubInvoiceParams) error
	InsertAMPSubInvoiceHTLC(ctx context.Context, arg InsertAMPSubInvoiceHTLCParams) error
	InsertChainNetwork(ctx context.Context, network string) error
	InsertChannelFeature(ctx context.Context, arg InsertChannelFeatureParams) error
	// NOTE: This query is only meant to be used by the graph SQL migration since
	// for that migration, in order to be retry-safe, we don't want to error out if
	// we re-insert the same channel again (which would error if the normal
	// CreateChannel query is used because of the uniqueness constraint on the scid
	// and version columns).
	InsertChannelMig(ctx context.Context, arg InsertChannelMigParams) (int64, error)
	InsertClosedChannel(ctx context.Context, scid []byte) error
	// NOTE: This query is only meant to be used by the graph SQL migration since
	// for that migration, in order to be retry-safe, we don't want to error out if
	// we re-insert the same policy (which would error if the normal
	// UpsertEdgePolicy query is used because of the constraint in that query that
	// requires a policy update to have a newer last_update than the existing one).
	InsertEdgePolicyMig(ctx context.Context, arg InsertEdgePolicyMigParams) (int64, error)
	InsertHtlcAttempt(ctx context.Context, arg InsertHtlcAttemptParams) (int64, error)
	InsertInvoice(ctx context.Context, arg InsertInvoiceParams) (int64, error)
	InsertInvoiceFeature(ctx context.Context, arg InsertInvoiceFeatureParams) error
	InsertInvoiceHTLC(ctx context.Context, arg InsertInvoiceHTLCParams) (int64, error)
	InsertInvoiceHTLCCustomRecord(ctx context.Context, arg InsertInvoiceHTLCCustomRecordParams) error
	InsertKVInvoiceKeyAndAddIndex(ctx context.Context, arg InsertKVInvoiceKeyAndAddIndexParams) error
	InsertMigratedInvoice(ctx context.Context, arg InsertMigratedInvoiceParams) (int64, error)
	InsertNodeFeature(ctx context.Context, arg InsertNodeFeatureParams) error
	// NOTE: This query is only meant to be used by the graph SQL migration since
	// for that migration, in order to be retry-safe, we don't want to error out if
	// we re-insert the same node (which would error if the normal UpsertNode query
	// is used because of the constraint in that query that requires a node update
	// to have a newer last_update than the existing node).
	InsertNodeMig(ctx context.Context, arg InsertNodeMigParams) (int64, error)
	// Insert a new payment and return its ID.
	// When creating a payment we don't have a fail reason because we start the
	// payment process.
	InsertPayment(ctx context.Context, arg InsertPaymentParams) (int64, error)
	InsertPaymentAttemptFirstHopCustomRecord(ctx context.Context, arg InsertPaymentAttemptFirstHopCustomRecordParams) error
	// Insert a duplicate payment record into the payment_duplicates table and
	// return its ID.
	InsertPaymentDuplicateMig(ctx context.Context, arg InsertPaymentDuplicateMigParams) (int64, error)
	InsertPaymentFirstHopCustomRecord(ctx context.Context, arg InsertPaymentFirstHopCustomRecordParams) error
	InsertPaymentHopCustomRecord(ctx context.Context, arg InsertPaymentHopCustomRecordParams) error
	// Insert a payment intent for a given payment and return its ID.
	InsertPaymentIntent(ctx context.Context, arg InsertPaymentIntentParams) (int64, error)
	// Migration-specific payment insert that allows setting fail_reason.
	// Normal InsertPayment forces fail_reason to NULL since new payments
	// aren't failed yet. During migration, we're inserting historical data
	// that may already be failed.
	InsertPaymentMig(ctx context.Context, arg InsertPaymentMigParams) (int64, error)
	InsertRouteHop(ctx context.Context, arg InsertRouteHopParams) (int64, error)
	InsertRouteHopAmp(ctx context.Context, arg InsertRouteHopAmpParams) error
	InsertRouteHopBlinded(ctx context.Context, arg InsertRouteHopBlindedParams) error
	InsertRouteHopMpp(ctx context.Context, arg InsertRouteHopMppParams) error
	IsClosedChannel(ctx context.Context, scid []byte) (bool, error)
	IsPublicV1Node(ctx context.Context, pubKey []byte) (bool, error)
	IsPublicV2Node(ctx context.Context, pubKey []byte) (bool, error)
	IsZombieChannel(ctx context.Context, arg IsZombieChannelParams) (bool, error)
	ListChannelsByNodeID(ctx context.Context, arg ListChannelsByNodeIDParams) ([]ListChannelsByNodeIDRow, error)
	ListChannelsForNodeIDs(ctx context.Context, arg ListChannelsForNodeIDsParams) ([]ListChannelsForNodeIDsRow, error)
	ListChannelsPaginated(ctx context.Context, arg ListChannelsPaginatedParams) ([]ListChannelsPaginatedRow, error)
	ListChannelsPaginatedV2(ctx context.Context, arg ListChannelsPaginatedV2Params) ([]ListChannelsPaginatedV2Row, error)
	ListChannelsWithPoliciesForCachePaginated(ctx context.Context, arg ListChannelsWithPoliciesForCachePaginatedParams) ([]ListChannelsWithPoliciesForCachePaginatedRow, error)
	ListChannelsWithPoliciesPaginated(ctx context.Context, arg ListChannelsWithPoliciesPaginatedParams) ([]ListChannelsWithPoliciesPaginatedRow, error)
	ListNodeIDsAndPubKeys(ctx context.Context, arg ListNodeIDsAndPubKeysParams) ([]ListNodeIDsAndPubKeysRow, error)
	ListNodesPaginated(ctx context.Context, arg ListNodesPaginatedParams) ([]GraphNode, error)
	NextInvoiceSettleIndex(ctx context.Context) (int64, error)
	NodeExists(ctx context.Context, arg NodeExistsParams) (bool, error)
	OnAMPSubInvoiceCanceled(ctx context.Context, arg OnAMPSubInvoiceCanceledParams) error
	OnAMPSubInvoiceCreated(ctx context.Context, arg OnAMPSubInvoiceCreatedParams) error
	OnAMPSubInvoiceSettled(ctx context.Context, arg OnAMPSubInvoiceSettledParams) error
	OnInvoiceCanceled(ctx context.Context, arg OnInvoiceCanceledParams) error
	OnInvoiceCreated(ctx context.Context, arg OnInvoiceCreatedParams) error
	OnInvoiceSettled(ctx context.Context, arg OnInvoiceSettledParams) error
	SetKVInvoicePaymentHash(ctx context.Context, arg SetKVInvoicePaymentHashParams) error
	SetMigration(ctx context.Context, arg SetMigrationParams) error
	SettleAttempt(ctx context.Context, arg SettleAttemptParams) error
	UpdateAMPSubInvoiceHTLCPreimage(ctx context.Context, arg UpdateAMPSubInvoiceHTLCPreimageParams) (sql.Result, error)
	UpdateAMPSubInvoiceState(ctx context.Context, arg UpdateAMPSubInvoiceStateParams) error
	UpdateInvoiceAmountPaid(ctx context.Context, arg UpdateInvoiceAmountPaidParams) (sql.Result, error)
	UpdateInvoiceHTLC(ctx context.Context, arg UpdateInvoiceHTLCParams) error
	UpdateInvoiceHTLCs(ctx context.Context, arg UpdateInvoiceHTLCsParams) error
	UpdateInvoiceState(ctx context.Context, arg UpdateInvoiceStateParams) (sql.Result, error)
	UpsertAMPSubInvoice(ctx context.Context, arg UpsertAMPSubInvoiceParams) (sql.Result, error)
	UpsertChanPolicyExtraType(ctx context.Context, arg UpsertChanPolicyExtraTypeParams) error
	UpsertChannelExtraType(ctx context.Context, arg UpsertChannelExtraTypeParams) error
	UpsertEdgePolicy(ctx context.Context, arg UpsertEdgePolicyParams) (int64, error)
	UpsertNode(ctx context.Context, arg UpsertNodeParams) (int64, error)
	UpsertNodeAddress(ctx context.Context, arg UpsertNodeAddressParams) error
	UpsertNodeExtraType(ctx context.Context, arg UpsertNodeExtraTypeParams) error
	UpsertPruneLogEntry(ctx context.Context, arg UpsertPruneLogEntryParams) error
	// We use a separate upsert for our own node since we want to be less strict
	// about the last_update field. For our own node, we always want to
	// update the record even if the last_update is the same as what we have.
	UpsertSourceNode(ctx context.Context, arg UpsertSourceNodeParams) (int64, error)
	UpsertZombieChannel(ctx context.Context, arg UpsertZombieChannelParams) error
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddSourceNode added in v1.0.10

func (q *Queries) AddSourceNode(ctx context.Context, nodeID int64) error

func (*Queries) AddV1ChannelProof added in v1.0.11

func (q *Queries) AddV1ChannelProof(ctx context.Context, arg AddV1ChannelProofParams) (sql.Result, error)

func (*Queries) AddV2ChannelProof added in v1.0.13

func (q *Queries) AddV2ChannelProof(ctx context.Context, arg AddV2ChannelProofParams) (sql.Result, error)

func (*Queries) ClearKVInvoiceHashIndex added in v1.0.7

func (q *Queries) ClearKVInvoiceHashIndex(ctx context.Context) error

func (*Queries) CountPayments added in v1.0.13

func (q *Queries) CountPayments(ctx context.Context) (int64, error)

func (*Queries) CountZombieChannels added in v1.0.11

func (q *Queries) CountZombieChannels(ctx context.Context, version int16) (int64, error)

func (*Queries) CreateChannel added in v1.0.10

func (q *Queries) CreateChannel(ctx context.Context, arg CreateChannelParams) (int64, error)

func (*Queries) DeleteCanceledInvoices

func (q *Queries) DeleteCanceledInvoices(ctx context.Context) (sql.Result, error)

func (*Queries) DeleteChannelPolicyExtraTypes added in v1.0.11

func (q *Queries) DeleteChannelPolicyExtraTypes(ctx context.Context, channelPolicyID int64) error

func (*Queries) DeleteChannels added in v1.0.11

func (q *Queries) DeleteChannels(ctx context.Context, ids []int64) error

func (*Queries) DeleteExtraNodeType added in v1.0.10

func (q *Queries) DeleteExtraNodeType(ctx context.Context, arg DeleteExtraNodeTypeParams) error

func (*Queries) DeleteFailedAttempts added in v1.0.13

func (q *Queries) DeleteFailedAttempts(ctx context.Context, paymentID int64) error

Delete all failed HTLC attempts for the given payment. Resolution type 2 indicates a failed attempt. Uses EXISTS to scope the resolution lookup to only this payment's attempts, avoiding an O(N) scan of all failed resolutions across all payments.

func (*Queries) DeleteInvoice

func (q *Queries) DeleteInvoice(ctx context.Context, arg DeleteInvoiceParams) (sql.Result, error)

func (*Queries) DeleteNode added in v1.0.11

func (q *Queries) DeleteNode(ctx context.Context, id int64) error

func (*Queries) DeleteNodeAddresses added in v1.0.10

func (q *Queries) DeleteNodeAddresses(ctx context.Context, nodeID int64) error

func (*Queries) DeleteNodeByPubKey added in v1.0.10

func (q *Queries) DeleteNodeByPubKey(ctx context.Context, arg DeleteNodeByPubKeyParams) (sql.Result, error)

func (*Queries) DeleteNodeFeature added in v1.0.10

func (q *Queries) DeleteNodeFeature(ctx context.Context, arg DeleteNodeFeatureParams) error

func (*Queries) DeletePayment added in v1.0.13

func (q *Queries) DeletePayment(ctx context.Context, id int64) error

func (*Queries) DeletePruneLogEntriesInRange added in v1.0.11

func (q *Queries) DeletePruneLogEntriesInRange(ctx context.Context, arg DeletePruneLogEntriesInRangeParams) error

func (*Queries) DeleteUnconnectedNodes added in v1.0.11

func (q *Queries) DeleteUnconnectedNodes(ctx context.Context) ([][]byte, error)

func (*Queries) DeleteZombieChannel added in v1.0.11

func (q *Queries) DeleteZombieChannel(ctx context.Context, arg DeleteZombieChannelParams) (sql.Result, error)

func (*Queries) FailAttempt added in v1.0.13

func (q *Queries) FailAttempt(ctx context.Context, arg FailAttemptParams) error

func (*Queries) FailPayment added in v1.0.13

func (q *Queries) FailPayment(ctx context.Context, arg FailPaymentParams) (sql.Result, error)

func (*Queries) FetchAMPSubInvoiceHTLCs

func (q *Queries) FetchAMPSubInvoiceHTLCs(ctx context.Context, arg FetchAMPSubInvoiceHTLCsParams) ([]FetchAMPSubInvoiceHTLCsRow, error)

func (*Queries) FetchAMPSubInvoices

func (q *Queries) FetchAMPSubInvoices(ctx context.Context, arg FetchAMPSubInvoicesParams) ([]AmpSubInvoice, error)

func (*Queries) FetchHopLevelCustomRecords added in v1.0.13

func (q *Queries) FetchHopLevelCustomRecords(ctx context.Context, hopIds []int64) ([]PaymentHopCustomRecord, error)

func (*Queries) FetchHopsForAttempts added in v1.0.13

func (q *Queries) FetchHopsForAttempts(ctx context.Context, htlcAttemptIndices []int64) ([]FetchHopsForAttemptsRow, error)

func (*Queries) FetchHtlcAttemptResolutionsForPayments added in v1.0.13

func (q *Queries) FetchHtlcAttemptResolutionsForPayments(ctx context.Context, paymentIds []int64) ([]FetchHtlcAttemptResolutionsForPaymentsRow, error)

Batch query to fetch only HTLC resolution status for multiple payments. We don't need to order by payment_id and attempt_time because we will group the resolutions by payment_id in the background.

func (*Queries) FetchHtlcAttemptsForPayments added in v1.0.13

func (q *Queries) FetchHtlcAttemptsForPayments(ctx context.Context, paymentIds []int64) ([]FetchHtlcAttemptsForPaymentsRow, error)

func (*Queries) FetchNonTerminalPayments added in v1.0.13

func (q *Queries) FetchNonTerminalPayments(ctx context.Context, arg FetchNonTerminalPaymentsParams) ([]FetchNonTerminalPaymentsRow, error)

Fetch all non-terminal payments using pagination. A payment is non-terminal if it has an unresolved attempt, or if it has not been permanently failed and has no settled attempt yet.

func (*Queries) FetchPayment added in v1.0.13

func (q *Queries) FetchPayment(ctx context.Context, paymentIdentifier []byte) (FetchPaymentRow, error)

func (*Queries) FetchPaymentDuplicates added in v1.0.13

func (q *Queries) FetchPaymentDuplicates(ctx context.Context, paymentID int64) ([]PaymentDuplicate, error)

Fetch all duplicate payment records from the payment_duplicates table for a given payment ID.

func (*Queries) FetchPaymentLevelFirstHopCustomRecords added in v1.0.13

func (q *Queries) FetchPaymentLevelFirstHopCustomRecords(ctx context.Context, paymentIds []int64) ([]PaymentFirstHopCustomRecord, error)

func (*Queries) FetchPaymentsByIDs added in v1.0.13

func (q *Queries) FetchPaymentsByIDs(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsRow, error)

Batch fetch payment and intent data for a set of payment IDs. Used to avoid fetching redundant payment data when processing multiple attempts for the same payment.

func (*Queries) FetchPaymentsByIDsMig added in v1.0.13

func (q *Queries) FetchPaymentsByIDsMig(ctx context.Context, paymentIds []int64) ([]FetchPaymentsByIDsMigRow, error)

Migration-specific batch fetch that returns payment data along with HTLC attempt counts for structural validation during KV to SQL migration.

func (*Queries) FetchPendingInvoices added in v1.0.13

func (q *Queries) FetchPendingInvoices(ctx context.Context, arg FetchPendingInvoicesParams) ([]Invoice, error)

FetchPendingInvoices returns all invoices in a pending state (open or accepted). The invoices_state_idx index on the state column makes this a fast index scan rather than a full table scan. id_cursor is an exclusive lower bound on the primary key used for cursor-based pagination; the caller must supply 0 when starting from the beginning.

func (*Queries) FetchRouteLevelFirstHopCustomRecords added in v1.0.13

func (q *Queries) FetchRouteLevelFirstHopCustomRecords(ctx context.Context, htlcAttemptIndices []int64) ([]PaymentAttemptFirstHopCustomRecord, error)

func (*Queries) FetchSettledAMPSubInvoices

func (q *Queries) FetchSettledAMPSubInvoices(ctx context.Context, arg FetchSettledAMPSubInvoicesParams) ([]FetchSettledAMPSubInvoicesRow, error)

func (*Queries) FilterInvoicesByAddIndex added in v1.0.13

func (q *Queries) FilterInvoicesByAddIndex(ctx context.Context, arg FilterInvoicesByAddIndexParams) ([]Invoice, error)

FilterInvoicesByAddIndex returns invoices whose add_index (primary key id) is greater than or equal to the given value, ordered by id. Because id is the primary key, this is always an efficient range scan on the clustered index. For cursor-based pagination the caller advances add_index_get to last_returned_id + 1 on each subsequent page.

func (*Queries) FilterInvoicesBySettleIndex added in v1.0.13

func (q *Queries) FilterInvoicesBySettleIndex(ctx context.Context, arg FilterInvoicesBySettleIndexParams) ([]Invoice, error)

FilterInvoicesBySettleIndex returns settled invoices whose settle_index is greater than or equal to the given value, ordered by id. The caller must always supply a concrete lower bound so the invoices_settle_index_idx index can be used. id_cursor is an exclusive lower bound on the primary key used for cursor-based pagination; the caller must supply 0 when starting from the beginning.

func (*Queries) FilterInvoicesForward added in v1.0.13

func (q *Queries) FilterInvoicesForward(ctx context.Context, arg FilterInvoicesForwardParams) ([]Invoice, error)

FilterInvoicesForward returns invoices in ascending id order. All parameters are non-nullable so the planner always sees plain range predicates and can use the primary-key index. For cursor-based pagination the caller advances add_index_get to last_returned_id + 1 on each subsequent page. The caller is responsible for supplying Go-side defaults when a filter is not needed:

add_index_get  → 1                             (first valid invoice id)
created_after  → time.Unix(0, 0).UTC()         (epoch – before any invoice)
created_before → time.Date(9999, …)             (far future – no upper cap)
pending_only   → false                          (include all states)

func (*Queries) FilterInvoicesReverse added in v1.0.13

func (q *Queries) FilterInvoicesReverse(ctx context.Context, arg FilterInvoicesReverseParams) ([]Invoice, error)

FilterInvoicesReverse is the descending counterpart of FilterInvoicesForward. It returns invoices in descending id order. For cursor-based pagination the caller advances add_index_let to last_returned_id - 1 on each subsequent page; pass math.MaxInt64 to start from the most recent invoice. See FilterInvoicesForward for the expected Go-side defaults.

func (*Queries) FilterPayments added in v1.0.13

func (q *Queries) FilterPayments(ctx context.Context, arg FilterPaymentsParams) ([]FilterPaymentsRow, error)

func (*Queries) FilterPaymentsDesc added in v1.0.13

func (q *Queries) FilterPaymentsDesc(ctx context.Context, arg FilterPaymentsDescParams) ([]FilterPaymentsDescRow, error)

func (*Queries) GetAMPInvoiceID

func (q *Queries) GetAMPInvoiceID(ctx context.Context, setID []byte) (int64, error)

func (*Queries) GetChainNetwork added in v1.0.13

func (q *Queries) GetChainNetwork(ctx context.Context) (string, error)

func (*Queries) GetChannelAndNodesBySCID added in v1.0.11

func (*Queries) GetChannelByOutpointWithPolicies added in v1.0.11

func (*Queries) GetChannelBySCID added in v1.0.10

func (q *Queries) GetChannelBySCID(ctx context.Context, arg GetChannelBySCIDParams) (GraphChannel, error)

func (*Queries) GetChannelBySCIDWithPolicies added in v1.0.11

func (*Queries) GetChannelExtrasBatch added in v1.0.11

func (q *Queries) GetChannelExtrasBatch(ctx context.Context, chanIds []int64) ([]GraphChannelExtraType, error)

func (*Queries) GetChannelFeaturesBatch added in v1.0.11

func (q *Queries) GetChannelFeaturesBatch(ctx context.Context, chanIds []int64) ([]GraphChannelFeature, error)

func (*Queries) GetChannelPolicyByChannelAndNode added in v1.0.11

func (q *Queries) GetChannelPolicyByChannelAndNode(ctx context.Context, arg GetChannelPolicyByChannelAndNodeParams) (GraphChannelPolicy, error)

func (*Queries) GetChannelPolicyExtraTypesBatch added in v1.0.11

func (q *Queries) GetChannelPolicyExtraTypesBatch(ctx context.Context, policyIds []int64) ([]GetChannelPolicyExtraTypesBatchRow, error)

func (*Queries) GetChannelsByIDs added in v1.0.11

func (q *Queries) GetChannelsByIDs(ctx context.Context, ids []int64) ([]GetChannelsByIDsRow, error)

func (*Queries) GetChannelsByOutpoints added in v1.0.11

func (q *Queries) GetChannelsByOutpoints(ctx context.Context, outpoints []string) ([]GetChannelsByOutpointsRow, error)

func (*Queries) GetChannelsByPolicyBlockRange added in v1.0.13

func (q *Queries) GetChannelsByPolicyBlockRange(ctx context.Context, arg GetChannelsByPolicyBlockRangeParams) ([]GetChannelsByPolicyBlockRangeRow, error)

func (*Queries) GetChannelsByPolicyLastUpdateRange added in v1.0.11

func (*Queries) GetChannelsBySCIDRange added in v1.0.11

func (q *Queries) GetChannelsBySCIDRange(ctx context.Context, arg GetChannelsBySCIDRangeParams) ([]GetChannelsBySCIDRangeRow, error)

func (*Queries) GetChannelsBySCIDWithPolicies added in v1.0.11

func (q *Queries) GetChannelsBySCIDWithPolicies(ctx context.Context, arg GetChannelsBySCIDWithPoliciesParams) ([]GetChannelsBySCIDWithPoliciesRow, error)

func (*Queries) GetChannelsBySCIDs added in v1.0.11

func (q *Queries) GetChannelsBySCIDs(ctx context.Context, arg GetChannelsBySCIDsParams) ([]GraphChannel, error)

func (*Queries) GetClosedChannelsSCIDs added in v1.0.11

func (q *Queries) GetClosedChannelsSCIDs(ctx context.Context, scids [][]byte) ([][]byte, error)

func (*Queries) GetDatabaseVersion added in v1.0.7

func (q *Queries) GetDatabaseVersion(ctx context.Context) (int32, error)

func (*Queries) GetExtraNodeTypes added in v1.0.10

func (q *Queries) GetExtraNodeTypes(ctx context.Context, nodeID int64) ([]GraphNodeExtraType, error)

func (*Queries) GetInvoiceByAddr added in v1.0.13

func (q *Queries) GetInvoiceByAddr(ctx context.Context, paymentAddr []byte) (Invoice, error)

func (*Queries) GetInvoiceByHash added in v1.0.7

func (q *Queries) GetInvoiceByHash(ctx context.Context, hash []byte) (Invoice, error)

func (*Queries) GetInvoiceBySetID added in v1.0.4

func (q *Queries) GetInvoiceBySetID(ctx context.Context, setID []byte) ([]Invoice, error)

TODO(ziggie): This query can only return one invoice if the set_id is the primary key of amp_sub_invoices table.

func (*Queries) GetInvoiceFeatures

func (q *Queries) GetInvoiceFeatures(ctx context.Context, invoiceID int64) ([]InvoiceFeature, error)

func (*Queries) GetInvoiceHTLCCustomRecords

func (q *Queries) GetInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int64) ([]GetInvoiceHTLCCustomRecordsRow, error)

func (*Queries) GetInvoiceHTLCs

func (q *Queries) GetInvoiceHTLCs(ctx context.Context, invoiceID int64) ([]InvoiceHtlc, error)

func (*Queries) GetKVInvoicePaymentHashByAddIndex added in v1.0.7

func (q *Queries) GetKVInvoicePaymentHashByAddIndex(ctx context.Context, addIndex int64) ([]byte, error)

func (*Queries) GetMigration added in v1.0.7

func (q *Queries) GetMigration(ctx context.Context, version int32) (time.Time, error)

func (*Queries) GetNodeAddresses added in v1.0.11

func (q *Queries) GetNodeAddresses(ctx context.Context, nodeID int64) ([]GetNodeAddressesRow, error)

func (*Queries) GetNodeAddressesBatch added in v1.0.11

func (q *Queries) GetNodeAddressesBatch(ctx context.Context, ids []int64) ([]GraphNodeAddress, error)

func (*Queries) GetNodeByPubKey added in v1.0.10

func (q *Queries) GetNodeByPubKey(ctx context.Context, arg GetNodeByPubKeyParams) (GraphNode, error)

func (*Queries) GetNodeExtraTypesBatch added in v1.0.11

func (q *Queries) GetNodeExtraTypesBatch(ctx context.Context, ids []int64) ([]GraphNodeExtraType, error)

func (*Queries) GetNodeFeatures added in v1.0.10

func (q *Queries) GetNodeFeatures(ctx context.Context, nodeID int64) ([]GraphNodeFeature, error)

func (*Queries) GetNodeFeaturesBatch added in v1.0.11

func (q *Queries) GetNodeFeaturesBatch(ctx context.Context, ids []int64) ([]GraphNodeFeature, error)

func (*Queries) GetNodeFeaturesByPubKey added in v1.0.10

func (q *Queries) GetNodeFeaturesByPubKey(ctx context.Context, arg GetNodeFeaturesByPubKeyParams) ([]int32, error)

func (*Queries) GetNodeIDByPubKey added in v1.0.11

func (q *Queries) GetNodeIDByPubKey(ctx context.Context, arg GetNodeIDByPubKeyParams) (int64, error)

func (*Queries) GetNodesByBlockHeightRange added in v1.0.13

func (q *Queries) GetNodesByBlockHeightRange(ctx context.Context, arg GetNodesByBlockHeightRangeParams) ([]GraphNode, error)

func (*Queries) GetNodesByIDs added in v1.0.11

func (q *Queries) GetNodesByIDs(ctx context.Context, ids []int64) ([]GraphNode, error)

func (*Queries) GetNodesByLastUpdateRange added in v1.0.10

func (q *Queries) GetNodesByLastUpdateRange(ctx context.Context, arg GetNodesByLastUpdateRangeParams) ([]GraphNode, error)

func (*Queries) GetPruneEntriesForHeights added in v1.0.11

func (q *Queries) GetPruneEntriesForHeights(ctx context.Context, heights []int64) ([]GraphPruneLog, error)

func (*Queries) GetPruneHashByHeight added in v1.0.11

func (q *Queries) GetPruneHashByHeight(ctx context.Context, blockHeight int64) ([]byte, error)

func (*Queries) GetPruneTip added in v1.0.11

func (q *Queries) GetPruneTip(ctx context.Context) (GraphPruneLog, error)

func (*Queries) GetPublicNodesByLastUpdateRange added in v1.0.13

func (q *Queries) GetPublicNodesByLastUpdateRange(ctx context.Context, arg GetPublicNodesByLastUpdateRangeParams) ([]GraphNode, error)

Returns only public V1 nodes within the given last_update range. A V1 node is public if it has at least one channel with a bitcoin_1_signature set. The public check uses two separate EXISTS probes (one per node_id column) instead of a single OR on node_id_1/node_id_2 so the planner can use the channel node-id indexes directly.

func (*Queries) GetPublicV1ChannelsBySCID added in v1.0.11

func (q *Queries) GetPublicV1ChannelsBySCID(ctx context.Context, arg GetPublicV1ChannelsBySCIDParams) ([]GraphChannel, error)

func (*Queries) GetPublicV2ChannelsBySCID added in v1.0.13

func (q *Queries) GetPublicV2ChannelsBySCID(ctx context.Context, arg GetPublicV2ChannelsBySCIDParams) ([]GraphChannel, error)

func (*Queries) GetSCIDByOutpoint added in v1.0.11

func (q *Queries) GetSCIDByOutpoint(ctx context.Context, arg GetSCIDByOutpointParams) ([]byte, error)

func (*Queries) GetSourceNodesByVersion added in v1.0.10

func (q *Queries) GetSourceNodesByVersion(ctx context.Context, version int16) ([]GetSourceNodesByVersionRow, error)

func (*Queries) GetTx added in v1.0.12

func (q *Queries) GetTx() DBTX

GetTx returns the underlying DBTX (either *sql.DB or *sql.Tx) used by the Queries struct.

func (*Queries) GetV1DisabledSCIDs added in v1.0.11

func (q *Queries) GetV1DisabledSCIDs(ctx context.Context) ([][]byte, error)

NOTE: this is V1 specific since for V1, disabled is a simple, single boolean. The proposed V2 policy structure will have a more complex disabled bit vector and so the query for V2 may differ.

func (*Queries) GetV2DisabledSCIDs added in v1.0.13

func (q *Queries) GetV2DisabledSCIDs(ctx context.Context) ([][]byte, error)

NOTE: this is V2 specific since V2 uses a disable flag bit vector instead of a single boolean.

func (*Queries) GetZombieChannel added in v1.0.11

func (q *Queries) GetZombieChannel(ctx context.Context, arg GetZombieChannelParams) (GraphZombieChannel, error)

func (*Queries) GetZombieChannelsSCIDs added in v1.0.11

func (q *Queries) GetZombieChannelsSCIDs(ctx context.Context, arg GetZombieChannelsSCIDsParams) ([]GraphZombieChannel, error)

func (*Queries) HighestSCID added in v1.0.10

func (q *Queries) HighestSCID(ctx context.Context, version int16) ([]byte, error)

func (*Queries) InsertAMPSubInvoice added in v1.0.7

func (q *Queries) InsertAMPSubInvoice(ctx context.Context, arg InsertAMPSubInvoiceParams) error

func (*Queries) InsertAMPSubInvoiceHTLC

func (q *Queries) InsertAMPSubInvoiceHTLC(ctx context.Context, arg InsertAMPSubInvoiceHTLCParams) error

func (*Queries) InsertChainNetwork added in v1.0.13

func (q *Queries) InsertChainNetwork(ctx context.Context, network string) error

func (*Queries) InsertChannelFeature added in v1.0.10

func (q *Queries) InsertChannelFeature(ctx context.Context, arg InsertChannelFeatureParams) error

func (*Queries) InsertChannelMig added in v1.0.11

func (q *Queries) InsertChannelMig(ctx context.Context, arg InsertChannelMigParams) (int64, error)

NOTE: This query is only meant to be used by the graph SQL migration since for that migration, in order to be retry-safe, we don't want to error out if we re-insert the same channel again (which would error if the normal CreateChannel query is used because of the uniqueness constraint on the scid and version columns).

func (*Queries) InsertClosedChannel added in v1.0.11

func (q *Queries) InsertClosedChannel(ctx context.Context, scid []byte) error

func (*Queries) InsertEdgePolicyMig added in v1.0.11

func (q *Queries) InsertEdgePolicyMig(ctx context.Context, arg InsertEdgePolicyMigParams) (int64, error)

NOTE: This query is only meant to be used by the graph SQL migration since for that migration, in order to be retry-safe, we don't want to error out if we re-insert the same policy (which would error if the normal UpsertEdgePolicy query is used because of the constraint in that query that requires a policy update to have a newer last_update than the existing one).

func (*Queries) InsertHtlcAttempt added in v1.0.13

func (q *Queries) InsertHtlcAttempt(ctx context.Context, arg InsertHtlcAttemptParams) (int64, error)

func (*Queries) InsertInvoice

func (q *Queries) InsertInvoice(ctx context.Context, arg InsertInvoiceParams) (int64, error)

func (*Queries) InsertInvoiceFeature

func (q *Queries) InsertInvoiceFeature(ctx context.Context, arg InsertInvoiceFeatureParams) error

func (*Queries) InsertInvoiceHTLC

func (q *Queries) InsertInvoiceHTLC(ctx context.Context, arg InsertInvoiceHTLCParams) (int64, error)

func (*Queries) InsertInvoiceHTLCCustomRecord

func (q *Queries) InsertInvoiceHTLCCustomRecord(ctx context.Context, arg InsertInvoiceHTLCCustomRecordParams) error

func (*Queries) InsertKVInvoiceKeyAndAddIndex added in v1.0.7

func (q *Queries) InsertKVInvoiceKeyAndAddIndex(ctx context.Context, arg InsertKVInvoiceKeyAndAddIndexParams) error

func (*Queries) InsertMigratedInvoice added in v1.0.7

func (q *Queries) InsertMigratedInvoice(ctx context.Context, arg InsertMigratedInvoiceParams) (int64, error)

func (*Queries) InsertNodeFeature added in v1.0.10

func (q *Queries) InsertNodeFeature(ctx context.Context, arg InsertNodeFeatureParams) error

func (*Queries) InsertNodeMig added in v1.0.11

func (q *Queries) InsertNodeMig(ctx context.Context, arg InsertNodeMigParams) (int64, error)

NOTE: This query is only meant to be used by the graph SQL migration since for that migration, in order to be retry-safe, we don't want to error out if we re-insert the same node (which would error if the normal UpsertNode query is used because of the constraint in that query that requires a node update to have a newer last_update than the existing node).

func (*Queries) InsertPayment added in v1.0.13

func (q *Queries) InsertPayment(ctx context.Context, arg InsertPaymentParams) (int64, error)

Insert a new payment and return its ID. When creating a payment we don't have a fail reason because we start the payment process.

func (*Queries) InsertPaymentAttemptFirstHopCustomRecord added in v1.0.13

func (q *Queries) InsertPaymentAttemptFirstHopCustomRecord(ctx context.Context, arg InsertPaymentAttemptFirstHopCustomRecordParams) error

func (*Queries) InsertPaymentDuplicateMig added in v1.0.13

func (q *Queries) InsertPaymentDuplicateMig(ctx context.Context, arg InsertPaymentDuplicateMigParams) (int64, error)

Insert a duplicate payment record into the payment_duplicates table and return its ID.

func (*Queries) InsertPaymentFirstHopCustomRecord added in v1.0.13

func (q *Queries) InsertPaymentFirstHopCustomRecord(ctx context.Context, arg InsertPaymentFirstHopCustomRecordParams) error

func (*Queries) InsertPaymentHopCustomRecord added in v1.0.13

func (q *Queries) InsertPaymentHopCustomRecord(ctx context.Context, arg InsertPaymentHopCustomRecordParams) error

func (*Queries) InsertPaymentIntent added in v1.0.13

func (q *Queries) InsertPaymentIntent(ctx context.Context, arg InsertPaymentIntentParams) (int64, error)

Insert a payment intent for a given payment and return its ID.

func (*Queries) InsertPaymentMig added in v1.0.13

func (q *Queries) InsertPaymentMig(ctx context.Context, arg InsertPaymentMigParams) (int64, error)

Migration-specific payment insert that allows setting fail_reason. Normal InsertPayment forces fail_reason to NULL since new payments aren't failed yet. During migration, we're inserting historical data that may already be failed.

func (*Queries) InsertRouteHop added in v1.0.13

func (q *Queries) InsertRouteHop(ctx context.Context, arg InsertRouteHopParams) (int64, error)

func (*Queries) InsertRouteHopAmp added in v1.0.13

func (q *Queries) InsertRouteHopAmp(ctx context.Context, arg InsertRouteHopAmpParams) error

func (*Queries) InsertRouteHopBlinded added in v1.0.13

func (q *Queries) InsertRouteHopBlinded(ctx context.Context, arg InsertRouteHopBlindedParams) error

func (*Queries) InsertRouteHopMpp added in v1.0.13

func (q *Queries) InsertRouteHopMpp(ctx context.Context, arg InsertRouteHopMppParams) error

func (*Queries) IsClosedChannel added in v1.0.11

func (q *Queries) IsClosedChannel(ctx context.Context, scid []byte) (bool, error)

func (*Queries) IsPublicV1Node added in v1.0.11

func (q *Queries) IsPublicV1Node(ctx context.Context, pubKey []byte) (bool, error)

func (*Queries) IsPublicV2Node added in v1.0.13

func (q *Queries) IsPublicV2Node(ctx context.Context, pubKey []byte) (bool, error)

func (*Queries) IsZombieChannel added in v1.0.11

func (q *Queries) IsZombieChannel(ctx context.Context, arg IsZombieChannelParams) (bool, error)

func (*Queries) ListChannelsByNodeID added in v1.0.11

func (q *Queries) ListChannelsByNodeID(ctx context.Context, arg ListChannelsByNodeIDParams) ([]ListChannelsByNodeIDRow, error)

func (*Queries) ListChannelsForNodeIDs added in v1.0.11

func (q *Queries) ListChannelsForNodeIDs(ctx context.Context, arg ListChannelsForNodeIDsParams) ([]ListChannelsForNodeIDsRow, error)

func (*Queries) ListChannelsPaginated added in v1.0.11

func (q *Queries) ListChannelsPaginated(ctx context.Context, arg ListChannelsPaginatedParams) ([]ListChannelsPaginatedRow, error)

func (*Queries) ListChannelsPaginatedV2 added in v1.0.13

func (q *Queries) ListChannelsPaginatedV2(ctx context.Context, arg ListChannelsPaginatedV2Params) ([]ListChannelsPaginatedV2Row, error)

func (*Queries) ListChannelsWithPoliciesForCachePaginated added in v1.0.11

func (*Queries) ListChannelsWithPoliciesPaginated added in v1.0.11

func (*Queries) ListNodeIDsAndPubKeys added in v1.0.11

func (q *Queries) ListNodeIDsAndPubKeys(ctx context.Context, arg ListNodeIDsAndPubKeysParams) ([]ListNodeIDsAndPubKeysRow, error)

func (*Queries) ListNodesPaginated added in v1.0.11

func (q *Queries) ListNodesPaginated(ctx context.Context, arg ListNodesPaginatedParams) ([]GraphNode, error)

func (*Queries) NextInvoiceSettleIndex

func (q *Queries) NextInvoiceSettleIndex(ctx context.Context) (int64, error)

func (*Queries) NodeExists added in v1.0.13

func (q *Queries) NodeExists(ctx context.Context, arg NodeExistsParams) (bool, error)

func (*Queries) OnAMPSubInvoiceCanceled

func (q *Queries) OnAMPSubInvoiceCanceled(ctx context.Context, arg OnAMPSubInvoiceCanceledParams) error

func (*Queries) OnAMPSubInvoiceCreated

func (q *Queries) OnAMPSubInvoiceCreated(ctx context.Context, arg OnAMPSubInvoiceCreatedParams) error

func (*Queries) OnAMPSubInvoiceSettled

func (q *Queries) OnAMPSubInvoiceSettled(ctx context.Context, arg OnAMPSubInvoiceSettledParams) error

func (*Queries) OnInvoiceCanceled

func (q *Queries) OnInvoiceCanceled(ctx context.Context, arg OnInvoiceCanceledParams) error

func (*Queries) OnInvoiceCreated

func (q *Queries) OnInvoiceCreated(ctx context.Context, arg OnInvoiceCreatedParams) error

func (*Queries) OnInvoiceSettled

func (q *Queries) OnInvoiceSettled(ctx context.Context, arg OnInvoiceSettledParams) error

func (*Queries) SetKVInvoicePaymentHash added in v1.0.7

func (q *Queries) SetKVInvoicePaymentHash(ctx context.Context, arg SetKVInvoicePaymentHashParams) error

func (*Queries) SetMigration added in v1.0.7

func (q *Queries) SetMigration(ctx context.Context, arg SetMigrationParams) error

func (*Queries) SettleAttempt added in v1.0.13

func (q *Queries) SettleAttempt(ctx context.Context, arg SettleAttemptParams) error

func (*Queries) UpdateAMPSubInvoiceHTLCPreimage

func (q *Queries) UpdateAMPSubInvoiceHTLCPreimage(ctx context.Context, arg UpdateAMPSubInvoiceHTLCPreimageParams) (sql.Result, error)

func (*Queries) UpdateAMPSubInvoiceState

func (q *Queries) UpdateAMPSubInvoiceState(ctx context.Context, arg UpdateAMPSubInvoiceStateParams) error

func (*Queries) UpdateInvoiceAmountPaid

func (q *Queries) UpdateInvoiceAmountPaid(ctx context.Context, arg UpdateInvoiceAmountPaidParams) (sql.Result, error)

func (*Queries) UpdateInvoiceHTLC

func (q *Queries) UpdateInvoiceHTLC(ctx context.Context, arg UpdateInvoiceHTLCParams) error

func (*Queries) UpdateInvoiceHTLCs

func (q *Queries) UpdateInvoiceHTLCs(ctx context.Context, arg UpdateInvoiceHTLCsParams) error

func (*Queries) UpdateInvoiceState

func (q *Queries) UpdateInvoiceState(ctx context.Context, arg UpdateInvoiceStateParams) (sql.Result, error)

func (*Queries) UpsertAMPSubInvoice

func (q *Queries) UpsertAMPSubInvoice(ctx context.Context, arg UpsertAMPSubInvoiceParams) (sql.Result, error)

func (*Queries) UpsertChanPolicyExtraType added in v1.0.11

func (q *Queries) UpsertChanPolicyExtraType(ctx context.Context, arg UpsertChanPolicyExtraTypeParams) error

func (*Queries) UpsertChannelExtraType added in v1.0.11

func (q *Queries) UpsertChannelExtraType(ctx context.Context, arg UpsertChannelExtraTypeParams) error

func (*Queries) UpsertEdgePolicy added in v1.0.11

func (q *Queries) UpsertEdgePolicy(ctx context.Context, arg UpsertEdgePolicyParams) (int64, error)

func (*Queries) UpsertNode added in v1.0.10

func (q *Queries) UpsertNode(ctx context.Context, arg UpsertNodeParams) (int64, error)

func (*Queries) UpsertNodeAddress added in v1.0.11

func (q *Queries) UpsertNodeAddress(ctx context.Context, arg UpsertNodeAddressParams) error

func (*Queries) UpsertNodeExtraType added in v1.0.10

func (q *Queries) UpsertNodeExtraType(ctx context.Context, arg UpsertNodeExtraTypeParams) error

func (*Queries) UpsertPruneLogEntry added in v1.0.11

func (q *Queries) UpsertPruneLogEntry(ctx context.Context, arg UpsertPruneLogEntryParams) error

func (*Queries) UpsertSourceNode added in v1.0.12

func (q *Queries) UpsertSourceNode(ctx context.Context, arg UpsertSourceNodeParams) (int64, error)

We use a separate upsert for our own node since we want to be less strict about the last_update field. For our own node, we always want to update the record even if the last_update is the same as what we have.

func (*Queries) UpsertZombieChannel added in v1.0.11

func (q *Queries) UpsertZombieChannel(ctx context.Context, arg UpsertZombieChannelParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type SetKVInvoicePaymentHashParams added in v1.0.7

type SetKVInvoicePaymentHashParams struct {
	ID   int64
	Hash []byte
}

type SetMigrationParams added in v1.0.7

type SetMigrationParams struct {
	Version       int32
	MigrationTime time.Time
}

type SettleAttemptParams added in v1.0.13

type SettleAttemptParams struct {
	AttemptIndex   int64
	ResolutionTime time.Time
	ResolutionType int32
	SettlePreimage []byte
}

type UpdateAMPSubInvoiceHTLCPreimageParams

type UpdateAMPSubInvoiceHTLCPreimageParams struct {
	InvoiceID int64
	SetID     []byte
	ChanID    string
	HtlcID    int64
	Preimage  []byte
}

type UpdateAMPSubInvoiceStateParams

type UpdateAMPSubInvoiceStateParams struct {
	SetID       []byte
	State       int16
	SettleIndex sql.NullInt64
	SettledAt   sql.NullTime
}

type UpdateInvoiceAmountPaidParams

type UpdateInvoiceAmountPaidParams struct {
	ID             int64
	AmountPaidMsat int64
}

type UpdateInvoiceHTLCParams

type UpdateInvoiceHTLCParams struct {
	HtlcID      int64
	ChanID      string
	InvoiceID   int64
	State       int16
	ResolveTime sql.NullTime
}

type UpdateInvoiceHTLCsParams

type UpdateInvoiceHTLCsParams struct {
	InvoiceID   int64
	State       int16
	ResolveTime sql.NullTime
}

type UpdateInvoiceStateParams

type UpdateInvoiceStateParams struct {
	ID          int64
	State       int16
	Preimage    []byte
	SettleIndex sql.NullInt64
	SettledAt   sql.NullTime
}

type UpsertAMPSubInvoiceParams

type UpsertAMPSubInvoiceParams struct {
	SetID     []byte
	State     int16
	CreatedAt time.Time
	InvoiceID int64
}

type UpsertChanPolicyExtraTypeParams added in v1.0.11

type UpsertChanPolicyExtraTypeParams struct {
	ChannelPolicyID int64
	Type            int64
	Value           []byte
}

type UpsertChannelExtraTypeParams added in v1.0.11

type UpsertChannelExtraTypeParams struct {
	ChannelID int64
	Type      int64
	Value     []byte
}

type UpsertEdgePolicyParams added in v1.0.11

type UpsertEdgePolicyParams struct {
	Version                 int16
	ChannelID               int64
	NodeID                  int64
	Timelock                int32
	FeePpm                  int64
	BaseFeeMsat             int64
	MinHtlcMsat             int64
	LastUpdate              sql.NullInt64
	Disabled                sql.NullBool
	MaxHtlcMsat             sql.NullInt64
	InboundBaseFeeMsat      sql.NullInt64
	InboundFeeRateMilliMsat sql.NullInt64
	MessageFlags            sql.NullInt16
	ChannelFlags            sql.NullInt16
	Signature               []byte
	BlockHeight             sql.NullInt64
	DisableFlags            sql.NullInt16
}

type UpsertNodeAddressParams added in v1.0.11

type UpsertNodeAddressParams struct {
	NodeID   int64
	Type     int16
	Address  string
	Position int32
}

type UpsertNodeExtraTypeParams added in v1.0.10

type UpsertNodeExtraTypeParams struct {
	NodeID int64
	Type   int64
	Value  []byte
}

type UpsertNodeParams added in v1.0.10

type UpsertNodeParams struct {
	Version     int16
	PubKey      []byte
	Alias       sql.NullString
	LastUpdate  sql.NullInt64
	BlockHeight sql.NullInt64
	Color       sql.NullString
	Signature   []byte
}

type UpsertPruneLogEntryParams added in v1.0.11

type UpsertPruneLogEntryParams struct {
	BlockHeight int64
	BlockHash   []byte
}

type UpsertSourceNodeParams added in v1.0.12

type UpsertSourceNodeParams struct {
	Version     int16
	PubKey      []byte
	Alias       sql.NullString
	LastUpdate  sql.NullInt64
	BlockHeight sql.NullInt64
	Color       sql.NullString
	Signature   []byte
}

type UpsertZombieChannelParams added in v1.0.11

type UpsertZombieChannelParams struct {
	Scid     []byte
	Version  int16
	NodeKey1 []byte
	NodeKey2 []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL