transaction

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransformTxData

func TransformTxData(tx models.Transaction) resource.Interface

Types

type BlockFilter

type BlockFilter struct {
	BlockId uint64
}

TODO: replace string in StartBlock, EndBlock to int

func (BlockFilter) Filter

func (f BlockFilter) Filter(q *orm.Query) (*orm.Query, error)

type BlocksRangeSelectFilter

type BlocksRangeSelectFilter struct {
	StartBlock *string
	EndBlock   *string
}

func (BlocksRangeSelectFilter) Filter

func (f BlocksRangeSelectFilter) Filter(q *orm.Query) (*orm.Query, error)

type Repository

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

func NewRepository

func NewRepository(db *pg.DB) *Repository

func (Repository) Get24hTransactionsData

func (repository Repository) Get24hTransactionsData() Tx24hData

Get transactions data by last 24 hours

func (Repository) GetPaginatedTxsByAddresses

func (repository Repository) GetPaginatedTxsByAddresses(addresses []string, filter BlocksRangeSelectFilter, pagination *tools.Pagination) []models.Transaction

Get paginated list of transactions by address filter

func (Repository) GetPaginatedTxsByCoin

func (repository Repository) GetPaginatedTxsByCoin(coinSymbol string, pagination *tools.Pagination) []models.TransactionOutput

Get paginated list of transactions by coin

func (Repository) GetPaginatedTxsByFilter

func (repository Repository) GetPaginatedTxsByFilter(filter tools.Filter, pagination *tools.Pagination) []models.Transaction

Get paginated list of transactions by select filter

func (Repository) GetTotalTransactionCount

func (repository Repository) GetTotalTransactionCount(startTime *string) int

Get total transaction count

func (Repository) GetTxByHash

func (repository Repository) GetTxByHash(hash string) *models.Transaction

Get transaction by hash

func (Repository) GetTxCountChartDataByFilter

func (repository Repository) GetTxCountChartDataByFilter(filter tools.Filter) []TxCountChartData

Get list of transactions counts filtered by created_at

type Resource

type Resource struct {
	Txn         uint64                 `json:"txn"`
	Hash        string                 `json:"hash"`
	Nonce       uint64                 `json:"nonce"`
	Block       uint64                 `json:"block"`
	CreatedAt   string                 `json:"created_at"`
	Fee         string                 `json:"fee"`
	Type        uint8                  `json:"type"`
	Payload     string                 `json:"payload"`
	From        string                 `json:"from"`
	Data        resource.ItemInterface `json:"data"`
	Gas         uint64                 `json:"gas"`
	GasPrice    uint64                 `json:"gas_price"`
	GasCoinName string                 `json:"gas_coin"`
	To          *string                `json:"to,omitempty"`
}

func (Resource) Transform

type ResourceTransactionOutput

type ResourceTransactionOutput struct {
	Txn         uint64                 `json:"txn"`
	Hash        string                 `json:"hash"`
	Nonce       uint64                 `json:"nonce"`
	Block       uint64                 `json:"block"`
	CreatedAt   string                 `json:"created_at"`
	Fee         string                 `json:"fee"`
	Type        uint8                  `json:"type"`
	From        string                 `json:"from"`
	Gas         uint64                 `json:"gas"`
	GasPrice    uint64                 `json:"gas_price"`
	GasCoinName string                 `json:"gas_coin"`
	To          *string                `json:"to,omitempty"`
	Data        resource.ItemInterface `json:"data"`
}

func (ResourceTransactionOutput) Transform

type TransformTxConfig

type TransformTxConfig struct {
	Model    resource.ItemInterface
	Resource resource.Interface
}

type Tx24hData

type Tx24hData struct {
	FeeSum float64
	Count  int
	FeeAvg float64
}

type TxCountChartData

type TxCountChartData struct {
	Time  time.Time
	Count uint64
}

type ValidatorFilter

type ValidatorFilter struct {
	ValidatorPubKey string
	StartBlock      *string
	EndBlock        *string
}

TODO: replace string in StartBlock, EndBlock to int

func (ValidatorFilter) Filter

func (f ValidatorFilter) Filter(q *orm.Query) (*orm.Query, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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