repository

package
v0.0.81 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocks

type Blocks interface {
	GetBlockInfo(ctx context.Context, block int32) (*model.BlockInfo, error)
	GetBlockInfoByHash(ctx context.Context, hash string) (*model.BlockInfo, error)
	GetBlockValidators(ctx context.Context, block int32) ([]string, error)
	TotalBlocks(ctx context.Context, to time.Time) (*model.TotalBlocks, error)
	Blocks(ctx context.Context, limit int64, offset int64) ([]*model.BlockInfo, int64, error)
	LatestBlockHeight(ctx context.Context) (int64, error)
	BlockSignatures(ctx context.Context, height int64, valAddress []string,
		limit int64, offset int64) ([]*model.BlockSigners, int64, error)
	BlockUptime(ctx context.Context, blockWindow, height int64,
		validatorAddr string) (float32, error)
	UptimeByBlocks(ctx context.Context, blockWindow, height int64,
		validatorAddr string) ([]*model.BlockSigned, float32, error)
}

func NewBlocks

func NewBlocks(db *pgxpool.Pool) Blocks

type BlocksCache

type BlocksCache interface {
	AddBlock(ctx context.Context, info *model.BlockInfo) error
	GetBlocks(ctx context.Context, start, stop int64) ([]*model.BlockInfo, int64, error)
}

type Cache

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

func NewCache

func NewCache(rdb *redis.Client) *Cache

func (*Cache) AddBlock

func (s *Cache) AddBlock(ctx context.Context, info *model.BlockInfo) error

func (*Cache) AddTotals

func (s *Cache) AddTotals(ctx context.Context, info *model.AggregatedInfo) error

func (*Cache) AddTransaction

func (s *Cache) AddTransaction(ctx context.Context, transaction *models.Tx) error

func (*Cache) GetBlocks

func (s *Cache) GetBlocks(ctx context.Context, start, stop int64) ([]*model.BlockInfo, int64, error)

func (*Cache) GetTotals

func (s *Cache) GetTotals(ctx context.Context) (*model.AggregatedInfo, error)

func (*Cache) GetTransactions

func (s *Cache) GetTransactions(ctx context.Context, start, stop int64) ([]*models.Tx, int64, error)

func (*Cache) PublishBlock

func (s *Cache) PublishBlock(ctx context.Context, info *models.Block) error

func (*Cache) PublishTx

func (s *Cache) PublishTx(ctx context.Context, tx *models.Tx) error

type PubSubCache

type PubSubCache interface {
	PublishTx(ctx context.Context, tx *models.Tx) error
	PublishBlock(ctx context.Context, info *models.Block) error
}
type Search interface {
	AddHash(ctx context.Context, hash string, hashType string, blockHeight int64) error
	HashByText(ctx context.Context, text string) ([]model.SearchResult, error)
	BlockByHeight(ctx context.Context, blockHeight int64) ([]model.SearchResult, error)
}

func NewSearch

func NewSearch(pool *mongo.Database) Search

type TotalsCache

type TotalsCache interface {
	AddTotals(ctx context.Context, info *model.AggregatedInfo) error
	GetTotals(ctx context.Context) (*model.AggregatedInfo, error)
}

type TransactionsCache

type TransactionsCache interface {
	AddTransaction(ctx context.Context, transaction *models.Tx) error
	GetTransactions(ctx context.Context, start, stop int64) ([]*models.Tx, int64, error)
}

type Txs

type Txs interface {
	ChartTxByDay(ctx context.Context, from time.Time, to time.Time) ([]*model.TxsByDay, error)
	TransactionsPerPeriod(ctx context.Context, to time.Time) (allTx, all24H, all48H, all30D int64, err error)
	VolumePerPeriod(ctx context.Context, to time.Time) (decimal.Decimal, decimal.Decimal, error)
	Transactions(ctx context.Context, limit int64, offset int64, filter *TxsFilter) ([]*models.Tx, int64, error)
	TransactionRawLog(ctx context.Context, hash string) ([]byte, error)
	TransactionSigners(ctx context.Context, hash string) ([]*models.SignerInfo, error)
	Messages(ctx context.Context, hash string) ([]*models.Message, error)
	GetSenderAndReceiver(ctx context.Context, hash string) (*model.TxSenderReceiver, error)
	GetWalletsCount(ctx context.Context) (*model.TotalWallets, error)
	ChartTransactionsByHour(ctx context.Context, to time.Time) (*model.TxByHourWithCount, error)
	ChartTransactionsVolume(ctx context.Context, to time.Time) ([]*model.TxVolumeByHour, error)
	GetPowerEvents(ctx context.Context, accountAddress string,
		limit int64, offset int64) ([]*models.Tx, int64, error)
	GetValidatorHistory(ctx context.Context, accountAddress string,
		limit int64, offset int64) ([]*models.Tx, int64, error)
	TransactionsByEventValue(ctx context.Context, values []string, messageType []string, includeEvents bool,
		limit int64, offset int64) ([]*models.Tx, int64, error)
	GetVotes(ctx context.Context, accountAddress string, limit int64, offset int64) ([]*model.VotesTransaction, int64, error)
	GetVotesByAccounts(ctx context.Context, accounts []string, excludeAccounts bool, voteOption string,
		proposalID int, byAccAddress *string, limit int64, offset int64, sortBy *model.SortBy) ([]*model.VotesTransaction, int64, error)
	GetWalletsCountPerPeriod(ctx context.Context, startDate, endDate time.Time) (int64, error)
	GetWalletsWithTx(ctx context.Context, limit int64, offset int64) ([]*model.WalletWithTxs, int64, error)
	TxCountByAccounts(ctx context.Context, accounts []string) ([]*model.WalletWithTxs, error)
	AccountInfo(ctx context.Context, account string) (*model.AccountInfo, error)
	GetEvents(ctx context.Context, txID uint) ([]*model.TxEvents, error)
	GetEventsV2(ctx context.Context, txHash string) ([]*model.TxEvents, error)
	UpdateViews(ctx context.Context) error
	ExtractNumber(value string) (decimal.Decimal, string, error)
	DelegatesByValidator(ctx context.Context, from, to time.Time, valoperAddress string,
		limit int64, offset int64) (data []*models.Tx, totalSum *model.Denom, all int64, err error)
	ProposalDepositors(ctx context.Context, proposalID int,
		sortBy *model.SortBy, limit int64, offset int64) ([]*model.ProposalDeposit, int64, error)
}

func NewTxs

func NewTxs(db *pgxpool.Pool) Txs

type TxsFilter

type TxsFilter struct {
	TxHash        *string
	TxBlockHeight *int64
	TxHashes      []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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