Documentation ¶
Index ¶
- Variables
- func CalcNotionalAmount(amount *big.Int, decimals uint8, price float64) *big.Float
- func FetchCoinGeckoCoins()
- func FetchCoinGeckoPrice(coinId string, timestamp time.Time) (float64, error)
- func FetchTokenPrices(ctx context.Context, coinIds []string) (map[string]float64, error)
- type CoinGeckoCoin
- type CoinGeckoCoinPrices
- type CoinGeckoErrorRes
- type CoinGeckoMarket
- type CoinGeckoMarketRes
- type Price
- type RateLimitClient
Constants ¶
This section is empty.
Variables ¶
View Source
var CoinGeckoCoins map[string][]CoinGeckoCoin
View Source
var DefaultLimiter = rate.NewLimiter(rate.Every(time.Second), 3)
View Source
var DefaultRateLimitClient = NewRateLimitClient(DefaultLimiter)
Functions ¶
func CalcNotionalAmount ¶
func FetchCoinGeckoCoins ¶
func FetchCoinGeckoCoins()
func FetchCoinGeckoPrice ¶
Types ¶
type CoinGeckoCoin ¶
type CoinGeckoCoin struct { Id string `json:"id"` Symbol string `json:"symbol"` Name string `json:"name"` }
func FetchCoinGeckoCoin ¶
func FetchCoinGeckoCoin(chainId vaa.ChainID, symbol, name string) *CoinGeckoCoin
type CoinGeckoCoinPrices ¶
type CoinGeckoErrorRes ¶
type CoinGeckoErrorRes struct {
Error string `json:"error"`
}
type CoinGeckoMarket ¶
type CoinGeckoMarket [2]float64
type CoinGeckoMarketRes ¶
type CoinGeckoMarketRes struct {
Prices []CoinGeckoMarket `json:"prices"`
}
type RateLimitClient ¶
func NewRateLimitClient ¶
func NewRateLimitClient(limiter *rate.Limiter) *RateLimitClient
Click to show internal directories.
Click to hide internal directories.