parsers

package
v1.7.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountsFiltersStructValidation

func AccountsFiltersStructValidation(sl validator.StructLevel)

AccountsFiltersStructValidation validates AccountsFilters

func BidsFiltersStructValidation

func BidsFiltersStructValidation(sl validator.StructLevel)

BidsFiltersStructValidation func for bids filters validation

func ExitsFiltersStructValidation

func ExitsFiltersStructValidation(sl validator.StructLevel)

ExitsFiltersStructValidation func validates ExitsFilters

func HistoryTxsFiltersStructValidation

func HistoryTxsFiltersStructValidation(sl validator.StructLevel)

HistoryTxsFiltersStructValidation func to validate history txs filters

func ParseAccountFilter

func ParseAccountFilter(c *gin.Context) (common.QueryAccount, error)

ParseAccountFilter parses account filter to the account index

func ParseAccountsFilters

func ParseAccountsFilters(c *gin.Context, v *validator.Validate) (historydb.GetAccountsAPIRequest, error)

ParseAccountsFilters parsing /accounts query params to GetAccountsAPIRequest

func ParseBatchFilter

func ParseBatchFilter(c *gin.Context) (*uint, error)

ParseBatchFilter parsing /batches request to the batch num

func ParseBatchesFilter

func ParseBatchesFilter(c *gin.Context) (historydb.GetBatchesAPIRequest, error)

ParseBatchesFilter parsing batches filter to the GetBatchesAPIRequest

func ParseBidsFilters

func ParseBidsFilters(c *gin.Context, v *validator.Validate) (historydb.GetBidsAPIRequest, error)

ParseBidsFilters function for parsing bids filters from the request /bids to the GetBidsAPIRequest

func ParseCoordinatorsFilters

func ParseCoordinatorsFilters(c *gin.Context) (historydb.GetCoordinatorsAPIRequest, error)

ParseCoordinatorsFilters func for parsing coordinator filters from the /coordinators request

func ParseCurrenciesFilters

func ParseCurrenciesFilters(c *gin.Context) ([]string, error)

ParseCurrenciesFilters func for parsing currencies filters from query to the symbols

func ParseCurrencyFilter

func ParseCurrencyFilter(c *gin.Context) (string, error)

ParseCurrencyFilter func for parsing currency filter from uri to the symbol

func ParseExitFilter

func ParseExitFilter(c *gin.Context) (*uint, *common.Idx, error)

ParseExitFilter func parsing exit filter from the /exits request to the accountIndex and batchNum

func ParseExitsFilters

func ParseExitsFilters(c *gin.Context, v *validator.Validate) (historydb.GetExitsAPIRequest, error)

ParseExitsFilters func parsing exits filters

func ParseGetAccountCreationAuthFilter

func ParseGetAccountCreationAuthFilter(c *gin.Context) (*ethCommon.Address, error)

ParseGetAccountCreationAuthFilter parsing uri request to the eth address

func ParseHistoryTxFilter

func ParseHistoryTxFilter(c *gin.Context) (common.TxID, error)

ParseHistoryTxFilter function for parsing history tx filter to the txID

func ParseHistoryTxsFilters

func ParseHistoryTxsFilters(c *gin.Context, v *validator.Validate) (historydb.GetTxsAPIRequest, error)

ParseHistoryTxsFilters func to parse history txs filters from query to the GetTxsAPIRequest

func ParseParamAtomicGroupID added in v1.6.0

func ParseParamAtomicGroupID(c *gin.Context) (common.AtomicGroupID, error)

ParseParamAtomicGroupID func for parsing AtomicGroupID

func ParsePoolTxFilter

func ParsePoolTxFilter(c *gin.Context) (common.TxID, error)

ParsePoolTxFilter func for parsing tx filter to the transaction id

func ParsePoolTxUpdateByIdxAndNonceFilter added in v1.7.0

func ParsePoolTxUpdateByIdxAndNonceFilter(c *gin.Context) (common.Idx, nonce.Nonce, error)

ParsePoolTxUpdateByIdxAndNonceFilter func for parsing pool tx update by idx and nonce filter to the account index and nonce

func ParsePoolTxsFilters

func ParsePoolTxsFilters(c *gin.Context, v *validator.Validate) (l2db.GetPoolTxsAPIRequest, error)

ParsePoolTxsFilters func to parse pool txs filters from the /transactions-pool request to the GetPoolTxsAPIRequest

func ParseSlotFilter

func ParseSlotFilter(c *gin.Context) (*uint, error)

ParseSlotFilter func to parse slot filter from uri to the slot number

func ParseSlotsFilters

func ParseSlotsFilters(c *gin.Context, v *validator.Validate) (historydb.GetBestBidsAPIRequest, error)

ParseSlotsFilters func for parsing slots filters to the GetBestBidsAPIRequest

func ParseTokenFilter

func ParseTokenFilter(c *gin.Context) (*uint, error)

ParseTokenFilter for parsing token filter from uri to the id

func ParseTokensFilters

func ParseTokensFilters(c *gin.Context) (historydb.GetTokensAPIRequest, error)

ParseTokensFilters function for parsing tokens filters to the GetTokensAPIRequest

func PoolTxsTxsFiltersStructValidation

func PoolTxsTxsFiltersStructValidation(sl validator.StructLevel)

PoolTxsTxsFiltersStructValidation func for pool txs query params validation

func SlotsFiltersStructValidation added in v1.6.0

func SlotsFiltersStructValidation(sl validator.StructLevel)

SlotsFiltersStructValidation func validating filters struct

Types

type AccountFilter

type AccountFilter struct {
	AccountIndex string `uri:"accountIndex" binding:"required"`
}

AccountFilter for parsing /accounts/{accountIndex} request to struct

type AccountsFilters

type AccountsFilters struct {
	IDs  string `form:"tokenIds"`
	Addr string `form:"hezEthereumAddress"`
	Bjj  string `form:"BJJ"`

	Pagination
}

AccountsFilters for parsing /accounts query params to struct

type AtomicGroupFilter added in v1.6.0

type AtomicGroupFilter struct {
	ID string `uri:"id" binding:"required"`
}

AtomicGroupFilter struct for filtering atomic group request

type BatchFilter

type BatchFilter struct {
	BatchNum uint `uri:"batchNum" binding:"required"`
}

BatchFilter struct to hold batch num from request /batches/:batchNum

type BatchesFilters

type BatchesFilters struct {
	MinBatchNum *uint  `form:"minBatchNum"`
	MaxBatchNum *uint  `form:"maxBatchNum"`
	SlotNum     *uint  `form:"slotNum"`
	ForgerAddr  string `form:"forgerAddr"`

	Pagination
}

BatchesFilters struct to hold batch num from request /batches/:batchNum

type BidsFilters

type BidsFilters struct {
	SlotNum    *int64 `form:"slotNum" binding:"omitempty,min=0"`
	BidderAddr string `form:"bidderAddr"`

	Pagination
}

BidsFilters struct to hold bids filters

type CoordinatorsFilters

type CoordinatorsFilters struct {
	BidderAddr string `form:"bidderAddr"`
	ForgerAddr string `form:"forgerAddr"`

	Pagination
}

CoordinatorsFilters struct to get coordinator query params from /coordinators request

type CurrenciesFilters

type CurrenciesFilters struct {
	Symbols string `form:"symbols"`
}

CurrenciesFilters struct to get query params from /currencies request

type CurrencyFilter

type CurrencyFilter struct {
	Symbol string `uri:"symbol" binding:"required"`
}

CurrencyFilter struct to get uri param from /currencies/:symbol request

type ExitFilter

type ExitFilter struct {
	BatchNum     uint   `uri:"batchNum" binding:"required"`
	AccountIndex string `uri:"accountIndex" binding:"required"`
}

ExitFilter struct to hold exit filter

type ExitsFilters

type ExitsFilters struct {
	TokenID              *uint  `form:"tokenId"`
	Addr                 string `form:"hezEthereumAddress"`
	Bjj                  string `form:"BJJ"`
	AccountIndex         string `form:"accountIndex"`
	BatchNum             *uint  `form:"batchNum"`
	OnlyPendingWithdraws *bool  `form:"onlyPendingWithdraws"`

	Pagination
}

ExitsFilters struct for holding exits filters

type GetAccountCreationAuthFilter

type GetAccountCreationAuthFilter struct {
	Addr string `uri:"hezEthereumAddress" binding:"required"`
}

GetAccountCreationAuthFilter struct for parsing hezEthereumAddress from /account-creation-authorization/:hezEthereumAddress request

type HistoryTxFilter

type HistoryTxFilter struct {
	TxID string `uri:"id" binding:"required"`
}

HistoryTxFilter struct to get history tx uri param from /transaction-history/:id request

type HistoryTxsFilters

type HistoryTxsFilters struct {
	TokenID             *uint  `form:"tokenId"`
	HezEthereumAddr     string `form:"hezEthereumAddress"`
	FromHezEthereumAddr string `form:"fromHezEthereumAddress"`
	ToHezEthereumAddr   string `form:"toHezEthereumAddress"`
	Bjj                 string `form:"BJJ"`
	ToBjj               string `form:"toBJJ"`
	FromBjj             string `form:"fromBJJ"`
	AccountIndex        string `form:"accountIndex"`
	FromAccountIndex    string `form:"fromAccountIndex"`
	ToAccountIndex      string `form:"toAccountIndex"`
	BatchNum            *uint  `form:"batchNum"`
	TxType              string `form:"type"`
	IncludePendingTxs   *bool  `form:"includePendingL1s"`

	Pagination
}

HistoryTxsFilters struct for holding filters from the /transaction-history request

type Pagination

type Pagination struct {
	FromItem *uint   `form:"fromItem"`
	Order    *string `form:"order,default=ASC" binding:"omitempty,oneof=ASC DESC"`
	Limit    *uint   `form:"limit,default=20" binding:"omitempty,min=1,max=2049"`
}

Pagination type for holding pagination params

type PoolTxFilter

type PoolTxFilter struct {
	TxID string `uri:"id" binding:"required"`
}

PoolTxFilter struct to get uri param from /transactions-pool/:id request

type PoolTxUpdateByIdxAndNonceFilter added in v1.7.0

type PoolTxUpdateByIdxAndNonceFilter struct {
	AccountIndex string `uri:"accountIndex" binding:"required"`
	Nonce        *uint  `uri:"nonce" binding:"required"`
}

PoolTxUpdateByIdxAndNonceFilter struct to get uri param from /transactions-pool/accounts/:accountIndex/nonces/:nonce request

type PoolTxsFilters

type PoolTxsFilters struct {
	TokenID             *uint  `form:"tokenId"`
	HezEthereumAddr     string `form:"hezEthereumAddress"`
	FromHezEthereumAddr string `form:"fromHezEthereumAddress"`
	ToHezEthereumAddr   string `form:"toHezEthereumAddress"`
	Bjj                 string `form:"BJJ"`
	FromBjj             string `form:"fromBJJ"`
	ToBjj               string `form:"toBJJ"`
	AccountIndex        string `form:"accountIndex"`
	FromAccountIndex    string `form:"fromAccountIndex"`
	ToAccountIndex      string `form:"toAccountIndex"`
	TxType              string `form:"type"`
	State               string `form:"state"`

	Pagination
}

PoolTxsFilters struct for holding query params from /transactions-pool request

type SlotFilter

type SlotFilter struct {
	SlotNum *uint `uri:"slotNum" binding:"required"`
}

SlotFilter struct to get slot filter uri param from /slots/:slotNum request

type SlotsFilters

type SlotsFilters struct {
	MinSlotNum           *int64 `form:"minSlotNum" binding:"omitempty,min=0"`
	MaxSlotNum           *int64 `form:"maxSlotNum" binding:"omitempty,min=0"`
	WonByEthereumAddress string `form:"wonByEthereumAddress"`
	FinishedAuction      *bool  `form:"finishedAuction"`

	Pagination
}

SlotsFilters struct to get slots filters from query params from /slots request

type TokenFilter

type TokenFilter struct {
	ID *uint `uri:"id" binding:"required"`
}

TokenFilter struct to get token uri param from /tokens/:id request

type TokensFilters

type TokensFilters struct {
	IDs       string `form:"ids"`
	Symbols   string `form:"symbols"`
	Name      string `form:"name"`
	Addresses string `form:"addresses"`

	Pagination
}

TokensFilters struct to get token query params from /tokens request

Jump to

Keyboard shortcuts

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