statistics

package
v0.0.0-...-4318582 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoinGeckoCoinPrices

type CoinGeckoCoinPrices map[string]Price

type CoinGeckoErrorRes

type CoinGeckoErrorRes struct {
	Error string `json:"error"`
}

type Controller

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

func NewController

func NewController(serv *Service, logger *zap.Logger) *Controller

func (*Controller) NotionalTVL

func (c *Controller) NotionalTVL(ctx *fiber.Ctx) error

func (*Controller) TotalMessages

func (c *Controller) TotalMessages(ctx *fiber.Ctx) error

func (*Controller) TotalNotionalTransferred

func (c *Controller) TotalNotionalTransferred(ctx *fiber.Ctx) error

func (*Controller) TotalNotionalTransferredTo

func (c *Controller) TotalNotionalTransferredTo(ctx *fiber.Ctx) error

type EmitterKey

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

type Price

type Price struct {
	USD float64 `json:"usd"`
}

type Repository

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

func NewRepository

func NewRepository(ctx context.Context, db *mongo.Database, logger *zap.Logger) (*Repository, error)

func (*Repository) Query

func (r *Repository) Query(ctx context.Context, days int, projection bson.D, fn func(*StatisticDoc) error) error

func (*Repository) TVL

func (r *Repository) TVL(ctx context.Context) (*TVL, error)

func (*Repository) TotalMessages

func (r *Repository) TotalMessages(ctx context.Context) (*TotalMessages, error)

func (*Repository) TotalNotionalTransferred

func (r *Repository) TotalNotionalTransferred(ctx context.Context) (*TotalNotionalTransferred, error)

func (*Repository) TotalNotionalTransferredTo

func (r *Repository) TotalNotionalTransferredTo(ctx context.Context) (*TotalNotionalTransferredTo, error)

type Service

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

TODO: remove this

func NewService

func NewService(r *Repository, logger *zap.Logger) *Service

func (*Service) TVL

func (s *Service) TVL(ctx context.Context) (*TVL, error)

func (*Service) TotalMessages

func (s *Service) TotalMessages(ctx context.Context) (*TotalMessages, error)

func (*Service) TotalNotionalTransferred

func (s *Service) TotalNotionalTransferred(ctx context.Context) (*TotalNotionalTransferred, error)

func (*Service) TotalNotionalTransferredTo

func (s *Service) TotalNotionalTransferredTo(ctx context.Context) (*TotalNotionalTransferredTo, error)

type StatisticDoc

type StatisticDoc struct {
	ID                  string      `bson:"_id" json:"id"`
	Date                *time.Time  `bson:"date" json:"date"`
	EmitterChain        vaa.ChainID `bson:"emitterChain" json:"emitterChain"`
	EmitterAddr         string      `bson:"emitterAddr" json:"emitterAddr"`
	TokenChain          vaa.ChainID `bson:"tokenChain" json:"tokenChain"`
	TargetChain         vaa.ChainID `bson:"targetChain" json:"targetChain"`
	TokenAddress        string      `bson:"tokenAddress" json:"tokenAddress"`
	TotalVAACount       uint32      `bson:"totalVAACount" json:"totalVAACount"`
	TotalTransferAmount string      `bson:"totalTransferAmount" json:"totalTransferAmount"`
	TotalNotionalUSD    float64     `bson:"totalNotionalUSD" json:"totalNotionalUSD"`
	UpdatedAt           *time.Time  `bson:"updatedAt" json:"updatedAt"`
}

type TVL

type TVL struct {
	TVL map[TVLKey]*big.Int
}

type TVLKey

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

type TokenDoc

type TokenDoc struct {
	ID              string      `bson:"_id"`
	TokenAddress    string      `bson:"tokenAddress"`
	TokenChain      vaa.ChainID `bson:"tokenChain"`
	Decimals        uint8       `bson:"decimals"`
	Symbol          string      `bson:"symbol"`
	Name            string      `bson:"name"`
	NativeAddress   string      `bson:"nativeAddress"`
	CoinGeckoCoinId string      `bson:"coinGeckoCoinId"`
	UpdatedAt       *time.Time  `bson:"updatedAt"`
}

type TokenTransferKey

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

type TokenTransferToKey

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

type TotalMessages

type TotalMessages struct {
	TotalMessagesPerEmitter map[EmitterKey]uint32
}

type TotalNotionalTransferred

type TotalNotionalTransferred struct {
	TotalTransferred map[TokenTransferKey]float64
}

type TotalNotionalTransferredTo

type TotalNotionalTransferredTo struct {
	TotalTransferred map[TokenTransferToKey]float64
}

Jump to

Keyboard shortcuts

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