Documentation ¶
Index ¶
Constants ¶
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 ( 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 int `json:"transactions_fees"` SnarkersCount int `json:"snarkers_count"` SnarkJobsCount int `json:"snark_jobs_count"` SnarkJobsFees types.Amount `json:"snark_jobs_fees"` }
Block model contains block data
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 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 *int `json:"timing_vesting_increment"` }
func (LedgerEntry) TableName ¶
func (LedgerEntry) TableName() string
type SnarkJob ¶
type SnarkJob struct { ID int `json:"-"` Height uint64 `json:"height"` 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_time"` StartTime time.Time `json:"start_height"` LastHeight uint64 `json:"last_height"` LastTime time.Time `json:"last_time"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
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"` 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"` 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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.