graph

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package graph implements the GraphQL schema and resolvers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAmountStatisticBridgeSQL added in v0.0.81

func GenerateAmountStatisticBridgeSQL(typeArg model.StatisticType, address *string, chainID *int, tokenAddress *string) (*string, error)

GenerateAmountStatisticBridgeSQL generate sql for the bridge platform.

func GenerateAmountStatisticMessageBusSQL added in v0.0.81

func GenerateAmountStatisticMessageBusSQL(typeArg model.StatisticType, compositeFilters string) (*string, error)

GenerateAmountStatisticMessageBusSQL generates sql for getting stats on the message bus platform.

func GenerateAmountStatisticSwapSQL added in v0.0.81

func GenerateAmountStatisticSwapSQL(typeArg model.StatisticType, compositeFilters string, tokenAddress *string) (*string, error)

GenerateAmountStatisticSwapSQL generates sql to get statistics on the swap platform.

nolint:cyclop

func GenerateDailyStatisticByChainAllSQL added in v0.0.81

func GenerateDailyStatisticByChainAllSQL(typeArg *model.DailyStatisticType, compositeFilters string, firstFilter *bool) (*string, error)

GenerateDailyStatisticByChainAllSQL generates sql for getting daily stats across all chains.

func GenerateDailyStatisticByChainAllSQLMv added in v0.0.81

func GenerateDailyStatisticByChainAllSQLMv(typeArg *model.DailyStatisticType, compositeFilters string, compositeFiltersMv string) (*string, error)

GenerateDailyStatisticByChainAllSQLMv generates sql for getting daily stats across all chains.

func GenerateDailyStatisticByChainBridgeSQL added in v0.0.81

func GenerateDailyStatisticByChainBridgeSQL(typeArg *model.DailyStatisticType, compositeFilters string, firstFilter *bool) (*string, error)

GenerateDailyStatisticByChainBridgeSQL generates sql for getting data for daily stats across the bridge platform.

func GenerateDailyStatisticByChainBridgeSQLMv added in v0.0.81

func GenerateDailyStatisticByChainBridgeSQLMv(typeArg *model.DailyStatisticType, compositeFilters string) (*string, error)

GenerateDailyStatisticByChainBridgeSQLMv generates sql for getting data for daily stats across the bridge platform.

func GenerateDailyStatisticByChainMessageBusSQL added in v0.0.81

func GenerateDailyStatisticByChainMessageBusSQL(typeArg *model.DailyStatisticType, compositeFilters string) (*string, error)

GenerateDailyStatisticByChainMessageBusSQL generates sql for getting daily stats across the message bus platform.

func GenerateDailyStatisticByChainSwapSQL added in v0.0.81

func GenerateDailyStatisticByChainSwapSQL(typeArg *model.DailyStatisticType, compositeFilters string) (*string, error)

GenerateDailyStatisticByChainSwapSQL generates sql for getting daily stats across the swap platform.

func GenerateRankedChainsByVolumeSQL added in v0.0.81

func GenerateRankedChainsByVolumeSQL(compositeFilters string, firstFilter *bool) string

GenerateRankedChainsByVolumeSQL generates sql for getting all chains ranked in order of volume.

func GetDurationFilter added in v0.0.81

func GetDurationFilter(duration *model.Duration, firstFilter *bool, prefix string) string

GetDurationFilter creates a filter for the various time ranges for analysis.

func GetFallbackTime added in v0.0.190

func GetFallbackTime() time.Duration

GetFallbackTime gets the fallback time for the bridge watcher. this is intended only for testing

func GetPartialInfoFromBridgeEventHybrid added in v0.0.43

func GetPartialInfoFromBridgeEventHybrid(bridgeEvent sql.HybridBridgeEvent, includePending *bool) (*model.BridgeTransaction, error)

GetPartialInfoFromBridgeEventHybrid returns the partial info from bridge event.

nolint:cyclop

func GetPartialInfoFromMessageBusEventHybrid added in v0.0.81

func GetPartialInfoFromMessageBusEventHybrid(ctx context.Context, messageBusEvent sql.HybridMessageBusEvent, pending bool) (*model.MessageBusTransaction, error)

GetPartialInfoFromMessageBusEventHybrid returns the partial info from message bus event.

nolint:cyclop

func GetTargetTime added in v0.0.81

func GetTargetTime(hours *int) uint64

GetTargetTime converts the number of hours into a timestamp.

func UnsafeSetFallbackTime added in v0.0.190

func UnsafeSetFallbackTime(ttf time.Duration)

UnsafeSetFallbackTime sets the fallback time for the bridge watcher. it is intended for testing. Plese remember to reset this value.

Types

type Resolver

type Resolver struct {
	DB      db.ConsumerDB
	Fetcher fetcher.ScribeFetcher
	Cache   cache.Service
	// CacheMutex is a mutex used for caching. It is used to prevent multiple
	// stat queries from being made at the same time. In the future, this should be done somewhere else.
	CacheMutex  mapmutex.StringMapMutex
	Clients     map[uint32]etherClient.EVM
	Parsers     *types.ServerParsers
	Refs        *types.ServerRefs
	SwapFilters map[string]*swap.SwapFlashLoanFilterer
	Config      serverConfig.Config
}

Resolver is the root resolver.

func (*Resolver) Query

func (r *Resolver) Query() resolvers.QueryResolver

Query returns resolvers.QueryResolver implementation.

type SortBridgeTxType added in v0.0.81

type SortBridgeTxType []*model.BridgeTransaction

SortBridgeTxType sorts bridge transactions by time.

func (SortBridgeTxType) Len added in v0.0.81

func (s SortBridgeTxType) Len() int

func (SortBridgeTxType) Less added in v0.0.81

func (s SortBridgeTxType) Less(i, j int) bool

func (SortBridgeTxType) Swap added in v0.0.81

func (s SortBridgeTxType) Swap(i, j int)

type SortMessageBusTxType added in v0.0.81

type SortMessageBusTxType []*model.MessageBusTransaction

SortMessageBusTxType sorts message bus transactions by time.

func (SortMessageBusTxType) Len added in v0.0.81

func (s SortMessageBusTxType) Len() int

func (SortMessageBusTxType) Less added in v0.0.81

func (s SortMessageBusTxType) Less(i, j int) bool

func (SortMessageBusTxType) Swap added in v0.0.81

func (s SortMessageBusTxType) Swap(i, j int)

Directories

Path Synopsis
Package interceptor contains a santizier for the graphql server It santitizes strings uing MysqlRealEscapeString.
Package interceptor contains a santizier for the graphql server It santitizes strings uing MysqlRealEscapeString.
Package model provides the GraphQL model for the explorer service.
Package model provides the GraphQL model for the explorer service.
Package resolvers provides the GraphQL resolver for the explorer service.
Package resolvers provides the GraphQL resolver for the explorer service.

Jump to

Keyboard shortcuts

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