Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement CoinGecko Pro API support #182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

CoinGecko Pro API Support

This PR adds support for CoinGecko's Pro API while maintaining compatibility with the free API. The implementation includes new endpoints for both free and pro tiers, with a focus on token prices, market data, trending coins, and metadata.

Changes

  • Added base service class (CoinGeckoServiceBase) defining common interface
  • Implemented CommonService for free API endpoints
  • Added ProService with Pro-specific endpoints
  • Updated plugin to support both free and pro modes via configuration
  • Added new parameter types for all endpoints
  • Updated request handling for Pro API authentication

New Features

A) Extended Token Prices & Market Data

  1. Common: Check price of any token via GeckoTerminal.com
  2. Pro: Check liquidity and market data (mcap, fdv, volume, price)
  3. Common: Check CoinGecko price with contract address

B) Trending Coins & Categories

  1. Common: Trending coins, NFTs, categories
  2. Common: Find coins by category with volume sorting
  3. Pro: Trending pools/tokens by network
  4. Pro: Top gainers/losers

C) Token Metadata

  1. Common: Token metadata (description, links)
  2. Pro: Extended metadata including security score and pool info

Usage Example

interface CoingeckoPluginOptions {
    apiKey: string;
    pro?: boolean;
}

// Free API usage
const freePlugin = new CoinGeckoPlugin({ apiKey: "demo-key" });

// Pro API usage
const proPlugin = new CoinGeckoPlugin({ 
    apiKey: "pro-key",
    pro: true 
});

Testing

  • Verified build success
  • Linting checks passed
  • Type definitions generated correctly

Link to Devin run: https://app.devin.ai/sessions/c9908aed1c934db5bb53556d070b464f

- Add base service class defining common interface
- Implement CommonService for free API endpoints
- Add ProService with Pro-specific endpoints
- Update plugin to support both free and pro modes
- Add new parameter types for all endpoints
- Update request handling for Pro API authentication

Co-Authored-By: Alfonso Gomez Jordana Manas <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

changeset-bot bot commented Jan 4, 2025

⚠️ No Changeset found

Latest commit: 20aafd4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants