@bsv/expo-wallet-toolbox 0.15.0 → 0.15.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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.1
4
+
5
+ ### Fixed
6
+
7
+ - **Connected apps can issue and send Mandala tokens.** `MandalaTokenModule`
8
+ forced `includeCustomInstructions` off on every `listOutputs` call from a
9
+ connected app, but the Mandala lib finds the issuer's admin assets and the
10
+ coins it can spend by the `keyID`/`counterparty` stored there, so the
11
+ console found nothing to issue from or send. After the token access prompt
12
+ the instructions are now returned as asked. The redaction dates from before
13
+ `createSignature` was bound to approved transactions; knowing a coin's
14
+ derivation no longer lets an app spend it.
15
+
3
16
  ## 0.15.0
4
17
 
5
18
  ### Changed
@@ -27,8 +27,13 @@
27
27
  * Source of truth: offline-settlement-final.md §8.3, plus a set of
28
28
  * adversarial-review findings closed here (see the inline notes tagged
29
29
  * "adversarial-review finding" throughout this file):
30
- * 1. [critical] listOutputs no longer lets a paired app read back
31
- * `customInstructions` (keyID/counterparty/blinding derivation data).
30
+ * 1. [critical] listOutputs used to withhold `customInstructions`
31
+ * (keyID/counterparty/blinding derivation data), because knowing a
32
+ * coin's derivation was enough to sign a spend of it. Reverted: the
33
+ * Mandala lib finds admin assets and spendable coins by those
34
+ * instructions, so withholding them broke issuing and sending from a
35
+ * connected app, and `createSignature` is now bound to approved
36
+ * transactions (see above), so the derivation alone no longer spends.
32
37
  * 2. [medium/high] createAction that only SPENDS `'p mandala'` INPUTS (no
33
38
  * basketed change output) is now gated too — see `anyInputIsTokenCoin`
34
39
  * and the `wrapCreateActionForTokenInputs` wrapper below.
@@ -243,13 +248,6 @@ interface MandalaInternalizeActionArgsLike {
243
248
  outputs?: MandalaInternalizeOutputLike[]
244
249
  }
245
250
 
246
- /** The slice of `ListOutputsArgs` this module reads/rewrites. */
247
- interface MandalaListOutputsArgsLike {
248
- basket?: string
249
- includeCustomInstructions?: boolean
250
- [key: string]: unknown
251
- }
252
-
253
251
  export interface DecodedMandalaOutput {
254
252
  assetId: string
255
253
  amount: number
@@ -473,15 +471,9 @@ export class MandalaTokenModule implements PermissionsModule {
473
471
 
474
472
  switch (method) {
475
473
  case 'listOutputs': {
474
+ // customInstructions come back when asked for: see finding (1).
476
475
  await this.promptOnceForAccess(originator, 'listOutputs')
477
- // Adversarial-review finding (1): WalletPermissionsManager forwards
478
- // the ARGS THIS METHOD RETURNS to the underlying listOutputs call
479
- // (delegateToPModuleIfNeeded), so redacting here genuinely prevents
480
- // the underlying wallet from ever including customInstructions in
481
- // its response — this is not merely filtering our own mirror of it
482
- // afterward, which would be too late for a caller that reads the
483
- // result directly.
484
- return { args: this.redactListOutputsArgs(args as MandalaListOutputsArgsLike) }
476
+ break
485
477
  }
486
478
  case 'listActions':
487
479
  // Adversarial-review finding (3): same once-per-session gate as
@@ -611,16 +603,6 @@ export class MandalaTokenModule implements PermissionsModule {
611
603
  }
612
604
  }
613
605
 
614
- /**
615
- * Forces `includeCustomInstructions` off regardless of what the caller
616
- * asked for. `customInstructions` is where a Mandala coin's `keyID`/
617
- * `counterparty`/blinding derivation lives (see the module doc) — a paired
618
- * app has no legitimate use for it, and no other `ListOutputsArgs` field
619
- * exposes anything equivalent.
620
- */
621
- private redactListOutputsArgs(args: MandalaListOutputsArgsLike): MandalaListOutputsArgsLike {
622
- return { ...args, includeCustomInstructions: false }
623
- }
624
606
 
625
607
  /**
626
608
  * createAction with an output in `'p mandala'` — always prompts (mirrors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/expo-wallet-toolbox",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
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",