Skip to content

chore(predict): consume predictionSettled from @metamask/client-utils 3.1.1 - #39071

Merged
matallui merged 2 commits into
mainfrom
feat/pred-1420-c7-client-utils-bump
Nov 6, 2026
Merged

matallui merged 2 commits into
mainfrom
feat/pred-1420-c7-client-utils-bump

Conversation

@matallui

@matallui matallui commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

C6 (PRED-1405, #38411) declared the predictionSettled activity kind locally in mobile so E5 was not blocked on a @metamask/client-utils release. MetaMask/core#11169 shipped it upstream in @metamask/client-utils@3.1.0, so mobile now consumes the upstream kind and deletes its local copy. client-utils is again the only source of activity kinds.

Bump. @metamask/client-utils 3.0.2 → 3.1.1. The manifest floor moves from ^3.0.2 to ^3.1.1 as well: the code now depends on predictionSettled existing upstream, so 3.0.2 no longer type-checks. 3.1.1 rather than 3.1.0 because it asks for @metamask/core-backend@^14, which the app already uses, so the lockfile ends up with one fewer copy.

Lockfile effect, all transitive through client-utils:

Package Before After Why
@metamask/client-utils 3.0.2 3.1.1 this PR
@metamask/core-backend client-utils had a private 11.0.0 shares the app's 14.0.0 11.0.0 dropped from the lock
@metamask/transaction-controller 72.3.0 72.3.0 client-utils asks ^73.1.1, but the root resolutions pins 72.3.0 (#39024 reverted 73 because it breaks simulations). This PR does not bring 73 back.
eth-chainlist 0.0.795 0.0.873 used by client-utils only

Code. LocalActivityKindShapes, LocalActivityKind and ShapeKindOf are deleted from app/util/activity-adapters/types.ts, and ActivityKind is re-exported straight from client-utils. ActivityItemForKind returns to its pre-C6 condition. Upstream puts predictionSettled in the same ActivityData group as predictionClaimWinnings, which is the shape the local mapping borrowed, so ActivityListItem is unchanged for every kind. PredictSettlementExtras, KALSHI_VENUE_CHAIN_ID and the row and details rendering stay mobile-only. The catalog contract doc is updated.

What the client-utils CHANGELOG (3.0.3 → 3.1.1) changes for mobile. I diffed the published dist of 3.0.2 against 3.1.1. Only three runtime files changed, plus the ActivityKind type:

  1. API contract-interaction rows now carry a network fee (core#11013). mapApiTransaction's contractInteraction fallback adds fees: getFees(transaction), the same helper API swap rows already use. Mobile renders this in ContractInteractionDetails → ActivityDetailsFeesAndTotal, so the details screen of a contract interaction that exists only in the accounts API (no local TransactionController record) now shows a network fee where it showed none. This is user-visible but outside Predict. It is an upstream fix and no mobile test depended on the old value.
  2. OP-stack L1 and operator fees in getLocalTransactionFees (core#9630). This does not reach mobile. Both mapLocalTransaction call sites run prepareLocalTransactionGroup first, which fills transactionGroup.fees from mobile's own getLocalActivityFees, and client-utils only falls back to its helper when that is absent. Mobile's helper has no L1 fee today. That gap predates this PR and is unchanged.
  3. Dependency bumps. No transaction-controller symbol is used in 3.1.1 that 3.0.2 did not already use, and 3.0.2 already runs on the pinned 72.3.0, so the resolution is safe. The new receipt fields the OP-stack fee code reads are optional and only used on the fallback path mobile never reaches. eth-chainlist adds 189 chains and changes the native symbol or slip44 of 15 obscure chains (for example Rome, c8ntinuum, Data Network). None of them is a network mobile ships by default.
  4. Node 26 support (core#10981) has no effect on the app bundle.

No test was changed.

Changelog

CHANGELOG entry: null

Related issues

Refs: PRED-1420

Manual testing steps

N/A. The predictionSettled change is type-only and emits identical JavaScript, and Predict rows are built by mobile's mapActivityEntry, not by client-utils. Coverage comes from the unchanged C6 unit and component-view tests:

  • yarn lint:tsc: pass
  • yarn jest over ActivityListItemRow, PredictNext activity, ActivityScreen, ActivityDetails, ActivityList, activity-adapters, selectors/activity, Transactions, MultichainTransactionsView, useFormatters and util/bridge: 100 suites, 1244 tests pass (rerun after merging main)
  • yarn jest -c jest.config.view.js over ActivityDetails (including ActivityDetails.predict.view.test.tsx), ActivityScreen, ActivityList, PredictNext, SwapsLimitOrderActivityPage and confirmations activity: 22 suites, 568 tests pass (rerun after merging main)
  • yarn lint:shard 1–4 of 4: 0 errors
  • yarn install --immutable: pass

To see the one visible change from the bump:

Feature: Activity details for API-only contract interactions

  Scenario: user opens a contract interaction known only to the accounts API
    Given a wallet whose history includes a contract interaction with no local transaction record (for example, imported on a fresh install)

    When user opens Activity and taps that contract interaction
    Then the details screen shows a Network fee row

Screenshots/Recordings

N/A. No Predict rendering changes, and the contract-interaction fee row reuses the existing fees component.

Before

N/A

After

N/A

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

Performance checks are not applicable: this is a type-only change plus a dependency bump, with no new rendering, polling or lists.

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

Medium Risk
Touches shared activity types and a client-utils bump with lockfile drift; minor user-visible change possible for API-only contract interaction details (fees row) per upstream.

Overview
Dependency and types

Bumps @metamask/client-utils to ^3.1.1 and refreshes yarn.lock (transitive updates such as eth-chainlist, contract-metadata, alignment with app’s core-backend).

Activity adapters

Removes the temporary mobile union for predictionSettled (LocalActivityKindShapes, LocalActivityKind, ShapeKindOf). ActivityKind is re-exported from client-utils only; ActivityItemForKind narrows on upstream kinds directly. Upstream now ships predictionSettled; mobile-only PredictSettlementExtras / KALSHI_VENUE_CHAIN_ID stay in types.ts.

Docs

Updates the canonical portfolio activity catalog to state that predictionSettled comes from client-utils (3.1.0+) and the local stub was dropped after the bump.

Note: client-utils 3.1.x also adds network fees on API-only contract-interaction rows; Predict rendering is unchanged per PR description.

Reviewed by Cursor Bugbot for commit 2bb918a. Bugbot is set up for automated code reviews on this repo. Configure here.

… 3.1.1

Bump @metamask/client-utils from 3.0.2 to 3.1.1. 3.1.0 adds
`predictionSettled` to `ActivityKind` with the same item shape as
`predictionClaimWinnings`, which is what the local declaration from
PRED-1405 reproduced. Delete the local-kind plumbing (LocalActivityKind,
ShapeKindOf) and re-export `ActivityKind` from client-utils again.

PredictSettlementExtras, KALSHI_VENUE_CHAIN_ID and the row and details
rendering stay mobile-only.

Lockfile: client-utils now shares the app's core-backend 14.0.0 (the
private 11.0.0 copy is dropped), eth-chainlist moves 0.0.795 -> 0.0.873,
and transaction-controller stays at 73.0.0 via the root resolution.

Refs: PRED-1420
@matallui matallui added the team-predict Predict team label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

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 the size-S label Nov 5, 2026
@socket-security

socket-security Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​client-utils@​3.0.2 ⏵ 3.1.199 +110078 +198 +1100

View full report

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags

SmokePredictions
SmokeWalletPlatform
SmokeConfirmations

AI Confidence: 82

E2E reasoning

Expand to read

Changes analyzed:

  1. package.json / yarn.lock: Bumps @metamask/client-utils from ^3.0.2 to ^3.1.1. The 3.1.0 release added predictionSettled as an official ActivityKind (feat(client-utils): add predictionSettled activity kind core#11169).

  2. app/util/activity-adapters/types.ts: Removes the locally-declared predictionSettled kind (PRED-1405 workaround) and now re-exports ActivityKind directly from @metamask/client-utils. This eliminates the LocalActivityKind union type, LocalActivityKindShapes interface, and ShapeKindOf helper — simplifying the type system. The ActivityItemForKind conditional type is also simplified since ShapeKindOf is no longer needed.

  3. app/components/UI/PredictNext/docs/...: Documentation-only update reflecting the upstream migration.

Impact assessment:

  • The changes are primarily in the Predictions (Polymarket) feature area — ActivityKind and predictionSettled are used by PredictNext activity components (usePredictActivityItems, usePredictActivityDetailsItem, PredictActivityDetails)
  • The type change is a cleanup (removing a local workaround), not a behavioral change — the predictionSettled kind now comes from upstream with the same shape
  • Risk is medium: while the change is logically a cleanup, it modifies a shared type exported from app/util/activity-adapters that feeds into the Predictions activity rendering pipeline. A regression could break the settled prediction display flow.
  • SmokePredictions is the primary tag — covers position lifecycle, activities tab, and balance sync
  • SmokeWalletPlatform is required per SmokePredictions description (Predictions is a section inside Trending)
  • SmokeConfirmations is required per SmokePredictions description (on-chain transactions)

View run

…ent-utils-bump

* origin/main: (35 commits)
  fix(social): open profile and position sheet from token feed posts (#39017)
  feat(predict): open market rules from a dotted-underlined card title (PRED-1469) (#39007)
  feat(predict): add a Politics feed screen with Trump, Congress and Iran tabs (PRED-1454) (#39010)
  fix: Revert `TransactionController` version back to `72.3` (#39024)
  fix(predict-next): stop the Order background observation firing before the grace ends (#39074)
  revert: add New badge to Limit Order tab cp-8.20.0 (#39030)
  feat: allow metamask.com WebView origins (#39089)
  chore(streams): remove unused JSON stream transforms (#38953)
  chore(browser): remove unused browser constants and scripts (#38954)
  chore(settings): remove unused settings action creators (#38952)
  chore(delegation): remove unused hex helpers (#38955)
  fix(neobank): show one Money home card from the routing table cp-8.20.0 (#39006)
  perf(perps): mount the Lighter signer WebView only when needed (#38837)
  chore(perps): bump perps-controller to 22.1.2 cp-8.20.0 (#38834)
  perf(perps): cache filterAndSortMarkets per market snapshot (#38817)
  chore(carousel): remove unused predefined slides (#38956)
  chore(homepage): remove unused SectionCard component (#39049)
  fix: translate settings menu Lock label to match extension in French (#39079)
  feat(predict): new Game header with helmets, abbreviations and live status (PRED-1461) (#38917)
  feat(predict): show threshold ladders as a generic line picker card (PRED-1468) (#39002)
  ...

# Conflicts:
#	yarn.lock
@matallui
matallui marked this pull request as ready for review November 6, 2026 09:33
@matallui
matallui requested review from a team as code owners November 6, 2026 09:33
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@matallui
matallui enabled auto-merge November 6, 2026 10:20
@matallui
matallui added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 95c2501 Nov 6, 2026
209 of 211 checks passed
@matallui
matallui deleted the feat/pred-1420-c7-client-utils-bump branch November 6, 2026 10:59
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
@metamask-ci metamask-ci Bot added the release-8.21.0 Issue or pull request that will be included in release 8.21.0 label Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.21.0 Issue or pull request that will be included in release 8.21.0 size-S team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants