feat: expose SmartTransactionsController methods through messenger#574
feat: expose SmartTransactionsController methods through messenger#574cryptodev-2s merged 3 commits intomainfrom
Conversation
Upgrade TypeScript to ~5.3.3 to align with core. Add method action type generation script and expose controller methods via messenger.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution MetaMask internal reviewing guidelines:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| // Since we're just using the method reference in the handler type, | ||
| // we don't need the full signature - just return the method name | ||
| // The actual signature will be inferred from the controller class | ||
| return node.name ? (node.name as ts.Identifier).text : ''; |
There was a problem hiding this comment.
extractMethodSignature and signature field are dead code
Low Severity
The extractMethodSignature function computes a value stored in MethodInfo.signature, but this field is never read anywhere. generateActionTypesContent only accesses method.name and method.jsDoc — method.signature is unused. This adds an unnecessary function, a type field, and two assignment sites (line 375-379 and line 554) that all contribute dead code.


Summary
SmartTransactionsControllermethods through the messenger pattern, aligning with the ongoing effort across all controllersgenerate-method-action-typesscript for automated method/action type generation~4.8.4to~5.3.3required to run the generation scriptNew exported messenger actions
SmartTransactionsController:checkPollSmartTransactionsController:initializeSmartTransactionsForChainIdSmartTransactionsController:pollSmartTransactionsController:stopSmartTransactionsController:setOptInStateSmartTransactionsController:trackStxStatusChangeSmartTransactionsController:isNewSmartTransactionSmartTransactionsController:updateSmartTransactionSmartTransactionsController:updateSmartTransactionsSmartTransactionsController:fetchSmartTransactionsStatusSmartTransactionsController:clearFeesSmartTransactionsController:getFeesSmartTransactionsController:submitSignedTransactionsSmartTransactionsController:cancelSmartTransactionSmartTransactionsController:fetchLivenessSmartTransactionsController:setStatusRefreshIntervalSmartTransactionsController:getTransactionsSmartTransactionsController:getSmartTransactionByMinedTxHashSmartTransactionsController:wipeSmartTransactionsTest plan
yarn testpassesyarn buildsucceedstsc --noEmitNote
Medium Risk
Adds many new messenger-exposed method actions and upgrades TypeScript to v5, which can break consumers via allowlist/API surface and type-checking changes.
Overview
Exposes
SmartTransactionsControllermethods via the messenger by registering method action handlers for a newMESSENGER_EXPOSED_METHODSallowlist, and expandsSmartTransactionsControllerActionsto include the newly exposed method actions.Adds an auto-generation pipeline for method action types (
scripts/generate-method-action-types.ts) plus a generatedSmartTransactionsController-method-action-types.ts, and exports these action types fromsrc/index.ts.BREAKING: upgrades TypeScript to
~5.3.3and updates linting to enforce generated action types are checked/kept in sync (addstsx,yargs, and related lockfile/lavamoat updates).Written by Cursor Bugbot for commit 0ccc5fa. This will update automatically on new commits. Configure here.