Class CoinGeckoAPI

The CoinGeckoAPI class provides methods to get coin prices.

Constructors

Methods

  • Gets the price of a token from CoinGecko.

    Parameters

    • _coinId: string

      The coingecko ID for the token to get the price for.

    • expiryDuration: number = defaultExpiryDuration

      The duration in milliseconds for which the price should be cached.

    Returns Promise<number>

    A Promise that resolves to the price of the token, or -1 if the price cannot be fetched.

  • Parameters

    Returns void

  • Returns boolean