handler

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 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 AddressHandler

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

func NewAddressHandler

func NewAddressHandler(
	constantCache *cache.ConstantsCache,
	address storage.IAddress,
	txs storage.ITx,
	actions storage.IAction,
	rollups storage.IRollup,
	fees storage.IFee,
	bridge storage.IBridge,
	deposits storage.IDeposit,
	state storage.IState,
	indexerName string,
) *AddressHandler

func (*AddressHandler) Actions

func (handler *AddressHandler) Actions(c echo.Context) error

Actions godoc

@Summary		Get address actions
@Description	Get address actions
@Tags			address
@ID				address-actions
@Param			hash			path	string					true	"Hash"									minlength(48)	maxlength(48)
@Param			limit			query	integer					false	"Count of requested entities"			minimum(1)		maximum(100)
@Param			offset			query	integer					false	"Offset"								minimum(1)
@Param			sort			query	string					false	"Sort order"							Enums(asc, desc)
@Param			action_types	query	types.ActionType     	false	"Comma-separated action types list"
@Produce		json
@Success		200	{array}		responses.Action
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address/{hash}/actions [get]

func (*AddressHandler) Count

func (handler *AddressHandler) Count(c echo.Context) error

Count godoc

@Summary		Get count of addresses in network
@Description	Get count of addresses in network
@Tags			address
@ID				get-address-count
@Produce		json
@Success		200	{integer}	uint64
@Failure		500	{object}	Error
@Router			/v1/address/count [get]

func (*AddressHandler) Deposits added in v1.1.0

func (handler *AddressHandler) Deposits(c echo.Context) error

Deposits godoc

@Summary		Get bridge deposits
@Description	Get bridge deposits
@Tags			address
@ID				get-address-deposits
@Param			hash		path	string	true	"Hash"								minlength(48)	maxlength(48)
@Param			limit		query	integer	false	"Count of requested entities"		mininum(1)	maximum(100)
@Param			offset		query	integer	false	"Offset"							mininum(1)
@Param			sort		query	string		false	"Sort order"					Enums(asc, desc)
@Produce		json
@Success		200	{array}		responses.Deposit
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address/{hash}/deposits [get]

func (*AddressHandler) Fees added in v1.1.0

func (handler *AddressHandler) Fees(c echo.Context) error

Fees godoc

@Summary		Get address paid fees
@Description	Get address paid fees
@Tags			address
@ID				get-address-fees
@Param			hash		path	string	true	"Hash"								minlength(48)	maxlength(48)
@Param			limit		query	integer	false	"Count of requested entities"		mininum(1)	maximum(100)
@Param			offset		query	integer	false	"Offset"							mininum(1)
@Produce		json
@Success		200	{array}		responses.FullFee
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address/{hash}/fees [get]

func (*AddressHandler) Get

func (handler *AddressHandler) Get(c echo.Context) error

Get godoc

@Summary		Get address info
@Description	Get address info
@Tags			address
@ID				get-address
@Param			hash	path	string	true	"Hash"	minlength(48)	maxlength(48)
@Produce		json
@Success		200	{object}	responses.Address
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address/{hash} [get]

func (*AddressHandler) List

func (handler *AddressHandler) List(c echo.Context) error

List godoc

@Summary		List address info
@Description	List address info
@Tags			address
@ID				list-address
@Param			limit		query	integer	false	"Count of requested entities"		mininum(1)	maximum(100)
@Param			offset		query	integer	false	"Offset"							mininum(1)
@Param			sort		query	string	false	"Sort order"						Enums(asc, desc)
@Param			asset		query	string	false	"Required balance asset"
@Produce		json
@Success		200	{array}		responses.Address
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address [get]

func (*AddressHandler) Roles

func (handler *AddressHandler) Roles(c echo.Context) error

Roles godoc

@Summary		Get address roles in bridges
@Description	Get address roles in bridges
@Tags			address
@ID				address-roles
@Param			hash		path	string	true	"Hash"								minlength(48)	maxlength(48)
@Param			limit		query	integer	false	"Count of requested entities"		mininum(1)	maximum(100)
@Param			offset		query	integer	false	"Offset"							mininum(1)
@Produce		json
@Success		200	{array}		responses.Bridge
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address/{hash}/roles [get]

func (*AddressHandler) Rollups

func (handler *AddressHandler) Rollups(c echo.Context) error

Rollups godoc

@Summary		Get rollups in which the address pushed something
@Description	Get rollups in which the address pushed something
@Tags			address
@ID				address-rollups
@Param			hash			path	string		true	"Hash"									minlength(48)	maxlength(48)
@Param			limit			query	integer		false	"Count of requested entities"			minimum(1)		maximum(100)
@Param			offset			query	integer		false	"Offset"								minimum(1)
@Param			sort			query	string		false	"Sort order"							Enums(asc, desc)
@Produce		json
@Success		200	{array}		responses.Rollup
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address/{hash}/rollups [get]

func (*AddressHandler) Transactions

func (handler *AddressHandler) Transactions(c echo.Context) error

Transactions godoc

@Summary		Get address transactions
@Description	Get address transactions
@Tags			address
@ID				address-transactions
@Param			hash		path	string					true	"Hash"							minlength(48)	maxlength(48)
@Param			limit		query	integer					false	"Count of requested entities"	minimum(1)		maximum(100)
@Param			offset		query	integer					false	"Offset"						minimum(1)
@Param			sort		query	string					false	"Sort order"					Enums(asc, desc)
@Param			status		query	types.Status	    	false	"Comma-separated status list"
@Param			msg_type	query	types.ActionType	    false	"Comma-separated message types list"
@Param			from		query	integer					false	"Time from in unix timestamp"	minimum(1)
@Param			to			query	integer					false	"Time to in unix timestamp"		minimum(1)
@Param			height		query	integer					false	"Block number"					minimum(1)
@Produce		json
@Success		200	{array}		responses.Tx
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/address/{hash}/txs [get]

type ApiValidator

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

func NewApiValidator

func NewApiValidator() *ApiValidator

func (*ApiValidator) Validate

func (v *ApiValidator) Validate(i interface{}) error

type AppHandler added in v1.2.0

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

func NewAppHandler added in v1.2.0

func NewAppHandler(
	apps storage.IApp,
) *AppHandler

func (AppHandler) Get added in v1.2.0

func (handler AppHandler) Get(c echo.Context) error

Get godoc

@Summary		Get application info
@Description	Get application info
@Tags			applications
@ID				get-application
@Param			slug	path	string	true	"Slug"
@Produce		json
@Success		200	{object}	responses.AppWithStats
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/app/{slug} [get]

func (AppHandler) Leaderboard added in v1.2.0

func (handler AppHandler) Leaderboard(c echo.Context) error

Leaderboard godoc

	@Summary		List applications info
	@Description	List applications info
	@Tags			applications
	@ID				list-applications
	@Param			limit	 query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
	@Param			offset	 query	integer	false	"Offset"						mininum(1)
	@Param			sort	 query	string	false	"Sort order. Default: desc"		Enums(asc, desc)
	@Param			sort_by	 query	string	false	"Sort field. Default: size"		Enums(time, actions_count, size)
    @Param          category query  string  false   "Comma-separated application category list"
	@Produce		json
	@Success		200	{array}		responses.AppWithStats
	@Failure		400	{object}	Error
	@Failure		500	{object}	Error
	@Router			/app [get]

type BlockHandler

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

func NewBlockHandler

func NewBlockHandler(
	block storage.IBlock,
	blockStats storage.IBlockStats,
	txs storage.ITx,
	actions storage.IAction,
	rollups storage.IRollup,
	state storage.IState,
	indexerName string,
) *BlockHandler

func (*BlockHandler) Count

func (handler *BlockHandler) Count(c echo.Context) error

Count godoc

@Summary		Get count of blocks in network
@Description	Get count of blocks in network
@Tags			block
@ID				get-block-count
@Produce		json
@Success		200	{integer}	uint64
@Failure		500	{object}	Error
@Router			/v1/block/count [get]

func (*BlockHandler) Get

func (handler *BlockHandler) Get(c echo.Context) error

Get godoc

@Summary		Get block info
@Description	Get block info
@Tags			block
@ID				get-block
@Param			height	path	integer	true	"Block height"	minimum(1)
@Param			stats	query	boolean	false	"Need join stats for block"
@Produce		json
@Success		200	{object}	responses.Block
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/block/{height} [get]

func (*BlockHandler) GetActions

func (handler *BlockHandler) GetActions(c echo.Context) error

GetActions godoc

@Summary		Get actions from begin and end of block
@Description	Get actions from begin and end of block
@Tags			block
@ID				get-block-actions
@Param			height	path	integer	true	"Block height"					minimum(1)
@Param			limit	query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset	query	integer	false	"Offset"						mininum(1)
@Produce		json
@Success		200	{array}		responses.Action
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/block/{height}/actions [get]

func (*BlockHandler) GetRollupActions

func (handler *BlockHandler) GetRollupActions(c echo.Context) error

GetRollupActions godoc

@Summary		Get rollup actions in the block
@Description	Get rollup actions in the block
@Tags			block
@ID				get-block-rollup-actions
@Param			height	path	integer	true	"Block height"					minimum(1)
@Param			limit	query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset	query	integer	false	"Offset"						mininum(1)
@Produce		json
@Success		200	{array}		responses.RollupAction
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/block/{height}/rollup_actions [get]

func (*BlockHandler) GetRollupsActionsCount

func (handler *BlockHandler) GetRollupsActionsCount(c echo.Context) error

GetRollupsActionsCount godoc

@Summary		Get count of rollup actions
@Description	Get count of rollup actions
@Tags			block
@ID				get-block-rollup-actions-count
@Param			height	path	integer	true	"Block height"	minimum(1)
@Produce		json
@Success		200	{integer}	int64
@Failure		500	{object}	Error
@Router			/v1/block/{height}/rollup_actions/count [get]

func (*BlockHandler) GetStats

func (handler *BlockHandler) GetStats(c echo.Context) error

GetStats godoc

@Summary		Get block stats by height
@Description	Get block stats by height
@Tags			block
@ID				get-block-stats
@Param			height	path	integer	true	"Block height"	minimum(1)
@Produce		json
@Success		200	{object}	responses.BlockStats
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/block/{height}/stats [get]

func (*BlockHandler) GetTransactions

func (handler *BlockHandler) GetTransactions(c echo.Context) error

GetTransactions godoc

@Summary		Get transactions are contained in the block
@Description	Get transactions are contained in the block
@Tags			block
@ID				get-block-transactions
@Param			height				path	integer			true	"Block height"					minimum(1)
@Param			limit				query	integer			false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset				query	integer			false	"Offset"						mininum(1)
@Produce		json
@Success		200	{array}		responses.Tx
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/block/{height}/txs [get]

func (*BlockHandler) List

func (handler *BlockHandler) List(c echo.Context) error

List godoc

@Summary		List blocks info
@Description	List blocks info
@Tags			block
@ID				list-block
@Param			limit	query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset	query	integer	false	"Offset"						mininum(1)
@Param			sort	query	string	false	"Sort order"					Enums(asc, desc)
@Param			stats	query	boolean	false	"Need join stats for block"
@Produce		json
@Success		200	{array}		responses.Block
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/block [get]

type ConstantHandler

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

func NewConstantHandler

func NewConstantHandler(constants storage.IConstant) *ConstantHandler

func (*ConstantHandler) Enums

func (handler *ConstantHandler) Enums(c echo.Context) error

Enums godoc

@Summary		Get astria explorer enumerators
@Description	Get astria explorer enumerators
@Tags			general
@ID				get-enums
@Produce		json
@Success		200	{object}	responses.Enums
@Router			/v1/enums [get]

func (*ConstantHandler) Get

func (handler *ConstantHandler) Get(c echo.Context) error

Get godoc

@Summary		Get network constants
@Description	Get network constants
@Tags			general
@ID				get-constants
@Produce		json
@Success		200	{object}	responses.Constants
@Success		204
@Failure		500	{object}	Error
@Router			/v1/constants [get]

type Error

type Error struct {
	Message string `json:"message"`
}

type NoRows

type NoRows interface {
	IsNoRows(err error) bool
}

type RollupHandler

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

func NewRollupHandler

func NewRollupHandler(
	constantCache *cache.ConstantsCache,
	rollups storage.IRollup,
	actions storage.IAction,
	bridge storage.IBridge,
	deposits storage.IDeposit,
	state storage.IState,
	indexerName string,
) *RollupHandler

func (*RollupHandler) Actions

func (handler *RollupHandler) Actions(c echo.Context) error

Actions godoc

@Summary		Get rollup actions
@Description	Get rollup actions
@Tags			rollup
@ID				rollup-actions
@Param			hash			path	string					true	"Base64Url encoded rollup id"
@Param			limit			query	integer					false	"Count of requested entities"			minimum(1)		maximum(100)
@Param			offset			query	integer					false	"Offset"								minimum(1)
@Param			sort			query	string					false	"Sort order"							Enums(asc, desc)
@Produce		json
@Success		200	{array}		responses.RollupAction
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/rollup/{hash}/actions [get]

func (*RollupHandler) Addresses

func (handler *RollupHandler) Addresses(c echo.Context) error

Addresses godoc

@Summary		List addresses which pushed something in the rollup
@Description	List addresses which pushed something in the rollup
@Tags			rollup
@ID				get-rollup-addresses
@Param			limit		query	integer	false	"Count of requested entities"		mininum(1)	maximum(100)
@Param			offset		query	integer	false	"Offset"							mininum(1)
@Param			sort		query	string	false	"Sort order"						Enums(asc, desc)
@Produce		json
@Success		200	{array}	    responses.Address
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/rollup/{hash}/addresses [get]

func (*RollupHandler) AllActions

func (handler *RollupHandler) AllActions(c echo.Context) error

AllActions godoc

@Summary		Get rollup actions with actions of all connected bridges
@Description	Get rollup actions with actions of all connected bridges
@Tags			rollup
@ID				rollup-all-actions
@Param			hash			path	string				true	"Base64Url encoded rollup id"
@Param			limit			query	integer				false	"Count of requested entities"					minimum(1)		maximum(100)
@Param			offset			query	integer				false	"Offset"										minimum(1)
@Param			sort			query	string				false	"Sort order"									Enums(asc, desc)
@Param			rollup_actions	query	boolean				false	"If true join rollup actions. Default: true"
@Param			bridge_actions	query	boolean				false	"If true join brigde actions. Default: true"
@Param			action_types	query	types.ActionType	false	"Comma-separated action types list"
@Param			from			query	integer				false	"Time from in unix timestamp"					mininum(1)
@Param			to				query	integer				false	"Time to in unix timestamp"						mininum(1)
@Produce		json
@Success		200	{array}		responses.Action
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/rollup/{hash}/all_actions [get]

func (*RollupHandler) Bridges

func (handler *RollupHandler) Bridges(c echo.Context) error

Bridges godoc

@Summary		Get rollup bridges
@Description	Get rollup bridges
@Tags			rollup
@ID				rollup-bridges
@Param			hash			path	string					true	"Base64Url encoded rollup id"
@Param			limit			query	integer					false	"Count of requested entities"			minimum(1)		maximum(100)
@Param			offset			query	integer					false	"Offset"								minimum(1)
@Param			sort			query	string					false	"Sort order"							Enums(asc, desc)
@Produce		json
@Success		200	{array}		responses.Bridge
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/rollup/{hash}/bridges [get]

func (*RollupHandler) Count

func (handler *RollupHandler) Count(c echo.Context) error

Count godoc

@Summary		Get count of rollups in network
@Description	Get count of rollups in network
@Tags			rollup
@ID				get-rollup-count
@Produce		json
@Success		200	{integer}	uint64
@Failure		500	{object}	Error
@Router			/v1/rollup/count [get]

func (*RollupHandler) Deposits added in v1.1.0

func (handler *RollupHandler) Deposits(c echo.Context) error

Deposits godoc

@Summary		Get rollup deposits
@Description	Get rollup deposits
@Tags			rollup
@ID				get-rollup-deposits
@Param			hash		path	string	true	"Base64Url encoded rollup id"
@Param			limit		query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset		query	integer	false	"Offset"						mininum(1)
@Param			sort		query	string	false	"Sort order"					Enums(asc, desc)
@Produce		json
@Success		200	{array}		responses.Deposit
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/rollup/{hash}/deposits [get]

func (*RollupHandler) Get

func (handler *RollupHandler) Get(c echo.Context) error

Get godoc

@Summary		Get rollup info
@Description	Get rollup info
@Tags			rollup
@ID				get-rollup
@Param			hash	path	string	true	"Base64Url encoded rollup id"
@Produce		json
@Success		200	{object}	responses.Rollup
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/rollup/{hash} [get]

func (*RollupHandler) List

func (handler *RollupHandler) List(c echo.Context) error

List godoc

@Summary		List rollups info
@Description	List rollups info
@Tags			rollup
@ID				list-rollups
@Param			limit		query	integer	false	"Count of requested entities"			mininum(1)	maximum(100)
@Param			offset		query	integer	false	"Offset"								mininum(1)
@Param			sort		query	string	false	"Sort order"							Enums(asc, desc)
@Param			sort_by		query	string	false	"Field using for sorting. Default: id"	Enums(id, size)
@Produce		json
@Success		200	{array}		responses.Rollup
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/rollup [get]

type SearchHandler

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

func NewSearchHandler

func NewSearchHandler(
	constantCache *cache.ConstantsCache,
	search storage.ISearch,
	address storage.IAddress,
	blocks storage.IBlock,
	txs storage.ITx,
	rollups storage.IRollup,
	bridges storage.IBridge,
	validators storage.IValidator,
) *SearchHandler

func (*SearchHandler) Search

func (s *SearchHandler) Search(c echo.Context) error

Search godoc

@Summary				Search by hash or text
@Tags					search
@ID						search
@Param					query	query	string	true	"Search string"
@Produce				json
@Success				200	{array}		responses.SearchResult
@Failure				400	{object}	Error
@Failure				500	{object}	Error
@Router					/v1/search [get]

type StateHandler

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

func NewStateHandler

func NewStateHandler(state storage.IState) *StateHandler

func (*StateHandler) Head

func (sh *StateHandler) Head(c echo.Context) error

Head godoc

@Summary		Get current indexer head
@Description	Get current indexer head
@Tags			general
@ID				head
@Produce		json
@Success		200	{object}	responses.State
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/head [get]

type StatsHandler

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

func NewStatsHandler

func NewStatsHandler(repo storage.IStats, rollups storage.IRollup) StatsHandler

func (StatsHandler) ActiveAddressesCount added in v1.1.0

func (sh StatsHandler) ActiveAddressesCount(c echo.Context) error

ActiveAddressesCount godoc

@Summary		Active adddresses count
@Description	Active adddresses count
@Tags			stats
@ID				stats-active-addresses-count
@Produce		json
@Success		200	{integer}	int64
@Failure		500	{object}	Error
@Router			/v1/stats/summary/active_addresses_count [get]

func (StatsHandler) FeeSummary added in v1.1.0

func (sh StatsHandler) FeeSummary(c echo.Context) error

FeeSummary godoc

@Summary		Get fee summary
@Description	Get fee summary
@Tags			stats
@ID				stats-fee-summary
@Produce		json
@Success		200	{array}		responses.FeeSummary
@Failure		500	{object}	Error
@Router			/v1/stats/fee/summary [get]

func (StatsHandler) RollupSeries

func (sh StatsHandler) RollupSeries(c echo.Context) error

RollupSeries godoc

@Summary		Get histogram with precomputed rollup stats
@Description	Get histogram with precomputed rollup by series name and timeframe
@Tags			stats
@ID				stats-rollup-series
@Param			hash		path	string	true	"Base64Url encoded rollup id"
@Param			timeframe	path	string	true	"Timeframe"						Enums(hour, day, month)
@Param			name		path	string	true	"Series name"					Enums(size, avg_size, min_size, max_size, actions_count)
@Param			from		query	integer	false	"Time from in unix timestamp"	mininum(1)
@Param			to			query	integer	false	"Time to in unix timestamp"		mininum(1)
@Produce		json
@Success		200	{array}		responses.RollupSeriesItem
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/stats/rollup/series/{hash}/{name}/{timeframe} [get]

func (StatsHandler) Series

func (sh StatsHandler) Series(c echo.Context) error

Series godoc

@Summary		Get histogram with precomputed stats
@Description	Get histogram with precomputed stats by series name and timeframe
@Tags			stats
@ID				stats-series
@Param			timeframe	path	string	true	"Timeframe"						Enums(hour, day, month)
@Param			name		path	string	true	"Series name"					Enums(data_size, tps, bps, rbps, fee, supply_change, block_time, tx_count, bytes_in_block)
@Param			from		query	integer	false	"Time from in unix timestamp"	mininum(1)
@Param			to			query	integer	false	"Time to in unix timestamp"		mininum(1)
@Produce		json
@Success		200	{array}		responses.SeriesItem
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/stats/series/{name}/{timeframe} [get]

func (StatsHandler) Summary

func (sh StatsHandler) Summary(c echo.Context) error

Summary godoc

@Summary		Get network summary
@Description	Get network summary
@Tags			stats
@ID				stats-summary
@Produce		json
@Success		200	{array}		responses.NetworkSummary
@Failure		500	{object}	Error
@Router			/v1/stats/summary [get]

func (StatsHandler) SummaryTimeframe

func (sh StatsHandler) SummaryTimeframe(c echo.Context) error

SummaryTimeframe godoc

@Summary		Get network summary for the last period
@Description	Get network summary for the last period
@Tags			stats
@ID				stats-summary-timeframe
@Param			timeframe	path	string	true "Timeframe" Enums(day, week, month)
@Produce		json
@Success		200	{array}		responses.NetworkSummaryWithChange
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/stats/summary/{timeframe} [get]

func (StatsHandler) TokenTransferDistribution added in v1.1.0

func (sh StatsHandler) TokenTransferDistribution(c echo.Context) error

TokenTransferDistribution godoc

@Summary		Token transfer distribution
@Description	Token transfer distribution
@Tags			stats
@ID				stats-token-transfer-distribution
@Param			limit	query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
@Produce		json
@Success		200	{array}		responses.TokenTransferDistributionItem
@Failure		500	{object}	Error
@Router			/v1/stats/token/transfer_distribution [get]

type StringArray

type StringArray []string

func (*StringArray) UnmarshalParam

func (s *StringArray) UnmarshalParam(param string) error

type TxHandler

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

func NewTxHandler

func NewTxHandler(
	tx storage.ITx,
	actions storage.IAction,
	rollups storage.IRollup,
	fees storage.IFee,
	state storage.IState,
	indexerName string,
) *TxHandler

func (*TxHandler) Count

func (handler *TxHandler) Count(c echo.Context) error

Count godoc

@Summary		Get count of transactions in network
@Description	Get count of transactions in network
@Tags			transactions
@ID				get-transactions-count
@Produce		json
@Success		200	{integer}	uint64
@Failure		500	{object}	Error
@Router			/v1/tx/count [get]

func (*TxHandler) Get

func (handler *TxHandler) Get(c echo.Context) error

Get godoc

@Summary		Get transaction by hash
@Description	Get transaction by hash
@Tags			transactions
@ID				get-transaction
@Param			hash	path	string	true	"Transaction hash in hexadecimal"	minlength(64)	maxlength(64)
@Produce		json
@Success		200	{object}	responses.Tx
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/tx/{hash} [get]

func (*TxHandler) GetActions

func (handler *TxHandler) GetActions(c echo.Context) error

GetActions godoc

@Summary		Get transaction actions
@Description	Get transaction actions
@Tags			transactions
@ID				get-transaction-actions
@Param			hash	path	string	true	"Transaction hash in hexadecimal"	minlength(64)	maxlength(64)
@Param			limit	query	integer	false	"Count of requested entities"		mininum(1)	maximum(100)
@Param			offset	query	integer	false	"Offset"							mininum(1)
@Produce		json
@Success		200	{array}		responses.Action
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/tx/{hash}/actions [get]

func (*TxHandler) GetFees added in v1.1.0

func (handler *TxHandler) GetFees(c echo.Context) error

GetFees godoc

@Summary		Get transaction fees
@Description	Get transaction fees
@Tags			transactions
@ID				get-transaction-fees
@Param			hash	path	string	true	"Transaction hash in hexadecimal"	minlength(64)	maxlength(64)
@Param			limit	query	integer	false	"Count of requested entities"		mininum(1)		maximum(100)
@Param			offset	query	integer	false	"Offset"							mininum(1)
@Produce		json
@Success		200	{array}		responses.FullFee
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/tx/{hash}/fees [get]

func (*TxHandler) List

func (handler *TxHandler) List(c echo.Context) error

List godoc

@Summary		List transactions info
@Description	List transactions info
@Tags			transactions
@ID				list-transactions
@Param			limit				query	integer				false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset				query	integer				false	"Offset"						mininum(1)
@Param			sort				query	string				false	"Sort order"					Enums(asc, desc)
@Param			status				query	types.Status		false	"Comma-separated status list"
@Param			action_types		query	types.ActionType	false	"Comma-separated action types list"
@Param			from				query	integer				false	"Time from in unix timestamp"	mininum(1)
@Param			to					query	integer				false	"Time to in unix timestamp"		mininum(1)
@Param			height				query	integer				false	"Block number"					mininum(1)
@Param			messages			query	boolean				false	"If true join actions"			mininum(1)
@Produce		json
@Success		200	{array}		responses.Tx
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/tx [get]

func (*TxHandler) RollupActions

func (handler *TxHandler) RollupActions(c echo.Context) error

RollupActions godoc

@Summary		List transaction's rollup actions
@Description	List transaction's rollup actions
@Tags			transactions
@ID				list-transactions-rollup-actions
@Param			hash	path	string	true	"Transaction hash in hexadecimal"	minlength(64)	maxlength(64)
@Param			limit	query	integer	false	"Count of requested entities"		mininum(1)		maximum(100)
@Param			offset	query	integer	false	"Offset"							mininum(1)
@Produce		json
@Success		200	{array}		responses.RollupAction
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/tx/{hash}/rollup_actions [get]

func (*TxHandler) RollupActionsCount

func (handler *TxHandler) RollupActionsCount(c echo.Context) error

RollupActionsCount godoc

@Summary		Count of rollup actions
@Description	Count of rollup actions
@Tags			transactions
@ID				list-transactions-rollup-actions-count
@Param			hash	path	string	true	"Transaction hash in hexadecimal"	minlength(64)	maxlength(64)
@Produce		json
@Success		200	{integer}	uint64
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/tx/{hash}/rollup_actions/count [get]

type ValidatorHandler

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

func NewValidatorHandler

func NewValidatorHandler(
	validators storage.IValidator,
	blocks storage.IBlock,
	blockSignatures storage.IBlockSignature,
	state storage.IState,
	indexerName string,
) *ValidatorHandler

func (*ValidatorHandler) Blocks

func (handler *ValidatorHandler) Blocks(c echo.Context) error

Blocks godoc

@Summary		List blocks which was proposed by validator
@Description	List blocks which was proposed by validator
@Tags			validator
@ID				get-validator-blocks
@Param			id		path	integer	true	"Internal validator id"
@Param			limit	query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset	query	integer	false	"Offset"						mininum(1)
@Param			sort	query	string	false	"Sort order"					Enums(asc, desc)
@Produce		json
@Success		200	{array}	responses.Block
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/validators/{id}/blocks [get]

func (*ValidatorHandler) Get

func (handler *ValidatorHandler) Get(c echo.Context) error

Get godoc

@Summary		Get validator info
@Description	Get validator info
@Tags			validator
@ID				get-validator
@Param			id	path	integer	true	"Internal validator id"
@Produce		json
@Success		200	{object}	responses.Validator
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/validators/{id} [get]

func (*ValidatorHandler) List

func (handler *ValidatorHandler) List(c echo.Context) error

List godoc

@Summary		List validators
@Description	List validators sorted by power
@Tags			validator
@ID				list-validator
@Param			limit	query	integer	false	"Count of requested entities"	mininum(1)	maximum(100)
@Param			offset	query	integer	false	"Offset"						mininum(1)
@Param			sort	query	string	false	"Sort order"					Enums(asc, desc)
@Produce		json
@Produce		json
@Success		200	{array}		responses.Validator
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/validators [get]

func (*ValidatorHandler) Uptime

func (handler *ValidatorHandler) Uptime(c echo.Context) error

Uptime godoc

@Summary		Get validator's uptime and history of signed block
@Description	Get validator's uptime and history of signed block
@Tags			validator
@ID				get-validator-uptime
@Param			id		path	integer	true	"Internal validator id"
@Param			limit	query	integer	false	"Count of requested blocks"	mininum(1)	maximum(100)
@Produce		json
@Success		200	{object}	responses.ValidatorUptime
@Success		204
@Failure		400	{object}	Error
@Failure		500	{object}	Error
@Router			/v1/validators/{id}/uptime [get]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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