repo_transfer_transactions

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	TransferID        uuid.UUID                         `db:"transfer_id" json:"transfer_id"`
	TxHash            string                            `db:"tx_hash" json:"tx_hash"`
	BandwidthAmount   decimal.Decimal                   `db:"bandwidth_amount" json:"bandwidth_amount"`
	EnergyAmount      decimal.Decimal                   `db:"energy_amount" json:"energy_amount"`
	NativeTokenAmount decimal.Decimal                   `db:"native_token_amount" json:"native_token_amount"`
	NativeTokenFee    decimal.Decimal                   `db:"native_token_fee" json:"native_token_fee"`
	TxType            models.TransferTransactionType    `db:"tx_type" json:"tx_type"`
	Status            models.TransferTransactionsStatus `db:"status" json:"status"`
	Step              string                            `db:"step" json:"step"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type FindSystemTransactionsParams

type FindSystemTransactionsParams struct {
	OwnerID       uuid.UUID                 `db:"owner_id" json:"owner_id"`
	Blockchain    wconstants.BlockchainType `db:"blockchain" json:"blockchain"`
	TxHash        string                    `db:"tx_hash" json:"tx_hash"`
	SystemTxTypes []string                  `db:"system_tx_types" json:"system_tx_types"`
}

type Querier

type Querier interface {
	Create(ctx context.Context, arg CreateParams) (*models.TransferTransaction, error)
	FindSystemTransactions(ctx context.Context, arg FindSystemTransactionsParams) ([]*models.TransferTransaction, error)
	FindTransactionByType(ctx context.Context, transferID uuid.UUID, txType models.TransferTransactionType) ([]*models.TransferTransaction, error)
	GetAllByTransfer(ctx context.Context, transferID uuid.UUID) ([]*models.TransferTransaction, error)
	GetByTransfer(ctx context.Context, transferID uuid.UUID) ([]*models.TransferTransaction, error)
	UpdatePendingTxExpense(ctx context.Context, arg UpdatePendingTxExpenseParams) error
	UpdateStatus(ctx context.Context, iD uuid.UUID, status models.TransferTransactionsStatus) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (*Queries) FindSystemTransactions

func (q *Queries) FindSystemTransactions(ctx context.Context, arg FindSystemTransactionsParams) ([]*models.TransferTransaction, error)

func (*Queries) FindTransactionByType

func (q *Queries) FindTransactionByType(ctx context.Context, transferID uuid.UUID, txType models.TransferTransactionType) ([]*models.TransferTransaction, error)

func (*Queries) GetAllByTransfer

func (q *Queries) GetAllByTransfer(ctx context.Context, transferID uuid.UUID) ([]*models.TransferTransaction, error)

func (*Queries) GetByTransfer

func (q *Queries) GetByTransfer(ctx context.Context, transferID uuid.UUID) ([]*models.TransferTransaction, error)

func (*Queries) UpdatePendingTxExpense

func (q *Queries) UpdatePendingTxExpense(ctx context.Context, arg UpdatePendingTxExpenseParams) error

func (*Queries) UpdateStatus

func (q *Queries) UpdateStatus(ctx context.Context, iD uuid.UUID, status models.TransferTransactionsStatus) error

func (*Queries) WithTx

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

type UpdatePendingTxExpenseParams

type UpdatePendingTxExpenseParams struct {
	BandwidthAmount   decimal.Decimal                   `db:"bandwidth_amount" json:"bandwidth_amount"`
	EnergyAmount      decimal.Decimal                   `db:"energy_amount" json:"energy_amount"`
	NativeTokenAmount decimal.Decimal                   `db:"native_token_amount" json:"native_token_amount"`
	NativeTokenFee    decimal.Decimal                   `db:"native_token_fee" json:"native_token_fee"`
	CurrentTxStatus   models.TransferTransactionsStatus `db:"current_tx_status" json:"current_tx_status"`
	TransferID        uuid.UUID                         `db:"transfer_id" json:"transfer_id"`
	TxHash            string                            `db:"tx_hash" json:"tx_hash"`
}

Jump to

Keyboard shortcuts

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