models

package
v0.0.0-...-71505b4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountID          null.String           `gorm:"primary_key;AUTO_INCREMENT" json:"account_id"`
	BlockID            null.String           `json:"block_id"`
	Block              *Block                `json:"block"` // This line is infered from column name "block_id".
	Manager            null.String           `json:"manager"`
	Spendable          null.Bool             `json:"spendable"`
	DelegateSetable    null.Bool             `json:"delegate_setable"`
	DelegateValue      string                `json:"delegate_value"`
	Counter            null.Int              `json:"counter"`
	Script             string                `json:"script"`
	Storage            string                `json:"storage"`
	Balance            null.Int              `json:"balance"`
	BlockLevel         null.Int              `json:"block_level" sql:"DEFAULT:'-1'::integer"`
	AccountsCheckpoint []*AccountsCheckpoint `json:"accounts_checkpoint"` // This line is infered from other tables.
	DelegatedContracts []*DelegatedContract  `json:"delegated_contracts"` // This line is infered from other tables.
	BakerInfo          *BakerInfo            `json:"baker_info"`
	IsBaker            bool                  `json:"is_baker"`
}

type AccountFilter

type AccountFilter struct {
	Type     AccountType
	Delegate string
	After    string
}

type AccountType

type AccountType int
const (
	AccountTypeBoth AccountType = iota
	AccountTypeAccount
	AccountTypeContract
)

type AccountsCheckpoint

type AccountsCheckpoint struct {
	AccountID  string    `json:"account_id"`
	Account    *Account  `json:"account"` // This line is infered from column name "account_id".
	BlockID    string    `json:"block_id"`
	Block      *Block    `json:"block"` // This line is infered from column name "block_id".
	BlockLevel uint      `json:"block_level" sql:"DEFAULT:'-1'::integer"`
	AsOf       time.Time `json:"asof" gorm:"column:asof"`
	IsBaker    bool      `json:"is_baker"`
}

type Baker

type Baker struct {
	AccountID      string `json:"pkh"`
	StakingBalance int64  `json:"staking_balance"`
	Blocks         int64  `json:"blocks"`
	Endorsements   int64  `json:"endorsements"`
	Fees           int64  `json:"fees"`
}

type BakerInfo

type BakerInfo struct {
	Delegate
	BakingDeposits      int64
	EndorsementDeposits int64
	BakingRewards       int64
	EndorsementRewards  int64
}

type BakingRight

type BakingRight struct {
	BlockHash     string    `json:"block_hash"`
	Level         int64     `json:"level"`
	Delegate      string    `json:"delegate"`
	Priority      int       `json:"priority"`
	EstimatedTime time.Time `json:"estimated_time"`
}

type BakingRightFilter

type BakingRightFilter struct {
	BlockFilter
	Delegates    []string
	PriorityFrom int
	PriorityTo   int
}

type BalanceUpdate

type BalanceUpdate struct {
	ID                 uint    `gorm:"primary_key;AUTO_INCREMENT" json:"id"`
	Source             string  `json:"source"`
	SourceID           uint    `json:"source_id"`
	SourceHash         string  `json:"source_hash"`
	Kind               string  `json:"kind"`
	Contract           string  `json:"contract"`
	Change             float64 `json:"change"`
	Level              float64 `json:"level"`
	Delegate           string  `json:"delegate"`
	Category           string  `json:"category"`
	OperationGroupHash string  `json:"operation_group_hash" gorm:"column:operation_group_hash"`
}

type Ballot

type Ballot struct {
	Pkh        string `json:"pkh"`
	Ballot     string `json:"ballot"`
	BlockID    string `json:"block_id"`
	Block      *Block `json:"block"` // This line is infered from column name "block_id".
	BlockLevel uint   `json:"block_level"`
}

type Block

type Block struct {
	Level                    null.Int               `json:"level"`
	Proto                    null.Int               `json:"proto"`
	Predecessor              null.String            `json:"predecessor"`
	Timestamp                time.Time              `json:"timestamp"`
	ValidationPass           null.Int               `json:"validation_pass"`
	Fitness                  null.String            `json:"fitness"`
	Context                  string                 `json:"context"`
	Signature                string                 `json:"signature"`
	Protocol                 null.String            `json:"protocol"`
	ChainID                  string                 `json:"chain_id"`
	Hash                     null.String            `json:"hash"`
	OperationsHash           string                 `json:"operations_hash"`
	PeriodKind               string                 `json:"period_kind"`
	CurrentExpectedQuorum    int64                  `json:"current_expected_quorum"`
	ActiveProposal           string                 `json:"active_proposal"`
	Baker                    string                 `json:"baker"`
	NonceHash                string                 `json:"nonce_hash"`
	ConsumedGas              int64                  `json:"consumed_gas"`
	MetaLevel                int64                  `json:"meta_level"`
	MetaLevelPosition        int64                  `json:"meta_level_position"`
	MetaCycle                int64                  `json:"meta_cycle"`
	MetaCyclePosition        int64                  `json:"meta_cycle_position"`
	MetaVotingPeriod         int64                  `json:"meta_voting_period"`
	MetaVotingPeriodPosition int64                  `json:"meta_voting_period_position"`
	ExpectedCommitment       bool                   `json:"expected_commitment"`
	Priority                 int64                  `json:"priority" gorm:"column:priority"`
	BlockAggregation         *BlockAggregationView  `json:"-"`
	Delegates                []*Delegate            `json:"delegates"`            // This line is infered from other tables.
	Proposals                []*Proposal            `json:"proposals"`            // This line is infered from other tables.
	Rolls                    []*Roll                `json:"rolls"`                // This line is infered from other tables.
	Ballots                  []*Ballot              `json:"ballots"`              // This line is infered from other tables.
	AccountsCheckpoint       []*AccountsCheckpoint  `json:"accounts_checkpoint"`  // This line is infered from other tables.
	OperationGroups          []*OperationGroup      `json:"operation_groups"`     // This line is infered from other tables.
	DelegatesCheckpoint      []*DelegatesCheckpoint `json:"delegates_checkpoint"` // This line is infered from other tables.
	Accounts                 []*Account             `json:"accounts"`             // This line is infered from other tables.
	BakingRights             []FutureBakingRight    `json:"baking_rights,omitempty"`
}

type BlockAggregationView

type BlockAggregationView struct {
	Level                int64 `json:"level"`
	Volume               int64 `json:"volume"`
	Fees                 int64 `json:"fees"`
	Endorsements         int64 `json:"endorsements"`
	Proposals            int64 `json:"proposals"`
	SeedNonceRevelations int64 `json:"seed_nonce_revelations"`
	Delegations          int64 `json:"delegations"`
	Transactions         int64 `json:"transactions"`
	ActivateAccounts     int64 `json:"activate_accounts"`
	Ballots              int64 `json:"ballots"`
	Originations         int64 `json:"originations"`
	Reveals              int64 `json:"reveals"`
	DoubleBakingEvidence int64 `json:"double_baking_evidences"`
}

func (*BlockAggregationView) TableName

func (*BlockAggregationView) TableName() string

type BlockFilter

type BlockFilter struct {
	BlockLevels []int64
	BlockHashes []string
}

type Delegate

type Delegate struct {
	Pkh              string `gorm:"primary_key;AUTO_INCREMENT" json:"pkh"`
	BlockID          string `json:"block_id"`
	Block            *Block `json:"block"` // This line is infered from column name "block_id".
	Balance          int64  `json:"balance"`
	FrozenBalance    int64  `json:"frozen_balance"`
	StakingBalance   int64  `json:"staking_balance"`
	DelegatedBalance int64  `json:"delegated_balance"`
	Deactivated      bool   `json:"deactivated"`
	GracePeriod      uint   `json:"grace_period"`
	BlockLevel       uint   `json:"block_level" sql:"DEFAULT:'-1'::integer"`
}

type DelegatedContract

type DelegatedContract struct {
	AccountID     string   `json:"account_id"`
	Account       *Account `json:"account"` // This line is infered from column name "account_id".
	DelegateValue string   `json:"delegate_value"`
}

type DelegatesCheckpoint

type DelegatesCheckpoint struct {
	DelegatePkh string `json:"delegate_pkh"`
	BlockID     string `json:"block_id"`
	Block       *Block `json:"block"` // This line is infered from column name "block_id".
	BlockLevel  uint   `json:"block_level" sql:"DEFAULT:'-1'::integer"`
}

type DoubleBakingEvidence

type DoubleBakingEvidence struct {
	OperationID    int64     `json:"operation_id" gorm:"column:operation_id"`
	Operation      Operation `gorm:"save_associations:false;association_foreignkey:OperationID;foreignkey:OperationID"`
	BlockHash      string    `json:"block_hash" gorm:"column:dbe_block_hash"`
	BlockLevel     int64     `json:"block_level" gorm:"column:dbe_block_level"`
	DenouncedLevel int64     `json:"denounced_level" gorm:"column:dbe_denounced_level"`
	Offender       string    `json:"offender" gorm:"column:dbe_offender"`
	Priority       int       `json:"priority" gorm:"column:dbe_priority"`
	EvidenceBaker  string    `json:"evidence_baker" gorm:"column:dbe_evidence_baker"`
	BakerReward    int64     `json:"baker_reward" gorm:"column:dbe_baker_reward"`
	LostDeposits   int64     `json:"lost_deposits" gorm:"column:dbe_lost_deposits"`
	LostRewards    int64     `json:"lost_rewards" gorm:"column:dbe_lost_rewards"`
	LostFees       int64     `json:"lost_fees" gorm:"column:dbe_lost_fees"`
}

type DoubleBakingEvidenceQueryOptions

type DoubleBakingEvidenceQueryOptions struct {
	BlockIDs        []string
	OperationHashes []string
	LoadOperation   bool
	Limit           uint
	Offset          uint
}

type EndorsingRight

type EndorsingRight struct {
	BlockHash     string    `json:"block_hash"`
	Level         int64     `json:"level"`
	Delegate      string    `json:"delegate"`
	Slot          int       `json:"slot"`
	EstimatedTime time.Time `json:"estimated_time"`
}

type Fee

type Fee struct {
	Low       uint      `json:"low"`
	Medium    uint      `json:"medium"`
	High      uint      `json:"high"`
	Timestamp time.Time `json:"timestamp"`
	Kind      string    `json:"kind"`
	Level     int64     `json:"level"`
	Cycle     int64     `json:"cycle"`
}

type FutureBakingRight

type FutureBakingRight struct {
	Level         int64     `json:"level"`
	Delegate      string    `json:"delegate"`
	Priority      int       `json:"priority"`
	EstimatedTime time.Time `json:"estimated_time"`
}

type FutureBlockBakingRight

type FutureBlockBakingRight struct {
	Level  int64               `json:"level"`
	Rights []FutureBakingRight `json:"rights"`
}

type MarketInfo

type MarketInfo interface {
	GetPrice() float64
	GetPriceChange() float64
	GetMarketCap() float64
	GetVolume() float64
	GetSupply() float64
}

MarketInfo is the interface getting prices and price changes.

type Network

type Network string
const (
	NetworkMain    Network = "main"
	NetworkBabylon Network = "babylon"
)

type Operation

type Operation struct {
	OperationID         null.Int    `gorm:"primary_key;AUTO_INCREMENT" json:"operation_id"`
	OperationGroupHash  null.String `json:"operation_group_hash"`
	Kind                null.String `json:"kind"`
	Level               int64       `json:"level"`
	Delegate            string      `json:"delegate"`
	Slots               string      `json:"slots"`
	Nonce               string      `json:"nonce"`
	Pkh                 string      `json:"pkh"`
	Secret              string      `json:"secret"`
	Source              string      `json:"source"`
	Fee                 int64       `json:"fee"`
	Counter             int64       `json:"counter"`
	GasLimit            int64       `json:"gas_limit"`
	StorageLimit        int64       `json:"storage_limit"`
	PublicKey           string      `json:"public_key"`
	Amount              int64       `json:"amount"`
	Destination         string      `json:"destination"`
	Parameters          string      `json:"parameters"`
	ManagerPubkey       string      `json:"manager_pubkey"`
	Balance             int64       `json:"balance"`
	Spendable           bool        `json:"spendable"`
	Delegatable         bool        `json:"delegatable"`
	Script              string      `json:"script"`
	Storage             string      `json:"storage"`
	Status              string      `json:"status"`
	ConsumedGas         int64       `json:"consumed_gas"`
	StorageSize         int64       `json:"storage_size"`
	PaidStorageSizeDiff int64       `json:"paid_storage_size_diff"`
	OriginatedContracts string      `json:"originated_contracts"`
	BlockHash           null.String `json:"block_hash"`
	BlockLevel          null.Int    `json:"block_level"`
	Timestamp           time.Time   `json:"timestamp"`
	Branch              string      `json:"branch" gorm:"column:branch"`
	NumberOfSlots       int64       `json:"number_of_slots" gorm:"column:number_of_slots"`
	Cycle               int64       `json:"cycle" gorm:"column:cycle"`
	Proposal            string      `json:"proposal" gorm:"column:proposal"`
	Ballot              string      `json:"ballot" gorm:"column:ballot"`
	Internal            bool        `json:"internal" gorm:"column:internal"`
	Period              int64       `json:"period" gorm:"column:period"`
}

type OperationCounter

type OperationCounter struct {
	ID              int64     `gorm:"column:cnt_id;primary_key;AUTO_INCREMENT"`
	LastOperationID int64     `gorm:"column:cnt_last_op_id"`
	OperationType   string    `gorm:"column:cnt_operation_type"`
	Count           int64     `gorm:"column:cnt_count"`
	CreatedAt       time.Time `gorm:"column:cnt_created_at"`
}

type OperationGroup

type OperationGroup struct {
	Protocol   null.String `json:"protocol"`
	ChainID    string      `json:"chain_id"`
	Hash       null.String `gorm:"primary_key;AUTO_INCREMENT" json:"hash"`
	Branch     null.String `json:"branch"`
	Signature  string      `json:"signature"`
	BlockID    null.String `json:"block_id"`
	Block      *Block      `json:"block"` // This line is infered from column name "block_id".
	BlockLevel int64       `json:"block_level" gorm:"column:block_level"`
}

type Proposal

type Proposal struct {
	ProtocolHash string `json:"protocol_hash"`
	BlockID      string `json:"block_id"`
	Block        *Block `json:"block"` // This line is infered from column name "block_id".
	BlockLevel   uint   `json:"block_level"`
	Supporters   uint   `json:"supporters"`
}

type Roll

type Roll struct {
	Pkh        string `json:"pkh"`
	Rolls      int64  `json:"rolls"`
	BlockID    string `json:"block_id"`
	Block      *Block `json:"block"` // This line is infered from column name "block_id".
	BlockLevel int64  `json:"block_level"`
}

type Snapshot

type Snapshot struct {
	Cycle      int64 `gorm:"column:snp_cycle" json:"cycle"`
	BlockLevel int64 `gorm:"column:snp_block_level" json:"block_level"`
	Block      Block `gorm:"column:snp_block_level save_associations:false" json:"block"`
	Rolls      int64 `gorm:"column:snp_rolls" json:"rolls"`
}

Jump to

Keyboard shortcuts

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