Documentation ¶
Index ¶
- func UpdateNodeStatus(node *schema.Node, newStatus schema.NodeStatus) error
- type BatchGetNodeMinTokensToStakeSnapshotsResponseData
- type BatchNodeMinTokensToStakeRequest
- type BatchNodeRequest
- type BridgeToken
- type BridgeTokenAddress
- type BridgeTransaction
- type BridgeTransactionEvent
- type BridgeTransactionEventTypeDeposit
- type BridgeTransactionEventTypeWithdraw
- type BridgeTransactionEventTypes
- type CountSnapshot
- type Epoch
- type EpochTransaction
- type GetBridgeTransactionRequest
- type GetBridgeTransactionResponseData
- type GetBridgeTransactionsRequest
- type GetBridgeTransactionsResponseData
- type GetEpochDistributionRequest
- type GetEpochDistributionResponseData
- type GetEpochNodeRewardsRequest
- type GetEpochNodeRewardsResponseData
- type GetEpochRequest
- type GetEpochResponseData
- type GetEpochsRequest
- type GetEpochsResponseData
- type GetNodeCountSnapshotsResponseData
- type GetNodeOperationProfitRequest
- type GetNodeOperationProfitResponse
- type GetNodeOperationProfitSnapshotsRequest
- type GetOperatorProfitsSnapshotsResponseData
- type GetStakeChipRequest
- type GetStakeChipResponseData
- type GetStakeChipsImageRequest
- type GetStakeChipsRequest
- type GetStakeChipsResponseData
- type GetStakeStakingsRequest
- type GetStakeStakingsResponseData
- type GetStakeTransactionRequest
- type GetStakeTransactionResponseData
- type GetStakeTransactionsRequest
- type GetStakeTransactionsResponseData
- type GetStakerCountSnapshotsResponseData
- type GetStakerProfitChangesSinceResponseData
- type GetStakerProfitRequest
- type GetStakerProfitResponseData
- type GetStakerProfitSnapshotsRequest
- type NetworkRequest
- type NodeChallengeRequest
- type NodeChallengeResponseData
- type NodeEvent
- type NodeEventResponseData
- type NodeEventsRequest
- type NodeEventsResponseData
- type NodeHeartbeatRequest
- type NodeHideTaxRateRequest
- type NodeMinTokensToStakeSnapshots
- type NodeProfitChangeDetail
- type NodeRequest
- type NodeResponseData
- type NodeStatusTransitionError
- type NodesResponseData
- type RegisterNodeRequest
- type Response
- type StakeChip
- type StakeStaking
- type StakeStakingChips
- type StakeTransaction
- type StakeTransactionEvent
- type StakeTransactionEventTypeDeposit
- type StakeTransactionEventTypeStake
- type StakeTransactionEventTypeUnstake
- type StakeTransactionEventTypeWithdraw
- type StakeTransactionEventTypes
- type TransactionEventBlock
- type TransactionEventTransaction
- type WorkerRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateNodeStatus ¶
func UpdateNodeStatus(node *schema.Node, newStatus schema.NodeStatus) error
UpdateNodeStatus updates the status of a given node if the transition is valid. It returns a NodeStatusTransitionError when the transition is invalid.
Types ¶
type BatchGetNodeMinTokensToStakeSnapshotsResponseData ¶
type BatchGetNodeMinTokensToStakeSnapshotsResponseData []*NodeMinTokensToStakeSnapshots
func NewNodeMinTokensToStakeSnapshots ¶
func NewNodeMinTokensToStakeSnapshots(nodeMinTokensToStakeSnapshots []*schema.NodeMinTokensToStakeSnapshot) BatchGetNodeMinTokensToStakeSnapshotsResponseData
type BatchNodeRequest ¶
type BridgeToken ¶
type BridgeToken struct { Address BridgeTokenAddress `json:"address"` Value decimal.Decimal `json:"value"` }
type BridgeTokenAddress ¶
type BridgeTransaction ¶
type BridgeTransaction struct { ID common.Hash `json:"id"` Sender common.Address `json:"sender"` Receiver common.Address `json:"receiver"` Token BridgeToken `json:"token"` Event BridgeTransactionEventTypes `json:"event"` }
func NewBridgeTransaction ¶
func NewBridgeTransaction(transaction *schema.BridgeTransaction, events []*schema.BridgeEvent) *BridgeTransaction
type BridgeTransactionEvent ¶
type BridgeTransactionEvent struct { Block TransactionEventBlock `json:"block"` Transaction TransactionEventTransaction `json:"transaction"` }
type BridgeTransactionEventTypeDeposit ¶
type BridgeTransactionEventTypeDeposit struct { Initialized *BridgeTransactionEvent `json:"initialized,omitempty"` Finalized *BridgeTransactionEvent `json:"finalized,omitempty"` }
type BridgeTransactionEventTypeWithdraw ¶
type BridgeTransactionEventTypeWithdraw struct { Initialized *BridgeTransactionEvent `json:"initialized,omitempty"` Proved *BridgeTransactionEvent `json:"proved,omitempty"` Finalized *BridgeTransactionEvent `json:"finalized,omitempty"` }
type BridgeTransactionEventTypes ¶
type BridgeTransactionEventTypes struct { Deposit *BridgeTransactionEventTypeDeposit `json:"deposit,omitempty"` Withdraw *BridgeTransactionEventTypeWithdraw `json:"withdraw,omitempty"` }
type CountSnapshot ¶
type Epoch ¶
type Epoch struct { ID uint64 `json:"id"` StartTimestamp int64 `json:"start_timestamp"` EndTimestamp int64 `json:"end_timestamp"` TotalOperationRewards decimal.Decimal `json:"total_operation_rewards"` TotalStakingRewards decimal.Decimal `json:"total_staking_rewards"` TotalRequestCounts decimal.Decimal `json:"total_request_counts"` TotalRewardedNodes int `json:"total_rewarded_nodes"` Distributions []*EpochTransaction `json:"distributions"` }
type EpochTransaction ¶
type EpochTransaction struct { ID uint64 `json:"id"` StartTimestamp int64 `json:"start_timestamp"` EndTimestamp int64 `json:"end_timestamp"` Transaction TransactionEventTransaction `json:"transaction"` Block TransactionEventBlock `json:"block"` TotalOperationRewards decimal.Decimal `json:"total_operation_rewards"` TotalStakingRewards decimal.Decimal `json:"total_staking_rewards"` TotalRequestCounts decimal.Decimal `json:"total_request_counts"` TotalRewardedNodes int `json:"total_rewarded_nodes"` RewardedNodes []*schema.RewardedNode `json:"rewarded_nodes,omitempty"` CreatedAt int64 `json:"-"` UpdatedAt int64 `json:"-"` }
func NewEpochTransaction ¶
func NewEpochTransaction(epoch *schema.Epoch) *EpochTransaction
type GetBridgeTransactionResponseData ¶
type GetBridgeTransactionResponseData *BridgeTransaction
type GetBridgeTransactionsRequest ¶
type GetBridgeTransactionsRequest struct { Cursor *common.Hash `query:"cursor"` Sender *common.Address `query:"sender"` Receiver *common.Address `query:"receiver"` Address *common.Address `query:"address"` Type *schema.BridgeTransactionType `query:"type"` Limit int `query:"limit" default:"20" min:"1" max:"20"` }
type GetBridgeTransactionsResponseData ¶
type GetBridgeTransactionsResponseData []*BridgeTransaction
type GetEpochDistributionResponseData ¶
type GetEpochDistributionResponseData *EpochTransaction
type GetEpochNodeRewardsResponseData ¶
type GetEpochNodeRewardsResponseData *Epoch
type GetEpochRequest ¶
type GetEpochResponseData ¶
type GetEpochResponseData *Epoch
type GetEpochsRequest ¶
type GetEpochsResponseData ¶
type GetEpochsResponseData []*Epoch
func NewEpochs ¶
func NewEpochs(epochs []*schema.Epoch) GetEpochsResponseData
type GetNodeCountSnapshotsResponseData ¶
type GetNodeCountSnapshotsResponseData []*CountSnapshot
func NewNodeCountSnapshots ¶
func NewNodeCountSnapshots(nodeSnapshots []*schema.NodeSnapshot) GetNodeCountSnapshotsResponseData
type GetNodeOperationProfitRequest ¶ added in v0.5.0
type GetNodeOperationProfitResponse ¶ added in v0.5.0
type GetNodeOperationProfitResponse struct { NodeAddress common.Address `json:"node_address"` OperationPool decimal.Decimal `json:"operation_pool"` OneDay *NodeProfitChangeDetail `json:"one_day"` OneWeek *NodeProfitChangeDetail `json:"one_week"` OneMonth *NodeProfitChangeDetail `json:"one_month"` }
type GetNodeOperationProfitSnapshotsRequest ¶ added in v0.5.0
type GetOperatorProfitsSnapshotsResponseData ¶
type GetOperatorProfitsSnapshotsResponseData []*schema.OperatorProfitSnapshot
type GetStakeChipRequest ¶
type GetStakeChipResponseData ¶
type GetStakeChipResponseData *StakeChip
func NewStakeChip ¶
func NewStakeChip(stakeChip *schema.StakeChip, baseURL url.URL) GetStakeChipResponseData
type GetStakeChipsRequest ¶
type GetStakeChipsResponseData ¶
type GetStakeChipsResponseData []*StakeChip
func NewStakeChips ¶
func NewStakeChips(stakeChips []*schema.StakeChip, baseURL url.URL) GetStakeChipsResponseData
type GetStakeStakingsRequest ¶
type GetStakeStakingsResponseData ¶
type GetStakeStakingsResponseData []*StakeStaking
func NewStakeStaking ¶
func NewStakeStaking(stakeStakings []*schema.StakeStaking, baseURL url.URL) GetStakeStakingsResponseData
type GetStakeTransactionRequest ¶
type GetStakeTransactionRequest struct { TransactionHash *common.Hash `param:"transaction_hash"` Type *schema.StakeTransactionType `query:"type"` }
type GetStakeTransactionResponseData ¶
type GetStakeTransactionResponseData *StakeTransaction
func NewStakeTransaction ¶
func NewStakeTransaction(transaction *schema.StakeTransaction, events []*schema.StakeEvent, stakeChips []*schema.StakeChip, baseURL url.URL) GetStakeTransactionResponseData
type GetStakeTransactionsResponseData ¶
type GetStakeTransactionsResponseData []*StakeTransaction
type GetStakerCountSnapshotsResponseData ¶ added in v0.5.9
type GetStakerCountSnapshotsResponseData []*CountSnapshot
func NewStakerCountSnapshots ¶ added in v0.5.9
func NewStakerCountSnapshots(stakeSnapshots []*schema.StakerCountSnapshot) GetStakerCountSnapshotsResponseData
type GetStakerProfitChangesSinceResponseData ¶ added in v0.5.18
type GetStakerProfitRequest ¶ added in v0.5.18
type GetStakerProfitResponseData ¶ added in v0.5.18
type GetStakerProfitResponseData struct { Owner common.Address `json:"owner"` TotalChipAmount decimal.Decimal `json:"total_chip_amount"` TotalChipValue decimal.Decimal `json:"total_chip_value"` OneDay *GetStakerProfitChangesSinceResponseData `json:"one_day"` OneWeek *GetStakerProfitChangesSinceResponseData `json:"one_week"` OneMonth *GetStakerProfitChangesSinceResponseData `json:"one_month"` }
type NetworkRequest ¶ added in v0.4.8
type NetworkRequest struct {
NetworkName string `param:"network_name" validate:"required"`
}
type NodeChallengeRequest ¶
type NodeChallengeResponseData ¶
type NodeChallengeResponseData string
type NodeEvent ¶
type NodeEvent struct { Transaction TransactionEventTransaction `json:"transaction"` Block TransactionEventBlock `json:"block"` AddressFrom common.Address `json:"address_from"` AddressTo common.Address `json:"address_to"` NodeID uint64 `json:"node_id"` Type schema.NodeEventType `json:"type"` LogIndex uint `json:"log_index"` ChainID uint64 `json:"chain_id"` Metadata schema.NodeEventMetadata `json:"metadata"` }
type NodeEventResponseData ¶
type NodeEventResponseData *NodeEvent
func NewNodeEvent ¶
func NewNodeEvent(event *schema.NodeEvent) NodeEventResponseData
type NodeEventsRequest ¶
type NodeEventsResponseData ¶
type NodeEventsResponseData []*NodeEvent
func NewNodeEvents ¶
func NewNodeEvents(events []*schema.NodeEvent) NodeEventsResponseData
type NodeHeartbeatRequest ¶
type NodeHideTaxRateRequest ¶
type NodeMinTokensToStakeSnapshots ¶
type NodeMinTokensToStakeSnapshots struct { NodeAddress common.Address `json:"node_address"` Snapshots []*schema.NodeMinTokensToStakeSnapshot `json:"snapshots"` }
type NodeProfitChangeDetail ¶ added in v0.5.0
type NodeRequest ¶
type NodeResponseData ¶
type NodeStatusTransitionError ¶
type NodeStatusTransitionError struct {
From, To schema.NodeStatus
}
NodeStatusTransitionError represents an error when attempting to transition a Node to an invalid status.
func (*NodeStatusTransitionError) Error ¶
func (err *NodeStatusTransitionError) Error() string
Error returns a string representation of the NodeStatusTransitionError. TODO: move to a more appropriate location.
type NodesResponseData ¶
type RegisterNodeRequest ¶
type RegisterNodeRequest struct { Address common.Address `json:"address" validate:"required"` Signature string `json:"signature" validate:"required"` Endpoint string `json:"endpoint" validate:"required"` Stream json.RawMessage `json:"stream,omitempty"` Config json.RawMessage `json:"config,omitempty"` Type string `json:"type" validate:"required,oneof=alpha beta" default:"alpha"` }
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"` }
func NewStakeAddress ¶
func NewStakeAddress(stakeAddress *schema.StakeStaking, baseURL url.URL) *StakeStaking
type StakeStakingChips ¶
type StakeTransaction ¶
type StakeTransactionEvent ¶
type StakeTransactionEvent struct { Block TransactionEventBlock `json:"block"` Transaction TransactionEventTransaction `json:"transaction"` }
type StakeTransactionEventTypeDeposit ¶
type StakeTransactionEventTypeDeposit struct {
Deposited *StakeTransactionEvent `json:"deposited,omitempty"`
}
type StakeTransactionEventTypeStake ¶
type StakeTransactionEventTypeStake struct {
Staked *StakeTransactionEvent `json:"staked,omitempty"`
}
type StakeTransactionEventTypeUnstake ¶
type StakeTransactionEventTypeUnstake struct { Requested *StakeTransactionEvent `json:"requested,omitempty"` Claimed *StakeTransactionEvent `json:"claimed,omitempty"` }
type StakeTransactionEventTypeWithdraw ¶
type StakeTransactionEventTypeWithdraw struct { Requested *StakeTransactionEvent `json:"requested,omitempty"` Claimed *StakeTransactionEvent `json:"claimed,omitempty"` }
type StakeTransactionEventTypes ¶
type StakeTransactionEventTypes struct { Deposit *StakeTransactionEventTypeDeposit `json:"deposit,omitempty"` Withdraw *StakeTransactionEventTypeWithdraw `json:"withdraw,omitempty"` Stake *StakeTransactionEventTypeStake `json:"stake,omitempty"` Unstake *StakeTransactionEventTypeUnstake `json:"unstake,omitempty"` }
type TransactionEventBlock ¶
type WorkerRequest ¶ added in v0.4.17
type WorkerRequest struct { NetworkRequest WorkerName string `param:"worker_name" validate:"required"` }
Click to show internal directories.
Click to hide internal directories.