Skip to content

Release: develop -> main#107

Merged
TaprootFreak merged 3 commits into
mainfrom
develop
May 12, 2026
Merged

Release: develop -> main#107
TaprootFreak merged 3 commits into
mainfrom
develop

Conversation

@github-actions
Copy link
Copy Markdown

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

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 TaprootFreak merged commit c086df5 into main May 12, 2026
4 checks passed
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.

1 participant