history

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoundingFunction

func GetRoundingFunction(interval time.Duration) (string, error)

Types

type AccountMetric

type AccountMetric string
const (
	ActiveAddresses AccountMetric = "active_addresses"
)

type AccountRepository

type AccountRepository interface {
	AggregateAccountsHistory(ctx context.Context, req *AccountsReq) (*AccountsRes, error)
}

type AccountsReq

type AccountsReq struct {
	Metric AccountMetric `form:"metric"`

	ContractTypes []abi.ContractName `form:"interface"`
	MinterAddress *addr.Address      // NFT or FT minter

	ReqParams
}

type AccountsRes

type AccountsRes struct {
	CountRes `json:"count_results,omitempty"`
}

type BigIntRes

type BigIntRes []struct {
	Value     *bunbig.Int `ch:"type:UInt256"`
	Timestamp time.Time
}

type CountRes

type CountRes []struct {
	Value     int
	Timestamp time.Time
}

type MessageMetric

type MessageMetric string
var (
	MessageCount     MessageMetric = "message_count"
	MessageAmountSum MessageMetric = "message_amount_sum"
)

type MessageRepository

type MessageRepository interface {
	AggregateMessagesHistory(ctx context.Context, req *MessagesReq) (*MessagesRes, error)
}

type MessagesReq

type MessagesReq struct {
	Metric MessageMetric `form:"metric"`

	SrcAddresses []*addr.Address // `form:"src_address"`
	DstAddresses []*addr.Address // `form:"dst_address"`

	SrcContracts []string `form:"src_contract"`
	DstContracts []string `form:"dst_contract"`

	OperationNames []string `form:"operation_name"`

	MinterAddress *addr.Address // `form:"minter_address"`

	ReqParams
}

type MessagesRes

type MessagesRes struct {
	CountRes  `json:"count_results,omitempty"`
	BigIntRes `json:"sum_results,omitempty"`
}

type ReqParams

type ReqParams struct {
	From     time.Time     `form:"from"`
	To       time.Time     `form:"to"`
	Interval time.Duration `form:"interval"`
}

type TransactionMetric

type TransactionMetric string
var (
	TransactionCount TransactionMetric = "transaction_count"
)

type TransactionRepository

type TransactionRepository interface {
	AggregateTransactionsHistory(ctx context.Context, req *TransactionsReq) (*TransactionsRes, error)
}

type TransactionsReq

type TransactionsReq struct {
	Metric TransactionMetric `form:"metric"`

	Addresses []*addr.Address // `form:"addresses"`
	Workchain *int32          `form:"workchain"`

	ReqParams
}

type TransactionsRes

type TransactionsRes struct {
	CountRes `json:"count_results,omitempty"`
}

Jump to

Keyboard shortcuts

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