stickerUpdater

package
v0.0.0-...-ecc0f28 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	POSITIVE_COLOR = color.RGBA{R: 126, G: 211, B: 33, A: 255}
	NEGATIVE_COLOR = color.RGBA{R: 208, G: 2, B: 27, A: 255}
	PIKE_COLOR     = color.RGBA{R: 211, G: 211, B: 211, A: 255}
)

Functions

This section is empty.

Types

type Candle

type Candle struct {
	Time   time.Time
	Open   float64
	High   float64
	Low    float64
	Close  float64
	Volume float64
}

type GeckoterminalOHLCVResponse

type GeckoterminalOHLCVResponse struct {
	Data struct {
		ID         string `json:"id"`
		Type       string `json:"type"`
		Attributes struct {
			OhlcvList [][]float64 `json:"ohlcv_list"`
		} `json:"attributes"`
	} `json:"data"`
	Meta struct {
		Base struct {
			Address         string `json:"address"`
			Name            string `json:"name"`
			Symbol          string `json:"symbol"`
			CoingeckoCoinID any    `json:"coingecko_coin_id"`
		} `json:"base"`
		Quote struct {
			Address         string `json:"address"`
			Name            string `json:"name"`
			Symbol          string `json:"symbol"`
			CoingeckoCoinID any    `json:"coingecko_coin_id"`
		} `json:"quote"`
	} `json:"meta"`
}

type GeckoterminalResponse

type GeckoterminalResponse struct {
	Data struct {
		ID         string `json:"id"`
		Type       string `json:"type"`
		Attributes struct {
			BaseTokenPriceUsd             string      `json:"base_token_price_usd"`
			BaseTokenPriceNativeCurrency  string      `json:"base_token_price_native_currency"`
			QuoteTokenPriceUsd            string      `json:"quote_token_price_usd"`
			QuoteTokenPriceNativeCurrency string      `json:"quote_token_price_native_currency"`
			BaseTokenPriceQuoteToken      string      `json:"base_token_price_quote_token"`
			QuoteTokenPriceBaseToken      string      `json:"quote_token_price_base_token"`
			Address                       string      `json:"address"`
			Name                          string      `json:"name"`
			PoolCreatedAt                 time.Time   `json:"pool_created_at"`
			FdvUsd                        string      `json:"fdv_usd"`
			MarketCapUsd                  interface{} `json:"market_cap_usd"`
			PriceChangePercentage         struct {
				M5  string `json:"m5"`
				H1  string `json:"h1"`
				H6  string `json:"h6"`
				H24 string `json:"h24"`
			} `json:"price_change_percentage"`
			Transactions struct {
				M5 struct {
					Buys    int `json:"buys"`
					Sells   int `json:"sells"`
					Buyers  int `json:"buyers"`
					Sellers int `json:"sellers"`
				} `json:"m5"`
				M15 struct {
					Buys    int `json:"buys"`
					Sells   int `json:"sells"`
					Buyers  int `json:"buyers"`
					Sellers int `json:"sellers"`
				} `json:"m15"`
				M30 struct {
					Buys    int `json:"buys"`
					Sells   int `json:"sells"`
					Buyers  int `json:"buyers"`
					Sellers int `json:"sellers"`
				} `json:"m30"`
				H1 struct {
					Buys    int `json:"buys"`
					Sells   int `json:"sells"`
					Buyers  int `json:"buyers"`
					Sellers int `json:"sellers"`
				} `json:"h1"`
				H24 struct {
					Buys    int `json:"buys"`
					Sells   int `json:"sells"`
					Buyers  int `json:"buyers"`
					Sellers int `json:"sellers"`
				} `json:"h24"`
			} `json:"transactions"`
			VolumeUsd struct {
				M5  string `json:"m5"`
				H1  string `json:"h1"`
				H6  string `json:"h6"`
				H24 string `json:"h24"`
			} `json:"volume_usd"`
			ReserveInUsd string `json:"reserve_in_usd"`
		} `json:"attributes"`
		Relationships struct {
			BaseToken struct {
				Data struct {
					ID   string `json:"id"`
					Type string `json:"type"`
				} `json:"data"`
			} `json:"base_token"`
			QuoteToken struct {
				Data struct {
					ID   string `json:"id"`
					Type string `json:"type"`
				} `json:"data"`
			} `json:"quote_token"`
			Dex struct {
				Data struct {
					ID   string `json:"id"`
					Type string `json:"type"`
				} `json:"data"`
			} `json:"dex"`
		} `json:"relationships"`
	} `json:"data"`
}

type Options

type Options struct {
	Width       int
	Height      int
	YOffset     int
	CandleWidth int
	Columns     int
	Rows        int
}

type StickerConfig

type StickerConfig struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	Emoji   string `json:"emoji"`
	// contains filtered or unexported fields
}

type StickerUpdater

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

func InitStickerUpdater

func InitStickerUpdater(logger *slog.Logger, config *config.Config, bot *bot.Bot, sender *sender.Sender) (*StickerUpdater, error)

func (*StickerUpdater) Run

func (su *StickerUpdater) Run(name string) error

func (*StickerUpdater) RunAll

func (su *StickerUpdater) RunAll() error

Jump to

Keyboard shortcuts

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