api

package
v0.0.0-...-fdde37d Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmountPerDay

type AmountPerDay struct {
	Amount string `json:"amount"`
	Date   string `json:"date"`
}

type CalculateClaim

type CalculateClaim struct {
	DisputeGame string `json:"disputeGame"`
	Position    int64  `json:"position"`
}

type CountGames

type CountGames struct {
	Amount string `json:"amount"`
	Date   string `json:"date"`
	Status string `json:"status"`
}

type CreditRank

type CreditRank struct {
	Amount  string `json:"amount"`
	Address string `json:"address"`
}

type DisputeGameHandler

type DisputeGameHandler struct {
	Config *config.Config
	DB     *gorm.DB
	L1RPC  *ethclient.Client
	L2RPC  *ethclient.Client
}

func NewDisputeGameHandler

func NewDisputeGameHandler(db *gorm.DB, l1rpc *ethclient.Client, l2rpc *ethclient.Client, config *config.Config) *DisputeGameHandler

func (DisputeGameHandler) GetAmountPerDays

func (h DisputeGameHandler) GetAmountPerDays(c *gin.Context)

@Summary GetAmountPerDays @schemes @Description Get amount per day @Accept json @Produce json @Param days query int false "today before ? days" @Success 200 {object} []AmountPerDay @Router /disputegames/overview/amountperdays [get]

func (DisputeGameHandler) GetBondInProgressPerDays

func (h DisputeGameHandler) GetBondInProgressPerDays(c *gin.Context)

@Summary GetBondInProgressPerDays @schemes @Description Get bond in progress per days @Accept json @Produce json @Success 200 {object} []AmountPerDay @Router /disputegames/statistics/bond/inprogress [get]

func (DisputeGameHandler) GetClaimData

func (h DisputeGameHandler) GetClaimData(c *gin.Context)

@Summary Get claim data @schemes @Description Get all claim data by address @Accept json @Produce json @Param address path int false "dispute game address" @Success 200 @Router /disputegames/:address/claimdatas [get]

func (DisputeGameHandler) GetClaimRoot

func (h DisputeGameHandler) GetClaimRoot(c *gin.Context)

@Summary calculate l2 block claim root @schemes @Description calculate l2 block claim roo @Accept json @Produce json @Param blockNumber path int false "dispute game l2 block number" @Success 200 @Router /disputegames/claimroot/:blockNumber [get]

func (DisputeGameHandler) GetCountDisputeGameGroupByStatus

func (h DisputeGameHandler) GetCountDisputeGameGroupByStatus(c *gin.Context)

@Summary GetCountDisputeGameGroupByStatus @schemes @Description Get dispute games count group by status and per day @Accept json @Produce json @Param days query int false "today before ? days" @Success 200 {object} []CountGames @Router /disputegames/count [get]

func (DisputeGameHandler) GetCreditDetails

func (h DisputeGameHandler) GetCreditDetails(c *gin.Context)

@Summary Get credit details @schemes @Description Get credit details @Accept json @Produce json @Param address path int false "account address" @Success 200 @Router /disputegames/:address/credit [get]

func (DisputeGameHandler) GetCreditRank

func (h DisputeGameHandler) GetCreditRank(c *gin.Context)

@Summary Get credit rank @schemes @Description Get credit rank @Accept json @Produce json @Param limit query int false "rank length limit number" @Success 200 @Router /disputegames/credit/rank [get]

func (DisputeGameHandler) GetCurrentBlockChain

func (h DisputeGameHandler) GetCurrentBlockChain(c *gin.Context)

@Summary get current block chain name @Schemes @Description get current block chain name @Accept json @Produce json @Success 200 @Router /disputegames/chainname [get]

func (DisputeGameHandler) GetGamesClaimByPosition

func (h DisputeGameHandler) GetGamesClaimByPosition(c *gin.Context)

@Summary calculate claim by position @Schemes @Description calculate dispute game honest claim by position @Accept json @Produce json @Success 200 @Router /disputegames/calculate/claim [post]

func (DisputeGameHandler) GetOverview

func (h DisputeGameHandler) GetOverview(c *gin.Context)

@Summary overview @schemes @Description Get overview @Accept json @Produce json @Success 200 {object} Overview @Router /disputegames/overview [get]

func (DisputeGameHandler) ListDisputeGames

func (h DisputeGameHandler) ListDisputeGames(c *gin.Context)

@Summary Get dispute games @schemes @Description Get all dispute game by page @Accept json @Produce json @Param page query int false "page num" @Param size query int false "page size" @Success 200 @Router /disputegames [get]

func (DisputeGameHandler) ListGameEvents

func (h DisputeGameHandler) ListGameEvents(c *gin.Context)

@Summary ListGameEvents @schemes @Description Get game events @Accept json @Produce json @Param days query int false "today before ? days" @Success 200 @Router /disputegames/events [get]

type Overview

type Overview struct {
	DisputeGameProxy         string `json:"disputeGameProxy"`
	TotalGames               int64  `json:"totalGames"`
	TotalCredit              string `json:"totalCredit"`
	InProgressGamesCount     int64  `json:"inProgressGamesCount"`
	ChallengerWinGamesCount  int64  `json:"challengerWinGamesCount"`
	DefenderWinWinGamesCount int64  `json:"defenderWinWinGamesCount"`
}

Jump to

Keyboard shortcuts

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