Skip to content

feat(pricing): public CoinGecko coins/list proxy endpoint#3715

Open
TaprootFreak wants to merge 2 commits into
developfrom
feat/pricing-coins-list
Open

feat(pricing): public CoinGecko coins/list proxy endpoint#3715
TaprootFreak wants to merge 2 commits into
developfrom
feat/pricing-coins-list

Conversation

@TaprootFreak
Copy link
Copy Markdown
Collaborator

@TaprootFreak TaprootFreak commented May 15, 2026

Summary

Adds a public, unauthenticated GET /pricing/coins-list endpoint that proxies CoinGecko's /coins/list through api.dfx.swiss, using the central CoinGecko Pro key and a 24 h in-memory cache. Closes #3713.

  • New CoinsListRequest DTO (optional include_platform boolean, defaults to false).
  • New CoinGeckoService.getCoinsList(); responses cached via AsyncCache with separate entries per include_platform value (24 h TTL — matches the wallet's local cache and CoinGecko's update cadence).
  • Controller returns CoinGecko's raw shape unchanged so the wallet only needs to swap the base URL.
  • Swagger schema documented via @ApiOkResponse with an example payload.

Test plan

  • DEV: curl https://dev.api.dfx.swiss/v1/pricing/coins-list?include_platform=true returns the full CoinGecko coin list (~2.6 MB)
  • include_platform=false (and omitted) returns the slim shape without platforms field
  • Second identical request within 24 h does not hit CoinGecko (cache verified via logs)
  • Wallet (dfx-wallet) swap of COINGECKO_LIST_URL to the new endpoint works end-to-end

Out of scope / follow-up

  • Filtering the payload (e.g. only chains the wallet uses) — keeping upstream shape minimizes wallet diff and keeps the endpoint reusable.
  • Server-side gzip: the upstream payload is ~2.6 MB but the API has no global compression middleware. Adding compression to main.ts would benefit this and other endpoints — separate PR.

Expose GET /pricing/coins-list as a cached, unauthenticated pass-through
to CoinGecko's /coins/list using the central CoinGecko Pro key. Optional
include_platform query param mirrors CoinGecko's shape; response is
cached for 24 h via AsyncCache.

Closes #3713
Document the response shape for swagger consumers so the endpoint
appears with a typed example instead of an opaque CoinListResponseItem
array.
@TaprootFreak TaprootFreak marked this pull request as ready for review May 15, 2026 19:59
@TaprootFreak TaprootFreak requested a review from davidleomay as a code owner May 15, 2026 19:59
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.

feat(pricing): expose CoinGecko /coins/list proxy endpoint

1 participant