types

package
v0.0.0-...-a08de0b Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveEmpty

func RemoveEmpty(s []string) []string

func ToNullString

func ToNullString(value string) sql.NullString

func ToString

func ToString(value sql.NullString) string

Types

type AccountBalanceRow

type AccountBalanceRow struct {
	Address     string  `db:"address"`
	Balance     float64 `db:"balance"`
	Code        string  `db:"code"`
	ContractMap string  `db:"contract_map"`
	Height      uint64  `db:"height"`
}

AccountBalanceRow represents a single row inside the account table

func NewAccountBalanceRow

func NewAccountBalanceRow(address string, balance float64, code, contractMap string, height uint64) AccountBalanceRow

NewAccountBalanceRow allows to easily build a new AccountBalanceRow

func (AccountBalanceRow) Equal

Equal tells whether a and b contain the same data

type AccountKeyListRow

type AccountKeyListRow struct {
	Address        string `db:"address"`
	Index          int    `db:"index"`
	Weight         int    `db:"weight"`
	Revoked        bool   `db:"revoked"`
	SigAlgo        string `db:"sig_algo"`
	HashAlgo       string `db:"hash_algo"`
	PublicKey      string `db:"public_key"`
	SequenceNumber uint64 `db:"sequence_number"`
}

AccountKeyListRow represents a single row of the account_key_list table

func NewAccountKeyListRow

func NewAccountKeyListRow(
	address string,
	index int,
	weight int,
	revoked bool,
	sigAlgo string,
	hashAlgo string,
	publicKey string,
	sequenceNumber uint64) AccountKeyListRow

AccountKeyListRow allows to build a new AccountKeyListRow

func (AccountKeyListRow) Equal

Equal tells whether v and w represent the same rows

type AccountRow

type AccountRow struct {
	Address string `db:"address"`
}

AccountRow represents a single row of the account table

func NewAccountRow

func NewAccountRow(
	address string) AccountRow

AccountRow allows to build a new AccountRow

func (AccountRow) Equal

func (v AccountRow) Equal(w AccountRow) bool

Equal tells whether v and w represent the same rows

type AverageTimeRow

type AverageTimeRow struct {
	OneRowID    bool    `db:"one_row_id"`
	AverageTime float64 `db:"average_time"`
	Height      int64   `db:"height"`
}

------------------------------------------------------------------------------------------------------------------- AverageTimeRow is the average block time each minute/hour/day

func NewAverageTimeRow

func NewAverageTimeRow(averageTime float64, height int64) AverageTimeRow

func (AverageTimeRow) Equal

func (r AverageTimeRow) Equal(s AverageTimeRow) bool

Equal return true if two AverageTimeRow are true

type BlockRow

type BlockRow struct {
	Height               int64     `db:"height"`
	Id                   string    `db:"id"`
	ParentId             string    `db:"parent_id"`
	CollectionGuarantees string    `db:"collection_guarantees"`
	Timestamp            time.Time `db:"timestamp"`
}

BlockRow represents a single block row stored inside the database

func NewBlockRow

func NewBlockRow(
	height int64,
	id string,
	parentId string,
	collectionGuarantees string,
	timestamp time.Time) BlockRow

BlockRow allows to build a new BlockRow

func (BlockRow) Equal

func (v BlockRow) Equal(w BlockRow) bool

Equal tells whether v and w represent the same rows

type CurrentTableRow

type CurrentTableRow struct {
	Height int64  `db:"height"`
	NodeId string `db:"node_id"`
}

CurrentTableRow represents a single row of the current_table table

func NewCurrentTableRow

func NewCurrentTableRow(
	height int64,
	nodeId string) CurrentTableRow

CurrentTableRow allows to build a new CurrentTableRow

func (CurrentTableRow) Equal

Equal tells whether v and w represent the same rows

type CutPercentageRow

type CutPercentageRow struct {
	CutPercentage uint64 `db:"cut_percentage"`
	Height        int64  `db:"height"`
}

CutPercentageRow represents a single row of the cut_percentage table

func NewCutPercentageRow

func NewCutPercentageRow(
	cutPercentage uint64,
	height int64) CutPercentageRow

CutPercentageRow allows to build a new CutPercentageRow

func (CutPercentageRow) Equal

Equal tells whether v and w represent the same rows

type DbCoin

type DbCoin struct {
	Denom  string
	Amount string
}

DbCoin represents the information stored inside the database about a single coin

func NewDbCoin

func NewDbCoin(coin sdk.Coin) DbCoin

NewDbCoin builds a DbCoin starting from an SDK Coin

func (DbCoin) Equal

func (coin DbCoin) Equal(d DbCoin) bool

Equal tells whether coin and d represent the same coin with the same amount

func (*DbCoin) Scan

func (coin *DbCoin) Scan(src interface{}) error

Scan implements sql.Scanner

func (DbCoin) ToCoin

func (coin DbCoin) ToCoin() sdk.Coin

ToCoin converts this DbCoin to sdk.Coin

func (*DbCoin) Value

func (coin *DbCoin) Value() (driver.Value, error)

Value implements driver.Valuer

type DbCoins

type DbCoins []*DbCoin

DbCoins represents an array of coins

func NewDbCoins

func NewDbCoins(coins sdk.Coins) DbCoins

NewDbCoins build a new DbCoins object starting from an array of coins

func (DbCoins) Equal

func (coins DbCoins) Equal(d *DbCoins) bool

Equal tells whether c and d contain the same items in the same order

func (*DbCoins) Scan

func (coins *DbCoins) Scan(src interface{}) error

Scan implements sql.Scanner

func (DbCoins) ToCoins

func (coins DbCoins) ToCoins() sdk.Coins

ToCoins converts this DbCoins to sdk.Coins

type DbDecCoin

type DbDecCoin struct {
	Denom  string
	Amount string
}

DbDecCoin represents the information stored inside the database about a single coin

func NewDbDecCoin

func NewDbDecCoin(coin sdk.DecCoin) DbDecCoin

NewDbDecCoin builds a DbDecCoin starting from an SDK Coin

func (DbDecCoin) Equal

func (coin DbDecCoin) Equal(d DbDecCoin) bool

Equal tells whether coin and d represent the same coin with the same amount

func (*DbDecCoin) Scan

func (coin *DbDecCoin) Scan(src interface{}) error

Scan implements sql.Scanner

func (DbDecCoin) ToDecCoin

func (coin DbDecCoin) ToDecCoin() sdk.DecCoin

ToDecCoin converts this DbDecCoin to sdk.DecCoin

func (*DbDecCoin) Value

func (coin *DbDecCoin) Value() (driver.Value, error)

Value implements driver.Valuer

type DbDecCoins

type DbDecCoins []*DbDecCoin

DbDecCoins represents an array of coins

func NewDbDecCoins

func NewDbDecCoins(coins sdk.DecCoins) DbDecCoins

NewDbDecCoins build a new DbDecCoins object starting from an array of coins

func (DbDecCoins) Equal

func (coins DbDecCoins) Equal(d *DbDecCoins) bool

Equal tells whether c and d contain the same items in the same order

func (*DbDecCoins) Scan

func (coins *DbDecCoins) Scan(src interface{}) error

Scan implements sql.Scanner

func (DbDecCoins) ToDecCoins

func (coins DbDecCoins) ToDecCoins() sdk.DecCoins

ToDecCoins converts this DbDecCoins to sdk.DecCoins

type DelegatorAccountRow

type DelegatorAccountRow struct {
	AccountAddress  string `db:"account_address"`
	DelegatorId     int64  `db:"delegator_id"`
	DelegatorNodeId string `db:"delegator_node_id"`
}

func NewDelegatorAccountRow

func NewDelegatorAccountRow(
	accountAddress string,
	delegatorId int64,
	delegatorNodeId string) DelegatorAccountRow

DelegatorAccountRow allows to build a new DelegatorAccountRow

func (DelegatorAccountRow) Equal

Equal tells whether v and w represent the same rows

type DelegatorCommittedRow

type DelegatorCommittedRow struct {
	Committed   uint64 `db:"committed"`
	Height      uint64 `db:"height"`
	NodeId      string `db:"node_id"`
	DelegatorID uint32 `db:"delegator_id"`
}

DelegatorCommittedRow represents a single row of the delegator_committed table

func NewDelegatorCommittedRow

func NewDelegatorCommittedRow(
	committed uint64,
	height uint64,
	nodeId string,
	delegatorID uint32) DelegatorCommittedRow

DelegatorCommittedRow allows to build a new DelegatorCommittedRow

func (DelegatorCommittedRow) Equal

Equal tells whether v and w represent the same rows

type DelegatorInfoFromAddressRow

type DelegatorInfoFromAddressRow struct {
	DelegatorInfo string `db:"delegator_info"`
	Height        int64  `db:"height"`
	Address       string `db:"address"`
}

DelegatorInfoFromAddressRow represents a single row of the delegator_info_from_address table

func NewDelegatorInfoFromAddressRow

func NewDelegatorInfoFromAddressRow(
	delegatorInfo string,
	height int64,
	address string) DelegatorInfoFromAddressRow

DelegatorInfoFromAddressRow allows to build a new DelegatorInfoFromAddressRow

func (DelegatorInfoFromAddressRow) Equal

Equal tells whether v and w represent the same rows

type DelegatorInfoRow

type DelegatorInfoRow struct {
	Id                       uint32 `db:"id"`
	NodeId                   string `db:"node_id"`
	TokensCommitted          uint64 `db:"tokens_committed"`
	TokensStaked             uint64 `db:"tokens_staked"`
	TokensUnstaking          uint64 `db:"tokens_unstaking"`
	TokensRewarded           uint64 `db:"tokens_rewarded"`
	TokensUnstaked           uint64 `db:"tokens_unstaked"`
	TokensRequestedToUnstake uint64 `db:"tokens_requested_to_unstake"`
	Height                   uint64 `db:"height"`
}

DelegatorInfoRow represents a single row of the delegator_info table

func NewDelegatorInfoRow

func NewDelegatorInfoRow(
	id uint32,
	nodeId string,
	tokensCommitted uint64,
	tokensStaked uint64,
	tokensUnstaking uint64,
	tokensRewarded uint64,
	tokensUnstaked uint64,
	tokensRequestedToUnstake uint64,
	height uint64) DelegatorInfoRow

DelegatorInfoRow allows to build a new DelegatorInfoRow

func (DelegatorInfoRow) Equal

Equal tells whether v and w represent the same rows

type GenesisRow

type GenesisRow struct {
	OneRowID      bool      `db:"one_row_id"`
	Time          time.Time `db:"time"`
	InitialHeight int64     `db:"initial_height"`
	ChainId       string    `db:"chain_id"`
}

func NewGenesisRow

func NewGenesisRow(time time.Time, initialHeight int64, chainId string) GenesisRow

func (GenesisRow) Equal

func (r GenesisRow) Equal(s GenesisRow) bool

type LockedAccountBalanceRow

type LockedAccountBalanceRow struct {
	LockedAddress string `db:"locked_address"`
	Balance       int    `db:"balance"`
	UnlockLimit   int    `db:"unlock_limit"`
	Height        int    `db:"height"`
}

func NewLockedAccountBalanceRow

func NewLockedAccountBalanceRow(lockedAddress string, balance, unlockLimit, height int) LockedAccountBalanceRow

func (LockedAccountBalanceRow) Equal

type LockedAccountRow

type LockedAccountRow struct {
	Address       string `db:"address"`
	LockedAddress string `db:"locked_address"`
}

LockedAccountRow represents a single row of the locked_account table

func NewLockedAccountRow

func NewLockedAccountRow(
	address string,
	lockedAddress string) LockedAccountRow

LockedAccountRow allows to build a new LockedAccountRow

func (LockedAccountRow) Equal

Equal tells whether v and w represent the same rows

type NodeCommittedTokensRow

type NodeCommittedTokensRow struct {
	NodeId          string `db:"node_id"`
	CommittedTokens uint64 `db:"committed_tokens"`
	Height          int64  `db:"height"`
}

NodeCommittedTokensRow represents a single row of the node_committed_tokens table

func NewNodeCommittedTokensRow

func NewNodeCommittedTokensRow(
	nodeId string,
	committedTokens uint64,
	height int64) NodeCommittedTokensRow

NodeCommittedTokensRow allows to build a new NodeCommittedTokensRow

func (NodeCommittedTokensRow) Equal

Equal tells whether v and w represent the same rows

type NodeInfoFromAddressRow

type NodeInfoFromAddressRow struct {
	Address  string `db:"address"`
	NodeInfo string `db:"node_info"`
	Height   int64  `db:"height"`
}

NodeInfoFromNodeIDsRow represents a single row of the node_info_from_address table

func NewNodeInfoFromAddressRow

func NewNodeInfoFromAddressRow(
	address string,
	nodeInfo string,
	height int64) NodeInfoFromAddressRow

NodeInfoFromNodeIDsRow allows to build a new NodeInfoFromNodeIDsRow

func (NodeInfoFromAddressRow) Equal

Equal tells whether v and w represent the same rows

type NodeInfosFromTableRow

type NodeInfosFromTableRow struct {
	Id                       string        `db:"id"`
	Role                     uint8         `db:"role"`
	NetworkingAddress        string        `db:"networking_address"`
	NetworkingKey            string        `db:"networking_key"`
	StakingKey               string        `db:"staking_key"`
	TokensStaked             uint64        `db:"tokens_staked"`
	TokensCommitted          uint64        `db:"tokens_committed"`
	TokensUnstaking          uint64        `db:"tokens_unstaking"`
	TokensUnstaked           uint64        `db:"tokens_unstaked"`
	TokensRewarded           uint64        `db:"tokens_rewarded"`
	Delegators               pq.Int32Array `db:"delegators"`
	DelegatorIDCounter       uint32        `db:"delegator_i_d_counter"`
	TokensRequestedToUnstake uint64        `db:"tokens_requested_to_unstake"`
	InitialWeight            uint64        `db:"initial_weight"`
	Height                   uint64        `db:"height"`
}

NodeInfosFromTableRow represents a single row of the node_infos_from_table table

func NewNodeInfosFromTableRow

func NewNodeInfosFromTableRow(
	id string,
	role uint8,
	networkingAddress string,
	networkingKey string,
	stakingKey string,
	tokensStaked uint64,
	tokensCommitted uint64,
	tokensUnstaking uint64,
	tokensUnstaked uint64,
	tokensRewarded uint64,
	delegators pq.Int32Array,
	delegatorIDCounter uint32,
	tokensRequestedToUnstake uint64,
	initialWeight uint64,
	height uint64) NodeInfosFromTableRow

func (NodeInfosFromTableRow) Equal

Equal tells whether v and w represent the same rows

type NodeTotalCommitmentRow

type NodeTotalCommitmentRow struct {
	NodeId          string `db:"node_id"`
	TotalCommitment uint64 `db:"total_commitment"`
	Height          int64  `db:"height"`
}

NodeTotalCommitmentRow represents a single row of the node_total_commitment table

func NewNodeTotalCommitmentRow

func NewNodeTotalCommitmentRow(
	nodeId string,
	totalCommitment uint64,
	height int64) NodeTotalCommitmentRow

NodeTotalCommitmentRow allows to build a new NodeTotalCommitmentRow

func (NodeTotalCommitmentRow) Equal

Equal tells whether v and w represent the same rows

type NodeTotalCommitmentWithoutDelegatorsRow

type NodeTotalCommitmentWithoutDelegatorsRow struct {
	NodeId                           string `db:"node_id"`
	TotalCommitmentWithoutDelegators uint64 `db:"total_commitment_without_delegators"`
	Height                           int64  `db:"height"`
}

NodeTotalCommitmentWithoutDelegatorsRow represents a single row of the node_total_commitment_without_delegators table

func NewNodeTotalCommitmentWithoutDelegatorsRow

func NewNodeTotalCommitmentWithoutDelegatorsRow(
	nodeId string,
	totalCommitmentWithoutDelegators uint64,
	height int64) NodeTotalCommitmentWithoutDelegatorsRow

NodeTotalCommitmentWithoutDelegatorsRow allows to build a new NodeTotalCommitmentWithoutDelegatorsRow

func (NodeTotalCommitmentWithoutDelegatorsRow) Equal

Equal tells whether v and w represent the same rows

type ProposedTableRow

type ProposedTableRow struct {
	Height        int64  `db:"height"`
	ProposedTable string `db:"proposed_table"`
}

ProposedTableRow represents a single row of the proposed_table table

func NewProposedTableRow

func NewProposedTableRow(
	height int64,
	proposedTable string) ProposedTableRow

ProposedTableRow allows to build a new ProposedTableRow

func (ProposedTableRow) Equal

Equal tells whether v and w represent the same rows

type StakeRequirementsRow

type StakeRequirementsRow struct {
	Height       int64  `db:"height"`
	Role         int8   `db:"role"`
	Requirements uint64 `db:"requirements"`
}

StakeRequirementsRow represents a single row of the stake_requirements table

func NewStakeRequirementsRow

func NewStakeRequirementsRow(
	height int64,
	role int8,
	requirements uint64) StakeRequirementsRow

StakeRequirementsRow allows to build a new StakeRequirementsRow

func (StakeRequirementsRow) Equal

Equal tells whether v and w represent the same rows

type StakerAccountRow

type StakerAccountRow struct {
	AccountAddress string `db:"account_address"`
	StakerNodeId   string `db:"staker_node_id"`
	StakerNodeInfo string `db:"staker_node_info"`
}

StakerAccountRow represents a single row of the staker_account table

func NewStakerAccountRow

func NewStakerAccountRow(
	accountAddress string,
	stakerNodeId string,
	stakerNodeInfo string) StakerAccountRow

StakerAccountRow allows to build a new StakerAccountRow

func (StakerAccountRow) Equal

Equal tells whether v and w represent the same rows

type StakerNodeIdRow

type StakerNodeIdRow struct {
	Address string `db:"address"`
	NodeId  string `db:"node_id"`
}

StakerNodeIdRow represents a single row of the staker_node_id table

func NewStakerNodeIdRow

func NewStakerNodeIdRow(
	address string,
	nodeId string) StakerNodeIdRow

StakerNodeIdRow allows to build a new StakerNodeIdRow

func (StakerNodeIdRow) Equal

Equal tells whether v and w represent the same rows

type StakingTableRow

type StakingTableRow struct {
	NodeId string `db:"node_id"`
}

StakingTableRow represents a single row of the staking_table table

func NewStakingTableRow

func NewStakingTableRow(
	nodeId string) StakingTableRow

StakingTableRow allows to build a new StakingTableRow

func (StakingTableRow) Equal

Equal tells whether v and w represent the same rows

type SupplyRow

type SupplyRow struct {
	OneRowId bool   `db:"one_row_id"`
	Height   uint64 `db:"height"`
	Supply   uint64 `db:"supply"`
}

SupplyRow represents a single row of the supply table

func NewSupplyRow

func NewSupplyRow(
	height uint64,
	supply uint64) SupplyRow

SupplyRow allows to build a new SupplyRow

func (SupplyRow) Equal

func (v SupplyRow) Equal(w SupplyRow) bool

Equal tells whether v and w represent the same rows

type TokenPriceRow

type TokenPriceRow struct {
	ID        string    `db:"id"`
	Name      string    `db:"unit_name"`
	Price     float64   `db:"price"`
	MarketCap int64     `db:"market_cap"`
	Timestamp time.Time `db:"timestamp"`
}

TokenPriceRow represent a row of the table token_price in the database

func NewTokenPriceRow

func NewTokenPriceRow(name string, currentPrice float64, marketCap int64, timestamp time.Time) TokenPriceRow

NewTokenPriceRow allows to easily create a new NewTokenPriceRow

func (TokenPriceRow) Equals

func (u TokenPriceRow) Equals(v TokenPriceRow) bool

Equals return true if u and v represent the same row

type TokenRow

type TokenRow struct {
	Name       string `db:"name"`
	TradedUnit string `db:"traded_unit"`
}

type TokenUnitRow

type TokenUnitRow struct {
	TokenName string         `db:"token_name"`
	Denom     string         `db:"denom"`
	Exponent  int            `db:"exponent"`
	Aliases   pq.StringArray `db:"aliases"`
	PriceID   sql.NullString `db:"price_id"`
}

type TotalStakeByTypeRow

type TotalStakeByTypeRow struct {
	Height     int64  `db:"height"`
	Role       int8   `db:"role"`
	TotalStake uint64 `db:"total_stake"`
}

TotalStakeRow represents a single row of the total_stake table

func NewTotalStakeByTypeRow

func NewTotalStakeByTypeRow(
	height int64,
	role int8,
	totalStake uint64) TotalStakeByTypeRow

TotalStakeRow allows to build a new TotalStakeRow

func (TotalStakeByTypeRow) Equal

Equal tells whether v and w represent the same rows

type TotalStakeRow

type TotalStakeRow struct {
	Height     int64  `db:"height"`
	TotalStake uint64 `db:"total_stake"`
}

TotalStakeRow represents a single row of the total_stake table

func NewTotalStakeRow

func NewTotalStakeRow(
	height int64,
	totalStake uint64) TotalStakeRow

TotalStakeRow allows to build a new TotalStakeRow

func (TotalStakeRow) Equal

func (v TotalStakeRow) Equal(w TotalStakeRow) bool

Equal tells whether v and w represent the same rows

type WeeklyPayoutRow

type WeeklyPayoutRow struct {
	Height int64  `db:"height"`
	Payout uint64 `db:"payout"`
}

WeeklyPayoutRow represents a single row of the weekly_payout table

func NewWeeklyPayoutRow

func NewWeeklyPayoutRow(
	height int64,
	payout uint64) WeeklyPayoutRow

WeeklyPayoutRow allows to build a new WeeklyPayoutRow

func (WeeklyPayoutRow) Equal

Equal tells whether v and w represent the same rows

Jump to

Keyboard shortcuts

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