Repository navigation
Remove v1 token-prices fallback - #3078
Merged
Merged
Conversation
The clients now get token prices only from freighter-backend-v2. The v1 /token-prices path on freighter-backend is removed, together with the use_token_prices_v2 feature flag that selected it. - getTokenPrices no longer takes a useV2 argument. - Remove tokenPricesV2Selector and the flag from remote config. - The confirmation price snapshot always reports token_prices_v2. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R8cp3zUn1aPP4zQrPvEFDQ
6 of 16 tasks
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes consistently remove the retired v1 and feature-flag plumbing while updating the related API, telemetry, snapshots, and tests for the v2-only flow, with no active issues identified.
No open issues 🎉
What changed in this PR
This pull request removes the legacy v1 token-prices path and its use_token_prices_v2 feature flag, making freighter-backend-v2 the sole token-pricing source while updating confirmation telemetry and tests.
Changes:
- Routes supported token-price requests exclusively through the authenticated v2 background-service-worker endpoint.
- Removes the feature flag, selector, API parameter, and related call-site plumbing.
- Updates confirmation snapshots and test coverage for v2-only behavior, including filtering, network handling, and contract-token support.
| File | Description |
|---|---|
| extension/src/popup/views/AddToken/__tests__/AddToken.test.tsx | Removes obsolete token-prices feature-flag state from test fixtures. |
| extension/src/popup/views/__tests__/Account.test.tsx | Removes obsolete token-prices feature-flag state from account test fixtures. |
| extension/src/popup/ducks/remoteConfig.ts | Removes the token-prices feature flag and selector. |
| extension/src/popup/ducks/__tests__/remoteConfig.test.ts | Removes tests for the retired token-prices flag and selector. |
| extension/src/popup/components/InternalTransaction/SubmitTransaction/hooks/useSubmitTxData.tsx | Stops reading and forwarding the removed token-prices feature flag. |
| extension/src/popup/components/account/AccountSheet/hooks/__tests__/useGetWalletsData.test.tsx | Updates token-price mock expectations for the simplified API. |
| extension/src/popup/components/__tests__/maintenanceMode.test.tsx | Removes obsolete token-prices remote-config test state. |
| extension/src/helpers/hooks/useGetTokenPrices.tsx | Uses the simplified v2-only token-prices API. |
| extension/src/helpers/confirmationPriceSnapshot.ts | Always uses the v2 price source and updated token-price API signature. |
| extension/src/helpers/confirmationPriceSnapshot.test.ts | Updates snapshot setup, cancellation mocks, and source expectations for v2-only pricing. |
| extension/src/helpers/__tests__/useGetTokenPrices.test.tsx | Updates hook expectations after removing the feature-flag argument. |
| extension/src/helpers/__tests__/useGetBalances.test.tsx | Removes obsolete token-prices feature-flag state from balance test fixtures. |
| @shared/api/internal.ts | Deletes the v1 request path and routes supported token-price requests through backend v2 while retaining filtering and network handling. |
| @shared/api/__tests__/internal.test.ts | Removes v1 endpoint coverage and updates v2 request, filtering, network, and response tests. |
Review effort: Lite
Contributor
|
PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-f1005c8e0c39dee8ce54 |
JakeUrban
marked this pull request as ready for review
November 10, 2026 16:15
Resolve the conflict with #3064 in useGetTokenPrices. That change waits for the remote config flags before it reads use_token_prices_v2. This branch removes that flag, so the price hook does not wait for the flags. The balances hook still waits, because use_balances_v2 picks its endpoint. - Replace the new "waits for the flags" price test with a test that prices are fetched without a wait. - Remove use_token_prices_v2 from the new test fixtures. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R8cp3zUn1aPP4zQrPvEFDQ
aristidesstaffieri
approved these changes
Nov 10, 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.
What
The extension gets token prices only from freighter-backend-v2. This PR removes the v1
/token-pricespath and theuse_token_prices_v2feature flag.Functional changes:
getTokenPricesalways sendsPOST /token-prices?network=…to freighter-backend-v2 through the background service worker. It does not callINDEXER_URL/token-pricesanymore.getTokenPricesdoes not take auseV2argument anymore.use_token_prices_v2has no effect. The extension does not read it.tokenPricesV2Selectoris removed.amount_usd_source: "token_prices_v2". The value does not change for users on the default path, so dashboards keep working.These items do not change:
INDEXER_URL. Theuse_balances_v2flag is not touched.Why
The v1 token price service on freighter-backend is not healthy. Repair is not useful, because v2 replaces it. The flag defaults to v2, so users on current versions do not use v1. After this change, a rollback to v1 is not possible.
Screenshots / video
N/A. There is no UI change.
Checklist
Checks run locally:
tscpasses. Jest: 292 suites pass.testNodeCompat.jsfails because it needs a build; it fails onmastertoo.Follow-up after release: archive
use_token_prices_v2in Amplitude. Then remove the v1 price worker and/token-pricesroute in freighter-backend.Generated by Claude Code