Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type Block
- type BlockAvgStat
- type BlockIntervalStat
- type BlockReward
- type Delegation
- type Ledger
- type LedgerEntry
- type RewardOwnerType
- type RewardsSummary
- type SnarkJob
- type Snarker
- type SnarkerJobFee
- type SnarkerJobsStat
- type SnarkerStat
- type SnarkerTimeStat
- type TimeInterval
- type Transaction
- type Validator
- type ValidatorEpoch
- type ValidatorStat
Constants ¶
View Source
const ( TimeIntervalDaily TimeInterval = iota TimeIntervalMonthly TimeIntervalYearly RewardOwnerTypeValidator RewardOwnerType = "validator" RewardOwnerTypeDelegator RewardOwnerType = "delegator" )
View Source
const ( // Transaction types TxTypePayment = "payment" TxTypeDelegation = "delegation" TxTypeCoinbase = "coinbase" TxTypeCoinbaseFeeTransfer = "fee_transfer_via_coinbase" TxTypeFeeTransfer = "fee_transfer" TxTypeSnarkFee = "snark_fee" // Transaction statuses TxStatusApplied = "applied" TxStatusFailed = "failed" )
Variables ¶
View Source
var ( TimeIntervalTypes = map[string]TimeInterval{ "daily": TimeIntervalDaily, "monthly": TimeIntervalMonthly, "yearly": TimeIntervalYearly, } RewardOwnerTypes = map[string]RewardOwnerType{ "validator": RewardOwnerTypeValidator, "delegator": RewardOwnerTypeDelegator, } )
View Source
var ( TxTypes = []string{ TxTypePayment, TxTypeDelegation, TxTypeCoinbase, TxTypeCoinbaseFeeTransfer, TxTypeFeeTransfer, TxTypeSnarkFee, } )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string `json:"-"` PublicKey string `json:"public_key"` Delegate *string `json:"delegate"` Balance types.Amount `json:"balance"` BalanceUnknown types.Amount `json:"balance_unknown"` Stake types.Amount `json:"stake"` Nonce uint64 `json:"nonce"` StartHeight uint64 `json:"start_height"` StartTime time.Time `json:"start_time"` LastHeight uint64 `json:"last_height"` LastTime time.Time `json:"last_time"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
Account contains the account details
type Block ¶
type Block struct { ID int `json:"-"` Height uint64 `json:"height"` Hash string `json:"hash"` ParentHash string `json:"parent_hash"` Time time.Time `json:"time"` Canonical bool `json:"canonical"` LedgerHash string `json:"ledger_hash"` SnarkedLedgerHash string `json:"snarked_ledger_hash"` Creator string `json:"creator"` Coinbase types.Amount `json:"coinbase"` TotalCurrency types.Amount `json:"total_currency"` Epoch int `json:"epoch"` Slot int `json:"slot"` TransactionsCount int `json:"transactions_count"` TransactionsFees types.Amount `json:"transactions_fees"` SnarkersCount int `json:"snarkers_count"` SnarkerAccounts pq.StringArray `json:"snarker_accounts"` SnarkJobsCount int `json:"snark_jobs_count"` SnarkJobsFees types.Amount `json:"snark_jobs_fees"` RewardCalculated bool `json:"reward_calculated"` Supercharged bool `json:"supercharged"` }
Block model contains block data
func (Block) EligibleForRewardCalculation ¶ added in v0.17.0
type BlockAvgStat ¶
type BlockAvgStat struct { StartHeight int64 `json:"start_height"` EndHeight int64 `json:"end_height"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` Count int64 `json:"count"` Diff float64 `json:"diff"` Avg float64 `json:"avg"` }
BlockAvgStat contains block averagess
type BlockIntervalStat ¶
type BlockIntervalStat struct { TimeInterval string `json:"time_interval"` Count int64 `json:"count"` Avg float64 `json:"avg"` }
BlockIntervalStat contains block count stats for a given time interval
type BlockReward ¶ added in v0.11.0
type BlockReward struct { ID string `json:"-"` OwnerAccount string `json:"owner_account"` Delegate *string `json:"delegate"` Epoch int `json:"epoch"` TimeBucket time.Time `json:"time_bucket"` Reward types.Amount `json:"reward"` OwnerType string `json:"owner_type"` }
BlockReward contains the reward details earned at a specific height
func (BlockReward) String ¶ added in v0.11.0
func (br BlockReward) String() string
String returns account text representation
type Delegation ¶
type Ledger ¶
type LedgerEntry ¶
type LedgerEntry struct { ID int `json:"-"` LedgerID int `json:"-"` PublicKey string `json:"public_key"` Delegate string `json:"delegate"` Delegation bool `json:"delegation"` Balance types.Amount `json:"balance"` TimingInitialMinimumBalance types.Amount `json:"timing_initial_minimum_balance"` TimingCliffTime *int `json:"timing_cliff_time"` TimingCliffAmount types.Amount `json:"timing_cliff_amount"` TimingVestingPeriod *int `json:"timing_vesting_period"` TimingVestingIncrement types.Amount `json:"timing_vesting_increment"` }
func (LedgerEntry) IsUntimed ¶ added in v0.11.0
func (l LedgerEntry) IsUntimed() bool
func (LedgerEntry) TableName ¶
func (LedgerEntry) TableName() string
type RewardOwnerType ¶ added in v0.11.0
type RewardOwnerType string
func GetTypeForRewardOwnerType ¶ added in v0.11.0
func GetTypeForRewardOwnerType(s string) (RewardOwnerType, bool)
type RewardsSummary ¶ added in v0.11.0
type SnarkJob ¶
type SnarkJob struct { ID int `json:"-"` Height uint64 `json:"height"` BlockHash string `json:"block_hash"` Time time.Time `json:"time"` Prover string `json:"prover"` Fee types.Amount `json:"fee"` WorksCount int `json:"works_count"` CreatedAt time.Time `json:"-"` }
SnarkJob contains a completed SNARK job details
type Snarker ¶
type Snarker struct { ID int `json:"-"` Account string `json:"public_key"` Fee uint64 `json:"fee"` JobsCount int `json:"jobs_count"` WorksCount int `json:"works_count"` StartHeight uint64 `json:"start_height"` StartTime time.Time `json:"start_time"` LastHeight uint64 `json:"last_height"` LastTime time.Time `json:"last_time"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
type SnarkerJobFee ¶ added in v0.18.0
type SnarkerJobsStat ¶ added in v0.18.0
type SnarkerStat ¶ added in v0.18.0
type SnarkerTimeStat ¶ added in v0.18.0
type SnarkerTimeStat struct { Time time.Time `json:"time"` FeeMin types.Amount `json:"fee_min"` FeeMax types.Amount `json:"fee_max"` FeeAvg types.Amount `json:"fee_avg"` JobsCount int `json:"jobs_count"` WorksCount int `json:"works_count"` BlocksCount int `json:"blocks_count"` CanonicalBlocksCount int `json:"canonical_blocks_count"` InclusionRatio float32 `json:"inclusion_ratio"` FeesAmount types.Amount `json:"fees_amount"` }
type TimeInterval ¶ added in v0.11.0
type TimeInterval uint
func GetTypeForTimeInterval ¶ added in v0.11.0
func GetTypeForTimeInterval(s string) (TimeInterval, bool)
func (TimeInterval) String ¶ added in v0.11.0
func (k TimeInterval) String() string
type Transaction ¶
type Transaction struct { ID int `json:"id"` Hash string `json:"hash"` Type string `json:"type"` BlockHash string `json:"block_hash"` BlockHeight uint64 `json:"block_height"` Time time.Time `json:"time"` Sender *string `json:"sender"` Receiver string `json:"receiver"` Amount types.Amount `json:"amount"` Fee types.Amount `json:"fee"` Nonce *int `json:"nonce"` Memo *string `json:"memo"` Status string `json:"status"` Canonical bool `json:"canonical"` FailureReason *string `json:"failure_reason"` SequenceNumber *int `json:"sequence_number"` SecondarySequenceNumber *int `json:"secondary_sequence_number"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
Transaction contains the blockchain transaction details
func (Transaction) TableName ¶
func (Transaction) TableName() string
TableName returns the model table name
func (Transaction) Validate ¶
func (t Transaction) Validate() error
Validate returns an error if transaction is invalid
type Validator ¶
type Validator struct { ID int `json:"-"` IdentityName *string `json:"identity_name"` PublicKey string `json:"public_key"` BlocksCreated int `json:"blocks_created"` BlocksProposed int `json:"blocks_proposed"` Stake types.Amount `json:"stake"` Fee types.Float `json:"fee" gorm:"-"` Delegations int `json:"delegations"` StartHeight uint64 `json:"start_height"` StartTime time.Time `json:"start_time"` LastHeight uint64 `json:"last_height"` LastTime time.Time `json:"last_time"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
Validator stores the block producer information
type ValidatorEpoch ¶ added in v0.11.0
type ValidatorEpoch struct { ID int `json:"-"` AccountAddress string `json:"account_address"` Epoch int `json:"epoch"` ValidatorFee types.Float `json:"validator_fee"` }
func (ValidatorEpoch) TableName ¶ added in v0.11.0
func (ValidatorEpoch) TableName() string
TableName returns the model table name
Source Files ¶
Click to show internal directories.
Click to hide internal directories.