chore(runway): cherry-pick 0e57cdc#29268
Merged
Merged
Conversation
…ontroller to ^24.0.0 (#28943) ## **Description** Bumps `@metamask/smart-transactions-controller` from `^23.0.0` to `^24.0.0` and handles the v24 breaking change. **Breaking change in v24:** The `getBearerToken` constructor parameter was removed. The controller now calls `AuthenticationController:getBearerToken` directly through its own runtime messenger. Changes made: - `AuthenticationController:getBearerToken` moved from the init messenger to the controller's runtime messenger (`getSmartTransactionsControllerMessenger`) - Removed the `getBearerToken` wrapper closure from `smart-transactions-controller-init.ts` - Mobile-specific: `setSentinelApiAuth` still needs the bearer token and now calls `controllerMessenger.call('AuthenticationController:getBearerToken')` directly - Updated unit tests to match the new constructor signature No behavior change — the bearer token is still fetched and sent with authenticated requests. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: STX-503 ## **Manual testing steps** ```gherkin Feature: smart transactions controller bump Scenario: no behavior change Given the app is open When smart transactions are used Then they behave identically to before the bump ``` ## **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 - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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) N/A — no runtime behavior change. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches auth token plumbing and messenger delegation for Smart Transactions/Sentinel requests; incorrect wiring could silently drop authenticated headers or break controller calls, though the change is narrowly scoped and covered by updated tests. > > **Overview** > Updates `@metamask/smart-transactions-controller` to `^24.0.0` and adjusts the engine integration for the v24 breaking change that removes the controller constructor’s `getBearerToken` option. > > `AuthenticationController:getBearerToken` delegation is moved to the Smart Transactions *runtime* messenger, and init-time delegation is removed; `smart-transactions-controller-init` now configures Sentinel auth via `setSentinelApiAuth` using a token getter that calls `controllerMessenger.call('AuthenticationController:getBearerToken')`. Unit tests are updated to assert the new constructor signature and to validate Sentinel auth setup/token retrieval behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e0e1eb3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release branch (release/*) All E2E tests pre-selected. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Contributor
|
✅ E2E Fixture Validation — Schema is up to date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Bumps
@metamask/smart-transactions-controllerfrom^23.0.0to^24.0.0and handles the v24 breaking change.Breaking change in v24: The
getBearerTokenconstructor parameterwas removed. The controller now calls
AuthenticationController:getBearerTokendirectly through its ownruntime messenger.
Changes made:
AuthenticationController:getBearerTokenmoved from the initmessenger to the controller's runtime messenger
(
getSmartTransactionsControllerMessenger)getBearerTokenwrapper closure fromsmart-transactions-controller-init.tssetSentinelApiAuthstill needs the bearer token andnow calls
controllerMessenger.call('AuthenticationController:getBearerToken')directly
No behavior change — the bearer token is still fetched and sent with
authenticated requests.
Changelog
CHANGELOG entry: null
Related issues
Fixes: STX-503
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
N/A — no runtime behavior change.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Touches auth token plumbing and messenger delegation for Smart
Transactions/Sentinel requests; incorrect wiring could silently drop
authenticated headers or break controller calls, though the change is
narrowly scoped and covered by updated tests.
Overview
Updates
@metamask/smart-transactions-controllerto^24.0.0andadjusts the engine integration for the v24 breaking change that removes
the controller constructor’s
getBearerTokenoption.AuthenticationController:getBearerTokendelegation is moved to theSmart Transactions runtime messenger, and init-time delegation is
removed;
smart-transactions-controller-initnow configures Sentinelauth via
setSentinelApiAuthusing a token getter that callscontrollerMessenger.call('AuthenticationController:getBearerToken').Unit tests are updated to assert the new constructor signature and to
validate Sentinel auth setup/token retrieval behavior.
Reviewed by Cursor Bugbot for commit
e0e1eb3. Bugbot is set up for automated
code reviews on this repo. Configure
here.