Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountParams
- type AccountType
- type ContractEvent
- type Delegation
- type DelegationParams
- type DelegationState
- type DelegationSummary
- type EventParams
- type Node
- type NodeParams
- type NodeStatus
- type StatisticTypeVS
- type SysEvtType
- type SystemEvent
- type SystemEventParams
- type ThreeState
- type Validator
- type ValidatorParams
- type ValidatorStatistics
- type ValidatorStatisticsParams
Constants ¶
View Source
const Layout = time.RFC3339
Variables ¶
View Source
var ( ErrNotAllowedMethod = errors.New("method not allowed") ErrMissingParameter = errors.New("missing parameter") ErrNotFound = errors.New("record not found") )
View Source
var ( NodeStatusTypes = map[string]NodeStatus{ "Active": NodeStatusActive, "Leaving": NodeStatusLeaving, "Left": NodeStatusLeft, "In_Maintenance": NodeStatusInMaintenance, "Unknown": NodeStatusUnknown, } )
View Source
var ( StatisticTypes = map[string]StatisticTypeVS{ "TOTAL_STAKE": ValidatorStatisticsTypeTotalStake, "ACTIVE_NODES": ValidatorStatisticsTypeActiveNodes, "LINKED_NODES": ValidatorStatisticsTypeLinkedNodes, "MDR": ValidatorStatisticsTypeMDR, "FEE": ValidatorStatisticsTypeFee, "AUTHORIZED": ValidatorStatisticsTypeAuthorized, "VALIDATOR_ADDRESS": ValidatorStatisticsTypeValidatorAddress, "REQUESTED_ADDRESS": ValidatorStatisticsTypeRequestedAddress, } )
View Source
var ( SysEvtTypes = map[SysEvtType]string{ SysEvtTypeNewDelegation: "new_delegation", SysEvtTypeDelegationAccepted: "delegation_accepted", SysEvtTypeDelegationRejected: "delegation_rejected", SysEvtTypeUndeledationRequested: "undelegation_requested", SysEvtTypeJoinedActiveSet: "joined_active_set", SysEvtTypeLeftActiveSet: "left_active_set", SysEvtTypeMDRChanged: "mdr_change", SysEvtTypeFeeChanged: "fee_change", SysEvtTypeSlashed: "slashed", SysEvtTypeForgiven: "forgiven", } )
Functions ¶
This section is empty.
Types ¶
type AccountParams ¶
type AccountType ¶
type AccountType string
const ( AccountTypeDefault AccountType = "default" AccountTypeDelegator AccountType = "delegator" AccountTypeValidator AccountType = "validator" )
type ContractEvent ¶
type ContractEvent struct { ID uuid.UUID `json:"id"` ContractName string `json:"contract_name"` EventName string `json:"event_name"` ContractAddress common.Address `json:"contract_address"` BlockHeight uint64 `json:"block_height"` Time time.Time `json:"time"` TransactionHash common.Hash `json:"transaction_hash"` Removed bool `json:"removed"` Params map[string]interface{} `json:"params"` BoundType string `json:"bound_type"` BoundID []big.Int `json:"bound_id"` BoundAddress []common.Address `json:"bound_address"` }
type Delegation ¶
type Delegation struct { ID uuid.UUID `json:"id"` CreatedAt time.Time `json:"created_at"` DelegationID *big.Int `json:"delegation_id"` Holder common.Address `json:"holder"` ValidatorID *big.Int `json:"validatorId"` BlockHeight uint64 `json:"block_height"` TransactionHash common.Hash `json:"transaction_hash"` Amount *big.Int `json:"amount"` DelegationPeriod *big.Int `json:"delegationPeriod"` Created time.Time `json:"created"` Started *big.Int `json:"started"` Finished *big.Int `json:"finished"` Info string `json:"info"` State DelegationState `json:"state"` // JOIN ValidatorName string `json:"validator_name"` }
type DelegationParams ¶
type DelegationState ¶
type DelegationState uint
const ( DelegationStatePROPOSED DelegationState = iota DelegationStateACCEPTED DelegationStateCANCELED DelegationStateREJECTED DelegationStateDELEGATED DelegationStateUNDELEGATION_REQUESTED DelegationStateCOMPLETED DelegationStateUNKNOWN DelegationState = 666 )
func DelegationStateFromString ¶ added in v0.0.4
func DelegationStateFromString(s string) DelegationState
func (DelegationState) String ¶
func (k DelegationState) String() string
type DelegationSummary ¶ added in v0.0.4
type DelegationSummary struct { Count *big.Int `json:"count"` Amount *big.Int `json:"amount"` State DelegationState `json:"state"` }
type EventParams ¶
type Node ¶
type Node struct { ID string `json:"id"` CreatedAt time.Time `json:"created_at"` NodeID *big.Int `json:"node_id"` Address common.Address `json:"address"` Name string `json:"name"` IP net.IP `json:"ip"` PublicIP net.IP `json:"public_ip"` Port uint16 `json:"port"` StartBlock *big.Int `json:"start_block"` NextRewardDate time.Time `json:"next_reward_date"` LastRewardDate time.Time `json:"last_reward_date"` FinishTime *big.Int `json:"finish_time"` Status NodeStatus `json:"node_status"` ValidatorID *big.Int `json:"validator_id"` BlockHeight uint64 `json:"block_height"` }
type NodeParams ¶
type NodeStatus ¶
type NodeStatus uint
const ( NodeStatusActive NodeStatus = iota NodeStatusLeaving NodeStatusLeft NodeStatusInMaintenance NodeStatusUnknown NodeStatus = 999 )
func GetTypeForNode ¶
func GetTypeForNode(s string) (NodeStatus, bool)
func (NodeStatus) String ¶
func (k NodeStatus) String() string
type StatisticTypeVS ¶
type StatisticTypeVS uint
const ( ValidatorStatisticsTypeTotalStake StatisticTypeVS = iota + 1 ValidatorStatisticsTypeActiveNodes ValidatorStatisticsTypeLinkedNodes ValidatorStatisticsTypeMDR ValidatorStatisticsTypeFee ValidatorStatisticsTypeAuthorized ValidatorStatisticsTypeValidatorAddress ValidatorStatisticsTypeRequestedAddress )
func GetTypeForValidatorStatistics ¶
func GetTypeForValidatorStatistics(s string) (StatisticTypeVS, bool)
func (StatisticTypeVS) String ¶
func (k StatisticTypeVS) String() string
type SysEvtType ¶
type SysEvtType uint64
const ( SysEvtTypeNewDelegation SysEvtType = iota + 1 SysEvtTypeDelegationAccepted SysEvtTypeDelegationRejected SysEvtTypeUndeledationRequested SysEvtTypeJoinedActiveSet SysEvtTypeLeftActiveSet SysEvtTypeSlashed SysEvtTypeForgiven SysEvtTypeMDRChanged SysEvtTypeFeeChanged )
type SystemEvent ¶
type SystemEvent struct { ID string `json:"id"` Height uint64 `json:"height"` Time time.Time `json:"time"` Kind SysEvtType `json:"kind"` SenderID big.Int `json:"sender_id"` RecipientID big.Int `json:"recipient_id"` Sender common.Address `json:"sender"` Recipient common.Address `json:"recipient"` Before big.Int `json:"before"` After big.Int `json:"after"` Change big.Float `json:"change"` }
type SystemEventParams ¶
type ThreeState ¶ added in v0.0.4
type ThreeState uint8
const ( StateNotSet ThreeState = iota StateTrue StateFalse )
type Validator ¶
type Validator struct { ID string `json:"id"` CreatedAt time.Time `json:"created_at"` ValidatorID *big.Int `json:"validator_id"` Name string `json:"name"` ValidatorAddress common.Address `json:"validator_address"` RequestedAddress common.Address `json:"requested_address"` Description string `json:"description"` FeeRate *big.Int `json:"fee_rate"` RegistrationTime time.Time `json:"registration_time"` MinimumDelegationAmount *big.Int `json:"minimum_delegation_amount"` AcceptNewRequests bool `json:"accept_new_requests"` Authorized bool `json:"authorized"` ActiveNodes uint `json:"active_nodes"` LinkedNodes uint `json:"linked_nodes"` Staked *big.Int `json:"staked"` BlockHeight uint64 `json:"block_height"` }
type ValidatorParams ¶
type ValidatorStatistics ¶
Click to show internal directories.
Click to hide internal directories.