store

package
v0.0.0-...-f0e4ce9 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuyTokenTxParams

type BuyTokenTxParams struct {
	Req     *pb.BuyTokenRequest
	BuyerID int64
}

type CancelWithdrawTxParams

type CancelWithdrawTxParams struct {
	WithdrawalId int64
}

type IStore

type IStore interface {
	db.Querier
	UpsertAccountTx(ctx context.Context, arg UpsertAccountTxParams) (*int64, error)
	WithdrawTx(ctx context.Context, arg WithdrawTxParams) (*int64, error)
	CancelWithdrawTx(ctx context.Context, arg CancelWithdrawTxParams) error
}

type Store

type Store struct {
	*db.Queries
	// contains filtered or unexported fields
}

func NewStore

func NewStore(pgdb *pgxpool.Pool) *Store

func (*Store) BuyTokenTx

func (s *Store) BuyTokenTx(
	ctx context.Context,
	qtx *db.Queries,
	arg *BuyTokenTxParams,
) (*db.Account, error)

func (*Store) CancelWithdrawTx

func (s *Store) CancelWithdrawTx(ctx context.Context, arg CancelWithdrawTxParams) error

func (*Store) DoUpsertAccountWithTx

func (s *Store) DoUpsertAccountWithTx(
	ctx context.Context,
	qtx *db.Queries,
	arg *UpsertAccountTxParams,
) (*db.Account, error)

func (*Store) GetConn

func (s *Store) GetConn() *pgxpool.Pool

func (*Store) UpsertAccountTx

func (s *Store) UpsertAccountTx(ctx context.Context, arg *UpsertAccountTxParams) (*db.Account, error)

func (*Store) WithdrawTx

func (s *Store) WithdrawTx(ctx context.Context, arg WithdrawTxParams) (*db.Withdrawal, error)

Account is not deleted even if all balance is withdrawn. Account is only deleted when expire_time is reached

type UpsertAccountTxParams

type UpsertAccountTxParams struct {
	db.UpsertAccountParams
	Digest string
	Epoch  int64
}

type WithdrawTxParams

type WithdrawTxParams struct {
	db.StartWithdrawalParams
	WithdrawAll bool
}

Jump to

Keyboard shortcuts

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