types

package
v0.0.0-...-1cd7654 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidatePairSortBy

func ValidatePairSortBy(sortBy PairSortBy) bool

func ValidateSortOrder

func ValidateSortOrder(order SortOrder) bool

func ValidateTokenSortBy

func ValidateTokenSortBy(sortBy TokenSortBy) bool

Types

type BatchElem

type BatchElem struct {
	Request interface{}
	Result  interface{}
}

type BlockTimestamp

type BlockTimestamp struct {
	Block     int64 `json:"block"`
	Timestamp int64 `json:"timestamp"`
}

type Chain

type Chain struct {
	ChainID       int    `json:"chain_id"`
	Name          string `json:"name"`
	ShortName     string `json:"short_name"`
	ExplorerURL   string `json:"explorer_url"`
	RouterV2      string `json:"router_v2"`
	FactoryV2     string `json:"factory_v2"`
	RouterV3      string `json:"router_v3"`
	FactoryV3     string `json:"factory_v3"`
	BlockDuration int64  `json:"block_duration"`
	Http          string `json:"-"`
}

type FindPairsParams

type FindPairsParams struct {
	ChainID int64
	Filter  *PairFilter
	Options *PairOptions
}

type FindPairsRequest

type FindPairsRequest struct {
	ChainID *int64       `json:"chain_id"`
	Filter  *PairFilter  `json:"filter,omitempty"`
	Options *PairOptions `json:"options,omitempty"`
}

type FindPairsResponse

type FindPairsResponse struct {
	ID     string     `json:"id"`
	Method string     `json:"method"`
	Result []*Pair    `json:"result,omitempty"`
	Error  *JRPCError `json:"error,omitempty"`
}

type FindTokensParams

type FindTokensParams struct {
	ChainID int64
	Filter  *TokenFilter
	Options *TokenOptions
}

type FindTokensRequest

type FindTokensRequest struct {
	ChainID *int64        `json:"chain_id"`
	Filter  *TokenFilter  `json:"filter,omitempty"`
	Options *TokenOptions `json:"options,omitempty"`
}

type FindTokensResponse

type FindTokensResponse struct {
	ID     string     `json:"id"`
	Method string     `json:"method"`
	Result []*Token   `json:"result,omitempty"`
	Error  *JRPCError `json:"error,omitempty"`
}

type GetBlockAtTimestampParams

type GetBlockAtTimestampParams struct {
	ChainID   int64
	Timestamp int64
}

type GetBlockAtTimestampRequest

type GetBlockAtTimestampRequest struct {
	ChainID   *int64 `json:"chain_id"`
	Timestamp *int64 `json:"timestamp"`
}

type GetBlockAtTimestampResponse

type GetBlockAtTimestampResponse struct {
	ID     string          `json:"id"`
	Method string          `json:"method"`
	Result *BlockTimestamp `json:"result,omitempty"`
	Error  *JRPCError      `json:"error,omitempty"`
}

type GetBlockNumberRequest

type GetBlockNumberRequest struct{}

type GetBlockNumberResponse

type GetBlockNumberResponse struct {
	ID     string          `json:"id"`
	Method string          `json:"method"`
	Result map[int64]int64 `json:"result,omitempty"`
	Error  *JRPCError      `json:"error,omitempty"`
}

type GetBlockTimestampsParams

type GetBlockTimestampsParams struct {
	ChainID   int64
	FromBlock int64
	ToBlock   int64
}

type GetBlockTimestampsRequest

type GetBlockTimestampsRequest struct {
	ChainID   *int64 `json:"chain_id"`
	FromBlock *int64 `json:"from_block"`
	ToBlock   *int64 `json:"to_block"`
}

type GetBlockTimestampsResponse

type GetBlockTimestampsResponse struct {
	ID     string            `json:"id"`
	Method string            `json:"method"`
	Result []*BlockTimestamp `json:"result,omitempty"`
	Error  *JRPCError        `json:"error,omitempty"`
}

type GetChainsRequest

type GetChainsRequest struct{}

type GetChainsResponse

type GetChainsResponse struct {
	ID     string     `json:"id"`
	Method string     `json:"method"`
	Result []Chain    `json:"result,omitempty"`
	Error  *JRPCError `json:"error,omitempty"`
}

type GetHeightsRequest

type GetHeightsRequest struct {
	ChainID *int64 `json:"chain_id"`
}

type GetHeightsResponse

type GetHeightsResponse struct {
	ID     string     `json:"id"`
	Method string     `json:"method"`
	Result *Heights   `json:"result,omitempty"`
	Error  *JRPCError `json:"error,omitempty"`
}

type GetPairCountRequest

type GetPairCountRequest struct {
	ChainID *int64 `json:"chain_id"`
}

type GetPairCountResponse

type GetPairCountResponse struct {
	ID     string     `json:"id"`
	Method string     `json:"method"`
	Result int64      `json:"result,omitempty"`
	Error  *JRPCError `json:"error,omitempty"`
}

type GetTokenCountRequest

type GetTokenCountRequest struct {
	ChainID *int64 `json:"chain_id"`
}

type GetTokenCountResponse

type GetTokenCountResponse struct {
	ID     string     `json:"id"`
	Method string     `json:"method"`
	Result int64      `json:"result,omitempty"`
	Error  *JRPCError `json:"error,omitempty"`
}

type Heights

type Heights struct {
	Blocks int64
	Tokens int64
	Pairs  int64
}

type JRPCError

type JRPCError struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

type JRPCRequest

type JRPCRequest struct {
	ID     string      `json:"id"`
	Method string      `json:"method"`
	Params interface{} `json:"params,omitempty"`
}

type JRPCResponse

type JRPCResponse struct {
	ID     string          `json:"id"`
	Method string          `json:"method"`
	Result json.RawMessage `json:"result,omitempty"`
	Error  *JRPCError      `json:"error,omitempty"`
}

type Pair

type Pair struct {
	Token0Address string `json:"token0_address"`
	Token1Address string `json:"token1_address"`
	Fee           int64  `json:"fee"`
	TickSpacing   int64  `json:"tick_spacing"`
	PoolAddress   string `json:"pool_address"`
	PoolType      uint8  `json:"pool_type"`
	CreatedAt     int64  `json:"created_at"`
	Hash          string `json:"hash"`
	ChainID       int16  `json:"chain_id"`
}

func (*Pair) Lower

func (p *Pair) Lower()

type PairFilter

type PairFilter struct {
	Token0Address *string `json:"token0_address,omitempty"`
	Token1Address *string `json:"token1_address,omitempty"`
	PoolAddress   *string `json:"pool_address,omitempty"`
	FromBlock     *int64  `json:"from_block,omitempty"`
	ToBlock       *int64  `json:"to_block,omitempty"`
	Fee           *int64  `json:"fee,omitempty"`
	TickSpacing   *int64  `json:"tick_spacing,omitempty"`
	Hash          *string `json:"hash,omitempty"`
	PoolType      *uint8  `json:"pool_type,omitempty"`
	Fuzzy         bool    `json:"fuzzy"`
}

type PairOptions

type PairOptions struct {
	Offset    int64      `json:"offset"`
	Limit     int64      `json:"limit"`
	SortBy    PairSortBy `json:"sort_by"`
	SortOrder SortOrder  `json:"sort_order"`
}

type PairSortBy

type PairSortBy string
const (
	PairSortByToken0Address PairSortBy = "token0_address"
	PairSortByToken1Address PairSortBy = "token1_address"
	PairSortByPoolAddress   PairSortBy = "pool_address"
	PairSortByFee           PairSortBy = "fee"
	PairSortByTickSpacing   PairSortBy = "tick_spacing"
	PairSortByHash          PairSortBy = "hash"
	PairSortByPoolType      PairSortBy = "pool_type"
	PairSortByCreatedAt     PairSortBy = "created_at"
)

type SortOrder

type SortOrder string
const (
	SortASC  SortOrder = "asc"
	SortDESC SortOrder = "desc"
)

type Token

type Token struct {
	Address      string `json:"address"`
	Name         string `json:"name"`
	Symbol       string `json:"symbol"`
	Decimals     uint8  `json:"decimals"`
	Creator      string `json:"creator"`
	CreatedAt    int64  `json:"created_at"`
	CreationHash string `json:"creation_hash"`
	ChainID      int16  `json:"chain_id"`
}

type TokenFilter

type TokenFilter struct {
	Address   *string `json:"address,omitempty"`
	Creator   *string `json:"creator,omitempty"`
	FromBlock *int64  `json:"from_block,omitempty"`
	ToBlock   *int64  `json:"to_block,omitempty"`
	Name      *string `json:"name,omitempty"`
	Symbol    *string `json:"symbol,omitempty"`
	Decimals  *uint8  `json:"decimals,omitempty"`
	Fuzzy     bool    `json:"fuzzy"`
}

type TokenOptions

type TokenOptions struct {
	Offset    int64       `json:"offset"`
	Limit     int64       `json:"limit"`
	SortBy    TokenSortBy `json:"sort_by"`
	SortOrder SortOrder   `json:"sort_order"`
}

type TokenSortBy

type TokenSortBy string
const (
	TokenSortByAddress   TokenSortBy = "address"
	TokenSortByCreator   TokenSortBy = "creator"
	TokenSortByName      TokenSortBy = "name"
	TokenSortBySymbol    TokenSortBy = "symbol"
	TokenSortByDecimals  TokenSortBy = "decimals"
	TokenSortByCreatedAt TokenSortBy = "created_at"
	TokenSortByHash      TokenSortBy = "creation_hash"
)

Jump to

Keyboard shortcuts

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