Skip to content

fix(Rewards): Ondo campaign UX cp-7.79.0#30711

Merged
Montoya merged 2 commits into
mainfrom
fix/ondo-source-token
May 27, 2026
Merged

fix(Rewards): Ondo campaign UX cp-7.79.0#30711
Montoya merged 2 commits into
mainfrom
fix/ondo-source-token

Conversation

@Montoya

@Montoya Montoya commented May 27, 2026

Copy link
Copy Markdown
Contributor

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

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

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_position in en.json, with matching test and comment updates.

Fixes open position swaps from Rewards by resolving default source tokens through a new getOndoOpenPositionSourceToken helper: chain defaults are keyed by hex (0x1 → USDC, 0x38 → USDT) instead of CAIP-only map lookups, and the helper accepts hex or eip155: 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.

@Montoya Montoya requested a review from a team as a code owner May 27, 2026 21:29
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added size-S and removed size-M labels May 27, 2026
sophieqgu
sophieqgu previously approved these changes May 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

E2E Test Selection:
All 6 changed files are confined to the Rewards/Ondo campaign feature area:

  1. OndoCampaignCTA.tsx – Comment-only change updating "Open Position" to "Trade now" in a JSDoc comment.
  2. OndoCampaignRwaSelectorView.tsx – Internal refactoring: renamed a constant and changed chain ID key format from CAIP (eip155:1) to hex (0x1), with a new exported helper getOndoOpenPositionSourceToken that handles both formats for backward compatibility.
  3. locales/languages/en.json – Single string key change: open_position value from "Open Position" to "Trade now".
  4. Three unit test files – Updated to reflect the label rename and added tests for the new helper function.

None of the available E2E test tags cover Ondo campaign flows specifically. The changes do not touch:

  • Shared navigation components (TabBar, BrowserTab, modals)
  • Controllers, Engine, or core infrastructure
  • Swap/bridge flows (the Ondo RWA selector calls into swap but the change is a refactor of chain ID lookup, not the swap flow itself)
  • Any E2E test infrastructure

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:
The changes are confined to the Rewards/Ondo campaign feature: a UI label rename and an internal chain ID lookup refactor. No rendering performance, data loading, account/network list components, critical user flows, or app startup code is affected. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@Montoya Montoya added this pull request to the merge queue May 27, 2026
Merged via the queue into main with commit f7e1cce May 27, 2026
159 checks passed
@Montoya Montoya deleted the fix/ondo-source-token branch May 27, 2026 22:41
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.80.0 Issue or pull request that will be included in release 7.80.0 label May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.80.0 Issue or pull request that will be included in release 7.80.0 size-S team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants