Release: develop -> main#107
Merged
Merged
Conversation
The api was always going to pro-api.coingecko.com directly with a query-string-keyed Pro key. That works on its own but cache-poisons any HTTP-cache that keys on the URL, and it bypasses the central pricing proxy that already holds the upstream key, runs a 60 s shared cache, and validates upstream error envelopes. - COINGECKO_BASE_URL is now the preferred env var: when set, requests go to that origin (typically the pricing proxy) and no auth header is added — the proxy injects the key. - COINGECKO_API_KEY remains supported as a direct fallback. Calls now route to pro-api.coingecko.com via header (`x-cg-pro-api-key`) instead of the cache-unfriendly `x_cg_pro_api_key` query string. - Bootstrap now requires at least one of the two so the service does not silently come up unauthenticated.
* Drop the empty-string fallback on the Pro API key The pro-tier branch of COINGECKO_CLIENT sent \`'x-cg-pro-api-key': CONFIG.coingeckoApiKey ?? ''\`. The bootstrap check at the top of the module already guarantees one of the two env vars is set, so the only way this branch ran with an empty key was a misconfiguration that escaped the bootstrap. The empty header would then turn into an upstream 401 that looks like a CoinGecko outage instead of the local configuration problem it really is. Explicit throw + plain string assignment removes the silent fallback and surfaces the misconfiguration where it actually happens. * Align bootstrap error message with helper throw * Drop the direct-Pro code path; everything goes via pricing-proxy COINGECKO_API_KEY is no longer read by this service. The proxy stack holds the upstream key. COINGECKO_CLIENT is now a one-liner that always hits the proxy and the bootstrap refuses to start without COINGECKO_BASE_URL. No more two-branch logic, no more dead code. * Make COINGECKO_API_KEY orthogonal: optional header, never a fallback The api can now also be pointed at pro-api.coingecko.com directly by setting COINGECKO_API_KEY alongside COINGECKO_BASE_URL — the key is attached as the x-cg-pro-api-key header on every request when set, no two-branch logic, no fallback. In the DFX setup COINGECKO_API_KEY stays unset because the proxy injects its own key. README documents the pattern and links the proxy reference implementation at github.com/DFXswiss/pricing-proxy.
TaprootFreak
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic Release PR
This PR was automatically created after changes were pushed to develop.
Commits: 1 new commit(s)
Checklist