From dc7d0ee80cbea567fe0ae2c933ffab80e8e4ef1a Mon Sep 17 00:00:00 2001 From: Dimitris Marlagkoutsos Date: Tue, 14 Jul 2026 21:28:21 +0200 Subject: [PATCH 1/2] feat(wallet-cli): wire the TransactionController slot in the daemon wallet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `TransactionController` is now wired in `@metamask/wallet` (#8975), so populate the previously-stubbed `transactionController` instance-options slot in the daemon's wallet factory instead of relying on the controller's implicit defaults. The headless daemon has no swaps surface, so swaps-specific processing is disabled (matching mobile), and no client-UI hooks are supplied — the controller's built-in publish path broadcasts through the wired `NetworkController` provider, and every other option is left at its default. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/wallet-cli/CHANGELOG.md | 1 + .../src/daemon/wallet-factory.test.ts | 2 ++ .../wallet-cli/src/daemon/wallet-factory.ts | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/wallet-cli/CHANGELOG.md b/packages/wallet-cli/CHANGELOG.md index 643a3563ebd..99a77efcbdd 100644 --- a/packages/wallet-cli/CHANGELOG.md +++ b/packages/wallet-cli/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Wire the `transactionController` slot in the daemon wallet's instance options, so the daemon runs the `TransactionController` with an explicit CLI-appropriate configuration (swaps processing disabled, no client hooks) rather than relying on the controller's implicit defaults ([#9539](https://github.com/MetaMask/core/pull/9539)) - Add the `mm wallet unlock` command, which dispatches `KeyringController:submitPassword` over the daemon socket, allowing the keyring to be unlocked after a daemon start with no password or after a `mm daemon call KeyringController:setLocked` ([#8821](https://github.com/MetaMask/core/pull/8821)) - Add the `mm daemon list` command, which prints the messenger actions the running daemon can dispatch via `daemon call`, enumerated from the live messenger so the list cannot drift from what `call` accepts ([#9339](https://github.com/MetaMask/core/pull/9339)) - Add the `mm daemon` command suite (`start`, `stop`, `status`, `purge`, and `call`) for running the wallet daemon and dispatching messenger actions over its socket ([#9255](https://github.com/MetaMask/core/pull/9255)) diff --git a/packages/wallet-cli/src/daemon/wallet-factory.test.ts b/packages/wallet-cli/src/daemon/wallet-factory.test.ts index 7a9d0e03d79..26d58695569 100644 --- a/packages/wallet-cli/src/daemon/wallet-factory.test.ts +++ b/packages/wallet-cli/src/daemon/wallet-factory.test.ts @@ -118,6 +118,8 @@ describe('createWallet', () => { expect(instanceOptions.storageService.storage).toBeInstanceOf( InMemoryStorageAdapter, ); + expect(instanceOptions.transactionController?.disableSwaps).toBe(true); + expect(instanceOptions.transactionController?.hooks).toStrictEqual({}); expect(ClientConfigApiService).toHaveBeenCalled(); await dispose(); diff --git a/packages/wallet-cli/src/daemon/wallet-factory.ts b/packages/wallet-cli/src/daemon/wallet-factory.ts index 10b7eaa1c56..6ecf2bbe29c 100644 --- a/packages/wallet-cli/src/daemon/wallet-factory.ts +++ b/packages/wallet-cli/src/daemon/wallet-factory.ts @@ -62,6 +62,9 @@ export type CreateWalletResult = { * flags over the network. * - `approvalController` — a no-op `showApprovalRequest` (the daemon is * headless). + * - `transactionController` — swaps processing disabled and no client hooks; + * see the slot's inline comment for why the daemon relies on the + * controller's defaults for everything else. * * The optional `keyringController` slot is intentionally omitted so the * controller's built-in defaults (e.g. the PBKDF2 encryptor) apply. @@ -100,7 +103,19 @@ function buildInstanceOptions( storageService: { storage: new InMemoryStorageAdapter(), }, - // TODO(#8975): add the `transactionController` slot once it is wired. + transactionController: { + // The CLI exposes no swaps surface, so skip the swaps-specific + // post-processing a full wallet client runs (mobile makes the same + // choice; the extension keeps swaps enabled). + disableSwaps: true, + // No CLI-specific transaction hooks: the controller's built-in publish + // path broadcasts through the wired `NetworkController` provider, and the + // remaining hooks (metrics, notifications, gas-fee tokens) are client-UI + // concerns the headless daemon has no equivalent for. Every other option + // (`getPermittedAccounts`, `isSimulationEnabled`, `trace`, …) is left at + // the controller's default. + hooks: {}, + }, }; } From 4ff0e4cb271a18ef19fdef4d18cef25fb26d3646 Mon Sep 17 00:00:00 2001 From: Dimitris Marlagkoutsos Date: Tue, 14 Jul 2026 21:31:10 +0200 Subject: [PATCH 2/2] docs(wallet-cli): correct changelog PR link to #9509 Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/wallet-cli/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wallet-cli/CHANGELOG.md b/packages/wallet-cli/CHANGELOG.md index 99a77efcbdd..9e83315b448 100644 --- a/packages/wallet-cli/CHANGELOG.md +++ b/packages/wallet-cli/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Wire the `transactionController` slot in the daemon wallet's instance options, so the daemon runs the `TransactionController` with an explicit CLI-appropriate configuration (swaps processing disabled, no client hooks) rather than relying on the controller's implicit defaults ([#9539](https://github.com/MetaMask/core/pull/9539)) +- Wire the `transactionController` slot in the daemon wallet's instance options, so the daemon runs the `TransactionController` with an explicit CLI-appropriate configuration (swaps processing disabled, no client hooks) rather than relying on the controller's implicit defaults ([#9509](https://github.com/MetaMask/core/pull/9509)) - Add the `mm wallet unlock` command, which dispatches `KeyringController:submitPassword` over the daemon socket, allowing the keyring to be unlocked after a daemon start with no password or after a `mm daemon call KeyringController:setLocked` ([#8821](https://github.com/MetaMask/core/pull/8821)) - Add the `mm daemon list` command, which prints the messenger actions the running daemon can dispatch via `daemon call`, enumerated from the live messenger so the list cannot drift from what `call` accepts ([#9339](https://github.com/MetaMask/core/pull/9339)) - Add the `mm daemon` command suite (`start`, `stop`, `status`, `purge`, and `call`) for running the wallet daemon and dispatching messenger actions over its socket ([#9255](https://github.com/MetaMask/core/pull/9255))