Skip to content

Commit c2ffb95

Browse files
committed
refactor: encapsulate provider logic in utils/provider.ts, eliminate 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
1 parent d3cfc50 commit c2ffb95

41 files changed

Lines changed: 1173 additions & 831 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ scripts/coverage
3434
!.yarn/versions
3535

3636
# typescript
37-
packages/*/*.tsbuildinfo
37+
packages/*/*.tsbuildinfo
38+
39+
# AI
40+
.sisyphus/

packages/transaction-controller/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5555

5656
- Add optional `sourceHash` field to `MetamaskPayMetadata` for tracking source chain transaction hashes when no local transaction exists ([#8133](https://github.com/MetaMask/core/pull/8133))
5757
- Add `predictDepositAndOrder` to `TransactionType` ([#8135](https://github.com/MetaMask/core/pull/8135))
58+
- Add `rpcRequest` and `getProvider` utility functions in `utils/provider.ts` for simplified RPC access using messenger + chainId/networkClientId
5859

5960
### Changed
6061

62+
- **BREAKING:** `GasFeeFlowRequest` type now uses `networkClientId` instead of `ethQuery`
63+
- **BREAKING:** `determineTransactionType` second parameter changed from `ethQuery` to an options object with `messenger` and `networkClientId`
64+
- **BREAKING:** Removed `ethQuery`/`EthQuery` from all internal types and utility function signatures, replaced with `rpcRequest` from `utils/provider`
6165
- Use distinct error message when failing incomplete transactions at startup whose required transactions are all confirmed ([#8189](https://github.com/MetaMask/core/pull/8189))
6266
- Bump `@metamask/core-backend` from `^6.1.0` to `^6.1.1` ([#8162](https://github.com/MetaMask/core/pull/8162))
6367

68+
### Removed
69+
70+
- **BREAKING:** Removed `@metamask/eth-query` as a dependency
71+
6472
### Fixed
6573

6674
- Use effective recipient (decoded from tx data for token transfers) when checking for existing transactions in first-time interaction logic ([#8130](https://github.com/MetaMask/core/pull/8130))

packages/transaction-controller/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"@metamask/base-controller": "^9.0.0",
6161
"@metamask/controller-utils": "^11.19.0",
6262
"@metamask/core-backend": "^6.2.0",
63-
"@metamask/eth-query": "^4.0.0",
6463
"@metamask/gas-fee-controller": "^26.1.0",
6564
"@metamask/messenger": "^0.3.0",
6665
"@metamask/metamask-eth-abis": "^3.1.1",

0 commit comments

Comments
 (0)