aggregate

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRepository

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

type AccountsReq

type AccountsReq struct {
	MinterAddress *addr.Address // NFT or FT minter

	Limit int `form:"limit"`
}

type AccountsRes

type AccountsRes struct {
	// NFT minter
	Items       int `json:"items,omitempty"`
	OwnersCount int `json:"owners_count,omitempty"`
	OwnedItems  []*struct {
		OwnerAddress *addr.Address `ch:"type:String" json:"owner_address"`
		ItemsCount   int           `json:"items_count"`
	} `json:"owned_items,omitempty"`
	UniqueOwners []*struct {
		ItemAddress *addr.Address `ch:"type:String" json:"item_address"`
		OwnersCount int           `json:"owners_count"`
	} `json:"unique_owners,omitempty"`

	// FT minter
	Wallets      int         `json:"wallets,omitempty"`
	TotalSupply  *bunbig.Int `json:"total_supply,omitempty"`
	OwnedBalance []*struct {
		WalletAddress *addr.Address `ch:"item_address,type:String" json:"wallet_address"`
		OwnerAddress  *addr.Address `ch:"type:String" json:"owner_address"`
		Balance       *bunbig.Int   `ch:"type:UInt256" json:"balance"`
	} `json:"owned_balance,omitempty"`
}

type AddressStatusCount added in v0.3.2

type AddressStatusCount struct {
	Status core.AccountStatus `json:"status"`
	Count  int                `json:"count"`
}

type AddressTypesCount added in v0.3.2

type AddressTypesCount struct {
	Interfaces []abi.ContractName `json:"interfaces"`
	Count      int                `json:"count"`
}

type MessageRepository

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

type MessagesReq

type MessagesReq struct {
	Address *addr.Address

	OrderBy string `form:"order_by"` // amount / count
	Limit   int    `form:"limit"`
}

type MessagesRes

type MessagesRes struct {
	RecvCount  int         `json:"received_count"`
	RecvAmount *bunbig.Int `json:"received_ton_amount"`

	SentCount  int         `json:"sent_count"`
	SentAmount *bunbig.Int `json:"sent_ton_amount"`

	RecvByAddress []struct {
		Sender *addr.Address `ch:"type:String" json:"sender"`
		Amount *bunbig.Int   `json:"amount"`
		Count  int           `json:"count"`
	} `json:"received_from_address"`

	SentByAddress []struct {
		Receiver *addr.Address `ch:"type:String" json:"receiver"`
		Amount   *bunbig.Int   `json:"amount"`
		Count    int           `json:"count"`
	} `json:"sent_to_address"`
}

type Statistics

type Statistics struct {
	FirstBlock       int `json:"first_masterchain_block"`
	LastBlock        int `json:"last_masterchain_block"`
	MasterBlockCount int `json:"masterchain_block_count"`

	AddressCount       int `json:"address_count"`
	ParsedAddressCount int `json:"parsed_address_count"`

	AccountCount       int `json:"account_count"`
	ParsedAccountCount int `json:"parsed_account_count"`

	TransactionCount int `json:"transaction_count"`

	MessageCount       int `json:"message_count"`
	ParsedMessageCount int `json:"parsed_message_count"`

	ContractInterfaceCount int `json:"contract_interface_count"`
	ContractOperationCount int `json:"contract_operation_count"`

	AddressStatusCount []AddressStatusCount `json:"address_count_by_status"`

	AddressTypesCount []AddressTypesCount `json:"address_count_by_interfaces"`

	MessageTypesCount []struct {
		Operation string `json:"operation"`
		Count     int    `json:"count"`
	} `json:"message_count_by_operation"`
}

func GetStatistics

func GetStatistics(ctx context.Context, ck *ch.DB, pg *bun.DB) (*Statistics, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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