@bsv/expo-wallet-toolbox 0.11.0 → 0.11.2

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,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.2
4
+
5
+ 0.11.1 was tagged but never reached npm: its publish run failed on a test-only
6
+ leak (the `expo-image` virtual mock bleeding between test files, fixed in #28).
7
+ 0.11.2 is the first published release carrying the 0.11.1 changes below, and
8
+ changes nothing else in the package. Upgrade from 0.11.0 straight to 0.11.2.
9
+
10
+ ## 0.11.1
11
+
12
+ ### External-wallet guard: `listOutputs` keeps `include`
13
+
14
+ The size bound on an external `listOutputs` (XR-019, added in 0.9.0) forwarded
15
+ the SDK's validated form of the request instead of the caller's own args. That
16
+ form replaces `include` with `includeTransactions`/`includeLockingScripts`, and
17
+ the wallet validates again downstream, so `include` was lost: every non-admin
18
+ caller (in-tab dApps, paired peers) got no `BEEF` for
19
+ `include: 'entire transactions'` and no locking scripts for
20
+ `include: 'locking scripts'`. A dApp that then spent those outputs with
21
+ `createAction` failed with "Every signableTransaction input must have a
22
+ sourceTransaction". The bound still refuses the same requests; an allowed one
23
+ now reaches the wallet unchanged.
24
+
25
+ ### External-wallet guard: `listOutputs` caps admit the SDK's contacts calls
26
+
27
+ The same bound refused any external `listOutputs` above 200 rows, or above 25
28
+ with `include: 'entire transactions'`. `@bsv/sdk`'s own `ContactsManager` asks
29
+ for 1000 rows with locking scripts (`getContacts`) and 100 with entire
30
+ transactions (`saveContact`, `removeContact`), so
31
+ `IdentityClient.resolveByAttributes`, `resolveByIdentityKey` and saving a
32
+ contact failed in every dApp with 'Wallet operation "listOutputs" is not
33
+ permitted for origin "…"'. The caps are now 1000 and 100. Larger pages are still
34
+ refused.
35
+
3
36
  ## 0.11.0
4
37
 
5
38
  ### Upgrading from 0.10.0
@@ -49,15 +49,16 @@ const MAX_EXTERNAL_ACTION_OFFSET = MAX_ACTION_SCAN
49
49
  * hard ceiling (limit <= 10000) — a normal-sized *request* from an
50
50
  * authenticated paired peer can still force a normal-sized *response* to
51
51
  * balloon, because each row can carry a full aggregate BEEF
52
- * (includeTransactions) or a locking script. These are deliberately far
53
- * below the SDK's 10000 cap: they bound what a legitimate basket check
54
- * (a handful to a few hundred rows) ever needs, the same relationship
55
- * MAX_EXTERNAL_ACTION_RESULTS has to listActions' own 10000 SDK ceiling.
56
- * The transactions variant is tighter because each row then also carries a
57
- * full BEEF, not just an outpoint + locking script.
52
+ * (includeTransactions) or a locking script. These stay well below the SDK's
53
+ * 10000 cap but must admit the largest page the SDK's own clients request:
54
+ * ContactsManager.getContacts asks for 1000 rows with locking scripts
55
+ * (MAX_CONTACTS), and its save/remove lookups 100 with entire transactions.
56
+ * Anything tighter refuses IdentityClient.resolveByAttributes and friends in
57
+ * every dApp. The transactions variant is tighter because the response then
58
+ * also carries those rows' BEEF, not just an outpoint + locking script.
58
59
  */
59
- const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS = 200
60
- const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS_WITH_TRANSACTIONS = 25
60
+ const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS = 1000
61
+ const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS_WITH_TRANSACTIONS = 100
61
62
  /** Permission-backed reads must never retain the exclusive listActions slot
62
63
  * indefinitely while a connected origin leaves a prompt unanswered. */
63
64
  export const EXTERNAL_ACTION_READ_TIMEOUT_MS = 30_000
@@ -629,13 +630,15 @@ export function guardVaultAccess<T extends WalletInterface>(
629
630
  // admin-vault listOutputs one layer further out (see this test's
630
631
  // own file: proofBar.railIsolation.test.ts's I3 listOutputs case)
631
632
  // throws its own specific error, and this bound must never mask it.
632
- let requested: ValidatedListOutputsArgs
633
633
  try {
634
- requested = validateExternalListOutputsArgs(args)
634
+ validateExternalListOutputsArgs(args)
635
635
  } catch {
636
636
  return deny(String(method), originator)
637
637
  }
638
- return await bound(requested, originator)
638
+ // Forward the caller's own args, not the validated form: that swaps
639
+ // `include` for includeTransactions/includeLockingScripts, and the
640
+ // wallet validates again, so passing it on would drop both.
641
+ return await bound(args, originator)
639
642
  }
640
643
  }
641
644
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/expo-wallet-toolbox",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "private": false,
5
5
  "description": "Wallet screens and P2P local-payment backend for Expo/React Native apps, extracted from BSV Wallet.",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",