Skip to content

Commit 27aa809

Browse files
committed
refactor(engine): wire TransactionController into @metamask/wallet init
Move TransactionController construction into the @metamask/wallet-owned wallet-init flow, mirroring extension PR #43182. The wallet now owns the TransactionController controller messenger and persisted state; the legacy messenger-client init registry entry is removed. - Bump @metamask/wallet 6->7 (bundles transaction-controller 68.2.2). - Relocate the TransactionController init messenger into wallet-init and drop the now-obsolete controller messenger factory. - Add wallet-init instance-options builder + listener setup for TransactionController. - Resolve the constructed instance via wallet.getInstance.
1 parent de26145 commit 27aa809

17 files changed

Lines changed: 635 additions & 1286 deletions

app/core/Engine/Engine.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ import { bridgeControllerInit } from './controllers/bridge-controller/bridge-con
129129
import { bridgeStatusControllerInit } from './controllers/bridge-status-controller/bridge-status-controller-init';
130130
import { multichainNetworkControllerInit } from './controllers/multichain-network-controller/multichain-network-controller-init';
131131
import { currencyRateControllerInit } from './controllers/currency-rate-controller/currency-rate-controller-init';
132-
import { TransactionControllerInit } from './controllers/transaction-controller';
133132
import { defiPositionsControllerInit } from './controllers/defi-positions-controller/defi-positions-controller-init';
134133
import { SignatureControllerInit } from './controllers/signature-controller';
135134
import { GasFeeControllerInit } from './controllers/gas-fee-controller';
@@ -291,6 +290,7 @@ export class Engine {
291290
};
292291

293292
this.#wallet = initializeWallet({
293+
getState: () => store.getState(),
294294
messenger: this.controllerMessenger,
295295
state: mergedInitialState,
296296
});
@@ -326,7 +326,6 @@ export class Engine {
326326
GasFeeController: GasFeeControllerInit,
327327
GatorPermissionsController: GatorPermissionsControllerInit,
328328
SmartTransactionsController: smartTransactionsControllerInit,
329-
TransactionController: TransactionControllerInit,
330329
TransactionPayController: TransactionPayControllerInit,
331330
SignatureController: SignatureControllerInit,
332331
CurrencyRateController: currencyRateControllerInit,
@@ -430,7 +429,9 @@ export class Engine {
430429
const signatureController = messengerClientsByName.SignatureController;
431430
const smartTransactionsController =
432431
messengerClientsByName.SmartTransactionsController;
433-
const transactionController = messengerClientsByName.TransactionController;
432+
const transactionController = this.#wallet.getInstance(
433+
'TransactionController',
434+
);
434435
const seedlessOnboardingController =
435436
messengerClientsByName.SeedlessOnboardingController;
436437
const geolocationController = messengerClientsByName.GeolocationController;

app/core/Engine/controllers/transaction-controller/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)