schema

package
v0.0.0-...-7c8ce1f Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	ID            int32     `json:"id" sql:",pk"`
	Height        int64     `json:"height" sql:",notnull"`
	Proposer      string    `json:"proposer" sql:",notnull"`
	Moniker       string    `json:"moniker" sql:",notnull"`
	BlockHash     string    `json:"block_hash" sql:",notnull,unique"`
	ParentHash    string    `json:"parent_hash" sql:",notnull"`
	NumPrecommits int64     `json:"num_pre_commits" sql:",notnull"`
	NumTxs        int64     `json:"num_txs" sql:"default:0"`
	Timestamp     time.Time `json:"timestamp" sql:"default:now()"`
}

Block defines the structure for block information.

func NewBlock

func NewBlock(b Block) *Block

NewBlock returns a new Block.

type PreCommit

type PreCommit struct {
	ID               int32     `json:"id" sql:",pk"`
	Height           int64     `json:"height" sql:",notnull"`
	Round            int32     `json:"round" sql:",notnull"`
	ValidatorAddress string    `json:"validator_address" sql:",notnull"`
	VotingPower      int64     `json:"voting_power" sql:",notnull"`
	ProposerPriority int64     `json:"proposer_priority" sql:",notnull"`
	Timestamp        time.Time `json:"timestamp" sql:"default:now()"`
}

PreCommit defines the schema for precommit state information.

func NewPrecommit

func NewPrecommit(p PreCommit) *PreCommit

NewPrecommit returns a new PreCommit.

type StatAssetInfoList1H

type StatAssetInfoList1H struct {
	ID           int32     `json:"id" sql:",pk"`
	Name         string    `json:"name" sql:",notnull"`
	Asset        string    `json:"asset" sql:",notnull"`
	MappedAsset  string    `json:"mapped_asset" sql:",notnull"`
	Price        float64   `json:"price"`
	QuoteUnit    string    `json:"quote_unit"`
	Supply       float64   `json:"supply" sql:",notnull"`
	Marketcap    float64   `json:"marketcap" sql:",notnull"`
	Owner        string    `json:"owner" sql:",notnull"`
	Transactions int       `json:"transactions" sql:",notnull"`
	Holders      int       `json:"holders" sql:",notnull"`
	AssetImage   string    `json:"asset_img"`
	Timestamp    time.Time `json:"timestamp" sql:"default:now()"`
}

StatAssetInfoList1H defines the schema for asset statistics in an hourly basis

type StatAssetInfoList24H

type StatAssetInfoList24H struct {
	ID           int32     `json:"id" sql:",pk"`
	Asset        string    `json:"asset" sql:",notnull"`
	MappedAsset  string    `json:"mapped_asset" sql:",notnull"`
	Name         string    `json:"name" sql:",notnull"`
	Price        float64   `json:"price"`
	QuoteUnit    string    `json:"quote_unit"`
	Supply       float64   `json:"supply" sql:",notnull"`
	Marketcap    float64   `json:"marketcap" sql:",notnull"`
	Owner        string    `json:"owner" sql:",notnull"`
	Transactions int       `json:"transactions" sql:",notnull"`
	Holders      int       `json:"holders" sql:",notnull"`
	AssetImage   string    `json:"asset_img"`
	Timestamp    time.Time `json:"timestamp" sql:"default:now()"`
}

StatAssetInfoList24H defines the schema for asset statistics in 24 hourly basis

type Transaction

type Transaction struct {
	ID               int32     `json:"id" sql:",pk"`
	TxType           string    `json:"tx_type" sql:",notnull"`
	Height           int64     `json:"height" sql:",notnull"`
	TxHash           string    `json:"tx_hash" sql:",notnull,unique"`
	Code             uint32    `json:"code"  sql:",notnull"`
	Messages         string    `json:"messages" sql:"type:jsonb, notnull, default: '[]'::jsonb"`
	Signatures       string    `json:"signatures" sql:"type:jsonb, notnull, default: '[]'::jsonb"`
	Log              string    `json:"log" sql:"type:jsonb, notnull, default: '[]'::jsonb"`
	Info             string    `json:"info"`
	Memo             string    `json:"memo"`
	Events           string    `json:"events" sql:"type:jsonb, notnull, default: '[]'::jsonb"`
	EVMTxData        string    `json:"evm_tx_data" sql:"type:jsonb, notnull, default: '[]'::jsonb"`
	EVMTxFrom        string    `json:"evm_tx_from"`
	EVMTxFromAccAddr string    `json:"evm_tx_from_acc"`
	GasWanted        int64     `json:"gas_wanted" sql:"default:0"`
	GasUsed          int64     `json:"gas_used" sql:"default:0"`
	Timestamp        time.Time `json:"timestamp" sql:"default:now()"`
}

Transaction defines the structure for transaction information.

func NewTransaction

func NewTransaction(t Transaction) *Transaction

NewTransaction returns a new Transaction.

type Validator

type Validator struct {
	ID                      int32     `json:"id" sql:",pk"`
	Moniker                 string    `json:"moniker"`
	OperatorAddress         string    `json:"operator_address" sql:",notnull, unique"`
	ConsensusAddress        string    `json:"consensus_address" sql:",notnull, unique"`
	Jailed                  bool      `json:"jailed"`
	Status                  string    `json:"status"`
	Tokens                  string    `json:"tokens"`
	VotingPower             int64     `json:"voting_power"`
	DelegatorShares         string    `json:"delegator_shares"`
	UnbondingHeight         int64     `json:"unbonding_height" sql:"default:0"`
	UnbondingTime           time.Time `json:"unbonding_time"`
	CommissionRate          string    `json:"commission_rate"`
	CommissionMaxRate       string    `json:"commission_max_rate"`
	CommissionMaxChangeRate string    `json:"commission_max_change_rate"`
	CommissionUpdateTime    time.Time `json:"commission_update_time"`
	Timestamp               time.Time `json:"timestamp" sql:"default:now()"`
}

Validator defines the structure for validator information.

func NewValidator

func NewValidator(v Validator) *Validator

NewValidator returns a new Validator.

Jump to

Keyboard shortcuts

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