table

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AverageTaxRateSubmission

type AverageTaxRateSubmission struct {
	ID              uint64          `gorm:"id"`
	EpochID         uint64          `gorm:"epoch_id"`
	AverageTaxRate  decimal.Decimal `gorm:"average_tax_rate"`
	TransactionHash string          `gorm:"transaction_hash"`
	CreatedAt       time.Time       `gorm:"created_at"`
	UpdatedAt       time.Time       `gorm:"updated_at"`
}

func (*AverageTaxRateSubmission) Export

func (*AverageTaxRateSubmission) Import

func (*AverageTaxRateSubmission) TableName

func (a *AverageTaxRateSubmission) TableName() string

type AverageTaxSubmissions

type AverageTaxSubmissions []AverageTaxRateSubmission

func (*AverageTaxSubmissions) Export

func (*AverageTaxSubmissions) Import

func (a *AverageTaxSubmissions) Import(submissions []*schema.AverageTaxRateSubmission) error

type BridgeEvent

type BridgeEvent struct {
	ID                string    `gorm:"column:id"`
	Type              string    `gorm:"column:type"`
	TransactionHash   string    `gorm:"column:transaction_hash;primaryKey"`
	TransactionIndex  uint      `gorm:"column:transaction_index"`
	TransactionStatus uint64    `gorm:"column:transaction_status"`
	ChainID           uint64    `gorm:"column:chain_id"`
	BlockHash         string    `gorm:"column:block_hash;primaryKey"`
	BlockNumber       uint64    `gorm:"column:block_number"`
	BlockTimestamp    time.Time `gorm:"column:block_timestamp"`
	Finalized         bool      `gorm:"column:finalized"`
}

func (*BridgeEvent) Export

func (b *BridgeEvent) Export() (*schema.BridgeEvent, error)

func (*BridgeEvent) Import

func (b *BridgeEvent) Import(bridgeEvent schema.BridgeEvent) error

func (*BridgeEvent) TableName

func (b *BridgeEvent) TableName() string

type BridgeTransaction

type BridgeTransaction struct {
	ID               string          `gorm:"column:id;primaryKey"`
	Type             string          `gorm:"column:type;primaryKey"`
	Sender           string          `gorm:"column:sender"`
	Receiver         string          `gorm:"column:receiver"`
	TokenAddressL1   *string         `gorm:"column:token_address_l1"`
	TokenAddressL2   *string         `gorm:"column:token_address_l2"`
	TokenValue       decimal.Decimal `gorm:"column:token_value"`
	Data             string          `gorm:"column:data"`
	ChainID          uint64          `gorm:"column:chain_id"`
	BlockTimestamp   time.Time       `gorm:"column:block_timestamp"`
	BlockNumber      uint64          `gorm:"column:block_number"`
	TransactionIndex uint            `gorm:"column:transaction_index"`
	Finalized        bool            `gorm:"column:finalized"`
}

func (*BridgeTransaction) Export

func (*BridgeTransaction) Import

func (b *BridgeTransaction) Import(bridgeTransaction schema.BridgeTransaction) error

func (*BridgeTransaction) TableName

func (b *BridgeTransaction) TableName() string

type Checkpoint

type Checkpoint struct {
	ChainID     uint64    `gorm:"column:chain_id"`
	BlockNumber uint64    `gorm:"column:block_number"`
	BlockHash   string    `gorm:"column:block_hash"`
	CreatedAt   time.Time `gorm:"column:created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at"`
}

func (*Checkpoint) Export

func (c *Checkpoint) Export() (*schema.Checkpoint, error)

func (*Checkpoint) Import

func (c *Checkpoint) Import(checkpoint schema.Checkpoint) error

func (*Checkpoint) TableName

func (c *Checkpoint) TableName() string

type Epoch

type Epoch struct {
	ID                    uint64          `gorm:"column:id;primaryKey"`
	StartTimestamp        time.Time       `gorm:"column:start_timestamp"`
	EndTimestamp          time.Time       `gorm:"column:end_timestamp"`
	TransactionHash       string          `gorm:"column:transaction_hash"`
	TransactionIndex      uint            `gorm:"column:transaction_index"`
	BlockHash             string          `gorm:"column:block_hash"`
	BlockNumber           uint64          `gorm:"column:block_number"`
	BlockTimestamp        time.Time       `gorm:"column:block_timestamp"`
	TotalOperationRewards decimal.Decimal `gorm:"column:total_operation_rewards"`
	TotalStakingRewards   decimal.Decimal `gorm:"column:total_staking_rewards"`
	TotalRewardedNodes    int             `gorm:"column:total_rewarded_nodes"`
	TotalRequestCounts    decimal.Decimal `gorm:"column:total_request_counts"`
	Finalized             bool            `gorm:"column:finalized"`

	CreatedAt time.Time `gorm:"column:created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at"`
}

func (*Epoch) Export

func (e *Epoch) Export(epochItems []*schema.RewardedNode) (*schema.Epoch, error)

func (*Epoch) Import

func (e *Epoch) Import(epoch *schema.Epoch) error

func (*Epoch) TableName

func (e *Epoch) TableName() string

type EpochAPYSnapshot added in v0.4.18

type EpochAPYSnapshot struct {
	EpochID   uint64          `gorm:"column:epoch_id"`
	Date      time.Time       `gorm:"column:date"`
	APY       decimal.Decimal `gorm:"column:apy"`
	CreatedAt time.Time       `gorm:"column:created_at"`
	UpdatedAt time.Time       `gorm:"column:updated_at"`
}

func (*EpochAPYSnapshot) Export added in v0.4.18

func (*EpochAPYSnapshot) Import added in v0.4.18

func (e *EpochAPYSnapshot) Import(epochAPYSnapshot *schema.EpochAPYSnapshot) error

func (*EpochAPYSnapshot) TableName added in v0.4.18

func (e *EpochAPYSnapshot) TableName() string

type EpochAPYSnapshots added in v0.4.18

type EpochAPYSnapshots []EpochAPYSnapshot

func (*EpochAPYSnapshots) Export added in v0.4.18

func (e *EpochAPYSnapshots) Export() ([]*schema.EpochAPYSnapshot, error)

func (*EpochAPYSnapshots) Import added in v0.4.18

func (e *EpochAPYSnapshots) Import(snapshots []*schema.EpochAPYSnapshot) error

type EpochItems

type EpochItems []*NodeRewardRecord

func (*EpochItems) Export

func (e *EpochItems) Export() ([]*schema.RewardedNode, error)

func (*EpochItems) Import

func (e *EpochItems) Import(nodesToReward []*schema.RewardedNode) error

type EpochTrigger

type EpochTrigger struct {
	TransactionHash string          `gorm:"column:transaction_hash"`
	EpochID         uint64          `gorm:"column:epoch_id"`
	Data            json.RawMessage `gorm:"column:data"`
	CreatedAt       time.Time       `gorm:"column:created_at"`
	UpdatedAt       time.Time       `gorm:"column:updated_at"`
}

func (*EpochTrigger) Export

func (e *EpochTrigger) Export() (*schema.EpochTrigger, error)

func (*EpochTrigger) Import

func (e *EpochTrigger) Import(epochTrigger *schema.EpochTrigger) (err error)

func (*EpochTrigger) TableName

func (e *EpochTrigger) TableName() string

type EpochTriggers added in v0.6.0

type EpochTriggers []*EpochTrigger

func (EpochTriggers) Export added in v0.6.0

func (e EpochTriggers) Export() ([]*schema.EpochTrigger, error)

type Epochs

type Epochs []*Epoch

func (*Epochs) Export

func (e *Epochs) Export(epochItems []*schema.RewardedNode) ([]*schema.Epoch, error)

type Node

type Node struct {
	Address                common.Address    `gorm:"column:address;primaryKey"`
	NodeID                 uint64            `gorm:"column:id"`
	Endpoint               string            `gorm:"column:endpoint"`
	HideTaxRate            bool              `gorm:"column:hide_tax_rate"`
	IsPublicGood           bool              `gorm:"column:is_public_good"`
	Stream                 json.RawMessage   `gorm:"column:stream"`
	Config                 json.RawMessage   `gorm:"column:config;type:jsonb"`
	Status                 schema.NodeStatus `gorm:"column:status"`
	LastHeartbeatTimestamp time.Time         `gorm:"column:last_heartbeat_timestamp"`
	Location               json.RawMessage   `gorm:"column:location;type:jsonb"`
	Avatar                 json.RawMessage   `gorm:"column:avatar;type:jsonb"`
	APY                    decimal.Decimal   `gorm:"column:apy"`
	Score                  decimal.Decimal   `gorm:"column:score"`
	Version                string            `gorm:"column:version"`
	Type                   string            `gorm:"column:type"`
	AccessToken            string            `gorm:"column:access_token"`
	CreatedAt              time.Time         `gorm:"column:created_at"`
	UpdatedAt              time.Time         `gorm:"column:updated_at"`
}

func (*Node) Export

func (n *Node) Export() (*schema.Node, error)

func (*Node) Import

func (n *Node) Import(node *schema.Node) (err error)

func (*Node) TableName

func (*Node) TableName() string

type NodeAPYSnapshot added in v0.4.18

type NodeAPYSnapshot struct {
	ID          uint64          `gorm:"column:id"`
	Date        time.Time       `gorm:"column:date"`
	EpochID     uint64          `gorm:"column:epoch_id"`
	NodeAddress common.Address  `gorm:"column:node_address"`
	APY         decimal.Decimal `gorm:"column:apy"`
	CreatedAt   time.Time       `gorm:"column:created_at"`
	UpdatedAt   time.Time       `gorm:"column:updated_at"`
}

func (*NodeAPYSnapshot) Export added in v0.4.18

func (s *NodeAPYSnapshot) Export() (*schema.NodeAPYSnapshot, error)

func (*NodeAPYSnapshot) Import added in v0.4.18

func (s *NodeAPYSnapshot) Import(nodeAPYSnapshot *schema.NodeAPYSnapshot) error

func (*NodeAPYSnapshot) TableName added in v0.4.18

func (s *NodeAPYSnapshot) TableName() string

type NodeAPYSnapshots added in v0.4.18

type NodeAPYSnapshots []NodeAPYSnapshot

func (*NodeAPYSnapshots) Import added in v0.4.18

func (s *NodeAPYSnapshots) Import(snapshots []*schema.NodeAPYSnapshot) error

type NodeEvent

type NodeEvent struct {
	TransactionHash  string               `gorm:"column:transaction_hash"`
	TransactionIndex uint                 `gorm:"column:transaction_index"`
	NodeID           uint64               `gorm:"column:node_id"`
	AddressFrom      common.Address       `gorm:"column:address_from"`
	AddressTo        common.Address       `gorm:"column:address_to"`
	Type             schema.NodeEventType `gorm:"column:type"`
	LogIndex         uint                 `gorm:"column:log_index"`
	ChainID          uint64               `gorm:"column:chain_id"`
	BlockHash        string               `gorm:"column:block_hash"`
	BlockNumber      uint64               `gorm:"column:block_number"`
	BlockTimestamp   time.Time            `gorm:"column:block_timestamp"`
	Metadata         json.RawMessage      `gorm:"column:metadata"`
	Finalized        bool                 `gorm:"column:finalized"`
}

func (*NodeEvent) Export

func (n *NodeEvent) Export() (*schema.NodeEvent, error)

func (*NodeEvent) Import

func (n *NodeEvent) Import(nodeEvent schema.NodeEvent) (err error)

func (*NodeEvent) TableName

func (*NodeEvent) TableName() string

type NodeEvents

type NodeEvents []*NodeEvent

func (NodeEvents) Export

func (n NodeEvents) Export() ([]*schema.NodeEvent, error)

type NodeInvalidResponse added in v0.4.11

type NodeInvalidResponse struct {
	ID               uint64                         `gorm:"id;primaryKey"`
	EpochID          uint64                         `gorm:"column:epoch_id"`
	Type             schema.NodeInvalidResponseType `gorm:"column:type"`
	Request          string                         `gorm:"column:request"`
	VerifierNodes    pq.ByteaArray                  `gorm:"column:verifier_nodes;type:bytea[]"`
	VerifierResponse json.RawMessage                `gorm:"column:verifier_response;type:jsonb"`
	Node             common.Address                 `gorm:"column:node"`
	Response         json.RawMessage                `gorm:"column:response;type:jsonb"`
	CreatedAt        time.Time                      `gorm:"column:created_at"`
	UpdatedAt        time.Time                      `gorm:"column:updated_at"`
}

func (*NodeInvalidResponse) Export added in v0.4.11

func (*NodeInvalidResponse) Import added in v0.4.11

func (n *NodeInvalidResponse) Import(nodeInvalidResponse *schema.NodeInvalidResponse)

func (*NodeInvalidResponse) TableName added in v0.4.11

func (*NodeInvalidResponse) TableName() string

type NodeInvalidResponses added in v0.4.13

type NodeInvalidResponses []NodeInvalidResponse

func (*NodeInvalidResponses) Import added in v0.4.13

func (ns *NodeInvalidResponses) Import(nodeInvalidResponses []*schema.NodeInvalidResponse)

type NodeRewardRecord added in v0.4.13

type NodeRewardRecord struct {
	EpochID          uint64          `gorm:"column:epoch_id;"`
	Index            int             `gorm:"column:index;primaryKey"`
	TransactionHash  string          `gorm:"column:transaction_hash;primaryKey"`
	NodeAddress      string          `gorm:"column:node_address"`
	OperationRewards decimal.Decimal `gorm:"column:operation_rewards"`
	StakingRewards   decimal.Decimal `gorm:"column:staking_rewards"`
	TaxCollected     decimal.Decimal `gorm:"column:tax_collected"`
	RequestCount     decimal.Decimal `gorm:"column:request_count"`
}

NodeRewardRecord stores rewards information for a Node in an Epoch

func (*NodeRewardRecord) Export added in v0.4.13

func (e *NodeRewardRecord) Export() (*schema.RewardedNode, error)

func (*NodeRewardRecord) Import added in v0.4.13

func (e *NodeRewardRecord) Import(nodeToReward *schema.RewardedNode) error

func (*NodeRewardRecord) TableName added in v0.4.13

func (e *NodeRewardRecord) TableName() string

type NodeSnapshot

type NodeSnapshot struct {
	Date  time.Time `gorm:"column:date"`
	Count uint64    `gorm:"column:count"`
}

func (*NodeSnapshot) Export

func (s *NodeSnapshot) Export() (*schema.NodeSnapshot, error)

func (*NodeSnapshot) Import

func (s *NodeSnapshot) Import(stakeSnapshot schema.NodeSnapshot) error

func (*NodeSnapshot) TableName

func (s *NodeSnapshot) TableName() string

type Nodes

type Nodes []Node

func (Nodes) Export

func (n Nodes) Export() ([]*schema.Node, error)

func (*Nodes) Import

func (n *Nodes) Import(nodes []*schema.Node) (err error)

type OperatorProfitSnapshot

type OperatorProfitSnapshot struct {
	ID            uint64          `gorm:"column:id"`
	Date          time.Time       `gorm:"column:date"`
	EpochID       uint64          `gorm:"column:epoch_id"`
	Operator      common.Address  `gorm:"column:operator"`
	OperationPool decimal.Decimal `gorm:"column:operation_pool"`
	CreatedAt     time.Time       `gorm:"column:created_at"`
	UpdatedAt     time.Time       `gorm:"column:updated_at"`
}

FIXME: OperatorProfit -> NodeOperationProfit

func (*OperatorProfitSnapshot) Export

func (*OperatorProfitSnapshot) Import

func (*OperatorProfitSnapshot) TableName

func (s *OperatorProfitSnapshot) TableName() string

type OperatorProfitSnapshots

type OperatorProfitSnapshots []OperatorProfitSnapshot

func (*OperatorProfitSnapshots) Export

func (*OperatorProfitSnapshots) Import

type StakeChip

type StakeChip struct {
	ID             decimal.Decimal `gorm:"column:id"`
	Owner          string          `gorm:"column:owner"`
	Node           string          `gorm:"column:node"`
	Value          decimal.Decimal `gorm:"column:value"`
	Metadata       json.RawMessage `gorm:"column:metadata"`
	BlockNumber    decimal.Decimal `gorm:"column:block_number"`
	BlockTimestamp time.Time       `gorm:"column:block_timestamp"`
	Finalized      bool            `gorm:"column:finalized"`
}

func (*StakeChip) Export

func (s *StakeChip) Export() (*schema.StakeChip, error)

func (*StakeChip) Import

func (s *StakeChip) Import(stakeChip schema.StakeChip) error

func (*StakeChip) TableName

func (s *StakeChip) TableName() string

type StakeEvent

type StakeEvent struct {
	ID                string          `gorm:"column:id"`
	Type              string          `gorm:"column:type"`
	TransactionHash   string          `gorm:"column:transaction_hash;primaryKey"`
	TransactionIndex  uint            `gorm:"column:transaction_index"`
	TransactionStatus uint64          `gorm:"column:transaction_status"`
	LogIndex          uint            `gorm:"column:log_index"`
	Metadata          json.RawMessage `gorm:"column:metadata"`
	BlockHash         string          `gorm:"column:block_hash;primaryKey"`
	BlockNumber       uint64          `gorm:"column:block_number"`
	BlockTimestamp    time.Time       `gorm:"column:block_timestamp"`
	Finalized         bool            `gorm:"column:finalized"`
}

func (*StakeEvent) Export

func (b *StakeEvent) Export() (*schema.StakeEvent, error)

func (*StakeEvent) Import

func (b *StakeEvent) Import(stakeEvent schema.StakeEvent) error

func (*StakeEvent) TableName

func (b *StakeEvent) TableName() string

type StakeStaking added in v0.5.27

type StakeStaking struct {
	Staker string          `gorm:"column:staker"`
	Node   string          `gorm:"column:node"`
	Count  uint32          `gorm:"column:count"`
	Value  decimal.Decimal `gorm:"column:value"`
}

func (*StakeStaking) Export added in v0.5.27

func (s *StakeStaking) Export() (*schema.StakeStaking, error)

func (*StakeStaking) Import added in v0.5.27

func (s *StakeStaking) Import(stakeStaking schema.StakeStaking) error

func (*StakeStaking) TableName added in v0.5.27

func (s *StakeStaking) TableName() string

type StakeTransaction

type StakeTransaction struct {
	ID               string          `gorm:"column:id;primaryKey"`
	Type             string          `gorm:"column:type;primaryKey"`
	User             string          `gorm:"column:user"`
	Node             string          `gorm:"column:node"`
	Value            decimal.Decimal `gorm:"column:value"`
	ChipIDs          pq.Int64Array   `gorm:"column:chips;type:bigint[]"`
	BlockTimestamp   time.Time       `gorm:"column:block_timestamp"`
	BlockNumber      uint64          `gorm:"column:block_number"`
	TransactionIndex uint            `gorm:"column:transaction_index"`
	Finalized        bool            `gorm:"column:finalized"`
}

func (*StakeTransaction) Export

func (*StakeTransaction) Import

func (s *StakeTransaction) Import(stakeTransaction schema.StakeTransaction) error

func (*StakeTransaction) TableName

func (s *StakeTransaction) TableName() string

type StakerCountSnapshot

type StakerCountSnapshot struct {
	Date  time.Time `gorm:"column:date"`
	Count uint64    `gorm:"column:count"`
}

func (*StakerCountSnapshot) Export

func (*StakerCountSnapshot) Import

func (s *StakerCountSnapshot) Import(stakeSnapshot schema.StakerCountSnapshot) error

func (*StakerCountSnapshot) TableName

func (s *StakerCountSnapshot) TableName() string

type StakerProfitSnapshot

type StakerProfitSnapshot struct {
	ID              uint64          `gorm:"column:id"`
	Date            time.Time       `gorm:"column:date"`
	EpochID         uint64          `gorm:"column:epoch_id"`
	OwnerAddress    common.Address  `gorm:"column:owner_address"`
	TotalChipAmount decimal.Decimal `gorm:"column:total_chip_amounts"` // Fixme: total_chip_amounts-> total_chip_amount
	TotalChipValue  decimal.Decimal `gorm:"column:total_chip_values"`  // Fixme: total_chip_values-> total_chip_value
	CreatedAt       time.Time       `gorm:"column:created_at"`
	UpdatedAt       time.Time       `gorm:"column:updated_at"`
}

func (*StakerProfitSnapshot) Export

func (*StakerProfitSnapshot) Import

func (*StakerProfitSnapshot) TableName

func (s *StakerProfitSnapshot) TableName() string

type StakerProfitSnapshots

type StakerProfitSnapshots []StakerProfitSnapshot

func (*StakerProfitSnapshots) Export

func (*StakerProfitSnapshots) Import

func (s *StakerProfitSnapshots) Import(snapshots []*schema.StakerProfitSnapshot) error

type Stat

type Stat struct {
	Address              common.Address `gorm:"column:address;primaryKey"`
	Endpoint             string         `gorm:"column:endpoint"`
	AccessToken          string         `gorm:"column:access_token"`
	Points               float64        `gorm:"column:points"`
	IsPublicGood         bool           `gorm:"column:is_public_good"`
	IsFullNode           bool           `gorm:"column:is_full_node"`
	IsRssNode            bool           `gorm:"column:is_rss_node"`
	Staking              float64        `gorm:"column:staking"`
	Epoch                int64          `gorm:"column:epoch"`
	TotalRequest         int64          `gorm:"column:total_request_count"`
	EpochRequest         int64          `gorm:"column:epoch_request_count"`
	EpochInvalidRequest  int64          `gorm:"column:epoch_invalid_request_count"`
	DecentralizedNetwork int            `gorm:"column:decentralized_network_count"`
	FederatedNetwork     int            `gorm:"column:federated_network_count"`
	Indexer              int            `gorm:"column:indexer_count"`
	ResetAt              time.Time      `gorm:"column:reset_at"`
	CreatedAt            time.Time      `gorm:"column:created_at"`
	UpdatedAt            time.Time      `gorm:"column:updated_at"`
}

func (*Stat) Export

func (s *Stat) Export() (*schema.Stat, error)

func (*Stat) Import

func (s *Stat) Import(stat *schema.Stat) (err error)

func (*Stat) TableName

func (*Stat) TableName() string

type Stats

type Stats []Stat

func (*Stats) Export

func (s *Stats) Export() ([]*schema.Stat, error)

func (*Stats) Import

func (s *Stats) Import(stats []*schema.Stat) (err error)

type Worker added in v0.4.11

type Worker struct {
	EpochID  uint64         `gorm:"column:epoch_id;primaryKey"`
	Address  common.Address `gorm:"column:address;primaryKey"`
	Network  string         `gorm:"column:network;primaryKey"`
	Name     string         `gorm:"column:name;primaryKey"`
	IsActive bool           `gorm:"column:is_active"`
}

func (*Worker) Export added in v0.4.11

func (w *Worker) Export() *schema.Worker

func (*Worker) Import added in v0.4.11

func (w *Worker) Import(worker *schema.Worker)

func (*Worker) TableName added in v0.4.11

func (*Worker) TableName() string

type Workers added in v0.4.11

type Workers []Worker

func (*Workers) Export added in v0.4.11

func (w *Workers) Export() []*schema.Worker

func (*Workers) Import added in v0.4.11

func (w *Workers) Import(workers []*schema.Worker)

Jump to

Keyboard shortcuts

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