schema

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeInvalidResponseTypeStrings added in v0.4.11

func NodeInvalidResponseTypeStrings() []string

NodeInvalidResponseTypeStrings returns a slice of all String values of the enum

func NodeStatusStrings

func NodeStatusStrings() []string

NodeStatusStrings returns a slice of all String values of the enum

Types

type AverageTaxRateSubmission

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

type AverageTaxRateSubmissionQuery

type AverageTaxRateSubmissionQuery struct {
	EpochID *uint64 `json:"epoch_id"`
	Limit   *int    `json:"limit"`
}

type BatchUpdateNode

type BatchUpdateNode struct {
	Address          common.Address
	Apy              decimal.Decimal
	MinTokensToStake decimal.Decimal
}

type BridgeEvent

type BridgeEvent struct {
	ID                common.Hash     `json:"id"`
	Type              BridgeEventType `json:"type"`
	TransactionHash   common.Hash     `json:"transactionHash"`
	TransactionIndex  uint            `json:"transactionIndex"`
	TransactionStatus uint64          `json:"transactionStatus"`
	ChainID           uint64          `json:"chainID"`
	BlockHash         common.Hash     `json:"blockHash"`
	BlockNumber       *big.Int        `json:"blockNumber"`
	BlockTimestamp    time.Time       `json:"blockTimestamp"`
}

func NewBridgeEvent

func NewBridgeEvent(id common.Hash, eventType BridgeEventType, chainID uint64, header *types.Header, transaction *types.Transaction, receipt *types.Receipt) *BridgeEvent

type BridgeEventExporter

type BridgeEventExporter interface {
	Export() (*BridgeEvent, error)
}

type BridgeEventImporter

type BridgeEventImporter interface {
	Import(bridgeEvent BridgeEvent) error
}

type BridgeEventTransformer

type BridgeEventTransformer interface {
	BridgeEventImporter
	BridgeEventExporter
}

type BridgeEventType

type BridgeEventType string
const (
	BridgeEventTypeDepositInitialized BridgeEventType = "initialized"
	BridgeEventTypeDepositFinalized   BridgeEventType = "finalized"

	BridgeEventTypeWithdrawalInitialized BridgeEventType = "initialized"
	BridgeEventTypeWithdrawalProved      BridgeEventType = "proved"
	BridgeEventTypeWithdrawalFinalized   BridgeEventType = "finalized"
)

type BridgeEventsQuery

type BridgeEventsQuery struct {
	IDs []common.Hash `query:"ids"`
}

type BridgeTransaction

type BridgeTransaction struct {
	ID               common.Hash           `json:"id"`
	Type             BridgeTransactionType `json:"type"`
	Sender           common.Address        `json:"sender"`
	Receiver         common.Address        `json:"receiver"`
	TokenAddressL1   *common.Address       `json:"tokenAddressL1"`
	TokenAddressL2   *common.Address       `json:"tokenAddressL2"`
	TokenValue       *big.Int              `json:"tokenValue"`
	Data             string                `json:"data"`
	ChainID          uint64                `json:"chainID"`
	BlockTimestamp   time.Time             `json:"blockTimestamp"`
	BlockNumber      uint64                `json:"blockNumber"`
	TransactionIndex uint                  `json:"transactionIndex"`
}

type BridgeTransactionExporter

type BridgeTransactionExporter interface {
	Export() (*BridgeTransaction, error)
}

type BridgeTransactionImporter

type BridgeTransactionImporter interface {
	Import(bridgeTransaction BridgeTransaction) error
}

type BridgeTransactionQuery

type BridgeTransactionQuery struct {
	ID       *common.Hash           `query:"id"`
	Sender   *common.Address        `query:"sender"`
	Receiver *common.Address        `query:"receiver"`
	Address  *common.Address        `query:"address"`
	Type     *BridgeTransactionType `query:"type"`
}

type BridgeTransactionTransformer

type BridgeTransactionTransformer interface {
	BridgeTransactionImporter
	BridgeTransactionExporter
}

type BridgeTransactionType

type BridgeTransactionType string
const (
	BridgeTransactionTypeDeposit  BridgeTransactionType = "deposit"
	BridgeTransactionTypeWithdraw BridgeTransactionType = "withdraw"
)

type BridgeTransactionsQuery

type BridgeTransactionsQuery struct {
	Cursor   *common.Hash           `query:"cursor"`
	ID       *common.Hash           `query:"id"`
	Sender   *common.Address        `query:"sender"`
	Receiver *common.Address        `query:"receiver"`
	Address  *common.Address        `query:"address"`
	Type     *BridgeTransactionType `query:"type"`
}

type Checkpoint

type Checkpoint struct {
	ChainID     uint64      `json:"network"`
	BlockNumber uint64      `json:"block_number"`
	BlockHash   common.Hash `json:"block_hash"`
}

type CheckpointExporter

type CheckpointExporter interface {
	Export() (*Checkpoint, error)
}

type CheckpointImporter

type CheckpointImporter interface {
	Import(checkpoint Checkpoint) error
}

type CheckpointTransformer

type CheckpointTransformer interface {
	CheckpointImporter
	CheckpointExporter
}

type Epoch

type Epoch struct {
	ID uint64 `json:"id"`
	// StartTimestamp when an Epoch begins.
	StartTimestamp int64 `json:"startTimestamp"`
	// EndTimestamp when an Epoch ends.
	EndTimestamp     int64       `json:"endTimestamp"`
	TransactionHash  common.Hash `json:"transactionHash"`
	TransactionIndex uint        `json:"transactionIndex"`
	BlockHash        common.Hash `json:"blockHash"`
	BlockNumber      *big.Int    `json:"blockNumber"`
	BlockTimestamp   int64       `json:"blockTimestamp"`
	// total Operation Rewards distributed.
	TotalOperationRewards decimal.Decimal `json:"totalOperationRewards"`
	// total Staking Rewards distributed.
	TotalStakingRewards decimal.Decimal `json:"totalStakingRewards"`
	// the number of Nodes that received rewards.
	TotalRewardedNodes int `json:"totalRewardedNodes"`
	// the list of Nodes that received rewards and the amount they received.
	RewardedNodes []*RewardedNode `json:"rewardedNodes,omitempty"`
	// the total number of DSL requests made during the Epoch.
	TotalRequestCounts decimal.Decimal `json:"totalRequestCounts"`
	CreatedAt          int64           `json:"-"`
	UpdatedAt          int64           `json:"-"`
}

Epoch records an Epoch and its proof of rewards distribution

type EpochTrigger

type EpochTrigger struct {
	TransactionHash common.Hash    `json:"transactionHash"`
	EpochID         uint64         `json:"epochID"`
	Data            SettlementData `json:"data"`
	CreatedAt       time.Time      `json:"createdAt"`
	UpdatedAt       time.Time      `json:"updatedAt"`
}

type FindNodesQuery

type FindNodesQuery struct {
	NodeAddresses []common.Address
	Status        *NodeStatus
	Cursor        *string
	Limit         *int
	OrderByScore  bool
}

type Node

type Node struct {
	ID                     *big.Int               `json:"id"`
	Address                common.Address         `json:"address"`
	Name                   string                 `json:"name"`
	Description            string                 `json:"description"`
	TaxRateBasisPoints     *uint64                `json:"taxRateBasisPoints"`
	HideTaxRate            bool                   `json:"-"`
	IsPublicGood           bool                   `json:"isPublicGood"`
	OperationPoolTokens    string                 `json:"operationPoolTokens"`
	StakingPoolTokens      string                 `json:"stakingPoolTokens"`
	TotalShares            string                 `json:"totalShares"`
	SlashedTokens          string                 `json:"slashedTokens"`
	Alpha                  bool                   `json:"alpha"`
	Endpoint               string                 `json:"-"`
	Stream                 json.RawMessage        `json:"-"`
	Config                 json.RawMessage        `json:"-"`
	Status                 NodeStatus             `json:"status"`
	LastHeartbeatTimestamp int64                  `json:"lastHeartbeat"`
	Location               []*NodeLocation        `json:"location"`
	Avatar                 *l2.ChipsTokenMetadata `json:"avatar"`
	MinTokensToStake       decimal.Decimal        `json:"minTokensToStake"`
	APY                    decimal.Decimal        `json:"apy"`
	ActiveScore            decimal.Decimal        `json:"activeScore"`
	ReliabilityScore       decimal.Decimal        `json:"reliabilityScore"`
	Type                   string                 `json:"type"`
	CreatedAt              int64                  `json:"createdAt"`
}

type NodeCreatedMetadata

type NodeCreatedMetadata struct {
	NodeID             *big.Int       `json:"nodeID"`
	Address            common.Address `json:"address"`
	Name               string         `json:"name"`
	Description        string         `json:"description"`
	TaxRateBasisPoints uint64         `json:"taxRateBasisPoints"`
	PublicGood         bool           `json:"publicGood"`
}

type NodeEvent

type NodeEvent struct {
	TransactionHash  common.Hash       `json:"transactionHash"`
	TransactionIndex uint              `json:"transactionIndex"`
	NodeID           *big.Int          `json:"nodeID"`
	AddressFrom      common.Address    `json:"addressFrom"`
	AddressTo        common.Address    `json:"addressTo"`
	Type             NodeEventType     `json:"type"`
	LogIndex         uint              `json:"logIndex"`
	ChainID          uint64            `json:"chainID"`
	BlockHash        common.Hash       `json:"blockHash"`
	BlockNumber      *big.Int          `json:"blockNumber"`
	BlockTimestamp   int64             `json:"blockTimestamp"`
	Metadata         NodeEventMetadata `json:"metadata"`
}

type NodeEventMetadata

type NodeEventMetadata struct {
	NodeCreatedMetadata *NodeCreatedMetadata `json:"nodeCreated"`
}

type NodeEventType

type NodeEventType string
const (
	NodeEventNodeCreated NodeEventType = "nodeCreated"
)

type NodeInvalidResponse added in v0.4.11

type NodeInvalidResponse struct {
	ID               uint64                  `json:"id"`
	EpochID          uint64                  `json:"epochID"`
	Type             NodeInvalidResponseType `json:"type"`
	Request          string                  `json:"request"`
	VerifierNodes    []common.Address        `json:"verifierNodes"`
	VerifierResponse json.RawMessage         `json:"verifierResponse"`
	Node             common.Address          `json:"node"`
	Response         json.RawMessage         `json:"response"`
	CreatedAt        int64                   `json:"createdAt"`
}

NodeInvalidResponse records an alleged invalid response of a Node A group of Nodes are selected as verifiers to verify the response returned by a Node The response (with all responses from all verifiers) is saved in the database pending challenge by the penalized Node

type NodeInvalidResponseType added in v0.4.11

type NodeInvalidResponseType int64
const (
	// NodeInvalidResponseTypeInconsistent when the Node's response differs from the majority of verifiers
	NodeInvalidResponseTypeInconsistent NodeInvalidResponseType = iota // inconsistent
	// NodeInvalidResponseTypeError when the Node returns an error
	NodeInvalidResponseTypeError // error
)

func NodeInvalidResponseTypeString added in v0.4.11

func NodeInvalidResponseTypeString(s string) (NodeInvalidResponseType, error)

NodeInvalidResponseTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func NodeInvalidResponseTypeValues added in v0.4.11

func NodeInvalidResponseTypeValues() []NodeInvalidResponseType

NodeInvalidResponseTypeValues returns all values of the enum

func (NodeInvalidResponseType) IsANodeInvalidResponseType added in v0.4.11

func (i NodeInvalidResponseType) IsANodeInvalidResponseType() bool

IsANodeInvalidResponseType returns "true" if the value is listed in the enum definition. "false" otherwise

func (NodeInvalidResponseType) MarshalJSON added in v0.4.11

func (i NodeInvalidResponseType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for NodeInvalidResponseType

func (NodeInvalidResponseType) MarshalYAML added in v0.4.11

func (i NodeInvalidResponseType) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for NodeInvalidResponseType

func (*NodeInvalidResponseType) Scan added in v0.4.11

func (i *NodeInvalidResponseType) Scan(value interface{}) error

func (NodeInvalidResponseType) String added in v0.4.11

func (i NodeInvalidResponseType) String() string

func (*NodeInvalidResponseType) UnmarshalJSON added in v0.4.11

func (i *NodeInvalidResponseType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for NodeInvalidResponseType

func (*NodeInvalidResponseType) UnmarshalYAML added in v0.4.11

func (i *NodeInvalidResponseType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for NodeInvalidResponseType

func (NodeInvalidResponseType) Value added in v0.4.11

func (NodeInvalidResponseType) Values added in v0.4.11

func (NodeInvalidResponseType) Values() []string

type NodeLocation added in v0.4.4

type NodeLocation struct {
	Country   string  `json:"country"`
	Region    string  `json:"region"`
	City      string  `json:"city"`
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type NodeMinTokensToStakeSnapshot

type NodeMinTokensToStakeSnapshot struct {
	Date             time.Time       `json:"date"`
	EpochID          uint64          `json:"epochID"`
	NodeAddress      common.Address  `json:"nodeAddress"`
	MinTokensToStake decimal.Decimal `json:"minTokensToStake"`
	ID               uint64          `json:"-"`
	CreatedAt        time.Time       `json:"-"`
	UpdatedAt        time.Time       `json:"-"`
}

type NodeSnapshot

type NodeSnapshot struct {
	Date  time.Time `json:"date"`
	Count int64     `json:"count"`
}

type NodeSnapshotExporter

type NodeSnapshotExporter interface {
	Export() (*NodeSnapshot, error)
}

type NodeSnapshotImporter

type NodeSnapshotImporter interface {
	Import(nodeSnapshot NodeSnapshot) error
}

type NodeSnapshotTransformer

type NodeSnapshotTransformer interface {
	NodeSnapshotImporter
	NodeSnapshotExporter
}

type NodeStatus

type NodeStatus int64
const (
	// NodeStatusRegistered
	// Node has been registered but does not meet the minimum requirements to be enter NodeStatusOnline.
	// Possible reasons:
	// - Node is not reachable by the Network.
	// - Node Operator has not deposited the minimum amount of tokens required.
	NodeStatusRegistered NodeStatus = iota // registered

	// NodeStatusOnline
	// Node is online and fully operational.
	NodeStatusOnline // online

	// NodeStatusOffline
	// Node was previously in NodeStatusOnline, but is currently offline.
	// Possible reasons:
	// - [Alpha only] Node missed a heartbeat.
	// - Node was slashed in the previous epoch, and was kicked out of the Network, the Operator did not acknowledge the slash and rejoin the Network.
	// - Node did not perform the mandatory upgrade before the deadline required by the Network.
	NodeStatusOffline // offline

	// NodeStatusExited
	// Node was previously in NodeStatusOnline, but is not anymore.
	// Possible reasons:
	// - Node announced its intention to leave the Network and gracefully exited after the mandatory waiting period.
	// - Node has been offline for a long time and is considered as exited.
	NodeStatusExited // exited

	// NodeStatusSlashed
	// Node was slashed in the current epoch, and was kicked out of the Network.
	NodeStatusSlashed // slashed

	// NodeStatusExiting
	// Node announced its intention to leave the Network, and is now in the mandatory waiting period.
	NodeStatusExiting // exiting
)

func NodeStatusString

func NodeStatusString(s string) (NodeStatus, error)

NodeStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func NodeStatusValues

func NodeStatusValues() []NodeStatus

NodeStatusValues returns all values of the enum

func (NodeStatus) IsANodeStatus

func (i NodeStatus) IsANodeStatus() bool

IsANodeStatus returns "true" if the value is listed in the enum definition. "false" otherwise

func (NodeStatus) MarshalJSON

func (i NodeStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for NodeStatus

func (NodeStatus) MarshalYAML

func (i NodeStatus) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for NodeStatus

func (*NodeStatus) Scan

func (i *NodeStatus) Scan(value interface{}) error

func (NodeStatus) String

func (i NodeStatus) String() string

func (*NodeStatus) UnmarshalJSON

func (i *NodeStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for NodeStatus

func (*NodeStatus) UnmarshalYAML

func (i *NodeStatus) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for NodeStatus

func (NodeStatus) Value

func (i NodeStatus) Value() (driver.Value, error)

func (NodeStatus) Values

func (NodeStatus) Values() []string

type OperatorProfitSnapshot

type OperatorProfitSnapshot struct {
	Date          time.Time       `json:"date"`
	EpochID       uint64          `json:"epochID"`
	Operator      common.Address  `json:"operator"`
	OperationPool decimal.Decimal `json:"operationPool"`
	ID            uint64          `json:"-"`
	CreatedAt     time.Time       `json:"-"`
	UpdatedAt     time.Time       `json:"-"`
}

type OperatorProfitSnapshotsQuery

type OperatorProfitSnapshotsQuery struct {
	Operator   *common.Address `json:"operator"`
	Limit      *int            `json:"limit"`
	Cursor     *string         `json:"cursor"`
	BeforeDate *time.Time      `json:"BeforeDate"`
	AfterDate  *time.Time      `json:"AfterDate"`
	Dates      []time.Time     `json:"dates"`
}

type RewardedNode added in v0.4.9

type RewardedNode struct {
	EpochID          uint64          `json:"epochID"`
	Index            int             `json:"index"`
	TransactionHash  common.Hash     `json:"transactionHash"`
	NodeAddress      common.Address  `json:"nodeAddress"`
	OperationRewards decimal.Decimal `json:"operationRewards"`
	StakingRewards   decimal.Decimal `json:"stakingRewards"`
	TaxCollected     decimal.Decimal `json:"taxCollected"`
	RequestCount     decimal.Decimal `json:"requestCount"`
}

type SettlementData

type SettlementData struct {
	Epoch            *big.Int         `json:"epoch"`
	NodeAddress      []common.Address `json:"nodeAddrs"`
	OperationRewards []*big.Int       `json:"operationRewards"`
	RequestCount     []*big.Int       `json:"requestCount"`
	IsFinal          bool             `json:"isFinal"`
}

type StakeChip

type StakeChip struct {
	ID             *big.Int        `json:"id"`
	Owner          common.Address  `json:"owner"`
	Node           common.Address  `json:"node"`
	Value          decimal.Decimal `json:"value"`
	LatestValue    decimal.Decimal `json:"latestValue,omitempty"`
	Metadata       json.RawMessage `json:"metadata"`
	BlockNumber    *big.Int        `json:"blockNumber"`
	BlockTimestamp uint64          `json:"blockTimestamp"`
}

type StakeChipExporter

type StakeChipExporter interface {
	Export() (*StakeChip, error)
}

type StakeChipImporter

type StakeChipImporter interface {
	Import(stakeChip StakeChip) error
}

type StakeChipQuery

type StakeChipQuery struct {
	ID *big.Int `query:"id"`
}

type StakeChipTransformer

type StakeChipTransformer interface {
	StakeChipImporter
	StakeChipExporter
}

type StakeChipsQuery

type StakeChipsQuery struct {
	Cursor        *big.Int
	IDs           []*big.Int
	Node          *common.Address
	Owner         *common.Address
	Limit         *int
	DistinctOwner bool
	BlockNumber   *big.Int
}

type StakeEvent

type StakeEvent struct {
	ID                common.Hash    `json:"id"`
	Type              StakeEventType `json:"type"`
	TransactionHash   common.Hash    `json:"transactionHash"`
	TransactionIndex  uint           `json:"transactionIndex"`
	TransactionStatus uint64         `json:"transactionStatus"`
	BlockHash         common.Hash    `json:"blockHash"`
	BlockNumber       *big.Int       `json:"blockNumber"`
	BlockTimestamp    time.Time      `json:"blockTimestamp"`
}

type StakeEventExporter

type StakeEventExporter interface {
	Export() (*StakeEvent, error)
}

type StakeEventImporter

type StakeEventImporter interface {
	Import(stakeEvent StakeEvent) error
}

type StakeEventQuery

type StakeEventQuery struct {
	ID *common.Hash `query:"id"`
}

type StakeEventTransformer

type StakeEventTransformer interface {
	StakeEventImporter
	StakeEventExporter
}

type StakeEventType

type StakeEventType string
const (
	StakeEventTypeDepositDeposited StakeEventType = "deposited"

	StakeEventTypeWithdrawRequested StakeEventType = "requested"
	StakeEventTypeWithdrawClaimed   StakeEventType = "claimed"

	StakeEventTypeStakeStaked StakeEventType = "staked"

	StakeEventTypeUnstakeRequested StakeEventType = "requested"
	StakeEventTypeUnstakeClaimed   StakeEventType = "claimed"
)

type StakeEventsQuery

type StakeEventsQuery struct {
	IDs []common.Hash `query:"ids"`
}

type StakeRecentCount

type StakeRecentCount struct {
	StakerCount uint64
	StakeValue  decimal.Decimal
}

type StakeSnapshotTransformer

type StakeSnapshotTransformer interface {
	StakerCountSnapshotImporter
	StakerCountSnapshotExporter
}

type StakeStaking

type StakeStaking struct {
	Staker common.Address    `json:"staker,omitempty"`
	Node   common.Address    `json:"node,omitempty"`
	Value  decimal.Decimal   `json:"value"`
	Chips  StakeStakingChips `json:"chips"`
}

type StakeStakingChips

type StakeStakingChips struct {
	Total    uint64       `json:"total"`
	Showcase []*StakeChip `json:"showcase"`
}

type StakeStakingsQuery

type StakeStakingsQuery struct {
	Cursor *string
	Node   *common.Address
	Staker *common.Address
	Limit  int
}

type StakeTransaction

type StakeTransaction struct {
	ID               common.Hash
	Type             StakeTransactionType
	User             common.Address
	Node             common.Address
	Value            *big.Int
	Chips            []*big.Int
	BlockTimestamp   time.Time
	BlockNumber      uint64
	TransactionIndex uint
}

type StakeTransactionExporter

type StakeTransactionExporter interface {
	Export() (*StakeTransaction, error)
}

type StakeTransactionImporter

type StakeTransactionImporter interface {
	Import(stakeTransaction StakeTransaction) error
}

type StakeTransactionQuery

type StakeTransactionQuery struct {
	ID      *common.Hash
	User    *common.Address
	Node    *common.Address
	Address *common.Address
	Type    *StakeTransactionType
}

type StakeTransactionTransformer

type StakeTransactionTransformer interface {
	StakeTransactionImporter
	StakeTransactionExporter
}

type StakeTransactionType

type StakeTransactionType string
const (
	StakeTransactionTypeDeposit  StakeTransactionType = "deposit"
	StakeTransactionTypeWithdraw StakeTransactionType = "withdraw"
	StakeTransactionTypeStake    StakeTransactionType = "stake"
	StakeTransactionTypeUnstake  StakeTransactionType = "unstake"
)

type StakeTransactionsQuery

type StakeTransactionsQuery struct {
	Cursor  *common.Hash
	IDs     []common.Hash
	User    *common.Address
	Node    *common.Address
	Address *common.Address
	Type    *StakeTransactionType
	Pending *bool
	Limit   int
}

type StakerCountSnapshot

type StakerCountSnapshot struct {
	Date  time.Time `json:"date"`
	Count int64     `json:"count"`
}

type StakerCountSnapshotExporter

type StakerCountSnapshotExporter interface {
	Export() (*StakerCountSnapshot, error)
}

type StakerCountSnapshotImporter

type StakerCountSnapshotImporter interface {
	Import(stakeSnapshot StakerCountSnapshot) error
}

type StakerProfitSnapshot

type StakerProfitSnapshot struct {
	Date             time.Time       `json:"date"`
	EpochID          uint64          `json:"epochID"`
	OwnerAddress     common.Address  `json:"ownerAddress"`
	TotalChipAmounts decimal.Decimal `json:"totalChipAmounts"`
	TotalChipValues  decimal.Decimal `json:"totalChipValues"`
	ID               uint64          `json:"-"`
	CreatedAt        time.Time       `json:"-"`
	UpdatedAt        time.Time       `json:"-"`
}

type StakerProfitSnapshotsQuery

type StakerProfitSnapshotsQuery struct {
	Cursor       *string         `json:"cursor"`
	Limit        *int            `json:"limit"`
	OwnerAddress *common.Address `json:"ownerAddress"`
	EpochID      *uint64         `json:"epochID"`
	Dates        []time.Time     `json:"dates"`
	BeforeDate   *time.Time      `json:"beforeDate"`
	AfterDate    *time.Time      `json:"afterDate"`
}

type Stat

type Stat struct {
	Address              common.Address `json:"address"`
	Endpoint             string         `json:"-"`
	Score                float64        `json:"score"`
	IsPublicGood         bool           `json:"isPublicGood"`
	IsFullNode           bool           `json:"isFullNode"`
	IsRssNode            bool           `json:"isRssNode"`
	Staking              float64        `json:"staking"`
	Epoch                int64          `json:"epoch"`
	TotalRequest         int64          `json:"totalRequest"`
	EpochRequest         int64          `json:"epochRequest"`
	EpochInvalidRequest  int64          `json:"epochInvalidRequest"`
	DecentralizedNetwork int            `json:"decentralizedNetwork"`
	FederatedNetwork     int            `json:"federatedNetwork"`
	Indexer              int            `json:"indexer"`
	ResetAt              time.Time      `json:"resetAt"`
}

type StatQuery

type StatQuery struct {
	Address      *common.Address  `query:"address" form:"address,omitempty"`
	Addresses    []common.Address `query:"Addresses" form:"addresses,omitempty"`
	IsFullNode   *bool            `query:"isFullNode" form:"isFullNode,omitempty"`
	IsRssNode    *bool            `query:"isRssNode" form:"isRssNode,omitempty"`
	PointsOrder  *string          `query:"pointsOrder" form:"pointsOrder,omitempty"`
	ValidRequest *int             `query:"validRequest" form:"validRequest,omitempty"`
	Limit        *int             `query:"limit" form:"limit,omitempty"`
	Cursor       *string          `query:"cursor" form:"cursor,omitempty"`
}

type Worker added in v0.4.11

type Worker struct {
	Address common.Address `json:"address"`
	Network string         `json:"network"`
	Name    string         `json:"name"`
}

Jump to

Keyboard shortcuts

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