gen

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	BlockHeight int64
	BlockHash   string
	Module      string
}

type CreateBlockParams

type CreateBlockParams struct {
	BlockHeight int64
	BlockHash   string
	Module      string
}

type CreateEventParams

type CreateEventParams struct {
	TxHash         string
	BlockHeight    int64
	TxIndex        int32
	WalletAddress  string
	Valid          bool
	Action         int32
	RawMessage     []byte
	ParsedMessage  []byte
	BlockTimestamp pgtype.Timestamp
	BlockHash      string
	Metadata       []byte
	Reason         string
}

type CreateNodeParams

type CreateNodeParams struct {
	SaleBlock      int64
	SaleTxIndex    int32
	NodeID         int32
	TierIndex      int32
	DelegatedTo    string
	OwnerPublicKey string
	PurchaseTxHash string
	DelegateTxHash string
}

type CreateNodeSaleParams

type CreateNodeSaleParams struct {
	BlockHeight           int64
	TxIndex               int32
	Name                  string
	StartsAt              pgtype.Timestamp
	EndsAt                pgtype.Timestamp
	Tiers                 [][]byte
	SellerPublicKey       string
	MaxPerAddress         int32
	DeployTxHash          string
	MaxDiscountPercentage int32
	SellerWallet          string
}

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 Event

type Event struct {
	TxHash         string
	BlockHeight    int64
	TxIndex        int32
	WalletAddress  string
	Valid          bool
	Action         int32
	RawMessage     []byte
	ParsedMessage  []byte
	BlockTimestamp pgtype.Timestamp
	BlockHash      string
	Metadata       []byte
	Reason         string
}

type GetNodeCountByTierIndexParams

type GetNodeCountByTierIndexParams struct {
	SaleBlock   int64
	SaleTxIndex int32
	FromTier    int32
	ToTier      int32
}

type GetNodeCountByTierIndexRow

type GetNodeCountByTierIndexRow struct {
	TierIndex int32
	Count     int64
}

type GetNodeSaleParams

type GetNodeSaleParams struct {
	BlockHeight int64
	TxIndex     int32
}

type GetNodesByDeploymentParams

type GetNodesByDeploymentParams struct {
	SaleBlock   int64
	SaleTxIndex int32
}

type GetNodesByIdsParams

type GetNodesByIdsParams struct {
	SaleBlock   int64
	SaleTxIndex int32
	NodeIds     []int32
}

type GetNodesByOwnerParams

type GetNodesByOwnerParams struct {
	SaleBlock      int64
	SaleTxIndex    int32
	OwnerPublicKey string
}

type GetNodesByPubkeyParams

type GetNodesByPubkeyParams struct {
	SaleBlock      int64
	SaleTxIndex    int32
	OwnerPublicKey string
	DelegatedTo    string
}

type Node

type Node struct {
	SaleBlock      int64
	SaleTxIndex    int32
	NodeID         int32
	TierIndex      int32
	DelegatedTo    string
	OwnerPublicKey string
	PurchaseTxHash string
	DelegateTxHash string
}

type NodeSale

type NodeSale struct {
	BlockHeight           int64
	TxIndex               int32
	Name                  string
	StartsAt              pgtype.Timestamp
	EndsAt                pgtype.Timestamp
	Tiers                 [][]byte
	SellerPublicKey       string
	MaxPerAddress         int32
	DeployTxHash          string
	MaxDiscountPercentage int32
	SellerWallet          string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ClearDelegate

func (q *Queries) ClearDelegate(ctx context.Context) (int64, error)

func (*Queries) ClearEvents

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

func (*Queries) CreateBlock

func (q *Queries) CreateBlock(ctx context.Context, arg CreateBlockParams) error

func (*Queries) CreateEvent

func (q *Queries) CreateEvent(ctx context.Context, arg CreateEventParams) error

func (*Queries) CreateNode

func (q *Queries) CreateNode(ctx context.Context, arg CreateNodeParams) error

func (*Queries) CreateNodeSale

func (q *Queries) CreateNodeSale(ctx context.Context, arg CreateNodeSaleParams) error

func (*Queries) GetBlock

func (q *Queries) GetBlock(ctx context.Context, blockHeight int64) (Block, error)

func (*Queries) GetEventsByWallet

func (q *Queries) GetEventsByWallet(ctx context.Context, walletAddress string) ([]Event, error)

func (*Queries) GetLastProcessedBlock

func (q *Queries) GetLastProcessedBlock(ctx context.Context) (Block, error)

func (*Queries) GetNodeCountByTierIndex

func (q *Queries) GetNodeCountByTierIndex(ctx context.Context, arg GetNodeCountByTierIndexParams) ([]GetNodeCountByTierIndexRow, error)

func (*Queries) GetNodeSale

func (q *Queries) GetNodeSale(ctx context.Context, arg GetNodeSaleParams) ([]NodeSale, error)

func (*Queries) GetNodesByDeployment

func (q *Queries) GetNodesByDeployment(ctx context.Context, arg GetNodesByDeploymentParams) ([]Node, error)

func (*Queries) GetNodesByIds

func (q *Queries) GetNodesByIds(ctx context.Context, arg GetNodesByIdsParams) ([]Node, error)

func (*Queries) GetNodesByOwner

func (q *Queries) GetNodesByOwner(ctx context.Context, arg GetNodesByOwnerParams) ([]Node, error)

func (*Queries) GetNodesByPubkey

func (q *Queries) GetNodesByPubkey(ctx context.Context, arg GetNodesByPubkeyParams) ([]Node, error)

func (*Queries) RemoveBlockFrom

func (q *Queries) RemoveBlockFrom(ctx context.Context, fromBlock int64) (int64, error)

func (*Queries) RemoveEventsFromBlock

func (q *Queries) RemoveEventsFromBlock(ctx context.Context, fromBlock int64) (int64, error)

func (*Queries) SetDelegates

func (q *Queries) SetDelegates(ctx context.Context, arg SetDelegatesParams) (int64, error)

func (*Queries) WithTx

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

type SetDelegatesParams

type SetDelegatesParams struct {
	SaleBlock      int64
	SaleTxIndex    int32
	DelegateTxHash string
	Delegatee      string
	NodeIds        []int32
}

Jump to

Keyboard shortcuts

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