@walletwright/core 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @walletwright/core
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 28c935f: Fix the Slush onboarding gate, which could never pass. It waited for `dataLayerMigrated`/`dataLayerMigrationStartedAt` on the preferences row, and current Slush (26.18.1) writes neither field, so every cache build failed after 60s regardless of the timeout. The gate now waits for what the cache actually needs: an account in `signaldb-accounts` and a preferences row whose `currentAccountId` selects it.
8
+
9
+ ## 0.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - fdb91d4: Fix a set of state-representation defects found by a repo-wide simplification audit.
14
+
15
+ **Caches now publish from staging.** Extension extraction and the onboarded profile build both wrote
16
+ in place, so an interrupted run (Ctrl-C, ENOSPC, a CI timeout, a flaky MV3 worker) could leave a
17
+ partial directory that still satisfied the "does it exist" check every later run made. That surfaced
18
+ much later as an unlock or selector timeout rather than as a build failure. Both now build inside the
19
+ cache and publish by rename. Profile replacement keeps the prior cache at a recovery path until the
20
+ new one lands, so a failed or interrupted publication can restore it.
21
+
22
+ **`launchWallet` no longer leaks its throwaway profile copy.** Cleanup was bound to the browser
23
+ context's `close` event, which does not exist yet if the profile copy or the launch itself fails, and
24
+ which nobody awaited. `launchWallet` now returns `close()` alongside `context` and `wallet`: it closes
25
+ the browser and then awaits removal of the copy. `context.close()` still triggers a best-effort
26
+ cleanup, so existing code keeps working, but `close()` is the documented path.
27
+
28
+ **Approval handling is more precise.** A popup respawned mid-approval is now positioned on screen like
29
+ the first one (it previously skipped that, and an off-screen window renders fine but refuses clicks).
30
+ The "did it close" check now tracks the exact page it drove instead of scanning the context for any
31
+ matching URL, which reported failure whenever a wallet chained a second popup or left a notification
32
+ window on its home screen. That check also now applies to `connectToDapp()`, which could previously
33
+ report success on a popup that never closed. MetaMask's `reject` gained the third-party-notice
34
+ dismissal and retry that `approve` already had, since the notice covers the whole footer.
35
+
36
+ **The `cache` CLI validates its flags.** It now uses `node:util`'s `parseArgs` in strict mode, so an
37
+ unknown flag, a flag missing its value, `--headless false` (which used to turn headless _on_), and
38
+ `--wallet=value` are all handled correctly instead of silently ignored or inverted. `--setup` combined
39
+ with a flag it would discard is now an error. Failures set `process.exitCode` rather than calling
40
+ `process.exit`, which could truncate the error message when stderr was piped.
41
+
42
+ **The mocks give each install its own bridge.** Installing `installMockWallet` or
43
+ `installMockStandardWallet` twice with different options used to discard the second handler while
44
+ returning its address, so the page signed with the first install's key on the first install's chain.
45
+
46
+ **Breaking (types only):** `WalletDefinition.reject` is now required. Every wallet in the registry
47
+ already declares it, and the public `Wallet` type has always promised rejection unconditionally, so
48
+ this only affects external code that annotates a `WalletDefinition` literal by hand. `isWalletKind` is
49
+ now exported.
50
+
3
51
  ## 0.2.1
4
52
 
5
53
  ### Patch Changes
package/README.md CHANGED
@@ -91,10 +91,10 @@ The same two calls drive every chain. A Phantom test can connect and sign on
91
91
  ```ts
92
92
  import { launchWallet } from "@walletwright/core";
93
93
 
94
- const { context, wallet } = await launchWallet(metamask);
94
+ const { close, context, wallet } = await launchWallet(metamask);
95
95
  const page = await context.newPage();
96
96
  // drive the page and the wallet here
97
- await context.close();
97
+ await close();
98
98
  ```
99
99
 
100
100
  ## Requirements and notes