Skip to content

Commit 6902301

Browse files
authored
chore(predict): enable world cup games for live sports (#29740)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until this PR meets the canonical Definition of Ready For Review in `docs/readme/ready-for-review.md`. In short: the template must be materially complete (not just section titles present), all status checks must be currently passing, and the only expected follow-up commits must be reviewer-driven. --> ## **Description** Adds FIFA World Cup (`fifwc`) as a supported sports league in the Predict feature, enabling users to browse and bet on World Cup match markets with live game data. **Changes:** - Added `fifwc` to the `PredictSportsLeague` union type - Registered `fifwc` in `SUPPORTED_SPORTS_LEAGUES` so World Cup markets appear in the sports feed - Added `fifwc` to `DRAW_CAPABLE_LEAGUES` since soccer matches can end in draws - Added slug config in `gameParser.ts` with: - Pattern: `fifwc-{team1}-{team2}-{date}` - Team order: `home-away` - Tag slug: `fifa-world-cup` This follows the existing pattern for adding new leagues as documented in `sports.ts`. ## **Changelog** CHANGELOG entry: Added FIFA World Cup support to live sports predictions ## **Related issues** Fixes: N/A — feature enablement for FIFA World Cup 2026 ## **Manual testing steps** ```gherkin Feature: FIFA World Cup prediction markets Scenario: user views World Cup markets in the sports feed Given the user has the Predict feature enabled And FIFA World Cup markets are available from the provider When user navigates to the Predict tab And user browses sports markets Then World Cup match markets appear in the list And each market displays home and away teams with logos and scores Scenario: user places a prediction on a World Cup match Given the user is viewing a FIFA World Cup match market And the market status is "open" When user selects an outcome (home win, draw, or away win) And user enters a bet amount And user confirms the prediction Then the order is placed successfully And the position appears in the user's positions list ``` ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### 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](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [ ] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **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. <!-- Generated with the help of the pr-description AI skill --> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this only extends existing league allowlists and slug parsing to recognize a new `fifwc` league, with minimal impact on existing leagues unless upstream data unexpectedly matches the new pattern/tag. > > **Overview** > Enables FIFA World Cup games in the Predict live sports flow by adding the `fifwc` league across the sports league type, the supported/draw-capable league allowlists, and the game slug parsing configuration. > > This allows events tagged as `fifa-world-cup` with slugs matching `fifwc-{team1}-{team2}-{date}` to be recognized and parsed like other soccer leagues. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4db00e5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent fe91d51 commit 6902301

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

app/components/UI/Predict/constants/sports.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const SUPPORTED_SPORTS_LEAGUES: PredictSportsLeague[] = [
5050
'itc',
5151
'dfb',
5252
'cde',
53+
'fifwc',
5354
];
5455

5556
export const filterSupportedLeagues = (
@@ -98,6 +99,7 @@ const DRAW_CAPABLE_LEAGUES: ReadonlySet<PredictSportsLeague> = new Set([
9899
'itc',
99100
'dfb',
100101
'cde',
102+
'fifwc',
101103
]);
102104

103105
export const isDrawCapableLeague = (league: PredictSportsLeague): boolean =>

app/components/UI/Predict/types/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ export type PredictSportsLeague =
183183
| 'bol1'
184184
| 'itc'
185185
| 'dfb'
186-
| 'cde';
186+
| 'cde'
187+
| 'fifwc';
187188

188189
// Game status
189190
export type PredictGameStatus = 'scheduled' | 'ongoing' | 'ended';

app/components/UI/Predict/utils/gameParser.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ const LEAGUE_SLUG_CONFIGS: Record<PredictSportsLeague, LeagueSlugConfig> = {
207207
teamOrder: 'home-away',
208208
tagSlug: 'coupe-de-france',
209209
},
210+
fifwc: {
211+
pattern: /^fifwc-([a-z0-9]+)-([a-z0-9]+)-(\d{4}-\d{2}-\d{2})$/,
212+
teamOrder: 'home-away',
213+
tagSlug: 'fifa-world-cup',
214+
},
210215
};
211216

212217
export type TeamLookup = (

0 commit comments

Comments
 (0)