Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/wallet-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ([#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))
Expand Down
2 changes: 2 additions & 0 deletions packages/wallet-cli/src/daemon/wallet-factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
17 changes: 16 additions & 1 deletion packages/wallet-cli/src/daemon/wallet-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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: {},
},
};
}

Expand Down