info_handlers

package
v0.0.0-...-fa633b5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitElection

type ExitElection struct {
	PublicKey   string `json:"publicKey"`
	ChoosenTime uint64 `json:"choosenTime"`
	ExitTime    uint64 `json:"exitTime"`
	EthReward   string `json:"ethReward"`
	Status      uint8  `json:"status"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(db *db.WrapDb) *Handler

func (*Handler) HandleGetGasPrice

func (h *Handler) HandleGetGasPrice(c *gin.Context)

@Summary gas price @Description gas price @Tags v1 @Produce json @Success 200 {object} utils.Rsp{data=RspGasPrice} @Router /v1/gasPrice [get]

func (*Handler) HandleGetPoolData

func (h *Handler) HandleGetPoolData(c *gin.Context)

@Summary pool data @Description pool data @Tags v1 @Produce json @Success 200 {object} utils.Rsp{data=RspPoolData} @Router /v1/poolData [get]

func (*Handler) HandleGetUnstakePoolData

func (h *Handler) HandleGetUnstakePoolData(c *gin.Context)

@Summary unstake pool data @Description unstake pool data @Tags v1 @Produce json @Success 200 {object} utils.Rsp{data=RspUnstakePoolData} @Router /v1/unstakePoolData [get]

func (*Handler) HandleGetUnstakingLeftSeconds

func (h *Handler) HandleGetUnstakingLeftSeconds(c *gin.Context)

@Summary staker unstaking left seconds @Description unstaking left seconds @Tags v1 @Produce json @Success 200 {object} utils.Rsp{data=RspUnstakingLeftSeconds} @Router /v1/staker/unstakingLeftSeconds [get]

func (*Handler) HandleGetWithdrawRemainingTime

func (h *Handler) HandleGetWithdrawRemainingTime(c *gin.Context)

@Summary staker withdraw remaining time @Description staker withdraw remaining time @Tags v1 @Accept json @Produce json @Param param body ReqWithdrawRemainingTime true "staker address" @Success 200 {object} utils.Rsp{data=RspWithdrawRemainingTime} @Router /v1/staker/withdrawRemainingTime [post]

func (*Handler) HandlePostExitElectionList

func (h *Handler) HandlePostExitElectionList(c *gin.Context)

@Summary exit election list @Description exit election list @Tags v1 @Accept json @Produce json @Param param body ReqExitElectionList true "election list" @Success 200 {object} utils.Rsp{data=RspExitElectionList} @Router /v1/exitElectionList [post]

func (*Handler) HandlePostNodeInfo

func (h *Handler) HandlePostNodeInfo(c *gin.Context)

@Summary node info @Description node info @Tags v1 @Accept json @Produce json @Param param body ReqNodeInfo true "node info" @Success 200 {object} utils.Rsp{data=RspNodeInfo} @Router /v1/nodeInfo [post]

func (*Handler) HandlePostProof

func (h *Handler) HandlePostProof(c *gin.Context)

@Summary get proof of claim @Description proof @Tags v1 @Accept json @Produce json @Param param body ReqProof true "proof" @Success 200 {object} utils.Rsp{data=RspProof} @Router /v1/proof [post]

func (*Handler) HandlePostProposeElectionList

func (h *Handler) HandlePostProposeElectionList(c *gin.Context)

@Summary propose election list @Description propose election list @Tags v1 @Accept json @Produce json @Param param body ReqProposeElectionList true "election list" @Success 200 {object} utils.Rsp{data=RspProposeElectionList} @Router /v1/proposeElectionList [post]

func (*Handler) HandlePostPubkeyDetail

func (h *Handler) HandlePostPubkeyDetail(c *gin.Context)

@Summary pubkey detail @Description pubkey detail @Tags v1 @Accept json @Produce json @Param param body ReqPubkeyDetail true "pubkey detail" @Success 200 {object} utils.Rsp{data=RspPubkeyDetail} @Router /v1/pubkeyDetail [post]

func (*Handler) HandlePostPubkeyStatusList

func (h *Handler) HandlePostPubkeyStatusList(c *gin.Context)

@Summary pubkey status list @Description pubkey status list @Tags v1 @Accept json @Produce json @Param param body ReqPubkeyStatusList true "pubkey status list" @Success 200 {object} utils.Rsp{data=RspPubkeyStatusList} @Router /v1/pubkeyStatusList [post]

func (*Handler) HandlePostRewardInfo

func (h *Handler) HandlePostRewardInfo(c *gin.Context)

@Summary reward info @Description reward info @Tags v1 @Accept json @Produce json @Param param body ReqRewardInfo true "reward info" @Success 200 {object} utils.Rsp{data=RspRewardInfo} @Router /v1/rewardInfo [post]

func (*Handler) HandlePostUnstakingPlanExist

func (h *Handler) HandlePostUnstakingPlanExist(c *gin.Context)

@Summary unstaking plan exit @Description staker unstaking plan exit @Tags v1 @Accept json @Produce json @Param param body ReqUnstakingPlanExist true "unstaking plan exist" @Success 200 {object} utils.Rsp{data=RspUnstakingPlanExist} @Router /v1/staker/unstakingPlanExist [post]

func (*Handler) HandlePostUploadUnstakingPlan

func (h *Handler) HandlePostUploadUnstakingPlan(c *gin.Context)

@Summary unstaking plan @Description staker unstaking plan @Tags v1 @Accept json @Produce json @Param param body ReqUploadUnstakingPlan true "unstaking plan" @Success 200 {object} utils.Rsp{} @Router /v1/staker/uploadUnstakingPlan [post]

type ProposeElection

type ProposeElection struct {
	PublicKey   string `json:"publicKey"`
	ChoosenTime uint64 `json:"choosenTime"`
	EthReward   string `json:"ethReward"`
	Status      uint8  `json:"status"`
}

type ReqExitElectionList

type ReqExitElectionList struct {
	NodeAddress string `json:"nodeAddress"`
	PageIndex   int    `json:"pageIndex"`
	PageCount   int    `json:"pageCount"`
}

type ReqNodeInfo

type ReqNodeInfo struct {
	NodeAddress string  `json:"nodeAddress"`
	Status      uint8   `json:"status"`     // ignore if statusList not empty
	StatusList  []uint8 `json:"statusList"` // {9 active 10 exited 20 pending 30 slash}
	PageIndex   int     `json:"pageIndex"`
	PageCount   int     `json:"pageCount"`
}

type ReqProof

type ReqProof struct {
	NodeAddress string `json:"nodeAddress"`
}

type ReqProposeElectionList

type ReqProposeElectionList struct {
	NodeAddress string `json:"nodeAddress"`
	PageIndex   int    `json:"pageIndex"`
	PageCount   int    `json:"pageCount"`
}

type ReqPubkeyDetail

type ReqPubkeyDetail struct {
	Pubkey         string `json:"pubkey"` //hex string
	ChartDuSeconds uint64 `json:"chartDuSeconds"`
	PageIndex      int    `json:"pageIndex"`
	PageCount      int    `json:"pageCount"`
}

type ReqPubkeyStatusList

type ReqPubkeyStatusList struct {
	PubkeyList []string `json:"pubkeyList"` //hex string list
}

type ReqRewardInfo

type ReqRewardInfo struct {
	NodeAddress    string `json:"nodeAddress"` //hex string
	ChartDuSeconds uint64 `json:"chartDuSeconds"`
	PageIndex      int    `json:"pageIndex"`
	PageCount      int    `json:"pageCount"`
}

type ReqUnstakingPlanExist

type ReqUnstakingPlanExist struct {
	StakerAddress string `json:"stakerAddress"` //hex string
}

type ReqUploadUnstakingPlan

type ReqUploadUnstakingPlan struct {
	StakerAddress string `json:"stakerAddress"` //hex string
	Amount        string `json:"amount"`
}

type ReqWithdrawRemainingTime

type ReqWithdrawRemainingTime struct {
	StakerAddress string `json:"stakerAddress"` //hex string
}

type ResPubkey

type ResPubkey struct {
	Status uint8  `json:"status"`
	Pubkey string `json:"pubkey"`
}

type ResReward

type ResReward struct {
	Timestamp         uint64 `json:"timestamp"`
	Commission        uint64 `json:"commission"`
	TotalStakedEth    string `json:"totalStakedEth"`
	SelfStakedEth     string `json:"selfStakedEth"`
	TotalEraRewardEth string `json:"totalEraRewardEth"`
	SelfEraRewardEth  string `json:"selfEraRewardEth"`
}

type RspExitElectionList

type RspExitElectionList struct {
	ElectionTotalCount uint64         `json:"electionTotalCount"`
	ElectionList       []ExitElection `json:"electionList"`
}

type RspGasPrice

type RspGasPrice struct {
	BaseFee     uint64  `json:"baseFee"`
	PriorityFee uint64  `json:"priorityFee"`
	EthPrice    float64 `json:"ethPrice"`
}

type RspNodeInfo

type RspNodeInfo struct {
	TotalCount       int64       `json:"totalCount"`
	PendingCount     int64       `json:"pendingCount"`
	ActiveCount      int64       `json:"activeCount"`
	ExitedCount      int64       `json:"exitedCount"`
	SlashCount       int64       `json:"slashCount"`
	SelfDepositedEth string      `json:"selfDepositedEth"`
	SelfRewardEth    string      `json:"selfRewardEth"`
	TotalManagedEth  string      `json:"totalManagedEth"`
	EthPrice         float64     `json:"ethPrice"`
	List             []ResPubkey `json:"pubkeyList"`
}

type RspPoolData

type RspPoolData struct {
	DepositedEth      string  `json:"depositedEth"` //staker principal + validator principal
	MintedREth        string  `json:"mintedREth"`
	StakedEth         string  `json:"stakedEth"`         // matched number * 32 + solo unmatched number * 4 + trust unmatched number * 1
	PoolEth           string  `json:"poolEth"`           // staker principal + validator principal + reward
	UnmatchedEth      string  `json:"unmatchedEth"`      // userdeposit balance
	MatchedValidators uint64  `json:"matchedValidators"` // staked waiting actived
	StakeApr          float64 `json:"stakeApr"`
	ValidatorApr      float64 `json:"validatorApr"`
	EthPrice          float64 `json:"ethPrice"`
	AllEth            string  `json:"allEth"` // staker principal + validator principal + reward
}

type RspProof

type RspProof struct {
	Index   uint64   `json:"index"`
	Address string   `json:"address"`
	Amount  string   `json:"amount"`
	Proof   []string `json:"proof"`
}

type RspProposeElectionList

type RspProposeElectionList struct {
	ElectionTotalCount uint64            `json:"electionTotalCount"`
	ElectionList       []ProposeElection `json:"electionList"`
}

type RspPubkeyDetail

type RspPubkeyDetail struct {
	Status            uint8    `json:"status"`
	CurrentBalance    string   `json:"currentBalance"`
	DepositBalance    string   `json:"depositBalance"`
	NodeDepositAmount string   `json:"nodeDepositAmount"`
	EffectiveBalance  string   `json:"effectiveBalance"`
	Last24hRewardEth  string   `json:"last24hRewardEth"`
	Apr               float64  `json:"apr"`
	EthPrice          float64  `json:"ethPrice"`
	EligibleEpoch     uint64   `json:"eligibleEpoch"`
	EligibleDays      uint64   `json:"eligibleDays"`
	ActiveEpoch       uint64   `json:"activeEpoch"`
	ActiveDays        uint64   `json:"activeDays"`
	ChartXData        []uint64 `json:"chartXData"`
	ChartYData        []string `json:"chartYData"`

	TotalCount       int64        `json:"totalCount"`
	TotalSlashAmount string       `json:"totalSlashAmount"`
	SlashEventList   []SlashEvent `json:"slashEventList"`
}

type RspPubkeyStatusList

type RspPubkeyStatusList struct {
	StatusList            []uint64 `json:"statusList"`
	NodeDepositAmountList []string `json:"nodeDepositAmountList"` //decimals 18
}

type RspRewardInfo

type RspRewardInfo struct {
	TotalCount       int64       `json:"totalCount"`
	TotalStakedEth   string      `json:"totalStakedEth"`
	LastEraRewardEth string      `json:"lastEraRewardEth"`
	EthPrice         float64     `json:"ethPrice"`
	ChartXData       []uint64    `json:"chartXData"`
	ChartYData       []string    `json:"chartYData"`
	List             []ResReward `json:"rewardList"`
}

type RspUnstakePoolData

type RspUnstakePoolData struct {
	PoolEth           string `json:"poolEth"`
	TodayUnstakedEth  string `json:"todayUnstakedEth"`
	UnstakeableEth    string `json:"unstakeableEth"`
	WaitingStakers    uint64 `json:"waitingStakers"`
	EjectedValidators uint64 `json:"ejectedValidators"`
}

type RspUnstakingLeftSeconds

type RspUnstakingLeftSeconds struct {
	LeftSeconds uint64 `json:"leftSeconds"` // staked waiting actived
}

type RspUnstakingPlanExist

type RspUnstakingPlanExist struct {
	Exist bool `json:"exist"`
}

type RspWithdrawRemainingTime

type RspWithdrawRemainingTime struct {
	RemainingSeconds uint64 `json:"remainingSeconds"` // staked waiting actived
}

type SlashEvent

type SlashEvent struct {
	StartTimestamp uint64 `json:"startTimestamp"`
	StartBlock     uint64 `json:"startBlock"`
	EndBlock       uint64 `json:"endBlock"`
	SlashAmount    string `json:"slashAmount"`
	SlashType      uint8  `json:"slashType"`
	ExplorerUrl    string `json:"explorerUrl"`
}

Jump to

Keyboard shortcuts

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