feat: read stablecoins from stable-tokens LD flag in useTokenFiatRates cp-8.3.0#33251
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🧪 Flaky unit test detection✅ All previously detected unit test flakiness issues in this PR have been fixed. This check is informational only and does not block merging. |
e3f7f02 to
5a4a6b0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ecd1bb7. Configure here.
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
Replace the hardcoded STABLECOINS constant in useTokenFiatRates with a selectStablecoins Redux selector that reads the stable-tokens LaunchDarkly flag, normalizing addresses to lowercase and falling back to the previous defaults when absent.
Move the stablecoin-check logic into relayFixedSpread.ts as isRouteToken and remove the now-unused isStablecoin from token.ts. useDepositPrefillAmount and its tests updated accordingly.
ecd1bb7 to
e691927
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
The feature flag registry change is a test infrastructure addition that registers the new Performance Test Selection: |
|




Description
On MM Pay UI read stablecoins from stable-tokens LD flag.
Changelog
CHANGELOG entry:
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1671
Manual testing steps
NA
Screenshots/Recordings
NA
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes how USD fiat rates and MM Pay deposit prefills are computed; wrong flag or route data could mis-price tokens or prefill amounts, though defaults mirror prior behavior.
Overview
Stablecoin fiat pricing no longer uses a hardcoded per-chain address map in
useTokenFiatRates. It now readsselectStablecoinsfrom the remotestable-tokensLaunchDarkly flag (with the previous addresses as defaults and normalization for invalid flag shapes).Deposit prefill (100% vs 50% of balance) switches from
isStablecoinintoken.tstoisRouteTokeninrelayFixedSpread, which treats a pay token as “stable” when it appears on any relay fixed-spread route as source or target. That helper is new;isStablecoinis removed fromtoken.ts. Related hooks/tests are updated accordingly.The
stable-tokensflag is registered in the feature-flag registry (remote, not in prod by default).Reviewed by Cursor Bugbot for commit dec93b9. Bugbot is set up for automated code reviews on this repo. Configure here.