Documentation ¶
Index ¶
- func FormatIntToKey(i uint64) string
- func GetHoldersPage(s Storage, from, count uint64) (ret []models.Account, pagination *models.PaginatedResponse)
- func GetObjectsPage[T Paginated](s Storage, address string, from, count uint64) (ret []T, pagination *models.PaginatedResponse)
- func GetTotal[T Paginated](s Storage, address string) (r uint64)
- func GetTypeName[T any]() string
- func GetUIntKey(key uint64) string
- func ProcessIntervalData[T Yields](s Storage, start uint64, fn func(string, T) (stop bool))
- type Account
- type AddressStats
- type Balances
- func (a *Balances) AddToBalance(address string, value *big.Int)
- func (a *Balances) FindBalance(address string) *Account
- func (a *Balances) RegisterBalance(address string) *Account
- func (a *Balances) RemoveBalance(address string)
- func (a *Balances) SortByBalanceDescending()
- func (a *Balances) UpdateBalances(from, to, value_str string)
- func (a *Balances) UpdateEvents(logs []models.EventLog) error
- type Batch
- type FinalizationData
- type GenesisHash
- type MultipliedYield
- type Paginated
- type Storage
- type TotalSupply
- type ValidatorYield
- type ValidatorsYield
- type WeekStats
- type Yield
- type Yields
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIntToKey ¶ added in v0.2.1
func GetHoldersPage ¶ added in v0.2.1
func GetObjectsPage ¶
func GetTypeName ¶
func GetUIntKey ¶ added in v0.2.1
Types ¶
type AddressStats ¶
type AddressStats struct { models.StatsResponse Address string `json:"address"` // contains filtered or unexported fields }
AddressStats defines the model for an address aggregate.
func MakeEmptyAddressStats ¶
func MakeEmptyAddressStats(addr string) *AddressStats
func (*AddressStats) AddTransaction ¶
func (a *AddressStats) AddTransaction(timestamp models.Timestamp) uint64
func (*AddressStats) IsEqual ¶ added in v0.2.1
func (a *AddressStats) IsEqual(b *AddressStats) bool
type Balances ¶ added in v0.2.1
type Balances struct {
Accounts []Account `json:"accounts"`
}
func (*Balances) AddToBalance ¶ added in v0.2.1
func (*Balances) FindBalance ¶ added in v0.2.1
func (*Balances) RegisterBalance ¶ added in v0.2.1
func (*Balances) RemoveBalance ¶ added in v0.2.1
func (*Balances) SortByBalanceDescending ¶ added in v0.2.1
func (a *Balances) SortByBalanceDescending()
func (*Balances) UpdateBalances ¶ added in v0.2.1
type Batch ¶
type Batch interface { CommitBatch() SetTotalSupply(s *TotalSupply) SetFinalizationData(f *FinalizationData) SetGenesisHash(h GenesisHash) UpdateWeekStats(w WeekStats) SaveAccounts(a *Balances) AddToBatchFullKey(o interface{}, key []byte) error AddToBatch(o interface{}, key1 string, key2 uint64) AddToBatchSingleKey(o interface{}, key string) Remove(key string) }
type FinalizationData ¶
type FinalizationData struct { DagCount uint64 `json:"dag_blocks_executed"` TrxCount uint64 `json:"transactions_executed"` PbftCount uint64 `json:"pbft_period"` }
func (*FinalizationData) Check ¶
func (local *FinalizationData) Check(remote FinalizationData)
type GenesisHash ¶
type GenesisHash string
type MultipliedYield ¶ added in v0.2.1
type Storage ¶
type Storage interface { Clean() error Close() error ForEach(o interface{}, key_prefix string, start *uint64, fn func(key, res []byte) (stop bool)) ForEachBackwards(o interface{}, key_prefix string, start *uint64, fn func(key, res []byte) (stop bool)) NewBatch() Batch GetTotalSupply() *TotalSupply GetAccounts() []Account GetWeekStats(year, week int32) WeekStats GetFinalizationData() *FinalizationData GetAddressStats(addr string) *AddressStats GenesisHashExist() bool GetGenesisHash() GenesisHash GetTransactionByHash(hash string) models.Transaction GetInternalTransactions(hash string) models.InternalTransactionsResponse GetTransactionLogs(hash string) models.TransactionLogsResponse GetValidatorYield(validator string, block uint64) (res Yield) GetTotalYield(block uint64) (res Yield) }
type TotalSupply ¶
type ValidatorYield ¶ added in v0.2.1
type ValidatorsYield ¶ added in v0.2.1
type ValidatorsYield struct {
Yields []ValidatorYield `json:"yields"`
}
type WeekStats ¶
func MakeEmptyWeekStats ¶
func MakeEmptyWeekStats() *WeekStats
func (*WeekStats) AddPbftBlock ¶
func (*WeekStats) GetPaginated ¶
type Yields ¶ added in v0.2.1
type Yields interface { ValidatorsYield | MultipliedYield }
Click to show internal directories.
Click to hide internal directories.