protocols

package
v0.0.0-...-ad9d088 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ALLBRIDGE = "ALLBRIDGE"
View Source
const AllProtocolStats24HrAgo = `` /* 1071-byte string literal not displayed */
View Source
const AllProtocolsDeltaLastDay = `` /* 1071-byte string literal not displayed */
View Source
const AllProtocolsDeltaSinceStartOfDay = `` /* 1060-byte string literal not displayed */
View Source
const CCTP = "CCTP_WORMHOLE_INTEGRATION"
View Source
const GenericRelayer = "GENERIC_RELAYER"
View Source
const MAYAN = "MAYAN"
View Source
const NTT = "NATIVE_TOKEN_TRANSFER"
View Source
const PortalTokenBridge = "PORTAL_TOKEN_BRIDGE"
View Source
const QueryLast24HrActivity = `` /* 238-byte string literal not displayed */
View Source
const QueryTemplateProtocolActivity = `` /* 447-byte string literal not displayed */
View Source
const QueryTemplateProtocolStats24HrAgo = `` /* 211-byte string literal not displayed */
View Source
const QueryTemplateProtocolStatsNow = `` /* 210-byte string literal not displayed */
View Source
const UNKNOWN = "UNKNOWN"

Variables

This section is empty.

Functions

This section is empty.

Types

type ProtocolStats

type ProtocolStats struct {
	Protocol                    string  `json:"protocol"`
	TotalMessages               uint64  `json:"total_messages"`
	TotalValueLocked            float64 `json:"total_value_locked,omitempty"`
	TotalValueSecured           float64 `json:"total_value_secured,omitempty"`
	TotalValueTransferred       float64 `json:"total_value_transferred"`
	LastDayMessages             uint64  `json:"last_day_messages"`
	LastDayDiffPercentage       string  `json:"last_day_diff_percentage"`
	LastDayVolumeDiffPercentage string  `json:"last_day_diff_volume_percentage"`
	Last24HourVolume            float64 `json:"last_24_hour_volume"`
}

type ProtocolTotalValuesDTO

type ProtocolTotalValuesDTO struct {
	ProtocolStats
	Error string `json:"error,omitempty"`
}

type QueryDoer

type QueryDoer interface {
	Query(ctx context.Context, query string) (QueryResult, error)
}

func WrapQueryAPI

func WrapQueryAPI(qApi api.QueryAPI) QueryDoer

type QueryResult

type QueryResult interface {
	Next() bool
	Record() *query.FluxRecord
	Err() error
	Close() error
}

type Repository

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

func NewRepository

func NewRepository(qApi QueryDoer, bucketInfinite, bucket30d, bucket24Hrs string, logger *zap.Logger) *Repository

type Service

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

func NewService

func NewService(protocols []string, repo *Repository, logger *zap.Logger, cache cache.Cache, cacheKeyPrefix string, cacheTTL int, metrics metrics.Metrics, tvlProvider tvlProvider) *Service

func (*Service) GetProtocolsTotalValues

func (s *Service) GetProtocolsTotalValues(ctx context.Context) []ProtocolTotalValuesDTO

Jump to

Keyboard shortcuts

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