fix(Rewards): Ondo campaign UX cp-7.79.0#30711
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
None of the available E2E test tags cover Ondo campaign flows specifically. The changes do not touch:
The risk is low: this is a UI label rename and an internal code refactor with full unit test coverage. No E2E tests need to run for these changes. Performance Test Selection: |
|



Description
This attempts to fix what was intended to be fixed in PR #30419 but for some reason that PR did not work - to ensure that a source token is used when opening an Ondo swap from Rewards. It also updates the button text to say "Trade now" instead of "Open Position."
Changelog
CHANGELOG entry: null
Related issues
Fixes: n/a
Manual testing steps
Screenshots/Recordings
Before
After
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
Low Risk
Copy and Rewards swap prefill logic only; changes are localized with new unit tests and no auth or payment impact.
Overview
Renames the opted-in, no-positions Ondo campaign CTA from Open Position to Trade now via
rewards.campaign_details.open_positioninen.json, with matching test and comment updates.Fixes open position swaps from Rewards by resolving default source tokens through a new
getOndoOpenPositionSourceTokenhelper: chain defaults are keyed by hex (0x1→ USDC,0x38→ USDT) instead of CAIP-only map lookups, and the helper accepts hex oreip155:chain IDs (including after-hours confirm). USDY balance preference is unchanged; tests cover BNB/USDT and the helper edge cases.Reviewed by Cursor Bugbot for commit be88b88. Bugbot is set up for automated code reviews on this repo. Configure here.