Uh oh!
There was an error while loading. Please reload this page.
refactor(transaction-controller): encapsulate provider logic - #8273
Conversation
72ca7a5 to
a7e5332CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
matthewwalsh0
commented
Mar 25, 2026
@metamaskbot publish-preview |
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
matthewwalsh0
commented
Mar 25, 2026
@metamaskbot publish-preview |
…ethQuery from transaction-controller Replace all ethQuery/EthQuery usage with a new rpcRequest() utility that accepts messenger + chainId/networkClientId + method + params. Any file can now send RPC requests without passing around ethQuery instances. - Add utils/provider.ts with rpcRequest() and getProvider() functions - Migrate all utils, gas-flows, helpers, hooks, and TransactionController - Update GasFeeFlowRequest type: ethQuery -> networkClientId (BREAKING) - Update determineTransactionType signature to options object (BREAKING) - Remove @metamask/eth-query dependency - Update all test files to match new signatures
…nts for connectivity-controller
a0caca0 to
2fbeb5cCompareThere was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.

Explanation
Currently,
transaction-controllerpassesethQueryinstances throughout the codebase — into utils, helpers, hooks, and gas flows — to make RPC calls. This couples every layer toEthQueryinternals and makes the provider plumbing verbose and fragile.This PR introduces a
utils/provider.tsmodule with functions includingrpcRequestandgetProvider, meaning allEthQueryusage is replaced, and all provider logic is encapsulated and callable anywhere with amessenger.References
Checklist
Note
Medium Risk
Medium risk because it replaces
EthQueryacross transaction publishing, gas estimation, and pending-tracking flows with a new messenger-based RPC abstraction, which could change runtime RPC behavior and error handling. Also includes a breaking API/export removal (determineTransactionType) and dependency removal (@metamask/eth-query).Overview
Refactors
transaction-controllerto remove@metamask/eth-queryentirely and route all RPC access through newutils/provider.tshelpers (getProvider,rpcRequest,getChainId,getNetworkClientId) using the messenger to resolve network clients.Updates transaction publishing, gas estimation/fee flows, simulation balance checks, batch/sequential publish hooks,
PendingTransactionTracker, and related helpers to passnetworkClientId/messengerinstead ofEthQuery/provider instances, and adjusts tests/integration mocks accordingly. Also removes the public export ofdetermineTransactionType(breaking change) and updates.gitignoreto ignore.sisyphus/.Written by Cursor Bugbot for commit 7c456b9. This will update automatically on new commits. Configure here.