sqlc

package
v0.27.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateReservationParams

type CreateReservationParams struct {
	ReservationID    []byte
	ClientPubkey     []byte
	ServerPubkey     []byte
	Expiry           int32
	Value            int64
	ClientKeyFamily  int32
	ClientKeyIndex   int32
	InitiationHeight int32
}

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 GetBatchSweepsRow

type GetBatchSweepsRow struct {
	ID                     int32
	SwapHash               []byte
	BatchID                int32
	OutpointTxid           []byte
	OutpointIndex          int32
	Amt                    int64
	Completed              bool
	ID_2                   int32
	SwapHash_2             []byte
	Preimage               []byte
	InitiationTime         time.Time
	AmountRequested        int64
	CltvExpiry             int32
	MaxMinerFee            int64
	MaxSwapFee             int64
	InitiationHeight       int32
	ProtocolVersion        int32
	Label                  string
	SwapHash_3             []byte
	DestAddress            string
	SwapInvoice            string
	MaxSwapRoutingFee      int64
	SweepConfTarget        int32
	HtlcConfirmations      int32
	OutgoingChanSet        string
	PrepayInvoice          string
	MaxPrepayRoutingFee    int64
	PublicationDeadline    time.Time
	SingleSweep            bool
	SwapHash_4             []byte
	SenderScriptPubkey     []byte
	ReceiverScriptPubkey   []byte
	SenderInternalPubkey   []byte
	ReceiverInternalPubkey []byte
	ClientKeyFamily        int32
	ClientKeyIndex         int32
}

type GetLoopInSwapRow

type GetLoopInSwapRow struct {
	ID                     int32
	SwapHash               []byte
	Preimage               []byte
	InitiationTime         time.Time
	AmountRequested        int64
	CltvExpiry             int32
	MaxMinerFee            int64
	MaxSwapFee             int64
	InitiationHeight       int32
	ProtocolVersion        int32
	Label                  string
	SwapHash_2             []byte
	HtlcConfTarget         int32
	LastHop                []byte
	ExternalHtlc           bool
	SwapHash_3             []byte
	SenderScriptPubkey     []byte
	ReceiverScriptPubkey   []byte
	SenderInternalPubkey   []byte
	ReceiverInternalPubkey []byte
	ClientKeyFamily        int32
	ClientKeyIndex         int32
}

type GetLoopInSwapsRow

type GetLoopInSwapsRow struct {
	ID                     int32
	SwapHash               []byte
	Preimage               []byte
	InitiationTime         time.Time
	AmountRequested        int64
	CltvExpiry             int32
	MaxMinerFee            int64
	MaxSwapFee             int64
	InitiationHeight       int32
	ProtocolVersion        int32
	Label                  string
	SwapHash_2             []byte
	HtlcConfTarget         int32
	LastHop                []byte
	ExternalHtlc           bool
	SwapHash_3             []byte
	SenderScriptPubkey     []byte
	ReceiverScriptPubkey   []byte
	SenderInternalPubkey   []byte
	ReceiverInternalPubkey []byte
	ClientKeyFamily        int32
	ClientKeyIndex         int32
}

type GetLoopOutSwapRow

type GetLoopOutSwapRow struct {
	ID                     int32
	SwapHash               []byte
	Preimage               []byte
	InitiationTime         time.Time
	AmountRequested        int64
	CltvExpiry             int32
	MaxMinerFee            int64
	MaxSwapFee             int64
	InitiationHeight       int32
	ProtocolVersion        int32
	Label                  string
	SwapHash_2             []byte
	DestAddress            string
	SwapInvoice            string
	MaxSwapRoutingFee      int64
	SweepConfTarget        int32
	HtlcConfirmations      int32
	OutgoingChanSet        string
	PrepayInvoice          string
	MaxPrepayRoutingFee    int64
	PublicationDeadline    time.Time
	SingleSweep            bool
	SwapHash_3             []byte
	SenderScriptPubkey     []byte
	ReceiverScriptPubkey   []byte
	SenderInternalPubkey   []byte
	ReceiverInternalPubkey []byte
	ClientKeyFamily        int32
	ClientKeyIndex         int32
}

type GetLoopOutSwapsRow

type GetLoopOutSwapsRow struct {
	ID                     int32
	SwapHash               []byte
	Preimage               []byte
	InitiationTime         time.Time
	AmountRequested        int64
	CltvExpiry             int32
	MaxMinerFee            int64
	MaxSwapFee             int64
	InitiationHeight       int32
	ProtocolVersion        int32
	Label                  string
	SwapHash_2             []byte
	DestAddress            string
	SwapInvoice            string
	MaxSwapRoutingFee      int64
	SweepConfTarget        int32
	HtlcConfirmations      int32
	OutgoingChanSet        string
	PrepayInvoice          string
	MaxPrepayRoutingFee    int64
	PublicationDeadline    time.Time
	SingleSweep            bool
	SwapHash_3             []byte
	SenderScriptPubkey     []byte
	ReceiverScriptPubkey   []byte
	SenderInternalPubkey   []byte
	ReceiverInternalPubkey []byte
	ClientKeyFamily        int32
	ClientKeyIndex         int32
}

type HtlcKey

type HtlcKey struct {
	SwapHash               []byte
	SenderScriptPubkey     []byte
	ReceiverScriptPubkey   []byte
	SenderInternalPubkey   []byte
	ReceiverInternalPubkey []byte
	ClientKeyFamily        int32
	ClientKeyIndex         int32
}

type InsertBatchParams

type InsertBatchParams struct {
	Confirmed          bool
	BatchTxID          sql.NullString
	BatchPkScript      []byte
	LastRbfHeight      sql.NullInt32
	LastRbfSatPerKw    sql.NullInt32
	MaxTimeoutDistance int32
}

type InsertHtlcKeysParams

type InsertHtlcKeysParams struct {
	SwapHash               []byte
	SenderScriptPubkey     []byte
	ReceiverScriptPubkey   []byte
	SenderInternalPubkey   []byte
	ReceiverInternalPubkey []byte
	ClientKeyFamily        int32
	ClientKeyIndex         int32
}

type InsertLoopInParams

type InsertLoopInParams struct {
	SwapHash       []byte
	HtlcConfTarget int32
	LastHop        []byte
	ExternalHtlc   bool
}

type InsertLoopOutParams

type InsertLoopOutParams struct {
	SwapHash            []byte
	DestAddress         string
	SwapInvoice         string
	MaxSwapRoutingFee   int64
	SweepConfTarget     int32
	HtlcConfirmations   int32
	OutgoingChanSet     string
	PrepayInvoice       string
	MaxPrepayRoutingFee int64
	PublicationDeadline time.Time
	SingleSweep         bool
}

type InsertReservationUpdateParams

type InsertReservationUpdateParams struct {
	ReservationID   []byte
	UpdateState     string
	UpdateTimestamp time.Time
}

type InsertSwapParams

type InsertSwapParams struct {
	SwapHash         []byte
	Preimage         []byte
	InitiationTime   time.Time
	AmountRequested  int64
	CltvExpiry       int32
	MaxMinerFee      int64
	MaxSwapFee       int64
	InitiationHeight int32
	ProtocolVersion  int32
	Label            string
}

type InsertSwapUpdateParams

type InsertSwapUpdateParams struct {
	SwapHash        []byte
	UpdateTimestamp time.Time
	UpdateState     int32
	HtlcTxhash      string
	ServerCost      int64
	OnchainCost     int64
	OffchainCost    int64
}

type LiquidityParam

type LiquidityParam struct {
	ID     int32
	Params []byte
}

type LoopinSwap

type LoopinSwap struct {
	SwapHash       []byte
	HtlcConfTarget int32
	LastHop        []byte
	ExternalHtlc   bool
}

type LoopoutSwap

type LoopoutSwap struct {
	SwapHash            []byte
	DestAddress         string
	SwapInvoice         string
	MaxSwapRoutingFee   int64
	SweepConfTarget     int32
	HtlcConfirmations   int32
	OutgoingChanSet     string
	PrepayInvoice       string
	MaxPrepayRoutingFee int64
	PublicationDeadline time.Time
	SingleSweep         bool
}

type Querier

type Querier interface {
	ConfirmBatch(ctx context.Context, id int32) error
	CreateReservation(ctx context.Context, arg CreateReservationParams) error
	FetchLiquidityParams(ctx context.Context) ([]byte, error)
	GetBatchSweeps(ctx context.Context, batchID int32) ([]GetBatchSweepsRow, error)
	GetLoopInSwap(ctx context.Context, swapHash []byte) (GetLoopInSwapRow, error)
	GetLoopInSwaps(ctx context.Context) ([]GetLoopInSwapsRow, error)
	GetLoopOutSwap(ctx context.Context, swapHash []byte) (GetLoopOutSwapRow, error)
	GetLoopOutSwaps(ctx context.Context) ([]GetLoopOutSwapsRow, error)
	GetReservation(ctx context.Context, reservationID []byte) (Reservation, error)
	GetReservationUpdates(ctx context.Context, reservationID []byte) ([]ReservationUpdate, error)
	GetReservations(ctx context.Context) ([]Reservation, error)
	GetSwapUpdates(ctx context.Context, swapHash []byte) ([]SwapUpdate, error)
	GetSweepStatus(ctx context.Context, swapHash []byte) (bool, error)
	GetUnconfirmedBatches(ctx context.Context) ([]SweepBatch, error)
	InsertBatch(ctx context.Context, arg InsertBatchParams) (int32, error)
	InsertHtlcKeys(ctx context.Context, arg InsertHtlcKeysParams) error
	InsertLoopIn(ctx context.Context, arg InsertLoopInParams) error
	InsertLoopOut(ctx context.Context, arg InsertLoopOutParams) error
	InsertReservationUpdate(ctx context.Context, arg InsertReservationUpdateParams) error
	InsertSwap(ctx context.Context, arg InsertSwapParams) error
	InsertSwapUpdate(ctx context.Context, arg InsertSwapUpdateParams) error
	UpdateBatch(ctx context.Context, arg UpdateBatchParams) error
	UpdateReservation(ctx context.Context, arg UpdateReservationParams) error
	UpsertLiquidityParams(ctx context.Context, params []byte) error
	UpsertSweep(ctx context.Context, arg UpsertSweepParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ConfirmBatch

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

func (*Queries) CreateReservation

func (q *Queries) CreateReservation(ctx context.Context, arg CreateReservationParams) error

func (*Queries) FetchLiquidityParams

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

func (*Queries) GetBatchSweeps

func (q *Queries) GetBatchSweeps(ctx context.Context, batchID int32) ([]GetBatchSweepsRow, error)

func (*Queries) GetLoopInSwap

func (q *Queries) GetLoopInSwap(ctx context.Context, swapHash []byte) (GetLoopInSwapRow, error)

func (*Queries) GetLoopInSwaps

func (q *Queries) GetLoopInSwaps(ctx context.Context) ([]GetLoopInSwapsRow, error)

func (*Queries) GetLoopOutSwap

func (q *Queries) GetLoopOutSwap(ctx context.Context, swapHash []byte) (GetLoopOutSwapRow, error)

func (*Queries) GetLoopOutSwaps

func (q *Queries) GetLoopOutSwaps(ctx context.Context) ([]GetLoopOutSwapsRow, error)

func (*Queries) GetReservation

func (q *Queries) GetReservation(ctx context.Context, reservationID []byte) (Reservation, error)

func (*Queries) GetReservationUpdates

func (q *Queries) GetReservationUpdates(ctx context.Context, reservationID []byte) ([]ReservationUpdate, error)

func (*Queries) GetReservations

func (q *Queries) GetReservations(ctx context.Context) ([]Reservation, error)

func (*Queries) GetSwapUpdates

func (q *Queries) GetSwapUpdates(ctx context.Context, swapHash []byte) ([]SwapUpdate, error)

func (*Queries) GetSweepStatus

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

func (*Queries) GetUnconfirmedBatches

func (q *Queries) GetUnconfirmedBatches(ctx context.Context) ([]SweepBatch, error)

func (*Queries) InsertBatch

func (q *Queries) InsertBatch(ctx context.Context, arg InsertBatchParams) (int32, error)

func (*Queries) InsertHtlcKeys

func (q *Queries) InsertHtlcKeys(ctx context.Context, arg InsertHtlcKeysParams) error

func (*Queries) InsertLoopIn

func (q *Queries) InsertLoopIn(ctx context.Context, arg InsertLoopInParams) error

func (*Queries) InsertLoopOut

func (q *Queries) InsertLoopOut(ctx context.Context, arg InsertLoopOutParams) error

func (*Queries) InsertReservationUpdate

func (q *Queries) InsertReservationUpdate(ctx context.Context, arg InsertReservationUpdateParams) error

func (*Queries) InsertSwap

func (q *Queries) InsertSwap(ctx context.Context, arg InsertSwapParams) error

func (*Queries) InsertSwapUpdate

func (q *Queries) InsertSwapUpdate(ctx context.Context, arg InsertSwapUpdateParams) error

func (*Queries) UpdateBatch

func (q *Queries) UpdateBatch(ctx context.Context, arg UpdateBatchParams) error

func (*Queries) UpdateReservation

func (q *Queries) UpdateReservation(ctx context.Context, arg UpdateReservationParams) error

func (*Queries) UpsertLiquidityParams

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

func (*Queries) UpsertSweep

func (q *Queries) UpsertSweep(ctx context.Context, arg UpsertSweepParams) error

func (*Queries) WithTx

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

type Reservation

type Reservation struct {
	ID                 int32
	ReservationID      []byte
	ClientPubkey       []byte
	ServerPubkey       []byte
	Expiry             int32
	Value              int64
	ClientKeyFamily    int32
	ClientKeyIndex     int32
	InitiationHeight   int32
	TxHash             []byte
	OutIndex           sql.NullInt32
	ConfirmationHeight sql.NullInt32
}

type ReservationUpdate

type ReservationUpdate struct {
	ID              int32
	ReservationID   []byte
	UpdateState     string
	UpdateTimestamp time.Time
}

type Swap

type Swap struct {
	ID               int32
	SwapHash         []byte
	Preimage         []byte
	InitiationTime   time.Time
	AmountRequested  int64
	CltvExpiry       int32
	MaxMinerFee      int64
	MaxSwapFee       int64
	InitiationHeight int32
	ProtocolVersion  int32
	Label            string
}

type SwapUpdate

type SwapUpdate struct {
	ID              int32
	SwapHash        []byte
	UpdateTimestamp time.Time
	UpdateState     int32
	HtlcTxhash      string
	ServerCost      int64
	OnchainCost     int64
	OffchainCost    int64
}

type Sweep

type Sweep struct {
	ID            int32
	SwapHash      []byte
	BatchID       int32
	OutpointTxid  []byte
	OutpointIndex int32
	Amt           int64
	Completed     bool
}

type SweepBatch

type SweepBatch struct {
	ID                 int32
	Confirmed          bool
	BatchTxID          sql.NullString
	BatchPkScript      []byte
	LastRbfHeight      sql.NullInt32
	LastRbfSatPerKw    sql.NullInt32
	MaxTimeoutDistance int32
}

type UpdateBatchParams

type UpdateBatchParams struct {
	ID              int32
	Confirmed       bool
	BatchTxID       sql.NullString
	BatchPkScript   []byte
	LastRbfHeight   sql.NullInt32
	LastRbfSatPerKw sql.NullInt32
}

type UpdateReservationParams

type UpdateReservationParams struct {
	ReservationID      []byte
	TxHash             []byte
	OutIndex           sql.NullInt32
	ConfirmationHeight sql.NullInt32
}

type UpsertSweepParams

type UpsertSweepParams struct {
	SwapHash      []byte
	BatchID       int32
	OutpointTxid  []byte
	OutpointIndex int32
	Amt           int64
	Completed     bool
}

Jump to

Keyboard shortcuts

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