Documentation
¶
Index ¶
- func GetTokenName(symbol string) (name string)
- func GetTokenPrice(tokenSymbol string, currency string, timestamp string, date string) (price float64)
- func GetTokenPriceByCoingecko(token, date string) (float64, error)
- func GetTokenPriceByRedstone(tokenSymbol string, currency string, timestamp string) (float64, error)
- func GetTokenPriceByRedstoneWithRetry(tokenSymbol string, currency string, timestamp string, retry int64) (float64, error)
- func MustGetTokenPrice(symbol string, currency string, timestamp string) (price float64)
- func MustGetTokenPriceByRedstone(tokenSymbol string, currency string, timestamp string) float64
- type CoingeckoData
- type Stats
- type WDB
- func (w *WDB) FindStatsSnapshot(date time.Time) (statSnapshot *schema.StatsSnapshot, err error)
- func (w *WDB) FindStatsSnapshots(start, end time.Time) (statSnapshots []*schema.StatsSnapshot, err error)
- func (w *WDB) LoadAllStats() (statSnapshots []*schema.StatsSnapshot, err error)
- func (w *WDB) LoadStats() (statSnapshot *schema.StatsSnapshot, err error)
- func (w *WDB) Migrate()
- func (w *WDB) SaveStatsSnapshot(stats *schema.Stats, tx *gorm.DB) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTokenName ¶
func GetTokenPrice ¶
func GetTokenPriceByRedstone ¶
func MustGetTokenPrice ¶
Types ¶
type CoingeckoData ¶
type CoingeckoData struct {
MarketData struct {
CurrentPrice struct {
USD float64 `json:"usd"`
} `json:"current_price"`
} `json:"market_data"`
}
type WDB ¶
type WDB struct {
// contains filtered or unexported fields
}
func (*WDB) FindStatsSnapshot ¶
func (*WDB) FindStatsSnapshots ¶
func (*WDB) LoadAllStats ¶
func (w *WDB) LoadAllStats() (statSnapshots []*schema.StatsSnapshot, err error)
Click to show internal directories.
Click to hide internal directories.