sqlc

package
v0.28.1-beta Latest Latest
Warning

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

Go to latest
Published: Apr 16, 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 GetInstantOutSwapRow

type GetInstantOutSwapRow 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
	Preimage_2                []byte
	SweepAddress              string
	OutgoingChanSet           string
	HtlcFeeRate               int64
	ReservationIds            []byte
	SwapInvoice               string
	FinalizedHtlcTx           []byte
	SweepTxHash               []byte
	FinalizedSweeplessSweepTx []byte
	SweepConfirmationHeight   sql.NullInt32
	SwapHash_3                []byte
	SenderScriptPubkey        []byte
	ReceiverScriptPubkey      []byte
	SenderInternalPubkey      []byte
	ReceiverInternalPubkey    []byte
	ClientKeyFamily           int32
	ClientKeyIndex            int32
}

type GetInstantOutSwapsRow

type GetInstantOutSwapsRow 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
	Preimage_2                []byte
	SweepAddress              string
	OutgoingChanSet           string
	HtlcFeeRate               int64
	ReservationIds            []byte
	SwapInvoice               string
	FinalizedHtlcTx           []byte
	SweepTxHash               []byte
	FinalizedSweeplessSweepTx []byte
	SweepConfirmationHeight   sql.NullInt32
	SwapHash_3                []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 InsertInstantOutParams

type InsertInstantOutParams struct {
	SwapHash        []byte
	Preimage        []byte
	SweepAddress    string
	OutgoingChanSet string
	HtlcFeeRate     int64
	ReservationIds  []byte
	SwapInvoice     string
}

type InsertInstantOutUpdateParams

type InsertInstantOutUpdateParams struct {
	SwapHash        []byte
	UpdateState     string
	UpdateTimestamp time.Time
}

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 InstantoutSwap

type InstantoutSwap struct {
	SwapHash                  []byte
	Preimage                  []byte
	SweepAddress              string
	OutgoingChanSet           string
	HtlcFeeRate               int64
	ReservationIds            []byte
	SwapInvoice               string
	FinalizedHtlcTx           []byte
	SweepTxHash               []byte
	FinalizedSweeplessSweepTx []byte
	SweepConfirmationHeight   sql.NullInt32
}

type InstantoutUpdate

type InstantoutUpdate struct {
	ID              int32
	SwapHash        []byte
	UpdateState     string
	UpdateTimestamp time.Time
}

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)
	GetBatchSweptAmount(ctx context.Context, batchID int32) (int64, error)
	GetInstantOutSwap(ctx context.Context, swapHash []byte) (GetInstantOutSwapRow, error)
	GetInstantOutSwapUpdates(ctx context.Context, swapHash []byte) ([]InstantoutUpdate, error)
	GetInstantOutSwaps(ctx context.Context) ([]GetInstantOutSwapsRow, 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)
	GetParentBatch(ctx context.Context, swapHash []byte) (SweepBatch, 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
	InsertInstantOut(ctx context.Context, arg InsertInstantOutParams) error
	InsertInstantOutUpdate(ctx context.Context, arg InsertInstantOutUpdateParams) 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
	UpdateInstantOut(ctx context.Context, arg UpdateInstantOutParams) 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) GetBatchSweptAmount

func (q *Queries) GetBatchSweptAmount(ctx context.Context, batchID int32) (int64, error)

func (*Queries) GetInstantOutSwap

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

func (*Queries) GetInstantOutSwapUpdates

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

func (*Queries) GetInstantOutSwaps

func (q *Queries) GetInstantOutSwaps(ctx context.Context) ([]GetInstantOutSwapsRow, 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) GetParentBatch

func (q *Queries) GetParentBatch(ctx context.Context, swapHash []byte) (SweepBatch, 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) InsertInstantOut

func (q *Queries) InsertInstantOut(ctx context.Context, arg InsertInstantOutParams) error

func (*Queries) InsertInstantOutUpdate

func (q *Queries) InsertInstantOutUpdate(ctx context.Context, arg InsertInstantOutUpdateParams) 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) UpdateInstantOut

func (q *Queries) UpdateInstantOut(ctx context.Context, arg UpdateInstantOutParams) 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 UpdateInstantOutParams

type UpdateInstantOutParams struct {
	SwapHash                  []byte
	FinalizedHtlcTx           []byte
	SweepTxHash               []byte
	FinalizedSweeplessSweepTx []byte
	SweepConfirmationHeight   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