explorer

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 5 Imported by: 0

README

Explorer

This package contains a monitoring interface for the explorer api. The gqlgenc works by spinning up a local version of the explorer and introspecting the graphql schema. The mechanism for this happening exists in contrib. We do not reuse the model definitions from the explorer package isnce these may not be useful.

Documentation

Overview

Package explorer contains the explorer gql client

Index

Constants

This section is empty.

Variables

View Source
var AllDirection = []Direction{
	DirectionIn,
	DirectionOut,
}

Functions

This section is empty.

Types

type AddressChainRanking

type AddressChainRanking struct {
	ChainID   *int64   `json:"chainID,omitempty"`
	VolumeUsd *float64 `json:"volumeUsd,omitempty"`
	Rank      *int64   `json:"rank,omitempty"`
}

type AddressDailyCount

type AddressDailyCount struct {
	Date  *string `json:"date,omitempty"`
	Count *int64  `json:"count,omitempty"`
}

type AddressData

type AddressData struct {
	BridgeVolume *float64               `json:"bridgeVolume,omitempty"`
	BridgeFees   *float64               `json:"bridgeFees,omitempty"`
	BridgeTxs    *int64                 `json:"bridgeTxs,omitempty"`
	SwapVolume   *float64               `json:"swapVolume,omitempty"`
	SwapFees     *float64               `json:"swapFees,omitempty"`
	SwapTxs      *int64                 `json:"swapTxs,omitempty"`
	Rank         *int64                 `json:"rank,omitempty"`
	EarliestTx   *int64                 `json:"earliestTx,omitempty"`
	ChainRanking []*AddressChainRanking `json:"chainRanking,omitempty"`
	DailyData    []*AddressDailyCount   `json:"dailyData,omitempty"`
}

type AddressRanking

type AddressRanking struct {
	Address *string `json:"address,omitempty"`
	Count   *int64  `json:"count,omitempty"`
}

AddressRanking gives the amount of transactions that occurred for a specific address across all chains.

type BlockHeight added in v0.0.38

type BlockHeight struct {
	ChainID     *int64        `json:"chainID,omitempty"`
	Type        *ContractType `json:"type,omitempty"`
	BlockNumber *int64        `json:"blockNumber,omitempty"`
}

type BridgeTransaction

type BridgeTransaction struct {
	FromInfo    *PartialInfo `json:"fromInfo,omitempty"`
	ToInfo      *PartialInfo `json:"toInfo,omitempty"`
	Kappa       *string      `json:"kappa,omitempty"`
	Pending     *bool        `json:"pending,omitempty"`
	SwapSuccess *bool        `json:"swapSuccess,omitempty"`
}

BridgeTransaction represents an entire bridge transaction, including both to and from transactions. If a `from` transaction does not have a corresponding `to` transaction, `pending` will be true.

type BridgeTxType added in v0.0.4

type BridgeTxType string
const (
	BridgeTxTypeOrigin      BridgeTxType = "ORIGIN"
	BridgeTxTypeDestination BridgeTxType = "DESTINATION"
)

func (BridgeTxType) IsValid added in v0.0.4

func (e BridgeTxType) IsValid() bool

func (BridgeTxType) MarshalGQL added in v0.0.4

func (e BridgeTxType) MarshalGQL(w io.Writer)

func (BridgeTxType) String added in v0.0.4

func (e BridgeTxType) String() string

func (*BridgeTxType) UnmarshalGQL added in v0.0.4

func (e *BridgeTxType) UnmarshalGQL(v interface{}) error

type BridgeType added in v0.0.32

type BridgeType string
const (
	BridgeTypeBridge BridgeType = "BRIDGE"
	BridgeTypeCctp   BridgeType = "CCTP"
	BridgeTypeRfq    BridgeType = "RFQ"
)

func (BridgeType) IsValid added in v0.0.32

func (e BridgeType) IsValid() bool

func (BridgeType) MarshalGQL added in v0.0.32

func (e BridgeType) MarshalGQL(w io.Writer)

func (BridgeType) String added in v0.0.32

func (e BridgeType) String() string

func (*BridgeType) UnmarshalGQL added in v0.0.32

func (e *BridgeType) UnmarshalGQL(v interface{}) error

type BridgeWatcherTx added in v0.0.4

type BridgeWatcherTx struct {
	BridgeTx    *PartialInfo  `json:"bridgeTx,omitempty"`
	Pending     *bool         `json:"pending,omitempty"`
	Type        *BridgeTxType `json:"type,omitempty"`
	Kappa       *string       `json:"kappa,omitempty"`
	KappaStatus *KappaStatus  `json:"kappaStatus,omitempty"`
}

BridgeWatcherTx represents a single sided bridge transaction specifically for the bridge watcher.

type Client

type Client struct {
	Client *client.Client
}

func NewClient

func NewClient(cli *http.Client, baseURL string, options ...client.HTTPRequestOption) *Client

type ContractQuery added in v0.0.38

type ContractQuery struct {
	ChainID int64        `json:"chainID"`
	Type    ContractType `json:"type"`
}

type ContractType added in v0.0.38

type ContractType string
const (
	ContractTypeBridge ContractType = "BRIDGE"
	ContractTypeCctp   ContractType = "CCTP"
	ContractTypeRfq    ContractType = "RFQ"
)

func (ContractType) IsValid added in v0.0.38

func (e ContractType) IsValid() bool

func (ContractType) MarshalGQL added in v0.0.38

func (e ContractType) MarshalGQL(w io.Writer)

func (ContractType) String added in v0.0.38

func (e ContractType) String() string

func (*ContractType) UnmarshalGQL added in v0.0.38

func (e *ContractType) UnmarshalGQL(v interface{}) error

type DailyStatisticType

type DailyStatisticType string
const (
	DailyStatisticTypeVolume       DailyStatisticType = "VOLUME"
	DailyStatisticTypeTransactions DailyStatisticType = "TRANSACTIONS"
	DailyStatisticTypeAddresses    DailyStatisticType = "ADDRESSES"
	DailyStatisticTypeFee          DailyStatisticType = "FEE"
)

func (DailyStatisticType) IsValid

func (e DailyStatisticType) IsValid() bool

func (DailyStatisticType) MarshalGQL

func (e DailyStatisticType) MarshalGQL(w io.Writer)

func (DailyStatisticType) String

func (e DailyStatisticType) String() string

func (*DailyStatisticType) UnmarshalGQL

func (e *DailyStatisticType) UnmarshalGQL(v interface{}) error

type DateResult

type DateResult struct {
	Date  *string  `json:"date,omitempty"`
	Total *float64 `json:"total,omitempty"`
}

DateResult is a given statistic for a given date.

type DateResultByChain

type DateResultByChain struct {
	Date      *string  `json:"date,omitempty"`
	Ethereum  *float64 `json:"ethereum,omitempty"`
	Optimism  *float64 `json:"optimism,omitempty"`
	Cronos    *float64 `json:"cronos,omitempty"`
	Bsc       *float64 `json:"bsc,omitempty"`
	Polygon   *float64 `json:"polygon,omitempty"`
	Fantom    *float64 `json:"fantom,omitempty"`
	Boba      *float64 `json:"boba,omitempty"`
	Metis     *float64 `json:"metis,omitempty"`
	Moonbeam  *float64 `json:"moonbeam,omitempty"`
	Moonriver *float64 `json:"moonriver,omitempty"`
	Klaytn    *float64 `json:"klaytn,omitempty"`
	Arbitrum  *float64 `json:"arbitrum,omitempty"`
	Avalanche *float64 `json:"avalanche,omitempty"`
	Dfk       *float64 `json:"dfk,omitempty"`
	Aurora    *float64 `json:"aurora,omitempty"`
	Harmony   *float64 `json:"harmony,omitempty"`
	Canto     *float64 `json:"canto,omitempty"`
	Dogechain *float64 `json:"dogechain,omitempty"`
	Base      *float64 `json:"base,omitempty"`
	Blast     *float64 `json:"blast,omitempty"`
	Scroll    *float64 `json:"scroll,omitempty"`
	Total     *float64 `json:"total,omitempty"`
}

DateResult is a given statistic for a given date.

type Direction

type Direction string
const (
	DirectionIn  Direction = "IN"
	DirectionOut Direction = "OUT"
)

func (Direction) IsValid

func (e Direction) IsValid() bool

func (Direction) MarshalGQL

func (e Direction) MarshalGQL(w io.Writer)

func (Direction) String

func (e Direction) String() string

func (*Direction) UnmarshalGQL

func (e *Direction) UnmarshalGQL(v interface{}) error

type Duration

type Duration string
const (
	DurationPastDay     Duration = "PAST_DAY"
	DurationPastMonth   Duration = "PAST_MONTH"
	DurationPast3Months Duration = "PAST_3_MONTHS"
	DurationPast6Months Duration = "PAST_6_MONTHS"
	DurationPastYear    Duration = "PAST_YEAR"
	DurationAllTime     Duration = "ALL_TIME"
)

func (Duration) IsValid

func (e Duration) IsValid() bool

func (Duration) MarshalGQL

func (e Duration) MarshalGQL(w io.Writer)

func (Duration) String

func (e Duration) String() string

func (*Duration) UnmarshalGQL

func (e *Duration) UnmarshalGQL(v interface{}) error

type HeroType

type HeroType struct {
	Recipient string `json:"recipient"`
	HeroID    string `json:"heroID"`
}

func (HeroType) IsMessageType

func (HeroType) IsMessageType()

type HistoricalResult

type HistoricalResult struct {
	Total       *float64              `json:"total,omitempty"`
	DateResults []*DateResult         `json:"dateResults,omitempty"`
	Type        *HistoricalResultType `json:"type,omitempty"`
}

HistoricalResult is a given statistic for dates.

type HistoricalResultType

type HistoricalResultType string
const (
	HistoricalResultTypeBridgevolume HistoricalResultType = "BRIDGEVOLUME"
	HistoricalResultTypeTransactions HistoricalResultType = "TRANSACTIONS"
	HistoricalResultTypeAddresses    HistoricalResultType = "ADDRESSES"
)

func (HistoricalResultType) IsValid

func (e HistoricalResultType) IsValid() bool

func (HistoricalResultType) MarshalGQL

func (e HistoricalResultType) MarshalGQL(w io.Writer)

func (HistoricalResultType) String

func (e HistoricalResultType) String() string

func (*HistoricalResultType) UnmarshalGQL

func (e *HistoricalResultType) UnmarshalGQL(v interface{}) error

type KappaStatus added in v0.0.32

type KappaStatus string
const (
	KappaStatusExists  KappaStatus = "EXISTS"
	KappaStatusPending KappaStatus = "PENDING"
	KappaStatusUnknown KappaStatus = "UNKNOWN"
)

func (KappaStatus) IsValid added in v0.0.32

func (e KappaStatus) IsValid() bool

func (KappaStatus) MarshalGQL added in v0.0.32

func (e KappaStatus) MarshalGQL(w io.Writer)

func (KappaStatus) String added in v0.0.32

func (e KappaStatus) String() string

func (*KappaStatus) UnmarshalGQL added in v0.0.32

func (e *KappaStatus) UnmarshalGQL(v interface{}) error

type Leaderboard

type Leaderboard struct {
	Address      *string  `json:"address,omitempty"`
	VolumeUsd    *float64 `json:"volumeUSD,omitempty"`
	Fees         *float64 `json:"fees,omitempty"`
	Txs          *int64   `json:"txs,omitempty"`
	Rank         *int64   `json:"rank,omitempty"`
	AvgVolumeUsd *float64 `json:"avgVolumeUSD,omitempty"`
}

type MessageBusTransaction

type MessageBusTransaction struct {
	FromInfo  *PartialMessageBusInfo `json:"fromInfo,omitempty"`
	ToInfo    *PartialMessageBusInfo `json:"toInfo,omitempty"`
	Pending   *bool                  `json:"pending,omitempty"`
	MessageID *string                `json:"messageID,omitempty"`
}

type MessageType

type MessageType interface {
	IsMessageType()
}

type PartialInfo

type PartialInfo struct {
	ChainID            *int64   `json:"chainID,omitempty"`
	DestinationChainID *int64   `json:"destinationChainID,omitempty"`
	Address            *string  `json:"address,omitempty"`
	TxnHash            *string  `json:"txnHash,omitempty"`
	Value              *string  `json:"value,omitempty"`
	FormattedValue     *float64 `json:"formattedValue,omitempty"`
	USDValue           *float64 `json:"USDValue,omitempty"`
	TokenAddress       *string  `json:"tokenAddress,omitempty"`
	TokenSymbol        *string  `json:"tokenSymbol,omitempty"`
	BlockNumber        *int64   `json:"blockNumber,omitempty"`
	Time               *int64   `json:"time,omitempty"`
	FormattedTime      *string  `json:"formattedTime,omitempty"`
	FormattedEventType *string  `json:"formattedEventType,omitempty"`
	EventType          *int64   `json:"eventType,omitempty"`
}

PartialInfo is a transaction that occurred on one chain.

type PartialMessageBusInfo

type PartialMessageBusInfo struct {
	ChainID              *int64      `json:"chainID,omitempty"`
	ChainName            *string     `json:"chainName,omitempty"`
	DestinationChainID   *int64      `json:"destinationChainID,omitempty"`
	DestinationChainName *string     `json:"destinationChainName,omitempty"`
	ContractAddress      *string     `json:"contractAddress,omitempty"`
	TxnHash              *string     `json:"txnHash,omitempty"`
	Message              *string     `json:"message,omitempty"`
	MessageType          MessageType `json:"messageType,omitempty"`
	BlockNumber          *int64      `json:"blockNumber,omitempty"`
	Time                 *int64      `json:"time,omitempty"`
	FormattedTime        *string     `json:"formattedTime,omitempty"`
	RevertedReason       *string     `json:"revertedReason,omitempty"`
}

type PetType

type PetType struct {
	Recipient string `json:"recipient"`
	PetID     string `json:"petID"`
	Name      string `json:"name"`
}

func (PetType) IsMessageType

func (PetType) IsMessageType()

type Platform

type Platform string
const (
	PlatformAll        Platform = "ALL"
	PlatformSwap       Platform = "SWAP"
	PlatformBridge     Platform = "BRIDGE"
	PlatformMessageBus Platform = "MESSAGE_BUS"
)

func (Platform) IsValid

func (e Platform) IsValid() bool

func (Platform) MarshalGQL

func (e Platform) MarshalGQL(w io.Writer)

func (Platform) String

func (e Platform) String() string

func (*Platform) UnmarshalGQL

func (e *Platform) UnmarshalGQL(v interface{}) error

type Query

type Query struct {
	BridgeTransactions     []*BridgeTransaction      "json:\"bridgeTransactions\" graphql:\"bridgeTransactions\""
	MessageBusTransactions []*MessageBusTransaction  "json:\"messageBusTransactions\" graphql:\"messageBusTransactions\""
	CountByChainID         []*TransactionCountResult "json:\"countByChainId\" graphql:\"countByChainId\""
	CountByTokenAddress    []*TokenCountResult       "json:\"countByTokenAddress\" graphql:\"countByTokenAddress\""
	AddressRanking         []*AddressRanking         "json:\"addressRanking\" graphql:\"addressRanking\""
	AmountStatistic        *ValueResult              "json:\"amountStatistic\" graphql:\"amountStatistic\""
	DailyStatisticsByChain []*DateResultByChain      "json:\"dailyStatisticsByChain\" graphql:\"dailyStatisticsByChain\""
	RankedChainIDsByVolume []*VolumeByChainID        "json:\"rankedChainIDsByVolume\" graphql:\"rankedChainIDsByVolume\""
	AddressData            *AddressData              "json:\"addressData\" graphql:\"addressData\""
	Leaderboard            []*Leaderboard            "json:\"leaderboard\" graphql:\"leaderboard\""
	GetOriginBridgeTx      *BridgeWatcherTx          "json:\"getOriginBridgeTx\" graphql:\"getOriginBridgeTx\""
	GetDestinationBridgeTx *BridgeWatcherTx          "json:\"getDestinationBridgeTx\" graphql:\"getDestinationBridgeTx\""
	GetBlockHeight         []*BlockHeight            "json:\"getBlockHeight\" graphql:\"getBlockHeight\""
}

type StatisticType

type StatisticType string
const (
	StatisticTypeMeanVolumeUsd     StatisticType = "MEAN_VOLUME_USD"
	StatisticTypeMedianVolumeUsd   StatisticType = "MEDIAN_VOLUME_USD"
	StatisticTypeTotalVolumeUsd    StatisticType = "TOTAL_VOLUME_USD"
	StatisticTypeMeanFeeUsd        StatisticType = "MEAN_FEE_USD"
	StatisticTypeMedianFeeUsd      StatisticType = "MEDIAN_FEE_USD"
	StatisticTypeTotalFeeUsd       StatisticType = "TOTAL_FEE_USD"
	StatisticTypeCountTransactions StatisticType = "COUNT_TRANSACTIONS"
	StatisticTypeCountAddresses    StatisticType = "COUNT_ADDRESSES"
)

func (StatisticType) IsValid

func (e StatisticType) IsValid() bool

func (StatisticType) MarshalGQL

func (e StatisticType) MarshalGQL(w io.Writer)

func (StatisticType) String

func (e StatisticType) String() string

func (*StatisticType) UnmarshalGQL

func (e *StatisticType) UnmarshalGQL(v interface{}) error

type TearType

type TearType struct {
	Recipient string `json:"recipient"`
	Amount    string `json:"amount"`
}

func (TearType) IsMessageType

func (TearType) IsMessageType()

type TokenCountResult

type TokenCountResult struct {
	ChainID      *int64  `json:"chainID,omitempty"`
	TokenAddress *string `json:"tokenAddress,omitempty"`
	Count        *int64  `json:"count,omitempty"`
}

TokenCountResult gives the amount of transactions that occurred for a specific token, separated by chain ID.

type TransactionCountResult

type TransactionCountResult struct {
	ChainID *int64 `json:"chainID,omitempty"`
	Count   *int64 `json:"count,omitempty"`
}

TransactionCountResult gives the amount of transactions that occurred for a specific chain ID.

type UnknownType

type UnknownType struct {
	Known bool `json:"known"`
}

func (UnknownType) IsMessageType

func (UnknownType) IsMessageType()

type ValueResult

type ValueResult struct {
	Value *string `json:"value,omitempty"`
}

ValueResult is a value result of either USD or numeric value.

type VolumeByChainID

type VolumeByChainID struct {
	ChainID *int64   `json:"chainID,omitempty"`
	Total   *float64 `json:"total,omitempty"`
}

Directories

Path Synopsis
Package main spins up a explorer api and introspects the graphql api
Package main spins up a explorer api and introspects the graphql api

Jump to

Keyboard shortcuts

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