queries

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSwapParams added in v0.1.12

type CreateSwapParams struct {
	ID           string
	Amount       int64
	Timestamp    int64
	ToCurrency   string
	FromCurrency string
	Status       int64
	Invoice      string
	FundingTxID  string
	RedeemTxID   string
	VhtlcID      string
}

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 GetSwapRow added in v0.1.12

type GetSwapRow struct {
	Swap  Swap
	Vhtlc Vhtlc
}

type InsertVHTLCParams

type InsertVHTLCParams struct {
	PreimageHash                              string
	Sender                                    string
	Receiver                                  string
	Server                                    string
	RefundLocktime                            int64
	UnilateralClaimDelayType                  int64
	UnilateralClaimDelayValue                 int64
	UnilateralRefundDelayType                 int64
	UnilateralRefundDelayValue                int64
	UnilateralRefundWithoutReceiverDelayType  int64
	UnilateralRefundWithoutReceiverDelayValue int64
}

type ListSwapsRow added in v0.1.12

type ListSwapsRow struct {
	Swap  Swap
	Vhtlc Vhtlc
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateSwap added in v0.1.12

func (q *Queries) CreateSwap(ctx context.Context, arg CreateSwapParams) error

Swap queries

func (*Queries) DeleteSettings

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

func (*Queries) DeleteSubscribedScript added in v0.1.13

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

func (*Queries) DeleteVtxoRollover

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

func (*Queries) GetSettings

func (q *Queries) GetSettings(ctx context.Context) (Setting, error)

func (*Queries) GetSubscribedScript added in v0.1.13

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

func (*Queries) GetSwap added in v0.1.12

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

func (*Queries) GetVHTLC

func (q *Queries) GetVHTLC(ctx context.Context, preimageHash string) (Vhtlc, error)

func (*Queries) GetVtxoRollover

func (q *Queries) GetVtxoRollover(ctx context.Context, address string) (VtxoRollover, error)

func (*Queries) InsertSubscribedScript added in v0.1.13

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

SubscribedScript queries

func (*Queries) InsertVHTLC

func (q *Queries) InsertVHTLC(ctx context.Context, arg InsertVHTLCParams) error

VHTLC queries

func (*Queries) ListSubscribedScript added in v0.1.13

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

func (*Queries) ListSwaps added in v0.1.12

func (q *Queries) ListSwaps(ctx context.Context) ([]ListSwapsRow, error)

func (*Queries) ListVHTLC

func (q *Queries) ListVHTLC(ctx context.Context) ([]Vhtlc, error)

func (*Queries) ListVtxoRollover

func (q *Queries) ListVtxoRollover(ctx context.Context) ([]VtxoRollover, error)

func (*Queries) UpsertSettings

func (q *Queries) UpsertSettings(ctx context.Context, arg UpsertSettingsParams) error

Settings queries

func (*Queries) UpsertVtxoRollover

func (q *Queries) UpsertVtxoRollover(ctx context.Context, arg UpsertVtxoRolloverParams) error

VtxoRollover queries

func (*Queries) WithTx

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

type Setting

type Setting struct {
	ID          int64
	ApiRoot     string
	ServerUrl   string
	EsploraUrl  sql.NullString
	Currency    string
	EventServer string
	FullNode    string
	LnUrl       sql.NullString
	Unit        string
}

type SubscribedScript added in v0.1.13

type SubscribedScript struct {
	Script string
}

type Swap added in v0.1.12

type Swap struct {
	ID           string
	Amount       int64
	Timestamp    int64
	ToCurrency   string
	FromCurrency string
	Status       int64
	Invoice      string
	FundingTxID  string
	RedeemTxID   string
	VhtlcID      string
}

type UpsertSettingsParams

type UpsertSettingsParams struct {
	ApiRoot     string
	ServerUrl   string
	EsploraUrl  sql.NullString
	Currency    string
	EventServer string
	FullNode    string
	LnUrl       sql.NullString
	Unit        string
}

type UpsertVtxoRolloverParams

type UpsertVtxoRolloverParams struct {
	Address            string
	TaprootTree        string
	DestinationAddress string
}

type Vhtlc

type Vhtlc struct {
	PreimageHash                              string
	Sender                                    string
	Receiver                                  string
	Server                                    string
	RefundLocktime                            int64
	UnilateralClaimDelayType                  int64
	UnilateralClaimDelayValue                 int64
	UnilateralRefundDelayType                 int64
	UnilateralRefundDelayValue                int64
	UnilateralRefundWithoutReceiverDelayType  int64
	UnilateralRefundWithoutReceiverDelayValue int64
}

type VtxoRollover

type VtxoRollover struct {
	Address            string
	TaprootTree        string
	DestinationAddress string
}

Jump to

Keyboard shortcuts

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