operation

package
v0.0.0-...-80b2b3e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo interface {
	List(ids, kinds []string, inBlocks, accountIDs []string, limit, offset uint, since int64, operationsIDs []int64) (operations []models.Operation, err error)
	ListAsc(kinds, accountIDs []string, limit, offset uint, after int64) (operations []models.Operation, err error)
	ContractOperationsList(contractID string, kinds, entrypoints []string, lastBlock int64, offset, limit uint, orderSide string) (operations []models.Operation, count int64, err error)
	Count(ids, kinds, inBlocks, accountIDs []string, maxOperationID int64) (count int64, err error)
	EndorsementsFor(blockLevel int64) (operations []models.Operation, err error)
	Last() (operation models.Operation, err error)
	ListDoubleEndorsementsWithoutLevel(limit, offset uint) (operations []models.Operation, err error)
	UpdateLevel(operation models.Operation) error
	AccountOperationCount(string) ([]models.OperationCount, error)
	AccountEndorsements(accountID string, cycle int64, limit uint, offset uint) (count int64, operations []models.Operation, err error)
	LargeTransfers(minAmount, cycle int64, limit, offset uint, sinceDate time.Time) (operations []models.Operation, err error)

	LargestSources(cycle int64, limit, offset uint, sinceDate time.Time, isSource bool) (account []models.Account, err error)
}

type Repository

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

Repository is the operation repo implementation.

func New

func New(db *gorm.DB) *Repository

New creates an instance of repository using the provided db.

func (*Repository) AccountEndorsements

func (r *Repository) AccountEndorsements(accountID string, cycle int64, limit uint, offset uint) (count int64, operations []models.Operation, err error)

func (*Repository) AccountOperationCount

func (r *Repository) AccountOperationCount(acc string) (counts []models.OperationCount, err error)

func (*Repository) ContractOperationsList

func (r *Repository) ContractOperationsList(contractID string, kinds, entrypoints []string, lastBlock int64, offset, limit uint, orderSide string) (operations []models.Operation, count int64, err error)

func (*Repository) Count

func (r *Repository) Count(ids, kinds, inBlocks, accountIDs []string, maxOperationID int64) (count int64, err error)

Count counts a number of operations sutisfying the filter.

func (*Repository) EndorsementsFor

func (r *Repository) EndorsementsFor(blockLevel int64) (operations []models.Operation, err error)

EndorsementsFor returns a list of endorsement operations for the provided block level.

func (*Repository) LargeTransfers

func (r *Repository) LargeTransfers(minAmount, cycle int64, limit, offset uint, sinceDate time.Time) (operations []models.Operation, err error)

func (*Repository) LargestSources

func (r *Repository) LargestSources(cycle int64, limit, offset uint, sinceDate time.Time, isSource bool) (whaleSources []models.Account, err error)

func (*Repository) Last

func (r *Repository) Last() (operation models.Operation, err error)

Last returns the last known operation.

func (*Repository) List

func (r *Repository) List(hashes, kinds, inBlocks, accountIDs []string, limit, offset uint, since int64, operationsIDs []int64) (operations []models.Operation, err error)

List returns a list of operations from the newest to oldest. limit defines the limit for the maximum number of operations returned. since is used to paginate results based on the operation id. As the result is ordered descendingly the operations with operation_id < since will be returned.

func (*Repository) ListAsc

func (r *Repository) ListAsc(kinds, accountIDs []string, limit, offset uint, after int64) (operations []models.Operation, err error)

func (*Repository) ListDoubleEndorsementsWithoutLevel

func (r *Repository) ListDoubleEndorsementsWithoutLevel(limit, offset uint) (operations []models.Operation, err error)

func (*Repository) UpdateLevel

func (r *Repository) UpdateLevel(operation models.Operation) error

Directories

Path Synopsis
Package mock_operation is a generated GoMock package.
Package mock_operation is a generated GoMock package.

Jump to

Keyboard shortcuts

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