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([]byte, T) (stop bool))
- type Account
- type Accounts
- func (a *Accounts) AddToBalance(address string, value *big.Int)
- func (a *Accounts) FindBalance(address string) *Account
- func (a *Accounts) RegisterBalance(address string) *Account
- func (a *Accounts) RemoveBalance(address string)
- func (a *Accounts) SortByBalanceDescending()
- func (a *Accounts) UpdateBalances(from, to, value_str string)
- func (a *Accounts) UpdateEvents(logs []models.EventLog) error
- type AddressStats
- func (a *AddressStats) AddDag(timestamp models.Timestamp) uint64
- func (a *AddressStats) AddPbft(timestamp models.Timestamp) uint64
- func (a *AddressStats) AddTransaction(timestamp models.Timestamp) uint64
- func (a *AddressStats) IsEqual(b *AddressStats) bool
- func (a *AddressStats) RegisterValidatorBlock(blockHeight uint64)
- type AddressStatsMap
- type Batch
- type FinalizationData
- type GenesisHash
- type MultipliedYield
- type Paginated
- type RewardsStats
- type Storage
- type TotalRewardsStats
- type TotalSupply
- type ValidatorStats
- type ValidatorStatsWithAddress
- 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 Accounts ¶ added in v1.5.4
type Accounts []Account
func (*Accounts) AddToBalance ¶ added in v1.5.4
func (*Accounts) FindBalance ¶ added in v1.5.4
func (*Accounts) RegisterBalance ¶ added in v1.5.4
func (*Accounts) RemoveBalance ¶ added in v1.5.4
func (*Accounts) SortByBalanceDescending ¶ added in v1.5.4
func (a *Accounts) SortByBalanceDescending()
func (*Accounts) UpdateBalances ¶ added in v1.5.4
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
func (*AddressStats) RegisterValidatorBlock ¶ added in v0.3.6
func (a *AddressStats) RegisterValidatorBlock(blockHeight uint64)
type AddressStatsMap ¶ added in v1.5.2
type AddressStatsMap struct {
// contains filtered or unexported fields
}
func MakeAddressStatsMap ¶ added in v1.5.2
func MakeAddressStatsMap() *AddressStatsMap
func (*AddressStatsMap) AddToBatch ¶ added in v1.5.2
func (a *AddressStatsMap) AddToBatch(b Batch)
func (*AddressStatsMap) GetAddress ¶ added in v1.5.2
func (a *AddressStatsMap) GetAddress(s Storage, addr string) *AddressStats
type Batch ¶
type Batch interface { CommitBatch() SetTotalSupply(s *TotalSupply) SetFinalizationData(f *FinalizationData) SetGenesisHash(h GenesisHash) UpdateWeekStats(w WeekStats) SaveAccounts(a Accounts) Add(o interface{}, key1 string, key2 uint64) AddSerialized(o interface{}, data []byte, key1 string, key2 uint64) AddSingleKey(o interface{}, key string) AddSerializedSingleKey(o interface{}, data []byte, key string) AddWithKey(o interface{}, key []byte) error AddSerializedWithKey(o interface{}, data, key []byte) error Remove(key []byte) }
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 RewardsStats ¶ added in v1.8.1
type RewardsStats struct { TotalRewardsStats ValidatorsStats []ValidatorStatsWithAddress }
map can't be serialized to rlp, so we need to use slice of structs
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)) ForEachFromKey(prefix, start_key []byte, fn func(key, res []byte) (stop bool)) ForEachFromKeyBackwards(prefix, start_key []byte, fn func(key, res []byte) (stop bool)) NewBatch() Batch GetTotalSupply() *TotalSupply GetAccounts() Accounts 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 TotalRewardsStats ¶ added in v1.8.1
type TotalSupply ¶
type ValidatorStats ¶ added in v1.8.1
type ValidatorStatsWithAddress ¶ added in v1.8.1
type ValidatorStatsWithAddress struct { ValidatorStats Address string }
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.