Skip to content

Conversation

@rarquevaux
Copy link
Contributor

@rarquevaux rarquevaux commented Dec 5, 2025

Description

Upgrades @metamask/smart-transactions-controller and consolidates feature flag logic by delegating to the controller's built-in selector (selectSmartTransactionsFeatureFlagsForChain).

Key changes:

  • Removes local feature flag selector implementation in favor of the controller's exported selector
  • Updates getSmartTransactionsFeatureFlagsForChain to wrap the controller's selector, which handles validation and merging of default + chain-specific config

This removes the usage of the smart-transactions section of the swaps feature flags. No functional changes are expected.

Dependency on MetaMask/smart-transactions-controller#550. The smart-controller-version will have to be updated.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: upgrade smart-transactions-controller and replace the legacy smart transactions swaps flag with smart transactions flag from remote config API.

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

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.

@metamaskbot metamaskbot added the team-transactions Transactions team label Dec 5, 2025
@metamaskbot
Copy link
Collaborator

metamaskbot commented Dec 5, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (2 files, +28 -16)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📄 useSmartTransactionFeatureFlags.test.ts +18 -15
          • 📄 useSmartTransactionFeatureFlags.ts +10 -1

💸 @MetaMask/transactions (4 files, +74 -156)
  • 📁 app/
    • 📁 scripts/
      • 📁 controller-init/
        • 📁 smart-transactions/
          • 📄 smart-transactions-controller-init.test.ts +1 -62
          • 📄 smart-transactions-controller-init.ts +2 -14
      • 📁 lib/
        • 📁 smart-transaction/
          • 📄 smart-transactions.test.ts +57 -50
          • 📄 smart-transactions.ts +14 -30

@github-actions github-actions bot added the size-L label Dec 5, 2025
@rarquevaux rarquevaux force-pushed the feat/STX-331-stx-flags branch 3 times, most recently from af7b80f to a940b01 Compare December 6, 2025 00:10
@rarquevaux rarquevaux changed the title feat(STX-331): wip feat(STX-331): replace legacy swaps flags with smart transaction flags from remote config API Dec 6, 2025

Promise.all([
// TODO: check if this is still needed.
fetchSwapsFeatureFlags(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this for now and the setSwapsFeatureFlags dispatch cause I am not sure if it is read at some point in the codebase

);

// TODO: Replace. Currently, this checks an hardcoded list in the client.
const currentChainSupportsSmartTransactions = useSelector(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dan437 , do we still have a use case for this?

@rarquevaux rarquevaux force-pushed the feat/STX-331-stx-flags branch 4 times, most recently from daad80d to 390d595 Compare December 8, 2025 23:31
@github-actions github-actions bot added size-XL and removed size-L labels Dec 8, 2025
@rarquevaux rarquevaux force-pushed the feat/STX-331-stx-flags branch from 390d595 to 1ee27ad Compare December 9, 2025 23:54
@rarquevaux rarquevaux force-pushed the feat/STX-331-stx-flags branch from 1ee27ad to d93fcd9 Compare December 9, 2025 23:55
@rarquevaux rarquevaux changed the title feat(STX-331): replace legacy swaps flags with smart transaction flags from remote config API feat(STX-331): replace legacy STX swaps flags with smart transaction flags from remote config API Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants