queries

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddIntentFeesParams added in v0.8.11

type AddIntentFeesParams struct {
	OffchainInputFeeProgram  interface{}
	OnchainInputFeeProgram   interface{}
	OffchainOutputFeeProgram interface{}
	OnchainOutputFeeProgram  interface{}
}

type CheckpointTx

type CheckpointTx struct {
	Txid                 string
	Tx                   string
	CommitmentTxid       string
	IsRootCommitmentTxid bool
	OffchainTxid         string
}

type Conviction added in v0.8.0

type Conviction struct {
	ID           string
	Type         int64
	CreatedAt    int64
	ExpiresAt    sql.NullInt64
	CrimeType    int64
	CrimeRoundID string
	CrimeReason  string
	Pardoned     bool
	Script       sql.NullString
}

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 InsertVtxoCommitmentTxidParams

type InsertVtxoCommitmentTxidParams struct {
	VtxoTxid       string
	VtxoVout       int64
	CommitmentTxid string
}

type Intent

type Intent struct {
	ID      sql.NullString
	RoundID sql.NullString
	Proof   sql.NullString
	Message sql.NullString
}

type IntentFee added in v0.8.11

type IntentFee struct {
	ID                       int64
	CreatedAt                int64
	OffchainInputFeeProgram  string
	OnchainInputFeeProgram   string
	OffchainOutputFeeProgram string
	OnchainOutputFeeProgram  string
}

type IntentWithInputsVw

type IntentWithInputsVw struct {
	Txid           sql.NullString
	Vout           sql.NullInt64
	Pubkey         sql.NullString
	Amount         sql.NullInt64
	ExpiresAt      sql.NullInt64
	CreatedAt      sql.NullInt64
	CommitmentTxid sql.NullString
	SpentBy        sql.NullString
	Spent          sql.NullBool
	Unrolled       sql.NullBool
	Swept          sql.NullBool
	Preconfirmed   sql.NullBool
	SettledBy      sql.NullString
	ArkTxid        sql.NullString
	IntentID       sql.NullString
	Commitments    interface{}
	ID             sql.NullString
	RoundID        sql.NullString
	Proof          sql.NullString
	Message        sql.NullString
}

type IntentWithReceiversVw

type IntentWithReceiversVw struct {
	IntentID       sql.NullString
	Pubkey         sql.NullString
	OnchainAddress sql.NullString
	Amount         sql.NullInt64
	ID             sql.NullString
	RoundID        sql.NullString
	Proof          sql.NullString
	Message        sql.NullString
}

type OffchainTx

type OffchainTx struct {
	Txid              string
	Tx                string
	StartingTimestamp int64
	EndingTimestamp   int64
	ExpiryTimestamp   int64
	FailReason        sql.NullString
	StageCode         int64
}

type OffchainTxVw

type OffchainTxVw struct {
	Txid                 string
	Tx                   string
	StartingTimestamp    int64
	EndingTimestamp      int64
	ExpiryTimestamp      int64
	FailReason           sql.NullString
	StageCode            int64
	CheckpointTxid       string
	CheckpointTx         string
	CommitmentTxid       string
	IsRootCommitmentTxid bool
	OffchainTxid         string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddIntentFees added in v0.8.11

func (q *Queries) AddIntentFees(ctx context.Context, arg AddIntentFeesParams) error

func (*Queries) ClearIntentFees added in v0.8.11

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

func (*Queries) ClearScheduledSession added in v0.8.4

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

func (*Queries) InsertVtxoCommitmentTxid

func (q *Queries) InsertVtxoCommitmentTxid(ctx context.Context, arg InsertVtxoCommitmentTxidParams) error

func (*Queries) SelectActiveScriptConvictions added in v0.8.0

func (q *Queries) SelectActiveScriptConvictions(ctx context.Context, arg SelectActiveScriptConvictionsParams) ([]Conviction, error)

func (*Queries) SelectAllRoundIds

func (q *Queries) SelectAllRoundIds(ctx context.Context) ([]string, error)

func (*Queries) SelectAllVtxos

func (q *Queries) SelectAllVtxos(ctx context.Context) ([]SelectAllVtxosRow, error)

func (*Queries) SelectConviction added in v0.8.0

func (q *Queries) SelectConviction(ctx context.Context, id string) (Conviction, error)

func (*Queries) SelectConvictionsByRoundID added in v0.8.0

func (q *Queries) SelectConvictionsByRoundID(ctx context.Context, roundID string) ([]Conviction, error)

func (*Queries) SelectConvictionsInTimeRange added in v0.8.0

func (q *Queries) SelectConvictionsInTimeRange(ctx context.Context, arg SelectConvictionsInTimeRangeParams) ([]Conviction, error)

func (*Queries) SelectExpiringLiquidityAmount added in v0.8.11

func (q *Queries) SelectExpiringLiquidityAmount(ctx context.Context, arg SelectExpiringLiquidityAmountParams) (interface{}, error)

func (*Queries) SelectLatestIntentFees added in v0.8.11

func (q *Queries) SelectLatestIntentFees(ctx context.Context) (IntentFee, error)

func (*Queries) SelectLatestScheduledSession added in v0.8.0

func (q *Queries) SelectLatestScheduledSession(ctx context.Context) (ScheduledSession, error)

func (*Queries) SelectNotUnrolledVtxos

func (q *Queries) SelectNotUnrolledVtxos(ctx context.Context) ([]SelectNotUnrolledVtxosRow, error)

func (*Queries) SelectNotUnrolledVtxosWithPubkey

func (q *Queries) SelectNotUnrolledVtxosWithPubkey(ctx context.Context, pubkey string) ([]SelectNotUnrolledVtxosWithPubkeyRow, error)

func (*Queries) SelectOffchainTx

func (q *Queries) SelectOffchainTx(ctx context.Context, txid string) ([]SelectOffchainTxRow, error)

func (*Queries) SelectPendingSpentVtxo added in v0.8.9

func (q *Queries) SelectPendingSpentVtxo(ctx context.Context, arg SelectPendingSpentVtxoParams) (VtxoVw, error)

func (*Queries) SelectPendingSpentVtxosWithPubkeys added in v0.8.9

func (q *Queries) SelectPendingSpentVtxosWithPubkeys(ctx context.Context, pubkeys []string) ([]VtxoVw, error)

func (*Queries) SelectRecoverableLiquidityAmount added in v0.8.11

func (q *Queries) SelectRecoverableLiquidityAmount(ctx context.Context) (interface{}, error)

func (*Queries) SelectRoundConnectors

func (q *Queries) SelectRoundConnectors(ctx context.Context, txid string) ([]Tx, error)

func (*Queries) SelectRoundForfeitTxs

func (q *Queries) SelectRoundForfeitTxs(ctx context.Context, txid string) ([]Tx, error)

func (*Queries) SelectRoundIdsInTimeRange

func (q *Queries) SelectRoundIdsInTimeRange(ctx context.Context, arg SelectRoundIdsInTimeRangeParams) ([]string, error)

func (*Queries) SelectRoundIdsInTimeRangeWithFilters added in v0.8.0

func (q *Queries) SelectRoundIdsInTimeRangeWithFilters(ctx context.Context, arg SelectRoundIdsInTimeRangeWithFiltersParams) ([]string, error)

func (*Queries) SelectRoundIdsWithFilters added in v0.8.0

func (q *Queries) SelectRoundIdsWithFilters(ctx context.Context, arg SelectRoundIdsWithFiltersParams) ([]string, error)

func (*Queries) SelectRoundStats

func (q *Queries) SelectRoundStats(ctx context.Context, txid string) (SelectRoundStatsRow, error)

func (*Queries) SelectRoundVtxoTree

func (q *Queries) SelectRoundVtxoTree(ctx context.Context, txid string) ([]Tx, error)

func (*Queries) SelectRoundVtxoTreeLeaves

func (q *Queries) SelectRoundVtxoTreeLeaves(ctx context.Context, commitmentTxid string) ([]SelectRoundVtxoTreeLeavesRow, error)

func (*Queries) SelectRoundWithId

func (q *Queries) SelectRoundWithId(ctx context.Context, id string) ([]SelectRoundWithIdRow, error)

func (*Queries) SelectRoundWithTxid

func (q *Queries) SelectRoundWithTxid(ctx context.Context, txid string) ([]SelectRoundWithTxidRow, error)

func (*Queries) SelectRoundsWithTxids

func (q *Queries) SelectRoundsWithTxids(ctx context.Context, txids []string) ([]string, error)

func (*Queries) SelectSweepableRounds

func (q *Queries) SelectSweepableRounds(ctx context.Context) ([]string, error)

func (*Queries) SelectSweepableUnrolledVtxos added in v0.8.0

func (q *Queries) SelectSweepableUnrolledVtxos(ctx context.Context) ([]SelectSweepableUnrolledVtxosRow, error)

func (*Queries) SelectSweepableVtxoOutpointsByCommitmentTxid added in v0.8.7

func (q *Queries) SelectSweepableVtxoOutpointsByCommitmentTxid(ctx context.Context, commitmentTxid string) ([]SelectSweepableVtxoOutpointsByCommitmentTxidRow, error)

func (*Queries) SelectSweptRoundsConnectorAddress

func (q *Queries) SelectSweptRoundsConnectorAddress(ctx context.Context) ([]string, error)

func (*Queries) SelectTxs

func (q *Queries) SelectTxs(ctx context.Context, arg SelectTxsParams) ([]SelectTxsRow, error)

func (*Queries) SelectVtxo

func (q *Queries) SelectVtxo(ctx context.Context, arg SelectVtxoParams) (SelectVtxoRow, error)

func (*Queries) SelectVtxoPubKeysByCommitmentTxid added in v0.8.7

func (q *Queries) SelectVtxoPubKeysByCommitmentTxid(ctx context.Context, arg SelectVtxoPubKeysByCommitmentTxidParams) ([]string, error)

func (*Queries) SelectVtxosOutpointsByArkTxidRecursive added in v0.8.7

func (q *Queries) SelectVtxosOutpointsByArkTxidRecursive(ctx context.Context, txid string) ([]SelectVtxosOutpointsByArkTxidRecursiveRow, error)

keep one row per node at its MIN depth (layers)

func (*Queries) SelectVtxosWithPubkeys

func (q *Queries) SelectVtxosWithPubkeys(ctx context.Context, pubkeys []string) ([]SelectVtxosWithPubkeysRow, error)

func (*Queries) UpdateConvictionPardoned added in v0.8.0

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

func (*Queries) UpdateVtxoExpiration

func (q *Queries) UpdateVtxoExpiration(ctx context.Context, arg UpdateVtxoExpirationParams) error

func (*Queries) UpdateVtxoIntentId

func (q *Queries) UpdateVtxoIntentId(ctx context.Context, arg UpdateVtxoIntentIdParams) error

func (*Queries) UpdateVtxoSettled

func (q *Queries) UpdateVtxoSettled(ctx context.Context, arg UpdateVtxoSettledParams) error

func (*Queries) UpdateVtxoSpent

func (q *Queries) UpdateVtxoSpent(ctx context.Context, arg UpdateVtxoSpentParams) error

func (*Queries) UpdateVtxoSweptIfNotSwept added in v0.8.0

func (q *Queries) UpdateVtxoSweptIfNotSwept(ctx context.Context, arg UpdateVtxoSweptIfNotSweptParams) (int64, error)

func (*Queries) UpdateVtxoUnrolled

func (q *Queries) UpdateVtxoUnrolled(ctx context.Context, arg UpdateVtxoUnrolledParams) error

func (*Queries) UpsertCheckpointTx

func (q *Queries) UpsertCheckpointTx(ctx context.Context, arg UpsertCheckpointTxParams) error

func (*Queries) UpsertConviction added in v0.8.0

func (q *Queries) UpsertConviction(ctx context.Context, arg UpsertConvictionParams) error

func (*Queries) UpsertIntent

func (q *Queries) UpsertIntent(ctx context.Context, arg UpsertIntentParams) error

func (*Queries) UpsertOffchainTx

func (q *Queries) UpsertOffchainTx(ctx context.Context, arg UpsertOffchainTxParams) error

func (*Queries) UpsertReceiver

func (q *Queries) UpsertReceiver(ctx context.Context, arg UpsertReceiverParams) error

func (*Queries) UpsertRound

func (q *Queries) UpsertRound(ctx context.Context, arg UpsertRoundParams) error

func (*Queries) UpsertScheduledSession added in v0.8.0

func (q *Queries) UpsertScheduledSession(ctx context.Context, arg UpsertScheduledSessionParams) error

func (*Queries) UpsertTx

func (q *Queries) UpsertTx(ctx context.Context, arg UpsertTxParams) error

func (*Queries) UpsertVtxo

func (q *Queries) UpsertVtxo(ctx context.Context, arg UpsertVtxoParams) error

func (*Queries) WithTx

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

type Receiver

type Receiver struct {
	IntentID       string
	Pubkey         sql.NullString
	OnchainAddress string
	Amount         int64
}

type Round

type Round struct {
	ID                 string
	StartingTimestamp  int64
	EndingTimestamp    int64
	Ended              bool
	Failed             bool
	StageCode          int64
	ConnectorAddress   string
	Version            int64
	Swept              bool
	VtxoTreeExpiration int64
	FailReason         sql.NullString
}

type RoundIntentsVw

type RoundIntentsVw struct {
	ID      sql.NullString
	RoundID sql.NullString
	Proof   sql.NullString
	Message sql.NullString
}

type RoundTxsVw

type RoundTxsVw struct {
	Txid     sql.NullString
	Tx       sql.NullString
	RoundID  sql.NullString
	Type     sql.NullString
	Position sql.NullInt64
	Children sql.NullString
}

type RoundWithCommitmentTxVw

type RoundWithCommitmentTxVw struct {
	ID                 string
	StartingTimestamp  int64
	EndingTimestamp    int64
	Ended              bool
	Failed             bool
	StageCode          int64
	ConnectorAddress   string
	Version            int64
	Swept              bool
	VtxoTreeExpiration int64
	FailReason         sql.NullString
	Txid               string
	Tx                 string
	RoundID            string
	Type               string
	Position           int64
	Children           sql.NullString
}

type ScheduledSession added in v0.8.0

type ScheduledSession struct {
	ID                   int64
	StartTime            int64
	EndTime              int64
	Period               int64
	Duration             int64
	RoundMinParticipants int64
	RoundMaxParticipants int64
	UpdatedAt            int64
}

type SelectActiveScriptConvictionsParams added in v0.8.0

type SelectActiveScriptConvictionsParams struct {
	Script    sql.NullString
	ExpiresAt sql.NullInt64
}

type SelectAllVtxosRow

type SelectAllVtxosRow struct {
	VtxoVw VtxoVw
}

type SelectConvictionsInTimeRangeParams added in v0.8.0

type SelectConvictionsInTimeRangeParams struct {
	FromTime int64
	ToTime   int64
}

type SelectExpiringLiquidityAmountParams added in v0.8.11

type SelectExpiringLiquidityAmountParams struct {
	After  int64
	Before interface{}
}

type SelectNotUnrolledVtxosRow

type SelectNotUnrolledVtxosRow struct {
	VtxoVw VtxoVw
}

type SelectNotUnrolledVtxosWithPubkeyRow

type SelectNotUnrolledVtxosWithPubkeyRow struct {
	VtxoVw VtxoVw
}

type SelectOffchainTxRow

type SelectOffchainTxRow struct {
	OffchainTxVw OffchainTxVw
}

type SelectPendingSpentVtxoParams added in v0.8.9

type SelectPendingSpentVtxoParams struct {
	Txid string
	Vout int64
}

type SelectRoundIdsInTimeRangeParams

type SelectRoundIdsInTimeRangeParams struct {
	StartTs int64
	EndTs   int64
}

type SelectRoundIdsInTimeRangeWithFiltersParams added in v0.8.0

type SelectRoundIdsInTimeRangeWithFiltersParams struct {
	StartTs       int64
	EndTs         int64
	WithFailed    interface{}
	WithCompleted interface{}
}

type SelectRoundIdsWithFiltersParams added in v0.8.0

type SelectRoundIdsWithFiltersParams struct {
	WithFailed    interface{}
	WithCompleted interface{}
}

type SelectRoundStatsRow

type SelectRoundStatsRow struct {
	Swept              bool
	StartingTimestamp  int64
	EndingTimestamp    int64
	TotalForfeitAmount interface{}
	TotalInputVtxos    interface{}
	TotalBatchAmount   interface{}
	TotalOutputVtxos   int64
	ExpiresAt          interface{}
}

type SelectRoundVtxoTreeLeavesRow

type SelectRoundVtxoTreeLeavesRow struct {
	VtxoVw VtxoVw
}

type SelectRoundWithIdRow

type SelectRoundWithIdRow struct {
	Round                 Round
	RoundIntentsVw        RoundIntentsVw
	RoundTxsVw            RoundTxsVw
	IntentWithReceiversVw IntentWithReceiversVw
	IntentWithInputsVw    IntentWithInputsVw
}

type SelectRoundWithTxidRow

type SelectRoundWithTxidRow struct {
	Round                 Round
	RoundIntentsVw        RoundIntentsVw
	RoundTxsVw            RoundTxsVw
	IntentWithReceiversVw IntentWithReceiversVw
	IntentWithInputsVw    IntentWithInputsVw
}

type SelectSweepableUnrolledVtxosRow added in v0.8.0

type SelectSweepableUnrolledVtxosRow struct {
	VtxoVw VtxoVw
}

type SelectSweepableVtxoOutpointsByCommitmentTxidRow added in v0.8.7

type SelectSweepableVtxoOutpointsByCommitmentTxidRow struct {
	VtxoTxid string
	VtxoVout int64
}

type SelectTxsParams

type SelectTxsParams struct {
	Ids1 []string
	Ids2 []string
	Ids3 []string
}

type SelectTxsRow

type SelectTxsRow struct {
	Txid string
	Data string
}

type SelectVtxoParams

type SelectVtxoParams struct {
	Txid string
	Vout int64
}

type SelectVtxoPubKeysByCommitmentTxidParams added in v0.8.7

type SelectVtxoPubKeysByCommitmentTxidParams struct {
	MinAmount      int64
	CommitmentTxid string
}

type SelectVtxoRow

type SelectVtxoRow struct {
	VtxoVw VtxoVw
}

type SelectVtxosOutpointsByArkTxidRecursiveRow added in v0.8.7

type SelectVtxosOutpointsByArkTxidRecursiveRow struct {
	Txid string
	Vout int64
}

type SelectVtxosWithPubkeysRow

type SelectVtxosWithPubkeysRow struct {
	VtxoVw VtxoVw
}

type Tx

type Tx struct {
	Txid     string
	Tx       string
	RoundID  string
	Type     string
	Position int64
	Children sql.NullString
}

type UpdateVtxoExpirationParams

type UpdateVtxoExpirationParams struct {
	ExpiresAt int64
	Txid      string
	Vout      int64
}

type UpdateVtxoIntentIdParams

type UpdateVtxoIntentIdParams struct {
	IntentID sql.NullString
	Txid     string
	Vout     int64
}

type UpdateVtxoSettledParams

type UpdateVtxoSettledParams struct {
	SpentBy   sql.NullString
	SettledBy sql.NullString
	Txid      string
	Vout      int64
}

type UpdateVtxoSpentParams

type UpdateVtxoSpentParams struct {
	SpentBy sql.NullString
	ArkTxid sql.NullString
	Txid    string
	Vout    int64
}

type UpdateVtxoSweptIfNotSweptParams added in v0.8.0

type UpdateVtxoSweptIfNotSweptParams struct {
	Txid string
	Vout int64
}

type UpdateVtxoUnrolledParams

type UpdateVtxoUnrolledParams struct {
	Txid string
	Vout int64
}

type UpsertCheckpointTxParams

type UpsertCheckpointTxParams struct {
	Txid                 string
	Tx                   string
	CommitmentTxid       string
	IsRootCommitmentTxid bool
	OffchainTxid         string
}

type UpsertConvictionParams added in v0.8.0

type UpsertConvictionParams struct {
	ID           string
	Type         int64
	CreatedAt    int64
	ExpiresAt    sql.NullInt64
	CrimeType    int64
	CrimeRoundID string
	CrimeReason  string
	Pardoned     bool
	Script       sql.NullString
}

type UpsertIntentParams

type UpsertIntentParams struct {
	ID      sql.NullString
	RoundID sql.NullString
	Proof   sql.NullString
	Message sql.NullString
}

type UpsertOffchainTxParams

type UpsertOffchainTxParams struct {
	Txid              string
	Tx                string
	StartingTimestamp int64
	EndingTimestamp   int64
	ExpiryTimestamp   int64
	FailReason        sql.NullString
	StageCode         int64
}

type UpsertReceiverParams

type UpsertReceiverParams struct {
	IntentID       string
	Pubkey         sql.NullString
	OnchainAddress string
	Amount         int64
}

type UpsertRoundParams

type UpsertRoundParams struct {
	ID                 string
	StartingTimestamp  int64
	EndingTimestamp    int64
	Ended              bool
	Failed             bool
	FailReason         sql.NullString
	StageCode          int64
	ConnectorAddress   string
	Version            int64
	Swept              bool
	VtxoTreeExpiration int64
}

type UpsertScheduledSessionParams added in v0.8.0

type UpsertScheduledSessionParams struct {
	ID                   int64
	StartTime            int64
	EndTime              int64
	Period               int64
	Duration             int64
	RoundMinParticipants int64
	RoundMaxParticipants int64
	UpdatedAt            int64
}

type UpsertTxParams

type UpsertTxParams struct {
	Tx       string
	RoundID  string
	Type     string
	Position int64
	Txid     string
	Children sql.NullString
}

type UpsertVtxoParams

type UpsertVtxoParams struct {
	Txid           string
	Vout           int64
	Pubkey         string
	Amount         int64
	CommitmentTxid string
	SettledBy      sql.NullString
	ArkTxid        sql.NullString
	SpentBy        sql.NullString
	Spent          bool
	Unrolled       bool
	Swept          bool
	Preconfirmed   bool
	ExpiresAt      int64
	CreatedAt      int64
}

type Vtxo

type Vtxo struct {
	Txid           string
	Vout           int64
	Pubkey         string
	Amount         int64
	ExpiresAt      int64
	CreatedAt      int64
	CommitmentTxid string
	SpentBy        sql.NullString
	Spent          bool
	Unrolled       bool
	Swept          bool
	Preconfirmed   bool
	SettledBy      sql.NullString
	ArkTxid        sql.NullString
	IntentID       sql.NullString
}

type VtxoCommitmentTxid

type VtxoCommitmentTxid struct {
	VtxoTxid       string
	VtxoVout       int64
	CommitmentTxid string
}

type VtxoVw

type VtxoVw struct {
	Txid           string
	Vout           int64
	Pubkey         string
	Amount         int64
	ExpiresAt      int64
	CreatedAt      int64
	CommitmentTxid string
	SpentBy        sql.NullString
	Spent          bool
	Unrolled       bool
	Swept          bool
	Preconfirmed   bool
	SettledBy      sql.NullString
	ArkTxid        sql.NullString
	IntentID       sql.NullString
	Commitments    interface{}
}

Jump to

Keyboard shortcuts

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