sqlc

package
v0.1.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AppendActivityEvent = `` /* 181-byte string literal not displayed */
View Source
const BackfillLedgerRoundUuid = `` /* 126-byte string literal not displayed */
View Source
const CancelVHTLCRecoveryJob = `` /* 303-byte string literal not displayed */
View Source
const ClearPendingIntentAnchorByOutpoint = `` /* 134-byte string literal not displayed */
View Source
const CompleteVHTLCRecoveryJob = `` /* 254-byte string literal not displayed */
View Source
const CountActivityEntriesByStatus = `-- name: CountActivityEntriesByStatus :one
SELECT COUNT(*) FROM activity_entries WHERE status = $1
`
View Source
const CountBoardingIntentsByStatus = `-- name: CountBoardingIntentsByStatus :one
SELECT COUNT(*) FROM boarding_intents
WHERE status = $1
`
View Source
const CountClientLedgerEntries = `-- name: CountClientLedgerEntries :one
SELECT COUNT(*) FROM ledger_entries
`
View Source
const CountPendingIntentAnchorsByIntentID = `-- name: CountPendingIntentAnchorsByIntentID :one
SELECT COUNT(*) FROM pending_intent_anchors
WHERE intent_id = $1
`
View Source
const CountPendingSendIntentsByIntentID = `-- name: CountPendingSendIntentsByIntentID :one
SELECT COUNT(*) FROM pending_send_intents
WHERE intent_id = $1
`
View Source
const CountUnresolvedBoardingSweepInputs = `` /* 149-byte string literal not displayed */
View Source
const CountUnspentVTXOs = `-- name: CountUnspentVTXOs :one
SELECT COUNT(*) FROM vtxos
WHERE spent = FALSE
    AND status != 4
`
View Source
const CountVTXOsByStatus = `-- name: CountVTXOsByStatus :one
SELECT COUNT(*) FROM vtxos WHERE status = $1
`
View Source
const CountWalletUTXOLog = `-- name: CountWalletUTXOLog :one
SELECT COUNT(*) FROM wallet_utxo_log
`
View Source
const DeleteClientTreeTxids = `-- name: DeleteClientTreeTxids :exec
DELETE FROM client_tree_txids WHERE round_id = $1 AND client_key = $2
`
View Source
const DeleteOORPackageCheckpoints = `-- name: DeleteOORPackageCheckpoints :exec
DELETE FROM oor_package_checkpoints
WHERE session_id = $1
`
View Source
const DeleteOrphanedPendingBoardIntents = `` /* 203-byte string literal not displayed */
View Source
const DeleteOrphanedPendingIntents = `` /* 209-byte string literal not displayed */
View Source
const DeleteOrphanedPendingSendIntents = `` /* 340-byte string literal not displayed */
View Source
const DeletePendingBoardIntentByID = `-- name: DeletePendingBoardIntentByID :exec
DELETE FROM pending_board_intents
WHERE intent_id = $1
`
View Source
const DeletePendingBoardIntentsAll = `-- name: DeletePendingBoardIntentsAll :exec
DELETE FROM pending_board_intents
`
View Source
const DeletePendingIntentAnchorsByIntentID = `-- name: DeletePendingIntentAnchorsByIntentID :exec
DELETE FROM pending_intent_anchors
WHERE intent_id = $1
`
View Source
const DeletePendingIntentAnchorsByKind = `` /* 164-byte string literal not displayed */
View Source
const DeletePendingIntentByID = `-- name: DeletePendingIntentByID :exec
DELETE FROM pending_intents
WHERE intent_id = $1
`
View Source
const DeletePendingIntentsByKind = `-- name: DeletePendingIntentsByKind :exec
DELETE FROM pending_intents
WHERE kind = $1
`
View Source
const DeletePendingSendIntentByID = `-- name: DeletePendingSendIntentByID :exec
DELETE FROM pending_send_intents
WHERE intent_id = $1
`
View Source
const DeletePendingSendIntentsAll = `-- name: DeletePendingSendIntentsAll :exec
DELETE FROM pending_send_intents
`
View Source
const DeleteSpendingReservation = `-- name: DeleteSpendingReservation :exec
DELETE FROM spending_reservations
WHERE outpoint_hash = $1 AND outpoint_index = $2
`
View Source
const DeleteVTXO = `-- name: DeleteVTXO :exec
DELETE FROM vtxos
WHERE outpoint_hash = $1 AND outpoint_index = $2
`
View Source
const DeleteVTXOAncestryPaths = `` /* 130-byte string literal not displayed */
View Source
const EscalateVHTLCRecoveryJob = `` /* 378-byte string literal not displayed */
View Source
const FailVHTLCRecoveryJob = `` /* 245-byte string literal not displayed */
View Source
const FinalizeRound = `` /* 205-byte string literal not displayed */
View Source
const GetActivityEntry = `` /* 351-byte string literal not displayed */
View Source
const GetBoardingAddress = `` /* 193-byte string literal not displayed */
View Source
const GetBoardingIntent = `` /* 243-byte string literal not displayed */
View Source
const GetBoardingSweep = `` /* 251-byte string literal not displayed */
View Source
const GetBoardingSweepByInput = `` /* 441-byte string literal not displayed */
View Source
const GetChainInfo = `-- name: GetChainInfo :one
SELECT id, chain_name, genesis_hash FROM chain_info WHERE chain_name = $1
`
View Source
const GetClientAccountBalance = `` /* 287-byte string literal not displayed */
View Source
const GetClientLedgerStats = `` /* 247-byte string literal not displayed */
View Source
const GetClientTreeByTxid = `` /* 215-byte string literal not displayed */
View Source
const GetClientTreeTxidInfo = `` /* 135-byte string literal not displayed */
View Source
const GetClientTreeTxids = `` /* 159-byte string literal not displayed */
View Source
const GetConfirmedExitCost = `` /* 189-byte string literal not displayed */
View Source
const GetCreditOperation = `` /* 309-byte string literal not displayed */
View Source
const GetExitFundingAddress = `` /* 210-byte string literal not displayed */
View Source
const GetInternalKeyByID = `-- name: GetInternalKeyByID :one
SELECT id, pubkey, key_family, key_index, created_at FROM internal_keys
WHERE id = $1
`
View Source
const GetMacaroonRootKey = `-- name: GetMacaroonRootKey :one

SELECT id, root_key FROM macaroons
WHERE id = $1
`
View Source
const GetOORPackage = `` /* 131-byte string literal not displayed */
View Source
const GetOORPackageByOutpoint = `` /* 678-byte string literal not displayed */
View Source
const GetOORPackageByOutpointAndKind = `` /* 661-byte string literal not displayed */
View Source
const GetOORRecipientCursor = `` /* 165-byte string literal not displayed */
View Source
const GetOORSessionRegistry = `` /* 238-byte string literal not displayed */
View Source
const GetOORVTXOBindingByOutpoint = `` /* 261-byte string literal not displayed */
View Source
const GetOORVTXOBindingByOutpointAndKind = `` /* 246-byte string literal not displayed */
View Source
const GetOwnedReceiveScript = `` /* 179-byte string literal not displayed */
View Source
const GetPendingIntentByID = `-- name: GetPendingIntentByID :one
SELECT status, failure_reason, failure_code
FROM pending_intents
WHERE intent_id = $1
`
View Source
const GetRound = `` /* 242-byte string literal not displayed */
View Source
const GetRoundBoardingIntents = `` /* 229-byte string literal not displayed */
View Source
const GetRoundByCommitmentTxid = `` /* 265-byte string literal not displayed */
View Source
const GetRoundClientTree = `` /* 136-byte string literal not displayed */
View Source
const GetRoundClientTrees = `-- name: GetRoundClientTrees :many
SELECT round_id, client_key, tree_data FROM round_client_trees WHERE round_id = $1
`
View Source
const GetRoundVtxoRequests = `` /* 245-byte string literal not displayed */
View Source
const GetTotalOperatorFeesPaid = `` /* 159-byte string literal not displayed */
View Source
const GetUnilateralExitJob = `` /* 287-byte string literal not displayed */
View Source
const GetVHTLCRecoveryJob = `` /* 700-byte string literal not displayed */
View Source
const GetVHTLCRecoveryJobByRequestID = `` /* 719-byte string literal not displayed */
View Source
const GetVTXO = `` /* 416-byte string literal not displayed */
View Source
const GetVTXOForfeitTx = `` /* 127-byte string literal not displayed */
View Source
const GetVTXOReplacement = `` /* 136-byte string literal not displayed */
View Source
const InsertBoardingAddress = `` /* 249-byte string literal not displayed */
View Source
const InsertBoardingIntent = `` /* 1677-byte string literal not displayed */
View Source
const InsertBoardingSweep = `` /* 902-byte string literal not displayed */
View Source
const InsertBoardingSweepInput = `` /* 581-byte string literal not displayed */
View Source
const InsertClientLedgerEntry = `` /* 352-byte string literal not displayed */
View Source
const InsertClientTreeTxid = `` /* 202-byte string literal not displayed */
View Source
const InsertExitFundingAddress = `` /* 255-byte string literal not displayed */
View Source
const InsertMacaroonRootKey = `-- name: InsertMacaroonRootKey :exec
INSERT INTO macaroons (id, root_key)
VALUES ($1, $2)
`
View Source
const InsertOORPackageCheckpoint = `` /* 278-byte string literal not displayed */
View Source
const InsertRound = `` /* 1166-byte string literal not displayed */
View Source
const InsertRoundBoardingIntent = `` /* 524-byte string literal not displayed */
View Source
const InsertRoundClientTree = `` /* 203-byte string literal not displayed */
View Source
const InsertRoundVtxoRequest = `` /* 315-byte string literal not displayed */
View Source
const InsertVHTLCRecoveryJob = `` /* 707-byte string literal not displayed */
View Source
const InsertVTXO = `` /* 1717-byte string literal not displayed */
View Source
const InsertVTXOAncestryPath = `` /* 258-byte string literal not displayed */
View Source
const InsertWalletUTXOLog = `` /* 263-byte string literal not displayed */
View Source
const ListActiveRounds = `` /* 290-byte string literal not displayed */
View Source
const ListActivityEntries = `` /* 559-byte string literal not displayed */
View Source
const ListAllBoardingAddresses = `` /* 207-byte string literal not displayed */
View Source
const ListAllBoardingIntents = `` /* 228-byte string literal not displayed */
View Source
const ListAllCreditOperations = `` /* 322-byte string literal not displayed */
View Source
const ListAllOORSessionRegistry = `` /* 245-byte string literal not displayed */
View Source
const ListAllVTXOs = `` /* 401-byte string literal not displayed */
View Source
const ListBoardingIntentOutpoints = `-- name: ListBoardingIntentOutpoints :many
SELECT outpoint_hash, outpoint_index FROM boarding_intents
`
View Source
const ListBoardingIntentsByConfHeight = `` /* 259-byte string literal not displayed */
View Source
const ListBoardingIntentsByPkScript = `` /* 256-byte string literal not displayed */
View Source
const ListBoardingIntentsByStatus = `` /* 1052-byte string literal not displayed */
View Source
const ListBoardingIntentsByStatusAndMinHeight = `` /* 691-byte string literal not displayed */
View Source
const ListBoardingIntentsBySweepableStatuses = `` /* 703-byte string literal not displayed */
View Source
const ListBoardingSweepInputs = `` /* 252-byte string literal not displayed */
View Source
const ListBoardingSweeps = `` /* 315-byte string literal not displayed */
View Source
const ListChainInfo = `-- name: ListChainInfo :many
SELECT id, chain_name, genesis_hash FROM chain_info ORDER BY id
`
View Source
const ListClientAccountBalances = `` /* 591-byte string literal not displayed */
View Source
const ListClientAccounts = `-- name: ListClientAccounts :many
SELECT account_id, account_name, account_type
FROM accounts
ORDER BY account_id
`
View Source
const ListClientLedgerEntries = `` /* 316-byte string literal not displayed */
View Source
const ListClientLedgerEntriesByType = `` /* 344-byte string literal not displayed */
View Source
const ListClientLedgerEventTotals = `` /* 235-byte string literal not displayed */
View Source
const ListEntriesByKindStatus = `` /* 432-byte string literal not displayed */
View Source
const ListForfeitingVTXOsByRound = `` /* 157-byte string literal not displayed */
View Source
const ListLedgerRoundIDsMissingUuid = `` /* 142-byte string literal not displayed */
View Source
const ListLiveVTXOAncestryPaths = `` /* 503-byte string literal not displayed */
View Source
const ListLiveVTXOs = `` /* 453-byte string literal not displayed */
View Source
const ListNonTerminalCreditOperations = `` /* 357-byte string literal not displayed */
View Source
const ListNonTerminalOORSessionRegistry = `` /* 280-byte string literal not displayed */
View Source
const ListNonTerminalUnilateralExitJobs = `` /* 290-byte string literal not displayed */
View Source
const ListNonTerminalVHTLCRecoveryJobs = `` /* 796-byte string literal not displayed */
View Source
const ListOORPackageCheckpoints = `` /* 187-byte string literal not displayed */
View Source
const ListOORPackages = `` /* 137-byte string literal not displayed */
View Source
const ListOORPackagesByDirection = `` /* 169-byte string literal not displayed */
View Source
const ListOORRecipientCursors = `` /* 162-byte string literal not displayed */
View Source
const ListOORVTXOBindingsBySession = `` /* 435-byte string literal not displayed */
View Source
const ListOwnedReceiveScripts = `` /* 186-byte string literal not displayed */
View Source
const ListPendingBoardIntents = `` /* 287-byte string literal not displayed */
View Source
const ListPendingBoardingSweepInputs = `` /* 267-byte string literal not displayed */
View Source
const ListPendingBoardingSweeps = `` /* 312-byte string literal not displayed */
View Source
const ListPendingIntentAnchorsByKind = `` /* 268-byte string literal not displayed */
View Source
const ListPendingSendIntents = `` /* 379-byte string literal not displayed */
View Source
const ListRecoverableVTXOs = `` /* 474-byte string literal not displayed */
View Source
const ListRoundsByStatus = `` /* 279-byte string literal not displayed */
View Source
const ListRoundsPaginated = `` /* 405-byte string literal not displayed */
View Source
const ListSpendingReservationOutpoints = `-- name: ListSpendingReservationOutpoints :many
SELECT outpoint_hash, outpoint_index FROM spending_reservations
`
View Source
const ListTransactionHistory = `` /* 10031-byte string literal not displayed */
View Source
const ListUnspentVTXOAncestryPaths = `` /* 489-byte string literal not displayed */
View Source
const ListUnspentVTXOs = `` /* 445-byte string literal not displayed */
View Source
const ListVHTLCRecoveryJobs = `` /* 731-byte string literal not displayed */
View Source
const ListVHTLCRecoveryJobsBySwapAction = `` /* 780-byte string literal not displayed */
View Source
const ListVTXOAncestryPaths = `` /* 278-byte string literal not displayed */
View Source
const ListVTXOAncestryPathsByStatus = `` /* 470-byte string literal not displayed */
View Source
const ListVTXOSelectionCandidatesByStatus = `` /* 164-byte string literal not displayed */
View Source
const ListVTXOsByRound = `` /* 425-byte string literal not displayed */
View Source
const ListVTXOsByStatus = `` /* 994-byte string literal not displayed */
View Source
const ListWalletUTXOLog = `` /* 227-byte string literal not displayed */
View Source
const ListWalletUTXOLogByBlock = `` /* 217-byte string literal not displayed */
View Source
const ListWalletUTXOLogByClassification = `` /* 268-byte string literal not displayed */
View Source
const LookupActiveCreditOperationByKey = `` /* 340-byte string literal not displayed */
View Source
const LookupActiveOORSessionRegistryByIdempotencyKey = `` /* 284-byte string literal not displayed */
View Source
const MarkBoardingSweepInputSpentByOutpoint = `` /* 268-byte string literal not displayed */
View Source
const MarkBoardingSweepInputStatus = `` /* 279-byte string literal not displayed */
View Source
const MarkBoardingSweepInputsStatus = `` /* 174-byte string literal not displayed */
View Source
const MarkBoardingSweepStatus = `` /* 221-byte string literal not displayed */
View Source
const MarkPendingSendIntentFailedByOutpoint = `` /* 338-byte string literal not displayed */
View Source
const MarkUnilateralExitJobTerminal = `` /* 217-byte string literal not displayed */
View Source
const MarkVHTLCRecoveryExitTxBroadcast = `` /* 280-byte string literal not displayed */
View Source
const MarkVHTLCRecoveryExitTxBuilt = `` /* 288-byte string literal not displayed */
View Source
const MarkVHTLCRecoveryExitTxSubmitting = `` /* 180-byte string literal not displayed */
View Source
const MarkVHTLCRecoveryTargetDetected = `` /* 332-byte string literal not displayed */
View Source
const MarkVTXOForfeited = `` /* 228-byte string literal not displayed */
View Source
const MarkVTXOForfeiting = `` /* 200-byte string literal not displayed */
View Source
const MarkVTXOSpent = `` /* 143-byte string literal not displayed */
View Source
const PullActivityEvents = `` /* 183-byte string literal not displayed */
View Source
const SumBoardingIntentAmountsByStatus = `` /* 128-byte string literal not displayed */
View Source
const SumUnspentVTXOAmounts = `` /* 128-byte string literal not displayed */
View Source
const UpdateBoardingIntentStatus = `` /* 154-byte string literal not displayed */
View Source
const UpdateRoundBoardingIntentSignature = `` /* 190-byte string literal not displayed */
View Source
const UpdateRoundStatus = `-- name: UpdateRoundStatus :exec
UPDATE rounds
SET status = $2, last_update_time = $3
WHERE round_id = $1
`
View Source
const UpdateVTXOStatus = `` /* 314-byte string literal not displayed */
View Source
const UpsertActivityEntry = `` /* 1770-byte string literal not displayed */
View Source
const UpsertChainInfo = `` /* 162-byte string literal not displayed */
View Source
const UpsertCreditOperation = `` /* 1114-byte string literal not displayed */
View Source
const UpsertInternalKey = `` /* 229-byte string literal not displayed */
View Source
const UpsertOORPackage = `` /* 320-byte string literal not displayed */
View Source
const UpsertOORRecipientCursor = `` /* 353-byte string literal not displayed */
View Source
const UpsertOORSessionRegistry = `` /* 686-byte string literal not displayed */
View Source
const UpsertOORVTXOBinding = `` /* 441-byte string literal not displayed */
View Source
const UpsertOwnedReceiveScript = `` /* 455-byte string literal not displayed */
View Source
const UpsertPendingBoardIntent = `` /* 216-byte string literal not displayed */
View Source
const UpsertPendingIntentAnchor = `` /* 242-byte string literal not displayed */
View Source
const UpsertPendingIntentHeader = `` /* 298-byte string literal not displayed */
View Source
const UpsertPendingSendIntent = `` /* 543-byte string literal not displayed */
View Source
const UpsertSpendingReservation = `` /* 349-byte string literal not displayed */
View Source
const UpsertUnilateralExitJob = `` /* 682-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountID   string
	AccountName string
	AccountType string
}

type AccountType

type AccountType struct {
	AccountType string
}

type ActivityEntry

type ActivityEntry struct {
	CanonicalID        string
	Kind               int64
	Status             int64
	AmountSat          int64
	FeeSat             int64
	Counterparty       string
	Note               string
	Phase              int64
	PhaseLabel         string
	FailureCode        int64
	FailureReason      string
	PaymentHash        []byte
	Txid               []byte
	ConfirmationHeight sql.NullInt64
	VtxoOutpoint       string
	SwapSessionID      []byte
	LedgerTxid         []byte
	BoardingAddr       []byte
	RequestJson        string
	CreatedAtUnix      int64
	UpdatedAtUnix      int64
}

type ActivityEvent

type ActivityEvent struct {
	EventSeq      int64
	CanonicalID   string
	Status        int64
	Phase         int64
	EntryJson     string
	CreatedAtUnix int64
}

type ActivityKind

type ActivityKind struct {
	ID   int64
	Name string
}

type ActivityStatus

type ActivityStatus struct {
	ID   int64
	Name string
}

type AppendActivityEventParams

type AppendActivityEventParams struct {
	CanonicalID   string
	Status        int64
	Phase         int64
	EntryJson     string
	CreatedAtUnix int64
}

type BackendType

type BackendType uint8

BackendType is an enum that represents the type of database backend we're using.

const (
	// BackendTypeUnknown indicates we're using an unknown backend.
	BackendTypeUnknown BackendType = iota

	// BackendTypeSqlite indicates we're using a SQLite backend.
	BackendTypeSqlite

	// BackendTypePostgres indicates we're using a Postgres backend.
	BackendTypePostgres
)

type BackfillLedgerRoundUuidParams

type BackfillLedgerRoundUuidParams struct {
	RoundUuid sql.NullString
	RoundID   []byte
}

type BoardingAddress

type BoardingAddress struct {
	PkScript            []byte
	AddressString       string
	ClientKeyID         sql.NullInt64
	OperatorPubkey      []byte
	ExitDelay           int32
	LastConfirmedHeight int32
	CreationTime        int64
}

type BoardingIntent

type BoardingIntent struct {
	OutpointHash   []byte
	OutpointIndex  int32
	PkScript       []byte
	Amount         int64
	ConfHeight     int32
	ConfHash       []byte
	ConfTx         []byte
	Status         string
	CreationTime   int64
	LastUpdateTime int64
	TxProof        []byte
}

type BoardingStatus

type BoardingStatus struct {
	ID         int64
	StatusName string
}

type BoardingSweep

type BoardingSweep struct {
	Txid               []byte
	RawTx              []byte
	DestinationAddress string
	TotalAmount        int64
	FeeAmount          int64
	FeeRateSatPerVbyte int64
	Vbytes             int64
	Status             string
	CreatedHeight      int32
	CreatedTime        int64
	PublishedTime      sql.NullInt64
	ConfirmedHeight    sql.NullInt32
	LastError          sql.NullString
}

type BoardingSweepInput

type BoardingSweepInput struct {
	Txid           []byte
	OutpointHash   []byte
	OutpointIndex  int32
	Amount         int64
	PreviousStatus string
	Status         string
	SpentByTxid    []byte
	SpentHeight    sql.NullInt32
	LastUpdateTime int64
}

type CancelVHTLCRecoveryJobParams

type CancelVHTLCRecoveryJobParams struct {
	ID              string
	CancelReason    sql.NullString
	CooperativeTxid []byte
	UpdatedAt       int64
}

type ChainInfo

type ChainInfo struct {
	ID          int64
	ChainName   string
	GenesisHash []byte
}

type ClearPendingIntentAnchorByOutpointParams

type ClearPendingIntentAnchorByOutpointParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type ClientTreeTxid

type ClientTreeTxid struct {
	Txid        []byte
	RoundID     string
	ClientKey   []byte
	TreeLevel   int32
	OutputIndex int32
}

type CompleteVHTLCRecoveryJobParams

type CompleteVHTLCRecoveryJobParams struct {
	ID        string
	UpdatedAt int64
}

type CreditOperation

type CreditOperation struct {
	OpID              string
	OpKey             string
	Kind              int32
	State             string
	Status            int32
	ServerOpID        sql.NullString
	PaymentHash       []byte
	DestinationPubkey []byte
	OorSessionID      sql.NullString
	Invoice           sql.NullString
	AmountSat         int64
	TopupSat          int64
	MaxCreditSat      int64
	MaxFeeSat         int64
	LastError         sql.NullString
	SnapshotData      []byte
	SnapshotVersion   int32
	CreatedAt         int64
	UpdatedAt         int64
}

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 DeleteClientTreeTxidsParams

type DeleteClientTreeTxidsParams struct {
	RoundID   string
	ClientKey []byte
}

type DeleteSpendingReservationParams

type DeleteSpendingReservationParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type DeleteVTXOAncestryPathsParams

type DeleteVTXOAncestryPathsParams struct {
	VtxoOutpointHash  []byte
	VtxoOutpointIndex int32
}

type DeleteVTXOParams

type DeleteVTXOParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type EscalateVHTLCRecoveryJobParams

type EscalateVHTLCRecoveryJobParams struct {
	ID            string
	UpdatedAt     int64
	ClaimPreimage []byte
}

type ExitFundingAddress

type ExitFundingAddress struct {
	TargetOutpointHash  []byte
	TargetOutpointIndex int32
	FundingAddress      string
	CreatedAt           int64
}

type FailVHTLCRecoveryJobParams

type FailVHTLCRecoveryJobParams struct {
	ID        string
	LastError sql.NullString
	UpdatedAt int64
}

type FinalizeRoundParams

type FinalizeRoundParams struct {
	RoundID               string
	CommitmentTxid        []byte
	ConfirmationHeight    sql.NullInt32
	ConfirmationBlockHash []byte
	LastUpdateTime        int64
}

type GetBoardingIntentParams

type GetBoardingIntentParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type GetBoardingSweepByInputParams

type GetBoardingSweepByInputParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type GetClientLedgerStatsRow

type GetClientLedgerStatsRow struct {
	EntryCount     int64
	FirstCreatedAt int64
	LastCreatedAt  int64
}

type GetClientTreeTxidsParams

type GetClientTreeTxidsParams struct {
	RoundID   string
	ClientKey []byte
}

type GetClientTreeTxidsRow

type GetClientTreeTxidsRow struct {
	Txid        []byte
	TreeLevel   int32
	OutputIndex int32
}

type GetExitFundingAddressParams

type GetExitFundingAddressParams struct {
	TargetOutpointHash  []byte
	TargetOutpointIndex int32
}

type GetOORPackageByOutpointAndKindParams

type GetOORPackageByOutpointAndKindParams struct {
	OutpointHash  []byte
	OutpointIndex int32
	LinkKind      int32
}

type GetOORPackageByOutpointAndKindRow

type GetOORPackageByOutpointAndKindRow struct {
	SessionID         []byte
	Direction         int32
	ArkPsbt           []byte
	PackageCreatedAt  int64
	PackageUpdatedAt  int64
	OutpointHash      []byte
	OutpointIndex     int32
	OutputIndex       int32
	LinkKind          int32
	RecipientPkScript []byte
	ValueSat          int64
	BindingCreatedAt  int64
	BindingUpdatedAt  int64
}

type GetOORPackageByOutpointParams

type GetOORPackageByOutpointParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type GetOORPackageByOutpointRow

type GetOORPackageByOutpointRow struct {
	SessionID         []byte
	Direction         int32
	ArkPsbt           []byte
	PackageCreatedAt  int64
	PackageUpdatedAt  int64
	OutpointHash      []byte
	OutpointIndex     int32
	OutputIndex       int32
	LinkKind          int32
	RecipientPkScript []byte
	ValueSat          int64
	BindingCreatedAt  int64
	BindingUpdatedAt  int64
}

type GetOORVTXOBindingByOutpointAndKindParams

type GetOORVTXOBindingByOutpointAndKindParams struct {
	OutpointHash  []byte
	OutpointIndex int32
	LinkKind      int32
}

type GetOORVTXOBindingByOutpointParams

type GetOORVTXOBindingByOutpointParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type GetPendingIntentByIDRow

type GetPendingIntentByIDRow struct {
	Status        string
	FailureReason sql.NullString
	FailureCode   int32
}

type GetRoundClientTreeParams

type GetRoundClientTreeParams struct {
	RoundID   string
	ClientKey []byte
}

type GetUnilateralExitJobParams

type GetUnilateralExitJobParams struct {
	TargetOutpointHash  []byte
	TargetOutpointIndex int32
}

type GetVTXOForfeitTxParams

type GetVTXOForfeitTxParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type GetVTXOForfeitTxRow

type GetVTXOForfeitTxRow struct {
	ForfeitTx      []byte
	ForfeitRoundID sql.NullString
}

type GetVTXOParams

type GetVTXOParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type GetVTXOReplacementParams

type GetVTXOReplacementParams struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type GetVTXOReplacementRow

type GetVTXOReplacementRow struct {
	ReplacedByHash  []byte
	ReplacedByIndex sql.NullInt32
}

type InsertBoardingAddressParams

type InsertBoardingAddressParams struct {
	PkScript       []byte
	AddressString  string
	ClientKeyID    sql.NullInt64
	OperatorPubkey []byte
	ExitDelay      int32
	CreationTime   int64
}

type InsertBoardingIntentParams

type InsertBoardingIntentParams struct {
	OutpointHash   []byte
	OutpointIndex  int32
	PkScript       []byte
	Amount         int64
	ConfHeight     int32
	ConfHash       []byte
	ConfTx         []byte
	TxProof        []byte
	Status         string
	CreationTime   int64
	LastUpdateTime int64
}

type InsertBoardingSweepInputParams

type InsertBoardingSweepInputParams struct {
	Txid           []byte
	OutpointHash   []byte
	OutpointIndex  int32
	Amount         int64
	PreviousStatus string
	Status         string
	SpentByTxid    []byte
	SpentHeight    sql.NullInt32
	LastUpdateTime int64
}

type InsertBoardingSweepParams

type InsertBoardingSweepParams struct {
	Txid               []byte
	RawTx              []byte
	DestinationAddress string
	TotalAmount        int64
	FeeAmount          int64
	FeeRateSatPerVbyte int64
	Vbytes             int64
	Status             string
	CreatedHeight      int32
	CreatedTime        int64
	PublishedTime      sql.NullInt64
	ConfirmedHeight    sql.NullInt32
	LastError          sql.NullString
}

type InsertClientLedgerEntryParams

type InsertClientLedgerEntryParams struct {
	DebitAccount       string
	CreditAccount      string
	AmountSat          int64
	RoundID            []byte
	SessionID          []byte
	IdempotencyKey     []byte
	EventType          string
	Description        string
	CreatedAt          int64
	ChainTxid          []byte
	ChainVout          sql.NullInt32
	ConfirmationHeight sql.NullInt32
	RoundUuid          sql.NullString
}

type InsertClientTreeTxidParams

type InsertClientTreeTxidParams struct {
	Txid        []byte
	RoundID     string
	ClientKey   []byte
	TreeLevel   int32
	OutputIndex int32
}

type InsertExitFundingAddressParams

type InsertExitFundingAddressParams struct {
	TargetOutpointHash  []byte
	TargetOutpointIndex int32
	FundingAddress      string
	CreatedAt           int64
}

type InsertMacaroonRootKeyParams

type InsertMacaroonRootKeyParams struct {
	ID      []byte
	RootKey []byte
}

type InsertOORPackageCheckpointParams

type InsertOORPackageCheckpointParams struct {
	SessionID       []byte
	CheckpointIndex int32
	CheckpointPsbt  []byte
	CreatedAt       int64
}

type InsertRoundBoardingIntentParams

type InsertRoundBoardingIntentParams struct {
	RoundID        string
	OutpointHash   []byte
	OutpointIndex  int32
	ClientKey      []byte
	OperatorKey    []byte
	ExitDelay      int32
	PolicyTemplate []byte
	TxProof        []byte
	InputIndex     sql.NullInt32
	InputSignature []byte
}

type InsertRoundClientTreeParams

type InsertRoundClientTreeParams struct {
	RoundID   string
	ClientKey []byte
	TreeData  []byte
}

type InsertRoundParams

type InsertRoundParams struct {
	RoundID               string
	ConfirmationHeight    sql.NullInt32
	ConfirmationBlockHash []byte
	CommitmentTx          []byte
	CommitmentTxid        []byte
	VtxtTree              []byte
	Status                string
	CreationTime          int64
	LastUpdateTime        int64
	StartHeight           int32
	FlowVersion           int32
	SweepDelay            int32
}

type InsertRoundVtxoRequestParams

type InsertRoundVtxoRequestParams struct {
	RoundID        string
	RequestIndex   int32
	Amount         int64
	PkScript       []byte
	Expiry         int32
	PolicyTemplate []byte
	ClientPubkey   []byte
	OperatorPubkey []byte
	OwnerKeyID     sql.NullInt64
	SigningKeyID   sql.NullInt64
}

type InsertVHTLCRecoveryJobParams

type InsertVHTLCRecoveryJobParams struct {
	ID                                   string
	RequestID                            string
	SwapID                               []byte
	Direction                            string
	Action                               string
	VtxoTxid                             []byte
	VtxoVout                             int32
	VtxoAmountSat                        int64
	SenderPubkey                         []byte
	ReceiverPubkey                       []byte
	ServerPubkey                         []byte
	RefundLocktime                       int32
	UnilateralClaimDelay                 int32
	UnilateralRefundDelay                int32
	UnilateralRefundWithoutReceiverDelay int32
	PreimageHash                         []byte
	SignerKeyFamily                      int32
	SignerKeyIndex                       int32
	DestinationScript                    []byte
	MaxFeeRateSatPerKw                   int32
	UnrollTargetOutpointHash             []byte
	UnrollTargetOutpointIndex            sql.NullInt32
	ExitPolicyKind                       string
	CreatedAt                            int64
}

type InsertVTXOAncestryPathParams

type InsertVTXOAncestryPathParams struct {
	VtxoOutpointHash  []byte
	VtxoOutpointIndex int32
	PathOrder         int32
	CommitmentTxid    []byte
	TreePath          []byte
	TreeDepth         int32
	InputIndices      []byte
	CommitmentHeight  int32
}

type InsertVTXOParams

type InsertVTXOParams struct {
	OutpointHash        []byte
	OutpointIndex       int32
	RoundID             string
	Amount              int64
	PkScript            []byte
	Expiry              int32
	PolicyTemplate      []byte
	ClientKeyID         sql.NullInt64
	OperatorPubkey      []byte
	BatchExpiry         int32
	ChainDepth          int32
	CreatedHeight       int32
	CommitmentTxid      []byte
	Spent               bool
	CreationTime        int64
	LastUpdateTime      int64
	ConstructionVersion int32
}

type InsertWalletUTXOLogParams

type InsertWalletUTXOLogParams struct {
	OutpointHash  []byte
	OutpointIndex int32
	AmountSat     int64
	Event         string
	BlockHeight   int32
	ClassifiedAs  string
	CreatedAt     int64
}

type InternalKey

type InternalKey struct {
	ID        int64
	Pubkey    []byte
	KeyFamily int64
	KeyIndex  int64
	CreatedAt int64
}

type LedgerEntry

type LedgerEntry struct {
	EntryID            int64
	DebitAccount       string
	CreditAccount      string
	AmountSat          int64
	RoundID            []byte
	SessionID          []byte
	IdempotencyKey     []byte
	EventType          string
	Description        string
	CreatedAt          int64
	ChainTxid          []byte
	ChainVout          sql.NullInt32
	ConfirmationHeight sql.NullInt32
	RoundUuid          sql.NullString
}

type LedgerEventType

type LedgerEventType struct {
	EventType string
}

type ListActivityEntriesParams

type ListActivityEntriesParams struct {
	CursorCreated int64
	CursorID      string
	LimitCount    int32
}

type ListBoardingIntentOutpointsRow

type ListBoardingIntentOutpointsRow struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type ListBoardingIntentsByStatusAndMinHeightParams

type ListBoardingIntentsByStatusAndMinHeightParams struct {
	Status     string
	ConfHeight int32
}

type ListBoardingIntentsBySweepableStatusesParams

type ListBoardingIntentsBySweepableStatusesParams struct {
	Status   string
	Status_2 string
	Status_3 string
}

type ListBoardingSweepsParams

type ListBoardingSweepsParams struct {
	StatusFilter interface{}
	PageOffset   int32
	PageLimit    int32
}

type ListClientAccountBalancesRow

type ListClientAccountBalancesRow struct {
	AccountID   string
	AccountName string
	AccountType string
	BalanceSat  int64
}

type ListClientLedgerEntriesByTypeParams

type ListClientLedgerEntriesByTypeParams struct {
	EventType string
	Limit     int32
	Offset    int32
}

type ListClientLedgerEntriesParams

type ListClientLedgerEntriesParams struct {
	Limit  int32
	Offset int32
}

type ListClientLedgerEventTotalsRow

type ListClientLedgerEventTotalsRow struct {
	EventType  string
	EntryCount int64
	TotalSat   int64
}

type ListEntriesByKindStatusParams

type ListEntriesByKindStatusParams struct {
	Kind       int64
	Status     int64
	CursorID   string
	LimitCount int32
}

type ListForfeitingVTXOsByRoundRow

type ListForfeitingVTXOsByRoundRow struct {
	OutpointHash  []byte
	OutpointIndex int32
	Amount        int64
}

type ListOORVTXOBindingsBySessionRow

type ListOORVTXOBindingsBySessionRow struct {
	OutpointHash      []byte
	OutpointIndex     int32
	SessionID         []byte
	OutputIndex       int32
	LinkKind          int32
	RecipientPkScript []byte
	ValueSat          int64
	CreatedAt         int64
	UpdatedAt         int64
}

type ListPendingBoardIntentsRow

type ListPendingBoardIntentsRow struct {
	IntentID        []byte
	RequestedAtUnix int64
	TargetVtxoCount int32
}

type ListPendingSendIntentsRow

type ListPendingSendIntentsRow struct {
	IntentID        []byte
	RequestedAtUnix int64
	DestPkscript    []byte
	TargetAmountSat int64
	SweepAll        int32
	OperatorKey     []byte
	VtxoExitDelay   int32
	DustLimitSat    int64
}

type ListRoundsPaginatedParams

type ListRoundsPaginatedParams struct {
	Cursor        interface{}
	StatusFilter  interface{}
	CreatedAfter  interface{}
	CreatedBefore interface{}
	LimitCount    int32
}

type ListSpendingReservationOutpointsRow

type ListSpendingReservationOutpointsRow struct {
	OutpointHash  []byte
	OutpointIndex int32
}

type ListTransactionHistoryParams

type ListTransactionHistoryParams struct {
	TypeFilter interface{}
	FromUnixS  interface{}
	ToUnixS    interface{}
	PageOffset int32
	PageLimit  int32
}

type ListTransactionHistoryRow

type ListTransactionHistoryRow struct {
	Source             string
	EntryID            int64
	Txid               []byte
	TransactionType    string
	Subtype            string
	AmountSat          int64
	FeeSat             int64
	CreatedAt          int64
	Status             string
	Description        string
	DebitAccount       string
	CreditAccount      string
	RoundID            []byte
	SessionID          []byte
	ConfirmationHeight int32
	OutputIndex        int32
	BoardingAddress    string
}

type ListVHTLCRecoveryJobsBySwapActionParams

type ListVHTLCRecoveryJobsBySwapActionParams struct {
	SwapID []byte
	Action string
}

type ListVTXOAncestryPathsParams

type ListVTXOAncestryPathsParams struct {
	VtxoOutpointHash  []byte
	VtxoOutpointIndex int32
}

type ListVTXOSelectionCandidatesByStatusRow

type ListVTXOSelectionCandidatesByStatusRow struct {
	OutpointHash  []byte
	OutpointIndex int32
	Amount        int64
	PkScript      []byte
}

type ListVTXOsByStatusRow

type ListVTXOsByStatusRow struct {
	Vtxo             Vtxo
	SettlementTxid   []byte
	SettlementHeight sql.NullInt32
	SettlementFeeSat int64
}

type ListWalletUTXOLogByClassificationParams

type ListWalletUTXOLogByClassificationParams struct {
	ClassifiedAs string
	Limit        int32
	Offset       int32
}

type ListWalletUTXOLogParams

type ListWalletUTXOLogParams struct {
	Limit  int32
	Offset int32
}

type Macaroon

type Macaroon struct {
	ID      []byte
	RootKey []byte
}

type MarkBoardingSweepInputSpentByOutpointParams

type MarkBoardingSweepInputSpentByOutpointParams struct {
	OutpointHash   []byte
	OutpointIndex  int32
	Status         string
	SpentByTxid    []byte
	SpentHeight    sql.NullInt32
	LastUpdateTime int64
}

type MarkBoardingSweepInputStatusParams

type MarkBoardingSweepInputStatusParams struct {
	Txid           []byte
	OutpointHash   []byte
	OutpointIndex  int32
	Status         string
	SpentByTxid    []byte
	SpentHeight    sql.NullInt32
	LastUpdateTime int64
}

type MarkBoardingSweepInputsStatusParams

type MarkBoardingSweepInputsStatusParams struct {
	Txid           []byte
	Status         string
	LastUpdateTime int64
}

type MarkBoardingSweepStatusParams

type MarkBoardingSweepStatusParams struct {
	Txid            []byte
	Status          string
	PublishedTime   sql.NullInt64
	ConfirmedHeight sql.NullInt32
	LastError       sql.NullString
}

type MarkPendingSendIntentFailedByOutpointParams

type MarkPendingSendIntentFailedByOutpointParams struct {
	OutpointHash  []byte
	OutpointIndex int32
	FailureReason sql.NullString
	FailureCode   int32
}

type MarkUnilateralExitJobTerminalParams

type MarkUnilateralExitJobTerminalParams struct {
	TargetOutpointHash  []byte
	TargetOutpointIndex int32
	Status              int32
	LastError           sql.NullString
	UpdatedAt           int64
	SweepTxid           []byte
}

type MarkVHTLCRecoveryExitTxBroadcastParams

type MarkVHTLCRecoveryExitTxBroadcastParams struct {
	ID        string
	UpdatedAt int64
}

type MarkVHTLCRecoveryExitTxBuiltParams

type MarkVHTLCRecoveryExitTxBuiltParams struct {
	ID        string
	ExitTx    []byte
	ExitTxid  []byte
	UpdatedAt int64
}

type MarkVHTLCRecoveryExitTxSubmittingParams

type MarkVHTLCRecoveryExitTxSubmittingParams struct {
	ID        string
	UpdatedAt int64
}

type MarkVHTLCRecoveryTargetDetectedParams

type MarkVHTLCRecoveryTargetDetectedParams struct {
	ID                        string
	UnrollTargetOutpointHash  []byte
	UnrollTargetOutpointIndex sql.NullInt32
	UpdatedAt                 int64
}

type MarkVTXOForfeitedParams

type MarkVTXOForfeitedParams struct {
	OutpointHash    []byte
	OutpointIndex   int32
	ForfeitTxid     []byte
	ReplacedByHash  []byte
	ReplacedByIndex sql.NullInt32
	LastUpdateTime  int64
}

type MarkVTXOForfeitingParams

type MarkVTXOForfeitingParams struct {
	OutpointHash   []byte
	OutpointIndex  int32
	ForfeitRoundID sql.NullString
	ForfeitTx      []byte
	LastUpdateTime int64
}

type MarkVTXOSpentParams

type MarkVTXOSpentParams struct {
	OutpointHash   []byte
	OutpointIndex  int32
	LastUpdateTime int64
}

type OorPackage

type OorPackage struct {
	SessionID []byte
	Direction int32
	ArkPsbt   []byte
	CreatedAt int64
	UpdatedAt int64
}

type OorPackageCheckpoint

type OorPackageCheckpoint struct {
	SessionID       []byte
	CheckpointIndex int32
	CheckpointPsbt  []byte
	CreatedAt       int64
}

type OorPackageDirection

type OorPackageDirection struct {
	Direction int64
	Name      string
}

type OorRecipientCursor

type OorRecipientCursor struct {
	RecipientPkScript []byte
	LastEventID       int64
	UpdatedAt         int64
	LastSessionID     []byte
}

type OorSessionRegistry

type OorSessionRegistry struct {
	SessionID       []byte
	ActorID         string
	Direction       int32
	Phase           string
	IdempotencyKey  sql.NullString
	Status          int32
	LastError       sql.NullString
	SnapshotData    []byte
	SnapshotVersion int32
	FlowVersion     int32
	CreatedAt       int64
	UpdatedAt       int64
}

type OorVtxoBinding

type OorVtxoBinding struct {
	OutpointHash  []byte
	OutpointIndex int32
	SessionID     []byte
	OutputIndex   int32
	LinkKind      int32
	CreatedAt     int64
	UpdatedAt     int64
}

type OorVtxoBindingLinkKind

type OorVtxoBindingLinkKind struct {
	LinkKind int64
	Name     string
}

type OwnedReceiveScript

type OwnedReceiveScript struct {
	PkScript       []byte
	ClientKeyID    sql.NullInt64
	OperatorPubkey []byte
	ExitDelay      int64
	Source         int32
	CreatedAt      int64
	LastUsedAt     sql.NullInt64
}

type OwnedReceiveScriptSource

type OwnedReceiveScriptSource struct {
	Source int64
	Name   string
}

type PendingBoardIntent

type PendingBoardIntent struct {
	IntentID        []byte
	TargetVtxoCount int32
}

type PendingIntent

type PendingIntent struct {
	IntentID        []byte
	Kind            string
	RequestedAtUnix int64
	Status          string
	FailureReason   sql.NullString
	FailureCode     int32
}

type PendingIntentAnchor

type PendingIntentAnchor struct {
	OutpointHash  []byte
	OutpointIndex int32
	IntentID      []byte
}

type PendingIntentKind

type PendingIntentKind struct {
	Kind string
}

type PendingSendIntent

type PendingSendIntent struct {
	IntentID        []byte
	DestPkscript    []byte
	TargetAmountSat int64
	SweepAll        int32
	OperatorKey     []byte
	VtxoExitDelay   int32
	DustLimitSat    int64
}

type PullActivityEventsParams

type PullActivityEventsParams struct {
	Cursor     int64
	LimitCount int32
}

type Querier

type Querier interface {
	// AppendActivityEvent records one immutable lifecycle-transition row and
	// returns the event_seq the database assigned (monotonic, not necessarily
	// contiguous). Callers use it as the resumable-subscribe cursor for the update.
	AppendActivityEvent(ctx context.Context, arg AppendActivityEventParams) (int64, error)
	// BackfillLedgerRoundUuid stamps the canonical UUID string form onto every
	// entry carrying the given raw round_id that does not have one yet. The
	// round_uuid IS NULL guard makes re-running the backfill (e.g. after a crash
	// mid-migration) a no-op for already-converted rows.
	BackfillLedgerRoundUuid(ctx context.Context, arg BackfillLedgerRoundUuidParams) error
	CancelVHTLCRecoveryJob(ctx context.Context, arg CancelVHTLCRecoveryJobParams) (int64, error)
	ClearPendingIntentAnchorByOutpoint(ctx context.Context, arg ClearPendingIntentAnchorByOutpointParams) error
	CompleteVHTLCRecoveryJob(ctx context.Context, arg CompleteVHTLCRecoveryJobParams) (int64, error)
	// CountActivityEntriesByStatus returns the number of current-state rows in the
	// given status. It backs the wallet status summary's pending count, which must
	// reflect the whole feed rather than a single paginated page.
	CountActivityEntriesByStatus(ctx context.Context, status int64) (int64, error)
	CountBoardingIntentsByStatus(ctx context.Context, status string) (int64, error)
	CountClientLedgerEntries(ctx context.Context) (int64, error)
	// Count the anchors retained for one intent (a failed intent keeps its
	// anchors so it stays correlatable by its consumed outpoints).
	CountPendingIntentAnchorsByIntentID(ctx context.Context, intentID []byte) (int64, error)
	// Count the send-detail rows retained for one intent.
	CountPendingSendIntentsByIntentID(ctx context.Context, intentID []byte) (int64, error)
	CountUnresolvedBoardingSweepInputs(ctx context.Context, txid []byte) (int64, error)
	CountUnspentVTXOs(ctx context.Context) (int64, error)
	// CountVTXOsByStatus returns the count of VTXOs with the specified status.
	CountVTXOsByStatus(ctx context.Context, status int32) (int64, error)
	CountWalletUTXOLog(ctx context.Context) (int64, error)
	DeleteClientTreeTxids(ctx context.Context, arg DeleteClientTreeTxidsParams) error
	DeleteOORPackageCheckpoints(ctx context.Context, sessionID []byte) error
	DeleteOrphanedPendingBoardIntents(ctx context.Context) error
	// A terminally failed intent is a durable record, not a sweepable orphan:
	// keep its header even once its anchors are reused. Replay already skips it on
	// the status filter, and the activity projection still surfaces it as failed.
	DeleteOrphanedPendingIntents(ctx context.Context) error
	// Keep the detail row of a terminally failed send even after its anchors are
	// gone (a released coin got reused by a later send, stealing the anchor). The
	// failed record is durable and correlated by intent_id, so its detail must
	// survive alongside its header for the activity projection to surface it.
	DeleteOrphanedPendingSendIntents(ctx context.Context) error
	DeletePendingBoardIntentByID(ctx context.Context, intentID []byte) error
	DeletePendingBoardIntentsAll(ctx context.Context) error
	DeletePendingIntentAnchorsByIntentID(ctx context.Context, intentID []byte) error
	DeletePendingIntentAnchorsByKind(ctx context.Context, kind string) error
	DeletePendingIntentByID(ctx context.Context, intentID []byte) error
	DeletePendingIntentsByKind(ctx context.Context, kind string) error
	DeletePendingSendIntentByID(ctx context.Context, intentID []byte) error
	DeletePendingSendIntentsAll(ctx context.Context) error
	// DeleteSpendingReservation removes the reservation for one outpoint. Called
	// when the VTXO leaves SpendingState (released or completed).
	DeleteSpendingReservation(ctx context.Context, arg DeleteSpendingReservationParams) error
	// DeleteVTXO removes a VTXO from storage. Used for cleanup after terminal
	// states are reached and the VTXO is no longer needed.
	DeleteVTXO(ctx context.Context, arg DeleteVTXOParams) error
	// DeleteVTXOAncestryPaths removes every ancestry row for the given VTXO.
	// Used as the first half of an upsert when the VTXO manager fills in
	// finalized lineage on top of a partially-written round-create row.
	DeleteVTXOAncestryPaths(ctx context.Context, arg DeleteVTXOAncestryPathsParams) error
	EscalateVHTLCRecoveryJob(ctx context.Context, arg EscalateVHTLCRecoveryJobParams) (int64, error)
	FailVHTLCRecoveryJob(ctx context.Context, arg FailVHTLCRecoveryJobParams) (int64, error)
	FinalizeRound(ctx context.Context, arg FinalizeRoundParams) error
	// GetActivityEntry returns one entry by its canonical id.
	GetActivityEntry(ctx context.Context, canonicalID string) (ActivityEntry, error)
	GetBoardingAddress(ctx context.Context, pkScript []byte) (BoardingAddress, error)
	GetBoardingIntent(ctx context.Context, arg GetBoardingIntentParams) (BoardingIntent, error)
	GetBoardingSweep(ctx context.Context, txid []byte) (BoardingSweep, error)
	GetBoardingSweepByInput(ctx context.Context, arg GetBoardingSweepByInputParams) (BoardingSweep, error)
	GetChainInfo(ctx context.Context, chainName string) (ChainInfo, error)
	GetClientAccountBalance(ctx context.Context, accountID string) (int64, error)
	GetClientLedgerStats(ctx context.Context) (GetClientLedgerStatsRow, error)
	GetClientTreeByTxid(ctx context.Context, txid []byte) (RoundClientTree, error)
	GetClientTreeTxidInfo(ctx context.Context, txid []byte) (ClientTreeTxid, error)
	GetClientTreeTxids(ctx context.Context, arg GetClientTreeTxidsParams) ([]GetClientTreeTxidsRow, error)
	// GetConfirmedExitCost returns the confirmed on-chain cost of a unilateral
	// exit: the onchain_fee_paid leg the ledger booked after the exit's final
	// sweep confirmed, keyed by the exit's outpoint-derived idempotency key
	// (ledger.ExitIdempotencyKey). Zero when the exit has not confirmed (or
	// predates exit-cost accounting).
	GetConfirmedExitCost(ctx context.Context, idempotencyKey []byte) (int64, error)
	GetCreditOperation(ctx context.Context, opID string) (CreditOperation, error)
	// Exit funding address persistence queries (wavelength#893).
	GetExitFundingAddress(ctx context.Context, arg GetExitFundingAddressParams) (ExitFundingAddress, error)
	GetInternalKeyByID(ctx context.Context, id int64) (InternalKey, error)
	// Macaroon root key store queries.
	GetMacaroonRootKey(ctx context.Context, id []byte) (Macaroon, error)
	GetOORPackage(ctx context.Context, sessionID []byte) (OorPackage, error)
	GetOORPackageByOutpoint(ctx context.Context, arg GetOORPackageByOutpointParams) (GetOORPackageByOutpointRow, error)
	GetOORPackageByOutpointAndKind(ctx context.Context, arg GetOORPackageByOutpointAndKindParams) (GetOORPackageByOutpointAndKindRow, error)
	GetOORRecipientCursor(ctx context.Context, recipientPkScript []byte) (OorRecipientCursor, error)
	GetOORSessionRegistry(ctx context.Context, sessionID []byte) (OorSessionRegistry, error)
	GetOORVTXOBindingByOutpoint(ctx context.Context, arg GetOORVTXOBindingByOutpointParams) (OorVtxoBinding, error)
	GetOORVTXOBindingByOutpointAndKind(ctx context.Context, arg GetOORVTXOBindingByOutpointAndKindParams) (OorVtxoBinding, error)
	GetOwnedReceiveScript(ctx context.Context, pkScript []byte) (OwnedReceiveScript, error)
	// Fetch one intent header by id, exposing the terminal-failure columns so
	// callers (and tests) can assert send-failure state without raw SQL.
	GetPendingIntentByID(ctx context.Context, intentID []byte) (GetPendingIntentByIDRow, error)
	GetRound(ctx context.Context, roundID string) (Round, error)
	GetRoundBoardingIntents(ctx context.Context, roundID string) ([]RoundBoardingIntent, error)
	GetRoundByCommitmentTxid(ctx context.Context, commitmentTxid []byte) (Round, error)
	GetRoundClientTree(ctx context.Context, arg GetRoundClientTreeParams) (RoundClientTree, error)
	GetRoundClientTrees(ctx context.Context, roundID string) ([]RoundClientTree, error)
	GetRoundVtxoRequests(ctx context.Context, roundID string) ([]RoundVtxoRequest, error)
	// Returns cumulative Ark protocol fees paid to the operator (fees_paid
	// account only). Does not include L1 chain/miner fees (onchain_fees).
	GetTotalOperatorFeesPaid(ctx context.Context) (int64, error)
	GetUnilateralExitJob(ctx context.Context, arg GetUnilateralExitJobParams) (UnilateralExitJob, error)
	GetVHTLCRecoveryJob(ctx context.Context, id string) (VhtlcRecoveryJob, error)
	GetVHTLCRecoveryJobByRequestID(ctx context.Context, requestID string) (VhtlcRecoveryJob, error)
	GetVTXO(ctx context.Context, arg GetVTXOParams) (Vtxo, error)
	// GetVTXOForfeitTx retrieves the persisted forfeit transaction for a VTXO.
	// Used during recovery to restore the ForfeitingState with its tx.
	GetVTXOForfeitTx(ctx context.Context, arg GetVTXOForfeitTxParams) (GetVTXOForfeitTxRow, error)
	// GetVTXOReplacement retrieves the replacement VTXO outpoint for a forfeited
	// VTXO. Returns NULL if not forfeited or no replacement recorded.
	GetVTXOReplacement(ctx context.Context, arg GetVTXOReplacementParams) (GetVTXOReplacementRow, error)
	// Boarding address queries.
	InsertBoardingAddress(ctx context.Context, arg InsertBoardingAddressParams) error
	// Boarding intent queries.
	InsertBoardingIntent(ctx context.Context, arg InsertBoardingIntentParams) error
	// Boarding sweep queries.
	InsertBoardingSweep(ctx context.Context, arg InsertBoardingSweepParams) error
	InsertBoardingSweepInput(ctx context.Context, arg InsertBoardingSweepInputParams) error
	// Column order matches the ledger_entries CREATE TABLE layout
	// from migration 000006 plus the chain metadata columns added in
	// migration 000014, so the generated row type for SELECTs stays
	// structurally identical to the LedgerEntry model returned by the
	// adapter. Changing the table column order requires changing these
	// SELECTs in lockstep.
	//
	// ON CONFLICT DO NOTHING makes the insert idempotent against
	// every partial unique index on ledger_entries:
	//   - idx_client_ledger_idempotent_round covers per-round events
	//   - idx_client_ledger_idempotent_session covers per-OOR-session events
	//   - idx_client_ledger_idempotent_key covers outpoint-keyed events
	//     (unilateral exit send leg + fee leg share the same key)
	// A redelivered durable-actor message that reprocesses an entry
	// already persisted in a committed tx becomes a silent no-op
	// instead of surfacing a constraint violation that would drive
	// an infinite nack-and-retry loop on a permanent condition.
	InsertClientLedgerEntry(ctx context.Context, arg InsertClientLedgerEntryParams) error
	// Client tree txids queries.
	InsertClientTreeTxid(ctx context.Context, arg InsertClientTreeTxidParams) error
	InsertExitFundingAddress(ctx context.Context, arg InsertExitFundingAddressParams) error
	InsertMacaroonRootKey(ctx context.Context, arg InsertMacaroonRootKeyParams) error
	InsertOORPackageCheckpoint(ctx context.Context, arg InsertOORPackageCheckpointParams) error
	// Round queries.
	InsertRound(ctx context.Context, arg InsertRoundParams) error
	// Round boarding intents queries.
	InsertRoundBoardingIntent(ctx context.Context, arg InsertRoundBoardingIntentParams) error
	// Client trees queries.
	InsertRoundClientTree(ctx context.Context, arg InsertRoundClientTreeParams) error
	// Round VTXO request queries.
	InsertRoundVtxoRequest(ctx context.Context, arg InsertRoundVtxoRequestParams) error
	// vHTLC recovery job queries.
	InsertVHTLCRecoveryJob(ctx context.Context, arg InsertVHTLCRecoveryJobParams) error
	// VTXO queries.
	// InsertVTXO creates or updates a VTXO. On conflict, richer semantic and
	// metadata fields from the later insert win when present. This allows the
	// round store to create the initial row and the VTXO manager to heal it with
	// the finalized descriptor (policy template, key material, batch metadata).
	InsertVTXO(ctx context.Context, arg InsertVTXOParams) error
	// InsertVTXOAncestryPath inserts one ancestry tree fragment for a VTXO.
	// Callers replace the full set on update by deleting via
	// DeleteVTXOAncestryPaths first.
	InsertVTXOAncestryPath(ctx context.Context, arg InsertVTXOAncestryPathParams) error
	// Crash-replay safe: duplicate (outpoint, event) inserts from
	// RestartMessage replay are silently ignored so the audit log stays
	// at-most-once per outpoint+event.
	InsertWalletUTXOLog(ctx context.Context, arg InsertWalletUTXOLogParams) error
	ListActiveRounds(ctx context.Context) ([]Round, error)
	// ListActivityEntries returns entries newest-first, paged by the immutable
	// (created_at_unix, canonical_id) cursor so a row that transitions in place
	// keeps its position. An empty cursor (created = 0) starts from the newest.
	// Callers pass limit_count + 1 and trim the extra row to compute has_more.
	ListActivityEntries(ctx context.Context, arg ListActivityEntriesParams) ([]ActivityEntry, error)
	ListAllBoardingAddresses(ctx context.Context) ([]BoardingAddress, error)
	ListAllBoardingIntents(ctx context.Context) ([]BoardingIntent, error)
	ListAllCreditOperations(ctx context.Context) ([]CreditOperation, error)
	ListAllOORSessionRegistry(ctx context.Context) ([]OorSessionRegistry, error)
	ListAllVTXOs(ctx context.Context) ([]Vtxo, error)
	ListBoardingIntentOutpoints(ctx context.Context) ([]ListBoardingIntentOutpointsRow, error)
	ListBoardingIntentsByConfHeight(ctx context.Context, confHeight int32) ([]BoardingIntent, error)
	ListBoardingIntentsByPkScript(ctx context.Context, pkScript []byte) ([]BoardingIntent, error)
	ListBoardingIntentsByStatus(ctx context.Context, status string) ([]BoardingIntent, error)
	ListBoardingIntentsByStatusAndMinHeight(ctx context.Context, arg ListBoardingIntentsByStatusAndMinHeightParams) ([]BoardingIntent, error)
	ListBoardingIntentsBySweepableStatuses(ctx context.Context, arg ListBoardingIntentsBySweepableStatusesParams) ([]BoardingIntent, error)
	ListBoardingSweepInputs(ctx context.Context, txid []byte) ([]BoardingSweepInput, error)
	ListBoardingSweeps(ctx context.Context, arg ListBoardingSweepsParams) ([]BoardingSweep, error)
	ListChainInfo(ctx context.Context) ([]ChainInfo, error)
	ListClientAccountBalances(ctx context.Context) ([]ListClientAccountBalancesRow, error)
	ListClientAccounts(ctx context.Context) ([]Account, error)
	ListClientLedgerEntries(ctx context.Context, arg ListClientLedgerEntriesParams) ([]LedgerEntry, error)
	ListClientLedgerEntriesByType(ctx context.Context, arg ListClientLedgerEntriesByTypeParams) ([]LedgerEntry, error)
	ListClientLedgerEventTotals(ctx context.Context) ([]ListClientLedgerEventTotalsRow, error)
	// ListEntriesByKindStatus returns entries of the given kind and status, paged
	// by the unique canonical_id ascending. It backs the startup rehydration of
	// the wallet-local pending map: filtering in SQL keeps that scan O(matching
	// rows) instead of decoding the whole activity feed, and the canonical_id
	// cursor is strictly monotonic (a full page always advances it).
	ListEntriesByKindStatus(ctx context.Context, arg ListEntriesByKindStatusParams) ([]ActivityEntry, error)
	// ListForfeitingVTXOsByRound returns the outpoint and amount of every VTXO
	// sitting in Forfeiting status whose forfeit reservation is bound to the
	// given round. Used during restart recovery to rebuild a reloaded round's
	// forfeit set, so the status-reconcile release path has real outpoints to
	// return to Live rather than the empty in-memory set the crash discarded.
	ListForfeitingVTXOsByRound(ctx context.Context, forfeitRoundID sql.NullString) ([]ListForfeitingVTXOsByRoundRow, error)
	// ListLedgerRoundIDsMissingUuid returns the distinct raw round_id BLOBs that
	// have not yet been mirrored into the round_uuid TEXT column. The BLOB-to-UUID
	// string conversion is not expressible in the SQL dialect subset shared by
	// SQLite and Postgres, so the migration-015 post-step performs it in Go and
	// writes the result back via BackfillLedgerRoundUuid.
	ListLedgerRoundIDsMissingUuid(ctx context.Context) ([][]byte, error)
	// ListLiveVTXOAncestryPaths returns every ancestry row whose parent VTXO
	// is non-terminal, mirroring the filter on ListLiveVTXOs. Used as a
	// single batched companion query so descriptor materialization across
	// the live set runs in two queries total instead of N+1.
	ListLiveVTXOAncestryPaths(ctx context.Context) ([]VtxoAncestryPath, error)
	// ListLiveVTXOs returns all VTXOs that are not in a terminal state.
	// Terminal states are: Forfeited (3), Spent (4), UnilateralExit (5),
	// Failed (6).
	// Non-terminal states: Live (0), PendingForfeit (1), Forfeiting (2),
	// Spending (7).
	// This is used during startup to recover active VTXO actors.
	// Also filter on spent = FALSE to handle VTXOs marked spent via the earlier
	// flag before the status field was introduced.
	ListLiveVTXOs(ctx context.Context) ([]Vtxo, error)
	// Status 1 = Completed, 2 = Failed (anchored to Go iota in
	// db/credit_operation_store.go CreditOpStatus).
	ListNonTerminalCreditOperations(ctx context.Context) ([]CreditOperation, error)
	// Status 1 = Completed, 2 = Failed (anchored to Go iota in
	// db/oor_session_registry_store.go OORSessionStatus).
	ListNonTerminalOORSessionRegistry(ctx context.Context) ([]OorSessionRegistry, error)
	// Status 4 = Completed, 5 = Failed, 7 = FailedRecoverable (anchored to Go
	// iota in db/unilateral_exit_store.go UnilateralExitJobStatus).
	ListNonTerminalUnilateralExitJobs(ctx context.Context) ([]UnilateralExitJob, error)
	ListNonTerminalVHTLCRecoveryJobs(ctx context.Context) ([]VhtlcRecoveryJob, error)
	ListOORPackageCheckpoints(ctx context.Context, sessionID []byte) ([]OorPackageCheckpoint, error)
	ListOORPackages(ctx context.Context) ([]OorPackage, error)
	ListOORPackagesByDirection(ctx context.Context, direction int32) ([]OorPackage, error)
	ListOORRecipientCursors(ctx context.Context) ([]OorRecipientCursor, error)
	ListOORVTXOBindingsBySession(ctx context.Context, sessionID []byte) ([]ListOORVTXOBindingsBySessionRow, error)
	ListOwnedReceiveScripts(ctx context.Context) ([]OwnedReceiveScript, error)
	// Only status = 'pending' rows replay; a 'failed' intent is terminally
	// retired and must not be re-submitted on restart.
	ListPendingBoardIntents(ctx context.Context) ([]ListPendingBoardIntentsRow, error)
	ListPendingBoardingSweepInputs(ctx context.Context) ([]BoardingSweepInput, error)
	ListPendingBoardingSweeps(ctx context.Context) ([]BoardingSweep, error)
	ListPendingIntentAnchorsByKind(ctx context.Context, kind string) ([]PendingIntentAnchor, error)
	// Only status = 'pending' rows replay; a 'failed' intent is terminally
	// retired and must not be re-submitted on restart.
	ListPendingSendIntents(ctx context.Context) ([]ListPendingSendIntentsRow, error)
	// ListRecoverableVTXOs returns every VTXO whose actor must be restored at
	// startup: the non-terminal set of ListLiveVTXOs plus Expired (8).
	//
	// Expired is deliberately absent from ListLiveVTXOs, which feeds spendable
	// balance and refresh estimation, because an expired VTXO holds no spendable
	// value until it has been reissued. Its actor still has to exist though: the
	// value is recoverable by forfeiting the VTXO in an ordinary round, and the
	// actor is what holds the descriptor and signing material that forfeit needs.
	ListRecoverableVTXOs(ctx context.Context) ([]Vtxo, error)
	ListRoundsByStatus(ctx context.Context, status string) ([]Round, error)
	// ListRoundsPaginated returns rounds ordered by round_id with cursor-
	// based pagination. When cursor is empty, returns from the beginning.
	ListRoundsPaginated(ctx context.Context, arg ListRoundsPaginatedParams) ([]Round, error)
	// ListSpendingReservationOutpoints returns every reserved outpoint. Used by
	// the startup sweep to build the set of live reservations.
	ListSpendingReservationOutpoints(ctx context.Context) ([]ListSpendingReservationOutpointsRow, error)
	// ListTransactionHistory returns a unified newest-first history from the
	// client-side ledger and tracked boarding sweep transactions. Filters are
	// applied before LIMIT/OFFSET so filtered pagination never skips over matching
	// rows hidden behind non-matching entries.
	ListTransactionHistory(ctx context.Context, arg ListTransactionHistoryParams) ([]ListTransactionHistoryRow, error)
	// ListUnspentVTXOAncestryPaths returns every ancestry row whose parent
	// VTXO is unspent (status != 4 AND spent = FALSE), mirroring the filter
	// on ListUnspentVTXOs. Companion to the round-side ListVTXOs path.
	ListUnspentVTXOAncestryPaths(ctx context.Context) ([]VtxoAncestryPath, error)
	// Unspent requires both spent=false and status!=Spent(4).
	ListUnspentVTXOs(ctx context.Context) ([]Vtxo, error)
	ListVHTLCRecoveryJobs(ctx context.Context) ([]VhtlcRecoveryJob, error)
	ListVHTLCRecoveryJobsBySwapAction(ctx context.Context, arg ListVHTLCRecoveryJobsBySwapActionParams) ([]VhtlcRecoveryJob, error)
	// ListVTXOAncestryPaths returns the ancestry rows for one VTXO ordered by
	// path_order so the unroller sees the fragments in the same sequence the
	// indexer chose at materialization time.
	ListVTXOAncestryPaths(ctx context.Context, arg ListVTXOAncestryPathsParams) ([]VtxoAncestryPath, error)
	// ListVTXOAncestryPathsByStatus returns every ancestry row whose parent
	// VTXO matches the given status code. Companion to ListVTXOsByStatus.
	ListVTXOAncestryPathsByStatus(ctx context.Context, status int32) ([]VtxoAncestryPath, error)
	// ListVTXOSelectionCandidatesByStatus returns the lightweight projection coin
	// selection runs on: outpoint, amount, and pkScript. Selection happens on
	// every payment and only needs these three fields, so this avoids decoding
	// full descriptors (pubkey parsing, taproot script reconstruction, policy
	// template decode) and the batched ancestry-path query on the hot path.
	ListVTXOSelectionCandidatesByStatus(ctx context.Context, status int32) ([]ListVTXOSelectionCandidatesByStatusRow, error)
	ListVTXOsByRound(ctx context.Context, roundID string) ([]Vtxo, error)
	// VTXO status and lifecycle queries.
	// These queries support the vtxo.VTXOStore interface for VTXO lifecycle
	// management, including status transitions and forfeit transaction tracking.
	// ListVTXOsByStatus returns all VTXOs with the specified status. It also
	// LEFT JOINs the round that forfeited each VTXO (via forfeit_round_id) so a
	// FORFEITED VTXO can surface the settling commitment txid and its confirmation
	// height. The join columns are NULL for every VTXO whose forfeit round is
	// unknown (all non-forfeited VTXOs, and forfeited ones whose round row is
	// absent), so consumers must treat them as optional.
	//
	// settlement_fee_sat is the TOTAL operator fee the client's ledger booked for
	// the forfeit round (boarding_fee_paid + refresh_fee_paid, joined via the
	// round_uuid TEXT mirror of the ledger's BLOB round_id). Every VTXO forfeited
	// in the same round reports the same round-level figure — consumers must not
	// sum it across VTXOs. Zero when the forfeit round is unknown or its fee rows
	// are absent (e.g. rows written before the round_uuid backfill ran).
	//
	// The fee lookup is a correlated scalar subquery rather than a grouped join:
	// the planner then resolves it as a per-row probe of the
	// idx_client_ledger_round_uuid index for the (few) forfeited rows that carry
	// a forfeit_round_id, instead of aggregating every fee row in the ledger on
	// every call.
	ListVTXOsByStatus(ctx context.Context, status int32) ([]ListVTXOsByStatusRow, error)
	ListWalletUTXOLog(ctx context.Context, arg ListWalletUTXOLogParams) ([]WalletUtxoLog, error)
	ListWalletUTXOLogByBlock(ctx context.Context, blockHeight int32) ([]WalletUtxoLog, error)
	ListWalletUTXOLogByClassification(ctx context.Context, arg ListWalletUTXOLogByClassificationParams) ([]WalletUtxoLog, error)
	// Status 2 = Failed (anchored to Go iota in db/credit_operation_store.go
	// CreditOpStatus). Failed operations never dedup a keyed retry, so the lookup
	// skips them: only a pending or completed operation answers for an op_key.
	LookupActiveCreditOperationByKey(ctx context.Context, opKey string) (CreditOperation, error)
	// Status 2 = Failed (anchored to Go iota in
	// db/oor_session_registry_store.go OORSessionStatus). Failed sessions never
	// dedup a keyed retry, so the lookup skips them: only a pending or completed
	// session answers for an idempotency key.
	LookupActiveOORSessionRegistryByIdempotencyKey(ctx context.Context, idempotencyKey sql.NullString) (OorSessionRegistry, error)
	MarkBoardingSweepInputSpentByOutpoint(ctx context.Context, arg MarkBoardingSweepInputSpentByOutpointParams) (int64, error)
	MarkBoardingSweepInputStatus(ctx context.Context, arg MarkBoardingSweepInputStatusParams) error
	MarkBoardingSweepInputsStatus(ctx context.Context, arg MarkBoardingSweepInputsStatusParams) error
	MarkBoardingSweepStatus(ctx context.Context, arg MarkBoardingSweepStatusParams) error
	// Terminally fail the pending send intent anchored to the given outpoint,
	// recording the reason and typed failure code. Idempotent: the status guard
	// makes a repeat call (e.g. a second forfeit outpoint of the same intent) a
	// no-op. Anchors are intentionally retained so the activity projection can
	// still correlate the failed job by its consumed outpoint.
	MarkPendingSendIntentFailedByOutpoint(ctx context.Context, arg MarkPendingSendIntentFailedByOutpointParams) error
	MarkUnilateralExitJobTerminal(ctx context.Context, arg MarkUnilateralExitJobTerminalParams) error
	MarkVHTLCRecoveryExitTxBroadcast(ctx context.Context, arg MarkVHTLCRecoveryExitTxBroadcastParams) error
	MarkVHTLCRecoveryExitTxBuilt(ctx context.Context, arg MarkVHTLCRecoveryExitTxBuiltParams) error
	MarkVHTLCRecoveryExitTxSubmitting(ctx context.Context, arg MarkVHTLCRecoveryExitTxSubmittingParams) error
	// Intermediate states waiting_for_target and building_exit_spend are written
	// by the execution-layer PR. This storage slice accepts them as source states
	// so replay can resume from each durable pipeline boundary once those writes
	// exist.
	MarkVHTLCRecoveryTargetDetected(ctx context.Context, arg MarkVHTLCRecoveryTargetDetectedParams) error
	// MarkVTXOForfeited marks a VTXO as forfeited and records the forfeit
	// transaction ID and replacement VTXO outpoint. Called when the new round's
	// commitment transaction confirms.
	MarkVTXOForfeited(ctx context.Context, arg MarkVTXOForfeitedParams) error
	// MarkVTXOForfeiting transitions a VTXO to Forfeiting status and persists
	// the forfeit round ID and transaction for crash recovery. Called when
	// entering the forfeit flow.
	MarkVTXOForfeiting(ctx context.Context, arg MarkVTXOForfeitingParams) error
	// Also sets status = 4 (Spent) to keep status in sync with spent flag.
	MarkVTXOSpent(ctx context.Context, arg MarkVTXOSpentParams) error
	// PullActivityEvents returns transition rows strictly after the cursor in
	// event_seq order, the resumable-subscribe replay primitive.
	PullActivityEvents(ctx context.Context, arg PullActivityEventsParams) ([]ActivityEvent, error)
	SumBoardingIntentAmountsByStatus(ctx context.Context, status string) (interface{}, error)
	SumUnspentVTXOAmounts(ctx context.Context) (interface{}, error)
	UpdateBoardingIntentStatus(ctx context.Context, arg UpdateBoardingIntentStatusParams) error
	UpdateRoundBoardingIntentSignature(ctx context.Context, arg UpdateRoundBoardingIntentSignatureParams) error
	UpdateRoundStatus(ctx context.Context, arg UpdateRoundStatusParams) error
	// UpdateVTXOStatus atomically updates a VTXO's status. This is the primary
	// method for state transitions that don't require additional data.
	UpdateVTXOStatus(ctx context.Context, arg UpdateVTXOStatusParams) error
	// Canonical activity log queries. activity_entries is the current-state
	// projection read by List; activity_events is the append-only transition log
	// read by a resumable SubscribeWallet. See docs/canonical_activity_log_design.md.
	// UpsertActivityEntry inserts the activity row or advances it in place. On
	// conflict the mutable lifecycle columns are overwritten with the new
	// projection and updated_at_unix is bumped, but created_at_unix is preserved so
	// the row keeps its position in the created-ordered feed. The settlement and
	// correlation handles are COALESCEd so an early projection that does not yet
	// know a txid never clobbers one a later projection already recorded.
	UpsertActivityEntry(ctx context.Context, arg UpsertActivityEntryParams) (int64, error)
	UpsertChainInfo(ctx context.Context, arg UpsertChainInfoParams) error
	// Credit operations control-plane queries.
	UpsertCreditOperation(ctx context.Context, arg UpsertCreditOperationParams) error
	// Internal key registry queries.
	// Register an internal key and return the stored row's id in a single
	// round-trip on both backends. ON CONFLICT (pubkey, key_family, key_index)
	// makes re-registration of an already-known triple idempotent; the no-op DO
	// UPDATE (rather than DO NOTHING) is required so RETURNING still fires on
	// conflict and the caller gets the existing id, closing the read-then-insert
	// race a separate re-select would leave open.
	UpsertInternalKey(ctx context.Context, arg UpsertInternalKeyParams) (int64, error)
	// OOR artifact store queries.
	UpsertOORPackage(ctx context.Context, arg UpsertOORPackageParams) (int64, error)
	UpsertOORRecipientCursor(ctx context.Context, arg UpsertOORRecipientCursorParams) error
	// OOR session registry control-plane queries.
	UpsertOORSessionRegistry(ctx context.Context, arg UpsertOORSessionRegistryParams) error
	UpsertOORVTXOBinding(ctx context.Context, arg UpsertOORVTXOBindingParams) (int64, error)
	UpsertOwnedReceiveScript(ctx context.Context, arg UpsertOwnedReceiveScriptParams) error
	UpsertPendingBoardIntent(ctx context.Context, arg UpsertPendingBoardIntentParams) error
	UpsertPendingIntentAnchor(ctx context.Context, arg UpsertPendingIntentAnchorParams) error
	// Re-arm a re-persisted intent as pending. NewPendingIntentID is
	// deterministic, so retrying a terminally failed send (same inputs and
	// payload) reuses the same intent_id and lands here on the retained 'failed'
	// row. Resetting the status and failure fields makes the retry replayable
	// again; without it the replay query (which now skips non-pending rows) would
	// silently drop a retry that crashes before the round adopts it.
	UpsertPendingIntentHeader(ctx context.Context, arg UpsertPendingIntentHeaderParams) error
	UpsertPendingSendIntent(ctx context.Context, arg UpsertPendingSendIntentParams) error
	// Spending reservation queries.
	// These queries maintain a durable index of VTXO outpoints reserved by an
	// active spend owner (e.g. an outgoing OOR session) so a startup sweep can
	// release orphaned Spending VTXOs that have no live reservation.
	// UpsertSpendingReservation records (or refreshes) the reservation for one
	// outpoint. The owner fields are updated on conflict so a re-checkpointed
	// session re-binds the same outpoint to its current owner.
	UpsertSpendingReservation(ctx context.Context, arg UpsertSpendingReservationParams) error
	// Unilateral-exit job control-plane queries.
	UpsertUnilateralExitJob(ctx context.Context, arg UpsertUnilateralExitJobParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func NewPostgres

func NewPostgres(db DBTX) *Queries

NewPostgres creates a new Queries instance for a Postgres database.

func NewSqlite

func NewSqlite(db DBTX) *Queries

NewSqlite creates a new Queries instance for a SQLite database.

func (*Queries) AppendActivityEvent

func (q *Queries) AppendActivityEvent(ctx context.Context, arg AppendActivityEventParams) (int64, error)

AppendActivityEvent records one immutable lifecycle-transition row and returns the event_seq the database assigned (monotonic, not necessarily contiguous). Callers use it as the resumable-subscribe cursor for the update.

func (*Queries) Backend

func (q *Queries) Backend() BackendType

Backend returns the type of database backend we're using.

func (*Queries) BackfillLedgerRoundUuid

func (q *Queries) BackfillLedgerRoundUuid(ctx context.Context, arg BackfillLedgerRoundUuidParams) error

BackfillLedgerRoundUuid stamps the canonical UUID string form onto every entry carrying the given raw round_id that does not have one yet. The round_uuid IS NULL guard makes re-running the backfill (e.g. after a crash mid-migration) a no-op for already-converted rows.

func (*Queries) CancelVHTLCRecoveryJob

func (q *Queries) CancelVHTLCRecoveryJob(ctx context.Context, arg CancelVHTLCRecoveryJobParams) (int64, error)

func (*Queries) ClearPendingIntentAnchorByOutpoint

func (q *Queries) ClearPendingIntentAnchorByOutpoint(ctx context.Context, arg ClearPendingIntentAnchorByOutpointParams) error

func (*Queries) CompleteVHTLCRecoveryJob

func (q *Queries) CompleteVHTLCRecoveryJob(ctx context.Context, arg CompleteVHTLCRecoveryJobParams) (int64, error)

func (*Queries) CountActivityEntriesByStatus

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

CountActivityEntriesByStatus returns the number of current-state rows in the given status. It backs the wallet status summary's pending count, which must reflect the whole feed rather than a single paginated page.

func (*Queries) CountBoardingIntentsByStatus

func (q *Queries) CountBoardingIntentsByStatus(ctx context.Context, status string) (int64, error)

func (*Queries) CountClientLedgerEntries

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

func (*Queries) CountPendingIntentAnchorsByIntentID

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

Count the anchors retained for one intent (a failed intent keeps its anchors so it stays correlatable by its consumed outpoints).

func (*Queries) CountPendingSendIntentsByIntentID

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

Count the send-detail rows retained for one intent.

func (*Queries) CountUnresolvedBoardingSweepInputs

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

func (*Queries) CountUnspentVTXOs

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

func (*Queries) CountVTXOsByStatus

func (q *Queries) CountVTXOsByStatus(ctx context.Context, status int32) (int64, error)

CountVTXOsByStatus returns the count of VTXOs with the specified status.

func (*Queries) CountWalletUTXOLog

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

func (*Queries) DeleteClientTreeTxids

func (q *Queries) DeleteClientTreeTxids(ctx context.Context, arg DeleteClientTreeTxidsParams) error

func (*Queries) DeleteOORPackageCheckpoints

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

func (*Queries) DeleteOrphanedPendingBoardIntents

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

func (*Queries) DeleteOrphanedPendingIntents

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

A terminally failed intent is a durable record, not a sweepable orphan: keep its header even once its anchors are reused. Replay already skips it on the status filter, and the activity projection still surfaces it as failed.

func (*Queries) DeleteOrphanedPendingSendIntents

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

Keep the detail row of a terminally failed send even after its anchors are gone (a released coin got reused by a later send, stealing the anchor). The failed record is durable and correlated by intent_id, so its detail must survive alongside its header for the activity projection to surface it.

func (*Queries) DeletePendingBoardIntentByID

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

func (*Queries) DeletePendingBoardIntentsAll

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

func (*Queries) DeletePendingIntentAnchorsByIntentID

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

func (*Queries) DeletePendingIntentAnchorsByKind

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

func (*Queries) DeletePendingIntentByID

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

func (*Queries) DeletePendingIntentsByKind

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

func (*Queries) DeletePendingSendIntentByID

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

func (*Queries) DeletePendingSendIntentsAll

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

func (*Queries) DeleteSpendingReservation

func (q *Queries) DeleteSpendingReservation(ctx context.Context, arg DeleteSpendingReservationParams) error

DeleteSpendingReservation removes the reservation for one outpoint. Called when the VTXO leaves SpendingState (released or completed).

func (*Queries) DeleteVTXO

func (q *Queries) DeleteVTXO(ctx context.Context, arg DeleteVTXOParams) error

DeleteVTXO removes a VTXO from storage. Used for cleanup after terminal states are reached and the VTXO is no longer needed.

func (*Queries) DeleteVTXOAncestryPaths

func (q *Queries) DeleteVTXOAncestryPaths(ctx context.Context, arg DeleteVTXOAncestryPathsParams) error

DeleteVTXOAncestryPaths removes every ancestry row for the given VTXO. Used as the first half of an upsert when the VTXO manager fills in finalized lineage on top of a partially-written round-create row.

func (*Queries) EscalateVHTLCRecoveryJob

func (q *Queries) EscalateVHTLCRecoveryJob(ctx context.Context, arg EscalateVHTLCRecoveryJobParams) (int64, error)

func (*Queries) FailVHTLCRecoveryJob

func (q *Queries) FailVHTLCRecoveryJob(ctx context.Context, arg FailVHTLCRecoveryJobParams) (int64, error)

func (*Queries) FinalizeRound

func (q *Queries) FinalizeRound(ctx context.Context, arg FinalizeRoundParams) error

func (*Queries) GetActivityEntry

func (q *Queries) GetActivityEntry(ctx context.Context, canonicalID string) (ActivityEntry, error)

GetActivityEntry returns one entry by its canonical id.

func (*Queries) GetBoardingAddress

func (q *Queries) GetBoardingAddress(ctx context.Context, pkScript []byte) (BoardingAddress, error)

func (*Queries) GetBoardingIntent

func (q *Queries) GetBoardingIntent(ctx context.Context, arg GetBoardingIntentParams) (BoardingIntent, error)

func (*Queries) GetBoardingSweep

func (q *Queries) GetBoardingSweep(ctx context.Context, txid []byte) (BoardingSweep, error)

func (*Queries) GetBoardingSweepByInput

func (q *Queries) GetBoardingSweepByInput(ctx context.Context, arg GetBoardingSweepByInputParams) (BoardingSweep, error)

func (*Queries) GetChainInfo

func (q *Queries) GetChainInfo(ctx context.Context, chainName string) (ChainInfo, error)

func (*Queries) GetClientAccountBalance

func (q *Queries) GetClientAccountBalance(ctx context.Context, accountID string) (int64, error)

func (*Queries) GetClientLedgerStats

func (q *Queries) GetClientLedgerStats(ctx context.Context) (GetClientLedgerStatsRow, error)

func (*Queries) GetClientTreeByTxid

func (q *Queries) GetClientTreeByTxid(ctx context.Context, txid []byte) (RoundClientTree, error)

func (*Queries) GetClientTreeTxidInfo

func (q *Queries) GetClientTreeTxidInfo(ctx context.Context, txid []byte) (ClientTreeTxid, error)

func (*Queries) GetClientTreeTxids

func (q *Queries) GetClientTreeTxids(ctx context.Context, arg GetClientTreeTxidsParams) ([]GetClientTreeTxidsRow, error)

func (*Queries) GetConfirmedExitCost

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

GetConfirmedExitCost returns the confirmed on-chain cost of a unilateral exit: the onchain_fee_paid leg the ledger booked after the exit's final sweep confirmed, keyed by the exit's outpoint-derived idempotency key (ledger.ExitIdempotencyKey). Zero when the exit has not confirmed (or predates exit-cost accounting).

func (*Queries) GetCreditOperation

func (q *Queries) GetCreditOperation(ctx context.Context, opID string) (CreditOperation, error)

func (*Queries) GetExitFundingAddress

func (q *Queries) GetExitFundingAddress(ctx context.Context, arg GetExitFundingAddressParams) (ExitFundingAddress, error)

Exit funding address persistence queries (wavelength#893).

func (*Queries) GetInternalKeyByID

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

func (*Queries) GetMacaroonRootKey

func (q *Queries) GetMacaroonRootKey(ctx context.Context, id []byte) (Macaroon, error)

Macaroon root key store queries.

func (*Queries) GetOORPackage

func (q *Queries) GetOORPackage(ctx context.Context, sessionID []byte) (OorPackage, error)

func (*Queries) GetOORPackageByOutpoint

func (q *Queries) GetOORPackageByOutpoint(ctx context.Context, arg GetOORPackageByOutpointParams) (GetOORPackageByOutpointRow, error)

func (*Queries) GetOORRecipientCursor

func (q *Queries) GetOORRecipientCursor(ctx context.Context, recipientPkScript []byte) (OorRecipientCursor, error)

func (*Queries) GetOORSessionRegistry

func (q *Queries) GetOORSessionRegistry(ctx context.Context, sessionID []byte) (OorSessionRegistry, error)

func (*Queries) GetOORVTXOBindingByOutpoint

func (q *Queries) GetOORVTXOBindingByOutpoint(ctx context.Context, arg GetOORVTXOBindingByOutpointParams) (OorVtxoBinding, error)

func (*Queries) GetOORVTXOBindingByOutpointAndKind

func (q *Queries) GetOORVTXOBindingByOutpointAndKind(ctx context.Context, arg GetOORVTXOBindingByOutpointAndKindParams) (OorVtxoBinding, error)

func (*Queries) GetOwnedReceiveScript

func (q *Queries) GetOwnedReceiveScript(ctx context.Context, pkScript []byte) (OwnedReceiveScript, error)

func (*Queries) GetPendingIntentByID

func (q *Queries) GetPendingIntentByID(ctx context.Context, intentID []byte) (GetPendingIntentByIDRow, error)

Fetch one intent header by id, exposing the terminal-failure columns so callers (and tests) can assert send-failure state without raw SQL.

func (*Queries) GetRound

func (q *Queries) GetRound(ctx context.Context, roundID string) (Round, error)

func (*Queries) GetRoundBoardingIntents

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

func (*Queries) GetRoundByCommitmentTxid

func (q *Queries) GetRoundByCommitmentTxid(ctx context.Context, commitmentTxid []byte) (Round, error)

func (*Queries) GetRoundClientTree

func (q *Queries) GetRoundClientTree(ctx context.Context, arg GetRoundClientTreeParams) (RoundClientTree, error)

func (*Queries) GetRoundClientTrees

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

func (*Queries) GetRoundVtxoRequests

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

func (*Queries) GetTotalOperatorFeesPaid

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

Returns cumulative Ark protocol fees paid to the operator (fees_paid account only). Does not include L1 chain/miner fees (onchain_fees).

func (*Queries) GetUnilateralExitJob

func (q *Queries) GetUnilateralExitJob(ctx context.Context, arg GetUnilateralExitJobParams) (UnilateralExitJob, error)

func (*Queries) GetVHTLCRecoveryJob

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

func (*Queries) GetVHTLCRecoveryJobByRequestID

func (q *Queries) GetVHTLCRecoveryJobByRequestID(ctx context.Context, requestID string) (VhtlcRecoveryJob, error)

func (*Queries) GetVTXO

func (q *Queries) GetVTXO(ctx context.Context, arg GetVTXOParams) (Vtxo, error)

func (*Queries) GetVTXOForfeitTx

func (q *Queries) GetVTXOForfeitTx(ctx context.Context, arg GetVTXOForfeitTxParams) (GetVTXOForfeitTxRow, error)

GetVTXOForfeitTx retrieves the persisted forfeit transaction for a VTXO. Used during recovery to restore the ForfeitingState with its tx.

func (*Queries) GetVTXOReplacement

func (q *Queries) GetVTXOReplacement(ctx context.Context, arg GetVTXOReplacementParams) (GetVTXOReplacementRow, error)

GetVTXOReplacement retrieves the replacement VTXO outpoint for a forfeited VTXO. Returns NULL if not forfeited or no replacement recorded.

func (*Queries) InsertBoardingAddress

func (q *Queries) InsertBoardingAddress(ctx context.Context, arg InsertBoardingAddressParams) error

Boarding address queries.

func (*Queries) InsertBoardingIntent

func (q *Queries) InsertBoardingIntent(ctx context.Context, arg InsertBoardingIntentParams) error

Boarding intent queries.

func (*Queries) InsertBoardingSweep

func (q *Queries) InsertBoardingSweep(ctx context.Context, arg InsertBoardingSweepParams) error

Boarding sweep queries.

func (*Queries) InsertBoardingSweepInput

func (q *Queries) InsertBoardingSweepInput(ctx context.Context, arg InsertBoardingSweepInputParams) error

func (*Queries) InsertClientLedgerEntry

func (q *Queries) InsertClientLedgerEntry(ctx context.Context, arg InsertClientLedgerEntryParams) error

Column order matches the ledger_entries CREATE TABLE layout from migration 000006 plus the chain metadata columns added in migration 000014, so the generated row type for SELECTs stays structurally identical to the LedgerEntry model returned by the adapter. Changing the table column order requires changing these SELECTs in lockstep.

ON CONFLICT DO NOTHING makes the insert idempotent against every partial unique index on ledger_entries:

  • idx_client_ledger_idempotent_round covers per-round events
  • idx_client_ledger_idempotent_session covers per-OOR-session events
  • idx_client_ledger_idempotent_key covers outpoint-keyed events (unilateral exit send leg + fee leg share the same key)

A redelivered durable-actor message that reprocesses an entry already persisted in a committed tx becomes a silent no-op instead of surfacing a constraint violation that would drive an infinite nack-and-retry loop on a permanent condition.

func (*Queries) InsertClientTreeTxid

func (q *Queries) InsertClientTreeTxid(ctx context.Context, arg InsertClientTreeTxidParams) error

Client tree txids queries.

func (*Queries) InsertExitFundingAddress

func (q *Queries) InsertExitFundingAddress(ctx context.Context, arg InsertExitFundingAddressParams) error

func (*Queries) InsertMacaroonRootKey

func (q *Queries) InsertMacaroonRootKey(ctx context.Context, arg InsertMacaroonRootKeyParams) error

func (*Queries) InsertOORPackageCheckpoint

func (q *Queries) InsertOORPackageCheckpoint(ctx context.Context, arg InsertOORPackageCheckpointParams) error

func (*Queries) InsertRound

func (q *Queries) InsertRound(ctx context.Context, arg InsertRoundParams) error

Round queries.

func (*Queries) InsertRoundBoardingIntent

func (q *Queries) InsertRoundBoardingIntent(ctx context.Context, arg InsertRoundBoardingIntentParams) error

Round boarding intents queries.

func (*Queries) InsertRoundClientTree

func (q *Queries) InsertRoundClientTree(ctx context.Context, arg InsertRoundClientTreeParams) error

Client trees queries.

func (*Queries) InsertRoundVtxoRequest

func (q *Queries) InsertRoundVtxoRequest(ctx context.Context, arg InsertRoundVtxoRequestParams) error

Round VTXO request queries.

func (*Queries) InsertVHTLCRecoveryJob

func (q *Queries) InsertVHTLCRecoveryJob(ctx context.Context, arg InsertVHTLCRecoveryJobParams) error

vHTLC recovery job queries.

func (*Queries) InsertVTXO

func (q *Queries) InsertVTXO(ctx context.Context, arg InsertVTXOParams) error

VTXO queries. InsertVTXO creates or updates a VTXO. On conflict, richer semantic and metadata fields from the later insert win when present. This allows the round store to create the initial row and the VTXO manager to heal it with the finalized descriptor (policy template, key material, batch metadata).

func (*Queries) InsertVTXOAncestryPath

func (q *Queries) InsertVTXOAncestryPath(ctx context.Context, arg InsertVTXOAncestryPathParams) error

InsertVTXOAncestryPath inserts one ancestry tree fragment for a VTXO. Callers replace the full set on update by deleting via DeleteVTXOAncestryPaths first.

func (*Queries) InsertWalletUTXOLog

func (q *Queries) InsertWalletUTXOLog(ctx context.Context, arg InsertWalletUTXOLogParams) error

Crash-replay safe: duplicate (outpoint, event) inserts from RestartMessage replay are silently ignored so the audit log stays at-most-once per outpoint+event.

func (*Queries) ListActiveRounds

func (q *Queries) ListActiveRounds(ctx context.Context) ([]Round, error)

func (*Queries) ListActivityEntries

func (q *Queries) ListActivityEntries(ctx context.Context, arg ListActivityEntriesParams) ([]ActivityEntry, error)

ListActivityEntries returns entries newest-first, paged by the immutable (created_at_unix, canonical_id) cursor so a row that transitions in place keeps its position. An empty cursor (created = 0) starts from the newest. Callers pass limit_count + 1 and trim the extra row to compute has_more.

func (*Queries) ListAllBoardingAddresses

func (q *Queries) ListAllBoardingAddresses(ctx context.Context) ([]BoardingAddress, error)

func (*Queries) ListAllBoardingIntents

func (q *Queries) ListAllBoardingIntents(ctx context.Context) ([]BoardingIntent, error)

func (*Queries) ListAllCreditOperations

func (q *Queries) ListAllCreditOperations(ctx context.Context) ([]CreditOperation, error)

func (*Queries) ListAllOORSessionRegistry

func (q *Queries) ListAllOORSessionRegistry(ctx context.Context) ([]OorSessionRegistry, error)

func (*Queries) ListAllVTXOs

func (q *Queries) ListAllVTXOs(ctx context.Context) ([]Vtxo, error)

func (*Queries) ListBoardingIntentOutpoints

func (q *Queries) ListBoardingIntentOutpoints(ctx context.Context) ([]ListBoardingIntentOutpointsRow, error)

func (*Queries) ListBoardingIntentsByConfHeight

func (q *Queries) ListBoardingIntentsByConfHeight(ctx context.Context, confHeight int32) ([]BoardingIntent, error)

func (*Queries) ListBoardingIntentsByPkScript

func (q *Queries) ListBoardingIntentsByPkScript(ctx context.Context, pkScript []byte) ([]BoardingIntent, error)

func (*Queries) ListBoardingIntentsByStatus

func (q *Queries) ListBoardingIntentsByStatus(ctx context.Context, status string) ([]BoardingIntent, error)

func (*Queries) ListBoardingIntentsByStatusAndMinHeight

func (q *Queries) ListBoardingIntentsByStatusAndMinHeight(ctx context.Context, arg ListBoardingIntentsByStatusAndMinHeightParams) ([]BoardingIntent, error)

func (*Queries) ListBoardingIntentsBySweepableStatuses

func (q *Queries) ListBoardingIntentsBySweepableStatuses(ctx context.Context, arg ListBoardingIntentsBySweepableStatusesParams) ([]BoardingIntent, error)

func (*Queries) ListBoardingSweepInputs

func (q *Queries) ListBoardingSweepInputs(ctx context.Context, txid []byte) ([]BoardingSweepInput, error)

func (*Queries) ListBoardingSweeps

func (q *Queries) ListBoardingSweeps(ctx context.Context, arg ListBoardingSweepsParams) ([]BoardingSweep, error)

func (*Queries) ListChainInfo

func (q *Queries) ListChainInfo(ctx context.Context) ([]ChainInfo, error)

func (*Queries) ListClientAccountBalances

func (q *Queries) ListClientAccountBalances(ctx context.Context) ([]ListClientAccountBalancesRow, error)

func (*Queries) ListClientAccounts

func (q *Queries) ListClientAccounts(ctx context.Context) ([]Account, error)

func (*Queries) ListClientLedgerEntries

func (q *Queries) ListClientLedgerEntries(ctx context.Context, arg ListClientLedgerEntriesParams) ([]LedgerEntry, error)

func (*Queries) ListClientLedgerEntriesByType

func (q *Queries) ListClientLedgerEntriesByType(ctx context.Context, arg ListClientLedgerEntriesByTypeParams) ([]LedgerEntry, error)

func (*Queries) ListClientLedgerEventTotals

func (q *Queries) ListClientLedgerEventTotals(ctx context.Context) ([]ListClientLedgerEventTotalsRow, error)

func (*Queries) ListEntriesByKindStatus

func (q *Queries) ListEntriesByKindStatus(ctx context.Context, arg ListEntriesByKindStatusParams) ([]ActivityEntry, error)

ListEntriesByKindStatus returns entries of the given kind and status, paged by the unique canonical_id ascending. It backs the startup rehydration of the wallet-local pending map: filtering in SQL keeps that scan O(matching rows) instead of decoding the whole activity feed, and the canonical_id cursor is strictly monotonic (a full page always advances it).

func (*Queries) ListForfeitingVTXOsByRound

func (q *Queries) ListForfeitingVTXOsByRound(ctx context.Context, forfeitRoundID sql.NullString) ([]ListForfeitingVTXOsByRoundRow, error)

ListForfeitingVTXOsByRound returns the outpoint and amount of every VTXO sitting in Forfeiting status whose forfeit reservation is bound to the given round. Used during restart recovery to rebuild a reloaded round's forfeit set, so the status-reconcile release path has real outpoints to return to Live rather than the empty in-memory set the crash discarded.

func (*Queries) ListLedgerRoundIDsMissingUuid

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

ListLedgerRoundIDsMissingUuid returns the distinct raw round_id BLOBs that have not yet been mirrored into the round_uuid TEXT column. The BLOB-to-UUID string conversion is not expressible in the SQL dialect subset shared by SQLite and Postgres, so the migration-015 post-step performs it in Go and writes the result back via BackfillLedgerRoundUuid.

func (*Queries) ListLiveVTXOAncestryPaths

func (q *Queries) ListLiveVTXOAncestryPaths(ctx context.Context) ([]VtxoAncestryPath, error)

ListLiveVTXOAncestryPaths returns every ancestry row whose parent VTXO is non-terminal, mirroring the filter on ListLiveVTXOs. Used as a single batched companion query so descriptor materialization across the live set runs in two queries total instead of N+1.

func (*Queries) ListLiveVTXOs

func (q *Queries) ListLiveVTXOs(ctx context.Context) ([]Vtxo, error)

ListLiveVTXOs returns all VTXOs that are not in a terminal state. Terminal states are: Forfeited (3), Spent (4), UnilateralExit (5), Failed (6). Non-terminal states: Live (0), PendingForfeit (1), Forfeiting (2), Spending (7). This is used during startup to recover active VTXO actors. Also filter on spent = FALSE to handle VTXOs marked spent via the earlier flag before the status field was introduced.

func (*Queries) ListNonTerminalCreditOperations

func (q *Queries) ListNonTerminalCreditOperations(ctx context.Context) ([]CreditOperation, error)

Status 1 = Completed, 2 = Failed (anchored to Go iota in db/credit_operation_store.go CreditOpStatus).

func (*Queries) ListNonTerminalOORSessionRegistry

func (q *Queries) ListNonTerminalOORSessionRegistry(ctx context.Context) ([]OorSessionRegistry, error)

Status 1 = Completed, 2 = Failed (anchored to Go iota in db/oor_session_registry_store.go OORSessionStatus).

func (*Queries) ListNonTerminalUnilateralExitJobs

func (q *Queries) ListNonTerminalUnilateralExitJobs(ctx context.Context) ([]UnilateralExitJob, error)

Status 4 = Completed, 5 = Failed, 7 = FailedRecoverable (anchored to Go iota in db/unilateral_exit_store.go UnilateralExitJobStatus).

func (*Queries) ListNonTerminalVHTLCRecoveryJobs

func (q *Queries) ListNonTerminalVHTLCRecoveryJobs(ctx context.Context) ([]VhtlcRecoveryJob, error)

func (*Queries) ListOORPackageCheckpoints

func (q *Queries) ListOORPackageCheckpoints(ctx context.Context, sessionID []byte) ([]OorPackageCheckpoint, error)

func (*Queries) ListOORPackages

func (q *Queries) ListOORPackages(ctx context.Context) ([]OorPackage, error)

func (*Queries) ListOORPackagesByDirection

func (q *Queries) ListOORPackagesByDirection(ctx context.Context, direction int32) ([]OorPackage, error)

func (*Queries) ListOORRecipientCursors

func (q *Queries) ListOORRecipientCursors(ctx context.Context) ([]OorRecipientCursor, error)

func (*Queries) ListOORVTXOBindingsBySession

func (q *Queries) ListOORVTXOBindingsBySession(ctx context.Context, sessionID []byte) ([]ListOORVTXOBindingsBySessionRow, error)

func (*Queries) ListOwnedReceiveScripts

func (q *Queries) ListOwnedReceiveScripts(ctx context.Context) ([]OwnedReceiveScript, error)

func (*Queries) ListPendingBoardIntents

func (q *Queries) ListPendingBoardIntents(ctx context.Context) ([]ListPendingBoardIntentsRow, error)

Only status = 'pending' rows replay; a 'failed' intent is terminally retired and must not be re-submitted on restart.

func (*Queries) ListPendingBoardingSweepInputs

func (q *Queries) ListPendingBoardingSweepInputs(ctx context.Context) ([]BoardingSweepInput, error)

func (*Queries) ListPendingBoardingSweeps

func (q *Queries) ListPendingBoardingSweeps(ctx context.Context) ([]BoardingSweep, error)

func (*Queries) ListPendingIntentAnchorsByKind

func (q *Queries) ListPendingIntentAnchorsByKind(ctx context.Context, kind string) ([]PendingIntentAnchor, error)

func (*Queries) ListPendingSendIntents

func (q *Queries) ListPendingSendIntents(ctx context.Context) ([]ListPendingSendIntentsRow, error)

Only status = 'pending' rows replay; a 'failed' intent is terminally retired and must not be re-submitted on restart.

func (*Queries) ListRecoverableVTXOs

func (q *Queries) ListRecoverableVTXOs(ctx context.Context) ([]Vtxo, error)

ListRecoverableVTXOs returns every VTXO whose actor must be restored at startup: the non-terminal set of ListLiveVTXOs plus Expired (8).

Expired is deliberately absent from ListLiveVTXOs, which feeds spendable balance and refresh estimation, because an expired VTXO holds no spendable value until it has been reissued. Its actor still has to exist though: the value is recoverable by forfeiting the VTXO in an ordinary round, and the actor is what holds the descriptor and signing material that forfeit needs.

func (*Queries) ListRoundsByStatus

func (q *Queries) ListRoundsByStatus(ctx context.Context, status string) ([]Round, error)

func (*Queries) ListRoundsPaginated

func (q *Queries) ListRoundsPaginated(ctx context.Context, arg ListRoundsPaginatedParams) ([]Round, error)

ListRoundsPaginated returns rounds ordered by round_id with cursor- based pagination. When cursor is empty, returns from the beginning.

func (*Queries) ListSpendingReservationOutpoints

func (q *Queries) ListSpendingReservationOutpoints(ctx context.Context) ([]ListSpendingReservationOutpointsRow, error)

ListSpendingReservationOutpoints returns every reserved outpoint. Used by the startup sweep to build the set of live reservations.

func (*Queries) ListTransactionHistory

func (q *Queries) ListTransactionHistory(ctx context.Context, arg ListTransactionHistoryParams) ([]ListTransactionHistoryRow, error)

ListTransactionHistory returns a unified newest-first history from the client-side ledger and tracked boarding sweep transactions. Filters are applied before LIMIT/OFFSET so filtered pagination never skips over matching rows hidden behind non-matching entries.

func (*Queries) ListUnspentVTXOAncestryPaths

func (q *Queries) ListUnspentVTXOAncestryPaths(ctx context.Context) ([]VtxoAncestryPath, error)

ListUnspentVTXOAncestryPaths returns every ancestry row whose parent VTXO is unspent (status != 4 AND spent = FALSE), mirroring the filter on ListUnspentVTXOs. Companion to the round-side ListVTXOs path.

func (*Queries) ListUnspentVTXOs

func (q *Queries) ListUnspentVTXOs(ctx context.Context) ([]Vtxo, error)

Unspent requires both spent=false and status!=Spent(4).

func (*Queries) ListVHTLCRecoveryJobs

func (q *Queries) ListVHTLCRecoveryJobs(ctx context.Context) ([]VhtlcRecoveryJob, error)

func (*Queries) ListVHTLCRecoveryJobsBySwapAction

func (q *Queries) ListVHTLCRecoveryJobsBySwapAction(ctx context.Context, arg ListVHTLCRecoveryJobsBySwapActionParams) ([]VhtlcRecoveryJob, error)

func (*Queries) ListVTXOAncestryPaths

func (q *Queries) ListVTXOAncestryPaths(ctx context.Context, arg ListVTXOAncestryPathsParams) ([]VtxoAncestryPath, error)

ListVTXOAncestryPaths returns the ancestry rows for one VTXO ordered by path_order so the unroller sees the fragments in the same sequence the indexer chose at materialization time.

func (*Queries) ListVTXOAncestryPathsByStatus

func (q *Queries) ListVTXOAncestryPathsByStatus(ctx context.Context, status int32) ([]VtxoAncestryPath, error)

ListVTXOAncestryPathsByStatus returns every ancestry row whose parent VTXO matches the given status code. Companion to ListVTXOsByStatus.

func (*Queries) ListVTXOSelectionCandidatesByStatus

func (q *Queries) ListVTXOSelectionCandidatesByStatus(ctx context.Context, status int32) ([]ListVTXOSelectionCandidatesByStatusRow, error)

ListVTXOSelectionCandidatesByStatus returns the lightweight projection coin selection runs on: outpoint, amount, and pkScript. Selection happens on every payment and only needs these three fields, so this avoids decoding full descriptors (pubkey parsing, taproot script reconstruction, policy template decode) and the batched ancestry-path query on the hot path.

func (*Queries) ListVTXOsByRound

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

func (*Queries) ListVTXOsByStatus

func (q *Queries) ListVTXOsByStatus(ctx context.Context, status int32) ([]ListVTXOsByStatusRow, error)

VTXO status and lifecycle queries. These queries support the vtxo.VTXOStore interface for VTXO lifecycle management, including status transitions and forfeit transaction tracking. ListVTXOsByStatus returns all VTXOs with the specified status. It also LEFT JOINs the round that forfeited each VTXO (via forfeit_round_id) so a FORFEITED VTXO can surface the settling commitment txid and its confirmation height. The join columns are NULL for every VTXO whose forfeit round is unknown (all non-forfeited VTXOs, and forfeited ones whose round row is absent), so consumers must treat them as optional.

settlement_fee_sat is the TOTAL operator fee the client's ledger booked for the forfeit round (boarding_fee_paid + refresh_fee_paid, joined via the round_uuid TEXT mirror of the ledger's BLOB round_id). Every VTXO forfeited in the same round reports the same round-level figure — consumers must not sum it across VTXOs. Zero when the forfeit round is unknown or its fee rows are absent (e.g. rows written before the round_uuid backfill ran).

The fee lookup is a correlated scalar subquery rather than a grouped join: the planner then resolves it as a per-row probe of the idx_client_ledger_round_uuid index for the (few) forfeited rows that carry a forfeit_round_id, instead of aggregating every fee row in the ledger on every call.

func (*Queries) ListWalletUTXOLog

func (q *Queries) ListWalletUTXOLog(ctx context.Context, arg ListWalletUTXOLogParams) ([]WalletUtxoLog, error)

func (*Queries) ListWalletUTXOLogByBlock

func (q *Queries) ListWalletUTXOLogByBlock(ctx context.Context, blockHeight int32) ([]WalletUtxoLog, error)

func (*Queries) ListWalletUTXOLogByClassification

func (q *Queries) ListWalletUTXOLogByClassification(ctx context.Context, arg ListWalletUTXOLogByClassificationParams) ([]WalletUtxoLog, error)

func (*Queries) LookupActiveCreditOperationByKey

func (q *Queries) LookupActiveCreditOperationByKey(ctx context.Context, opKey string) (CreditOperation, error)

Status 2 = Failed (anchored to Go iota in db/credit_operation_store.go CreditOpStatus). Failed operations never dedup a keyed retry, so the lookup skips them: only a pending or completed operation answers for an op_key.

func (*Queries) LookupActiveOORSessionRegistryByIdempotencyKey

func (q *Queries) LookupActiveOORSessionRegistryByIdempotencyKey(ctx context.Context, idempotencyKey sql.NullString) (OorSessionRegistry, error)

Status 2 = Failed (anchored to Go iota in db/oor_session_registry_store.go OORSessionStatus). Failed sessions never dedup a keyed retry, so the lookup skips them: only a pending or completed session answers for an idempotency key.

func (*Queries) MarkBoardingSweepInputSpentByOutpoint

func (q *Queries) MarkBoardingSweepInputSpentByOutpoint(ctx context.Context, arg MarkBoardingSweepInputSpentByOutpointParams) (int64, error)

func (*Queries) MarkBoardingSweepInputStatus

func (q *Queries) MarkBoardingSweepInputStatus(ctx context.Context, arg MarkBoardingSweepInputStatusParams) error

func (*Queries) MarkBoardingSweepInputsStatus

func (q *Queries) MarkBoardingSweepInputsStatus(ctx context.Context, arg MarkBoardingSweepInputsStatusParams) error

func (*Queries) MarkBoardingSweepStatus

func (q *Queries) MarkBoardingSweepStatus(ctx context.Context, arg MarkBoardingSweepStatusParams) error

func (*Queries) MarkPendingSendIntentFailedByOutpoint

func (q *Queries) MarkPendingSendIntentFailedByOutpoint(ctx context.Context, arg MarkPendingSendIntentFailedByOutpointParams) error

Terminally fail the pending send intent anchored to the given outpoint, recording the reason and typed failure code. Idempotent: the status guard makes a repeat call (e.g. a second forfeit outpoint of the same intent) a no-op. Anchors are intentionally retained so the activity projection can still correlate the failed job by its consumed outpoint.

func (*Queries) MarkUnilateralExitJobTerminal

func (q *Queries) MarkUnilateralExitJobTerminal(ctx context.Context, arg MarkUnilateralExitJobTerminalParams) error

func (*Queries) MarkVHTLCRecoveryExitTxBroadcast

func (q *Queries) MarkVHTLCRecoveryExitTxBroadcast(ctx context.Context, arg MarkVHTLCRecoveryExitTxBroadcastParams) error

func (*Queries) MarkVHTLCRecoveryExitTxBuilt

func (q *Queries) MarkVHTLCRecoveryExitTxBuilt(ctx context.Context, arg MarkVHTLCRecoveryExitTxBuiltParams) error

func (*Queries) MarkVHTLCRecoveryExitTxSubmitting

func (q *Queries) MarkVHTLCRecoveryExitTxSubmitting(ctx context.Context, arg MarkVHTLCRecoveryExitTxSubmittingParams) error

func (*Queries) MarkVHTLCRecoveryTargetDetected

func (q *Queries) MarkVHTLCRecoveryTargetDetected(ctx context.Context, arg MarkVHTLCRecoveryTargetDetectedParams) error

Intermediate states waiting_for_target and building_exit_spend are written by the execution-layer PR. This storage slice accepts them as source states so replay can resume from each durable pipeline boundary once those writes exist.

func (*Queries) MarkVTXOForfeited

func (q *Queries) MarkVTXOForfeited(ctx context.Context, arg MarkVTXOForfeitedParams) error

MarkVTXOForfeited marks a VTXO as forfeited and records the forfeit transaction ID and replacement VTXO outpoint. Called when the new round's commitment transaction confirms.

func (*Queries) MarkVTXOForfeiting

func (q *Queries) MarkVTXOForfeiting(ctx context.Context, arg MarkVTXOForfeitingParams) error

MarkVTXOForfeiting transitions a VTXO to Forfeiting status and persists the forfeit round ID and transaction for crash recovery. Called when entering the forfeit flow.

func (*Queries) MarkVTXOSpent

func (q *Queries) MarkVTXOSpent(ctx context.Context, arg MarkVTXOSpentParams) error

Also sets status = 4 (Spent) to keep status in sync with spent flag.

func (*Queries) PullActivityEvents

func (q *Queries) PullActivityEvents(ctx context.Context, arg PullActivityEventsParams) ([]ActivityEvent, error)

PullActivityEvents returns transition rows strictly after the cursor in event_seq order, the resumable-subscribe replay primitive.

func (*Queries) SumBoardingIntentAmountsByStatus

func (q *Queries) SumBoardingIntentAmountsByStatus(ctx context.Context, status string) (interface{}, error)

func (*Queries) SumUnspentVTXOAmounts

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

func (*Queries) UpdateBoardingIntentStatus

func (q *Queries) UpdateBoardingIntentStatus(ctx context.Context, arg UpdateBoardingIntentStatusParams) error

func (*Queries) UpdateRoundBoardingIntentSignature

func (q *Queries) UpdateRoundBoardingIntentSignature(ctx context.Context, arg UpdateRoundBoardingIntentSignatureParams) error

func (*Queries) UpdateRoundStatus

func (q *Queries) UpdateRoundStatus(ctx context.Context, arg UpdateRoundStatusParams) error

func (*Queries) UpdateVTXOStatus

func (q *Queries) UpdateVTXOStatus(ctx context.Context, arg UpdateVTXOStatusParams) error

UpdateVTXOStatus atomically updates a VTXO's status. This is the primary method for state transitions that don't require additional data.

func (*Queries) UpsertActivityEntry

func (q *Queries) UpsertActivityEntry(ctx context.Context, arg UpsertActivityEntryParams) (int64, error)

Canonical activity log queries. activity_entries is the current-state projection read by List; activity_events is the append-only transition log read by a resumable SubscribeWallet. See docs/canonical_activity_log_design.md. UpsertActivityEntry inserts the activity row or advances it in place. On conflict the mutable lifecycle columns are overwritten with the new projection and updated_at_unix is bumped, but created_at_unix is preserved so the row keeps its position in the created-ordered feed. The settlement and correlation handles are COALESCEd so an early projection that does not yet know a txid never clobbers one a later projection already recorded.

func (*Queries) UpsertChainInfo

func (q *Queries) UpsertChainInfo(ctx context.Context, arg UpsertChainInfoParams) error

func (*Queries) UpsertCreditOperation

func (q *Queries) UpsertCreditOperation(ctx context.Context, arg UpsertCreditOperationParams) error

Credit operations control-plane queries.

func (*Queries) UpsertInternalKey

func (q *Queries) UpsertInternalKey(ctx context.Context, arg UpsertInternalKeyParams) (int64, error)

Internal key registry queries. Register an internal key and return the stored row's id in a single round-trip on both backends. ON CONFLICT (pubkey, key_family, key_index) makes re-registration of an already-known triple idempotent; the no-op DO UPDATE (rather than DO NOTHING) is required so RETURNING still fires on conflict and the caller gets the existing id, closing the read-then-insert race a separate re-select would leave open.

func (*Queries) UpsertOORPackage

func (q *Queries) UpsertOORPackage(ctx context.Context, arg UpsertOORPackageParams) (int64, error)

OOR artifact store queries.

func (*Queries) UpsertOORRecipientCursor

func (q *Queries) UpsertOORRecipientCursor(ctx context.Context, arg UpsertOORRecipientCursorParams) error

func (*Queries) UpsertOORSessionRegistry

func (q *Queries) UpsertOORSessionRegistry(ctx context.Context, arg UpsertOORSessionRegistryParams) error

OOR session registry control-plane queries.

func (*Queries) UpsertOORVTXOBinding

func (q *Queries) UpsertOORVTXOBinding(ctx context.Context, arg UpsertOORVTXOBindingParams) (int64, error)

func (*Queries) UpsertOwnedReceiveScript

func (q *Queries) UpsertOwnedReceiveScript(ctx context.Context, arg UpsertOwnedReceiveScriptParams) error

func (*Queries) UpsertPendingBoardIntent

func (q *Queries) UpsertPendingBoardIntent(ctx context.Context, arg UpsertPendingBoardIntentParams) error

func (*Queries) UpsertPendingIntentAnchor

func (q *Queries) UpsertPendingIntentAnchor(ctx context.Context, arg UpsertPendingIntentAnchorParams) error

func (*Queries) UpsertPendingIntentHeader

func (q *Queries) UpsertPendingIntentHeader(ctx context.Context, arg UpsertPendingIntentHeaderParams) error

Re-arm a re-persisted intent as pending. NewPendingIntentID is deterministic, so retrying a terminally failed send (same inputs and payload) reuses the same intent_id and lands here on the retained 'failed' row. Resetting the status and failure fields makes the retry replayable again; without it the replay query (which now skips non-pending rows) would silently drop a retry that crashes before the round adopts it.

func (*Queries) UpsertPendingSendIntent

func (q *Queries) UpsertPendingSendIntent(ctx context.Context, arg UpsertPendingSendIntentParams) error

func (*Queries) UpsertSpendingReservation

func (q *Queries) UpsertSpendingReservation(ctx context.Context, arg UpsertSpendingReservationParams) error

Spending reservation queries. These queries maintain a durable index of VTXO outpoints reserved by an active spend owner (e.g. an outgoing OOR session) so a startup sweep can release orphaned Spending VTXOs that have no live reservation. UpsertSpendingReservation records (or refreshes) the reservation for one outpoint. The owner fields are updated on conflict so a re-checkpointed session re-binds the same outpoint to its current owner.

func (*Queries) UpsertUnilateralExitJob

func (q *Queries) UpsertUnilateralExitJob(ctx context.Context, arg UpsertUnilateralExitJobParams) error

Unilateral-exit job control-plane queries.

func (*Queries) WithTx

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

type Round

type Round struct {
	RoundID               string
	StartHeight           int32
	ConfirmationHeight    sql.NullInt32
	ConfirmationBlockHash []byte
	CommitmentTx          []byte
	CommitmentTxid        []byte
	VtxtTree              []byte
	Status                string
	CreationTime          int64
	LastUpdateTime        int64
	FlowVersion           int32
	SweepDelay            int32
}

type RoundBoardingIntent

type RoundBoardingIntent struct {
	RoundID        string
	OutpointHash   []byte
	OutpointIndex  int32
	ClientKey      []byte
	OperatorKey    []byte
	ExitDelay      int32
	PolicyTemplate []byte
	TxProof        []byte
	InputIndex     sql.NullInt32
	InputSignature []byte
}

type RoundClientTree

type RoundClientTree struct {
	RoundID   string
	ClientKey []byte
	TreeData  []byte
}

type RoundStatus

type RoundStatus struct {
	ID         int64
	StatusName string
}

type RoundVtxoRequest

type RoundVtxoRequest struct {
	RoundID        string
	RequestIndex   int32
	Amount         int64
	PkScript       []byte
	Expiry         int32
	PolicyTemplate []byte
	ClientPubkey   []byte
	OperatorPubkey []byte
	OwnerKeyID     sql.NullInt64
	SigningKeyID   sql.NullInt64
}

type SpendingReservation

type SpendingReservation struct {
	OutpointHash  []byte
	OutpointIndex int32
	OwnerKind     int32
	OwnerID       []byte
	CreatedAt     int64
}

type UnilateralExitJob

type UnilateralExitJob struct {
	TargetOutpointHash  []byte
	TargetOutpointIndex int32
	ActorID             string
	Status              int32
	Trigger             int32
	LastError           sql.NullString
	SweepTxid           []byte
	CreatedAt           int64
	UpdatedAt           int64
	ExitPolicyKind      string
	ExitPolicyRef       sql.NullString
}

type UpdateBoardingIntentStatusParams

type UpdateBoardingIntentStatusParams struct {
	OutpointHash   []byte
	OutpointIndex  int32
	Status         string
	LastUpdateTime int64
}

type UpdateRoundBoardingIntentSignatureParams

type UpdateRoundBoardingIntentSignatureParams struct {
	RoundID        string
	OutpointHash   []byte
	OutpointIndex  int32
	InputSignature []byte
	InputIndex     sql.NullInt32
}

type UpdateRoundStatusParams

type UpdateRoundStatusParams struct {
	RoundID        string
	Status         string
	LastUpdateTime int64
}

type UpdateVTXOStatusParams

type UpdateVTXOStatusParams struct {
	OutpointHash   []byte
	OutpointIndex  int32
	Status         int32
	LastUpdateTime int64
}

type UpsertActivityEntryParams

type UpsertActivityEntryParams struct {
	CanonicalID        string
	Kind               int64
	Status             int64
	AmountSat          int64
	FeeSat             int64
	Counterparty       string
	Note               string
	Phase              int64
	PhaseLabel         string
	FailureCode        int64
	FailureReason      string
	PaymentHash        []byte
	Txid               []byte
	ConfirmationHeight sql.NullInt64
	VtxoOutpoint       string
	SwapSessionID      []byte
	LedgerTxid         []byte
	BoardingAddr       []byte
	RequestJson        string
	CreatedAtUnix      int64
	UpdatedAtUnix      int64
	PendingStatus      int64
}

type UpsertChainInfoParams

type UpsertChainInfoParams struct {
	ID          int64
	ChainName   string
	GenesisHash []byte
}

type UpsertCreditOperationParams

type UpsertCreditOperationParams struct {
	OpID              string
	OpKey             string
	Kind              int32
	State             string
	Status            int32
	ServerOpID        sql.NullString
	PaymentHash       []byte
	DestinationPubkey []byte
	OorSessionID      sql.NullString
	Invoice           sql.NullString
	AmountSat         int64
	TopupSat          int64
	MaxCreditSat      int64
	MaxFeeSat         int64
	LastError         sql.NullString
	SnapshotData      []byte
	SnapshotVersion   int32
	CreatedAt         int64
	UpdatedAt         int64
}

type UpsertInternalKeyParams

type UpsertInternalKeyParams struct {
	Pubkey    []byte
	KeyFamily int64
	KeyIndex  int64
	CreatedAt int64
}

type UpsertOORPackageParams

type UpsertOORPackageParams struct {
	SessionID []byte
	Direction int32
	ArkPsbt   []byte
	CreatedAt int64
	UpdatedAt int64
}

type UpsertOORRecipientCursorParams

type UpsertOORRecipientCursorParams struct {
	RecipientPkScript []byte
	LastEventID       int64
	UpdatedAt         int64
	LastSessionID     []byte
}

type UpsertOORSessionRegistryParams

type UpsertOORSessionRegistryParams struct {
	SessionID       []byte
	ActorID         string
	Direction       int32
	Phase           string
	IdempotencyKey  sql.NullString
	Status          int32
	LastError       sql.NullString
	SnapshotData    []byte
	SnapshotVersion int32
	CreatedAt       int64
	UpdatedAt       int64
	FlowVersion     int32
}

type UpsertOORVTXOBindingParams

type UpsertOORVTXOBindingParams struct {
	OutpointHash  []byte
	OutpointIndex int32
	SessionID     []byte
	OutputIndex   int32
	LinkKind      int32
	CreatedAt     int64
	UpdatedAt     int64
}

type UpsertOwnedReceiveScriptParams

type UpsertOwnedReceiveScriptParams struct {
	PkScript       []byte
	ClientKeyID    sql.NullInt64
	OperatorPubkey []byte
	ExitDelay      int64
	Source         int32
	CreatedAt      int64
	LastUsedAt     sql.NullInt64
}

type UpsertPendingBoardIntentParams

type UpsertPendingBoardIntentParams struct {
	IntentID        []byte
	TargetVtxoCount int32
}

type UpsertPendingIntentAnchorParams

type UpsertPendingIntentAnchorParams struct {
	OutpointHash  []byte
	OutpointIndex int32
	IntentID      []byte
}

type UpsertPendingIntentHeaderParams

type UpsertPendingIntentHeaderParams struct {
	IntentID        []byte
	Kind            string
	RequestedAtUnix int64
}

type UpsertPendingSendIntentParams

type UpsertPendingSendIntentParams struct {
	IntentID        []byte
	DestPkscript    []byte
	TargetAmountSat int64
	SweepAll        int32
	OperatorKey     []byte
	VtxoExitDelay   int32
	DustLimitSat    int64
}

type UpsertSpendingReservationParams

type UpsertSpendingReservationParams struct {
	OutpointHash  []byte
	OutpointIndex int32
	OwnerKind     int32
	OwnerID       []byte
	CreatedAt     int64
}

type UpsertUnilateralExitJobParams

type UpsertUnilateralExitJobParams struct {
	TargetOutpointHash  []byte
	TargetOutpointIndex int32
	ActorID             string
	Status              int32
	Trigger             int32
	ExitPolicyKind      string
	ExitPolicyRef       sql.NullString
	LastError           sql.NullString
	SweepTxid           []byte
	CreatedAt           int64
	UpdatedAt           int64
}

type UtxoClassification

type UtxoClassification struct {
	Classification string
}

type UtxoEvent

type UtxoEvent struct {
	Event string
}

type VhtlcRecoveryJob

type VhtlcRecoveryJob struct {
	ID                                   string
	RequestID                            string
	SwapID                               []byte
	Direction                            string
	Action                               string
	State                                string
	VtxoTxid                             []byte
	VtxoVout                             int32
	VtxoAmountSat                        int64
	SenderPubkey                         []byte
	ReceiverPubkey                       []byte
	ServerPubkey                         []byte
	RefundLocktime                       int32
	UnilateralClaimDelay                 int32
	UnilateralRefundDelay                int32
	UnilateralRefundWithoutReceiverDelay int32
	PreimageHash                         []byte
	ClaimPreimage                        []byte
	SignerKeyFamily                      int32
	SignerKeyIndex                       int32
	DestinationScript                    []byte
	MaxFeeRateSatPerKw                   int32
	UnrollTargetOutpointHash             []byte
	UnrollTargetOutpointIndex            sql.NullInt32
	ExitPolicyKind                       string
	ExitTx                               []byte
	ExitTxid                             []byte
	CooperativeTxid                      []byte
	LastError                            sql.NullString
	CancelReason                         sql.NullString
	CreatedAt                            int64
	UpdatedAt                            int64
	ArmedAt                              sql.NullInt64
	EscalatedAt                          sql.NullInt64
	TargetDetectedAt                     sql.NullInt64
	ExitTxBuiltAt                        sql.NullInt64
	ExitTxBroadcastAt                    sql.NullInt64
	TerminalAt                           sql.NullInt64
}

type Vtxo

type Vtxo struct {
	OutpointHash        []byte
	OutpointIndex       int32
	RoundID             string
	Amount              int64
	PkScript            []byte
	Expiry              int32
	PolicyTemplate      []byte
	ClientKeyID         sql.NullInt64
	OperatorPubkey      []byte
	BatchExpiry         int32
	CreatedHeight       int32
	CommitmentTxid      []byte
	Spent               bool
	Status              int32
	ForfeitRoundID      sql.NullString
	ForfeitTx           []byte
	ForfeitTxid         []byte
	ReplacedByHash      []byte
	ReplacedByIndex     sql.NullInt32
	CreationTime        int64
	LastUpdateTime      int64
	ChainDepth          int32
	ConstructionVersion int32
}

type VtxoAncestryPath

type VtxoAncestryPath struct {
	VtxoOutpointHash  []byte
	VtxoOutpointIndex int32
	PathOrder         int32
	CommitmentTxid    []byte
	TreePath          []byte
	TreeDepth         int32
	InputIndices      []byte
	CommitmentHeight  int32
}

type WalletUtxoLog

type WalletUtxoLog struct {
	EntryID       int64
	OutpointHash  []byte
	OutpointIndex int32
	AmountSat     int64
	Event         string
	BlockHeight   int32
	ClassifiedAs  string
	CreatedAt     int64
}

Jump to

Keyboard shortcuts

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