types

package
v0.0.0-...-2adbdf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2022 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AverageTimeRow

type AverageTimeRow struct {
	OneRowID    bool    `db:"one_row_id"`
	Slot        uint64  `db:"slot"`
	AverageTime float64 `db:"average_time"`
}

AverageTimeRow is the average slot time each minute/hour/day

func NewAverageTimeRow

func NewAverageTimeRow(slot uint64, averageTime float64) AverageTimeRow

type BalanceHistoryRow

type BalanceHistoryRow struct {
	Address   string    `db:"address"`
	Timestamp time.Time `db:"timestamp"`
	Balance   uint64    `db:"balance"`
}

func NewBalanceHistoryRow

func NewBalanceHistoryRow(address string, timestamp time.Time, balance uint64) BalanceHistoryRow

func (BalanceHistoryRow) Equal

func (b BalanceHistoryRow) Equal(other BalanceHistoryRow) bool

type BalanceRow

type BalanceRow struct {
	Address string `db:"address"`
	Slot    uint64 `db:"slot"`
	Balance uint64 `db:"balance"`
}

func NewBalanceRow

func NewBalanceRow(address string, slot uint64, balance uint64) BalanceRow

type BlockRow

type BlockRow struct {
	Slot      uint64    `db:"slot"`
	Height    uint64    `db:"height"`
	Hash      string    `db:"hash"`
	Leader    string    `db:"leader"`
	Timestamp time.Time `db:"timestamp"`
	NumTxs    int       `db:"num_txs"`
}

BlockRow represents a single block row stored inside the database

func NewBlockRow

func NewBlockRow(slot uint64, height uint64, hash string, leader string, timestamp time.Time, numTxs int) BlockRow

func (BlockRow) Equal

func (b BlockRow) Equal(otherBlock BlockRow) bool

type BufferAccountRow

type BufferAccountRow struct {
	Address   string `db:"address"`
	Slot      uint64 `db:"slot"`
	Authority string `db:"authority"`
}

func NewBufferAccountRow

func NewBufferAccountRow(address string, slot uint64, authority string) BufferAccountRow

type InstructionRow

type InstructionRow struct {
	TxSignature      string      `db:"tx_signature"`
	Slot             uint64      `db:"slot"`
	Index            int         `db:"index"`
	InnerIndex       int         `db:"inner_index"`
	Program          string      `db:"program"`
	InvolvedAccounts interface{} `db:"involved_accounts"`
	RawData          string      `db:"raw_data"`
	Type             string      `db:"type"`
	Value            interface{} `db:"value"`
	PartitionId      int         `db:"partition_id"`
}

func NewInstructionRow

func NewInstructionRow(
	txSignature string, slot uint64, index int, innerIndex int, program string, involvedAccounts []string, rawData string, typ string, value interface{},
) InstructionRow

func NewInstructionRowFromInstruction

func NewInstructionRowFromInstruction(
	instruction types.Instruction,
) InstructionRow

type MissingHeightRow

type MissingHeightRow struct {
	Height uint64 `db:"height"`
}

type MissingSlotRangeRow

type MissingSlotRangeRow struct {
	Slot uint64 `db:"slot"`
}

type MultisigRow

type MultisigRow struct {
	Address string         `db:"address"`
	Slot    uint64         `db:"slot"`
	Signers pq.StringArray `db:"signers"`
	Minimum uint8          `db:"minimum"`
}

func NewMultisigRow

func NewMultisigRow(address string, slot uint64, signers []string, m uint8) MultisigRow

type NonceAccountRow

type NonceAccountRow struct {
	Address              string `db:"address"`
	Slot                 uint64 `db:"slot"`
	Authority            string `db:"authority"`
	Blockhash            string `db:"blockhash"`
	LamportsPerSignature uint64 `db:"lamports_per_signature"`
}

func NewNonceAccountRow

func NewNonceAccountRow(
	address string, slot uint64, authority string, blockhash string, lamportsPerSignature uint64,
) NonceAccountRow

type ParsedValidatorConfig

type ParsedValidatorConfig struct {
	Name            string `json:"name"`
	KeybaseUsername string `json:"keybaseUsername"`
	Website         string `json:"website"`
	Details         string `json:"details"`
}

func NewParsedValidatorConfig

func NewParsedValidatorConfig(
	name string,
	keybaseUsername string,
	website string,
	details string,
) ParsedValidatorConfig

type ProgramAccountRow

type ProgramAccountRow struct {
	Address            string `db:"address"`
	Slot               uint64 `db:"slot"`
	ProgramDataAccount string `db:"program_data_account"`
}

func NewProgramAccountRow

func NewProgramAccountRow(address string, slot uint64, programDataAccount string) ProgramAccountRow

type ProgramDataAccountRow

type ProgramDataAccountRow struct {
	Address          string `db:"address"`
	Slot             uint64 `db:"slot"`
	LastModifiedSlot uint64 `db:"last_modified_slot"`
	UpdateAuthority  string `db:"update_authority"`
}

func NewProgramDataAccountRow

func NewProgramDataAccountRow(address string, slot uint64, lastModifiedSlot uint64, updateAuthority string) ProgramDataAccountRow

type StakeAccountRow

type StakeAccountRow struct {
	Address    string `db:"address"`
	Slot       uint64 `db:"slot"`
	Staker     string `db:"staker"`
	Withdrawer string `db:"withdrawer"`
}

func NewStakeAccountRow

func NewStakeAccountRow(
	address string, slot uint64, staker string, withdrawer string,
) StakeAccountRow

type StakeDelegationRow

type StakeDelegationRow struct {
	Address            string  `db:"address"`
	Slot               uint64  `db:"slot"`
	ActivationEpoch    uint64  `db:"activation_epoch"`
	DeactivationEpoch  uint64  `db:"deactivation_epoch"`
	Stake              uint64  `db:"stake"`
	Voter              string  `db:"voter"`
	WarmupCooldownRate float64 `db:"warmup_cooldown_rate"`
}

func NewStakeDelegationRow

func NewStakeDelegationRow(
	address string, slot uint64, activationEpoch uint64, deactivationEpoch uint64, stake uint64, voter string, rate float64,
) StakeDelegationRow

type StakeLockupRow

type StakeLockupRow struct {
	Address       string    `db:"address"`
	Slot          uint64    `db:"slot"`
	Custodian     string    `db:"custodian"`
	Epoch         uint64    `db:"epoch"`
	UnixTimestamp time.Time `db:"unix_timestamp"`
}

func NewStakeLockupRow

func NewStakeLockupRow(
	address string, slot uint64, custodian string, epoch uint64, unixTimestamp int64,
) StakeLockupRow

func (StakeLockupRow) Equal

func (lockup StakeLockupRow) Equal(other StakeLockupRow) bool

type SupplyInfoRow

type SupplyInfoRow struct {
	OneRowID       bool   `db:"one_row_id"`
	Epoch          uint64 `db:"epoch"`
	Total          uint64 `db:"total"`
	Circulating    uint64 `db:"circulating"`
	NonCirculating uint64 `db:"non_circulating"`
}

func NewSupplyInfoRow

func NewSupplyInfoRow(
	epoch uint64,
	total uint64,
	circulating uint64,
	nonCirculating uint64,
) SupplyInfoRow

type TokenAccountRow

type TokenAccountRow struct {
	Address string `db:"address"`
	Slot    uint64 `db:"slot"`
	Mint    string `db:"mint"`
	Owner   string `db:"owner"`
}

func NewTokenAccountRow

func NewTokenAccountRow(
	address string, slot uint64, mint string, owner string,
) TokenAccountRow

type TokenDelegationRow

type TokenDelegationRow struct {
	Source      string `db:"source_address"`
	Destination string `db:"delegate_address"`
	Slot        uint64 `db:"slot"`
	Amount      uint64 `db:"amount"`
}

func NewTokenDelegationRow

func NewTokenDelegationRow(source string, destination string, slot uint64, amount uint64) TokenDelegationRow

type TokenPriceRow

type TokenPriceRow struct {
	ID        string    `db:"id"`
	Price     float64   `db:"price"`
	MarketCap int64     `db:"market_cap"`
	Symbol    string    `db:"symbol"`
	Timestamp time.Time `db:"timestamp"`
	Volume    float64   `db:"volume"`
}

func NewTokenPriceRow

func NewTokenPriceRow(id string, price float64, marketCap int64, symbol string, timestamp time.Time, volume float64) TokenPriceRow

type TokenRow

type TokenRow struct {
	Mint            string `db:"mint"`
	Slot            uint64 `db:"slot"`
	Decimals        uint8  `db:"decimals"`
	MintAuthority   string `db:"mint_authority"`
	FreezeAuthority string `db:"freeze_authority"`
}

func NewTokenRow

func NewTokenRow(
	mint string,
	slot uint64,
	decimals uint8,
	mintAuthority string,
	freezeAuthority string,
) TokenRow

type TokenSupplyRow

type TokenSupplyRow struct {
	Mint   string `db:"mint"`
	Slot   uint64 `db:"slot"`
	Supply uint64 `db:"supply"`
}

func NewTokenSupplyRow

func NewTokenSupplyRow(mint string, slot uint64, supply uint64) TokenSupplyRow

type TokenUnitRow

type TokenUnitRow struct {
	Mint        string `db:"mint"`
	PriceID     string `db:"price_id"`
	Name        string `db:"unit_name"`
	LogoURI     string `db:"logo_uri"`
	Description string `db:"description"`
	Website     string `db:"website"`
}

func NewTokenUnitRow

func NewTokenUnitRow(
	mint string,
	priceID string,
	name string,
	logoURI string,
	description string,
	website string,
) TokenUnitRow

type TxByAddressRow

type TxByAddressRow struct {
	Address     string `db:"address"`
	Signature   string `db:"signature"`
	Slot        uint64 `db:"slot"`
	Index       int    `db:"index"`
	PartitionId int    `db:"partition_id"`
}

type TxRow

type TxRow struct {
	Signature        string         `db:"signature"`
	Slot             uint64         `db:"slot"`
	Index            int            `db:"index"`
	InvolvedAccounts pq.StringArray `db:"involved_accounts"`
	Success          bool           `db:"success"`
	Fee              uint64         `db:"fee"`
	Logs             interface{}    `db:"logs"`
	NumInstructions  int            `db:"num_instructions"`
	PartitionId      int            `db:"partition_id"`
}

func NewTxRow

func NewTxRow(signature string, slot uint64, index int, accounts []string, success bool, fee uint64, logs []string, numInstructions int) TxRow

func NewTxRowsFromTxs

func NewTxRowsFromTxs(txs []types.Tx) []TxRow

type ValidatorConfigRow

type ValidatorConfigRow struct {
	Address string `db:"address"`
	Slot    uint64 `db:"slot"`
	Owner   string `db:"owner"`

	Name            string `db:"name"`
	KeybaseUsername string `db:"keybase_username"`
	Website         string `db:"website"`
	Details         string `db:"details"`

	AvatarURL string `db:"avatar_url"`
}

func NewValidatorConfigRow

func NewValidatorConfigRow(
	address string,
	slot uint64,
	owner string,
	config ParsedValidatorConfig,
	avatarUrl string,
) ValidatorConfigRow

type ValidatorSkipRateRow

type ValidatorSkipRateRow struct {
	Address  string  `db:"address"`
	Epoch    uint64  `db:"epoch"`
	SkipRate float64 `db:"skip_rate"`
	Total    int     `db:"total"`
	Skip     int     `db:"skip"`
}

func NewValidatorSkipRateRow

func NewValidatorSkipRateRow(address string, epoch uint64, skipRate float64, total int, skip int) ValidatorSkipRateRow

type ValidatorStatusRow

type ValidatorStatusRow struct {
	Address        string `db:"address"`
	Slot           uint64 `db:"slot"`
	ActivatedStake uint64 `db:"activated_stake"`
	LastVote       uint64 `db:"last_vote"`
	RootSlot       uint64 `db:"root_slot"`
	Active         bool   `db:"active"`
}

func NewValidatorStatusRow

func NewValidatorStatusRow(
	address string,
	slot uint64,
	activatedStake uint64,
	lastVote uint64,
	rootSlot uint64,
	active bool,
) ValidatorStatusRow

type VoteAccountRow

type VoteAccountRow struct {
	Address    string `db:"address"`
	Slot       uint64 `db:"slot"`
	Node       string `db:"node"`
	Voter      string `db:"voter"`
	Withdrawer string `db:"withdrawer"`
	Commission uint8  `db:"commission"`
}

func NewVoteAccountRow

func NewVoteAccountRow(address string, slot uint64, node string, voter string, withdrawer string, commission uint8) VoteAccountRow

Jump to

Keyboard shortcuts

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