Class CoinGeckoAPI

The CoinGeckoAPI class provides methods to get coin prices.



  • Gets the price of a token from CoinGecko.


    • _coinId: string

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

    • Optional expiryDuration: number

      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