@bsv/expo-wallet-toolbox 0.19.0 → 0.21.0

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +154 -30
  2. package/README.md +79 -79
  3. package/core/backup/RemoteSyncReader.ts +26 -24
  4. package/core/backup/appData.ts +9 -8
  5. package/core/backup/codec.ts +21 -18
  6. package/core/backup/constants.ts +5 -5
  7. package/core/backup/contactsBackup.ts +8 -8
  8. package/core/backup/cursor.ts +12 -7
  9. package/core/backup/derive.ts +3 -3
  10. package/core/backup/deviceId.ts +2 -2
  11. package/core/backup/erase.ts +2 -2
  12. package/core/backup/preference.ts +2 -2
  13. package/core/backup/push.ts +10 -12
  14. package/core/backup/restore.ts +22 -14
  15. package/core/backup/restoreOnImport.ts +3 -2
  16. package/core/config.tsx +17 -13
  17. package/core/constants.ts +34 -11
  18. package/core/contacts/contactsStore.ts +4 -3
  19. package/core/context/WalletConnectionContext.tsx +294 -212
  20. package/core/context/WalletContext.tsx +132 -97
  21. package/core/context/defaultWalletSettings.ts +4 -2
  22. package/core/demo/demoLedger.ts +1 -5
  23. package/core/directpay/DirectPayManager.ts +148 -29
  24. package/core/directpay/DirectPayProvider.tsx +26 -26
  25. package/core/directpay/payFlow.ts +10 -1
  26. package/core/directpay/receive.ts +2 -1
  27. package/core/directpay/settings.ts +56 -9
  28. package/core/directpay/types.ts +11 -2
  29. package/core/directpay/webrtpay.ts +4 -0
  30. package/core/headers/checkpoints.ts +10 -1
  31. package/core/headers/headerStore.ts +13 -2
  32. package/core/hooks/useConfirmationSound.ts +3 -3
  33. package/core/hooks/useHaptics.ts +23 -6
  34. package/core/i18n/translations.tsx +382 -209
  35. package/core/index.ts +2 -0
  36. package/core/localpay/codec.ts +12 -6
  37. package/core/localpay/deviceCaps.ts +4 -14
  38. package/core/localpay/pending.ts +2 -1
  39. package/core/localpay/qr.ts +1 -1
  40. package/core/localpay/settlementAck.ts +1 -4
  41. package/core/localpay/transport/ble.ts +2 -2
  42. package/core/localpay/transport/socket.ts +1 -1
  43. package/core/mandala/abortGuard.ts +1 -1
  44. package/core/mandala/drain.ts +3 -0
  45. package/core/mandala/permissionModule.ts +3 -2
  46. package/core/mandala/resendTransfer.ts +4 -1
  47. package/core/mandala/runtime.ts +4 -4
  48. package/core/monitor/TaskBackupPush.ts +10 -13
  49. package/core/net/chainMatch.ts +8 -5
  50. package/core/networks.ts +145 -0
  51. package/core/parsePeerPayURI.ts +4 -1
  52. package/core/pay/beefRepair.ts +6 -3
  53. package/core/pay/creditErrors.ts +37 -1
  54. package/core/pay/rails/address.ts +10 -6
  55. package/core/pay/rails/direct.ts +6 -2
  56. package/core/pay/rails/handle.ts +84 -11
  57. package/core/pay/rails/index.ts +18 -2
  58. package/core/pay/receiveHistory.ts +8 -8
  59. package/core/peerpay/handleResendRequests.ts +11 -18
  60. package/core/peerpay/inboxAttempts.ts +1 -4
  61. package/core/peerpay/rebuildToken.ts +12 -9
  62. package/core/profiles/profileStore.ts +2 -1
  63. package/core/profiles/removalProblems.ts +3 -1
  64. package/core/services/arcTokenStorage.ts +2 -1
  65. package/core/services/arcadeBroadcastProvider.ts +7 -17
  66. package/core/services/secrets/envelope.ts +1 -6
  67. package/core/services/secrets/hkdf.ts +1 -6
  68. package/core/services/secrets/index.ts +3 -22
  69. package/core/services/usdFxRates.ts +1 -4
  70. package/core/services/vault/VaultKeyService.ts +2 -1
  71. package/core/services/vault/chainRecovery.ts +48 -21
  72. package/core/services/vault/metaAuthority.ts +4 -1
  73. package/core/services/vault/r1comb.ts +113 -51
  74. package/core/services/vault/session.ts +5 -1
  75. package/core/services/vault/transfers.ts +699 -576
  76. package/core/services/vault/vaultStore.ts +12 -10
  77. package/core/services/walletArgLimits.ts +1 -2
  78. package/core/services/walletConnectionValidation.ts +44 -28
  79. package/core/services/walletServiceConfig.ts +9 -40
  80. package/core/storage/StorageExpoSQLite.ts +7 -21
  81. package/core/storage/methods/listActionsSql.ts +81 -67
  82. package/core/storage/methods/listOutputsSql.ts +21 -16
  83. package/core/storage/methods/reviewStatusSql.ts +1 -4
  84. package/core/stores/ConnectionStore.ts +1 -1
  85. package/core/theme/ThemeContext.tsx +12 -16
  86. package/core/theme/motion.ts +3 -3
  87. package/core/theme/tokens.ts +6 -6
  88. package/core/toolboxConfig.ts +23 -0
  89. package/core/walletDbRegistry.ts +7 -5
  90. package/core/walletRepair/runWalletCheck.ts +1 -4
  91. package/package.json +2 -2
  92. package/ui/components/pay/AddressReceive.tsx +3 -3
  93. package/ui/components/pay/HandleReceive.tsx +21 -15
  94. package/ui/components/pay/MessageBoxConfig.tsx +46 -20
  95. package/ui/components/pay/NearbyFlow.tsx +575 -507
  96. package/ui/components/pay/OfflineNotice.tsx +1 -3
  97. package/ui/components/pay/PayCellRow.tsx +1 -4
  98. package/ui/components/pay/PayForm.tsx +1 -3
  99. package/ui/components/pay/RequestHub.tsx +14 -6
  100. package/ui/components/pay/UniversalSend.tsx +79 -27
  101. package/ui/components/pay/tokenSendCopy.ts +1 -2
  102. package/ui/components/pay/useRecipientInput.ts +2 -2
  103. package/ui/components/security/WalletLockNotice.tsx +1 -3
  104. package/ui/components/ui/AlertCard.tsx +44 -45
  105. package/ui/components/ui/BlurChrome.tsx +4 -15
  106. package/ui/components/ui/Celebration.tsx +3 -3
  107. package/ui/components/ui/ChoiceSheet.ts +1 -3
  108. package/ui/components/ui/ErrorBoundary.tsx +2 -6
  109. package/ui/components/ui/GroupedList.tsx +13 -31
  110. package/ui/components/ui/IconButton.tsx +6 -9
  111. package/ui/components/ui/ListRow.tsx +19 -25
  112. package/ui/components/ui/PresenceRow.tsx +4 -4
  113. package/ui/components/ui/PressableScale.tsx +24 -20
  114. package/ui/components/ui/Toast.tsx +23 -16
  115. package/ui/components/vault/KeyChooser.tsx +9 -6
  116. package/ui/components/vault/VaultBackdrop.tsx +1 -8
  117. package/ui/components/vault/VaultCeremonySheet.tsx +5 -5
  118. package/ui/components/wallet/ActivityRow.tsx +3 -2
  119. package/ui/components/wallet/BackupReminderSheet.tsx +1 -5
  120. package/ui/components/wallet/Balance.tsx +4 -1
  121. package/ui/components/wallet/ContactActivityList.tsx +7 -7
  122. package/ui/components/wallet/IconPickerSheet.tsx +1 -5
  123. package/ui/components/wallet/ProfileSwitcherPopover.tsx +6 -1
  124. package/ui/components/wallet/tokenEviction.ts +4 -1
  125. package/ui/hooks/useMandala.ts +1 -7
  126. package/ui/hooks/useOfflineNoticeActions.ts +21 -27
  127. package/ui/hooks/useSpendableBalance.ts +2 -2
  128. package/ui/hooks/useVaultCoverage.ts +7 -1
  129. package/ui/index.ts +9 -1
  130. package/ui/resolveIdentity.ts +20 -8
  131. package/ui/screens/ConnectionsScreen.tsx +44 -18
  132. package/ui/screens/LogsScreen.tsx +24 -22
  133. package/ui/screens/PairScreen.tsx +85 -54
  134. package/ui/screens/PayScreen.tsx +5 -1
  135. package/ui/screens/ProfileScreen.tsx +0 -3
  136. package/ui/screens/TrustScreen.tsx +125 -80
  137. package/ui/screens/VaultScreen.tsx +19 -7
  138. package/ui/screens/VaultTransferScreen.tsx +5 -1
  139. package/ui/screens/WalletCheckScreen.tsx +14 -17
  140. package/ui/screens/WalletConfigScreen.tsx +414 -376
  141. package/ui/screens/WalletHomeScreen.tsx +47 -42
package/CHANGELOG.md CHANGED
@@ -1,5 +1,129 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.0
4
+
5
+ ### Breaking
6
+
7
+ - **Live payments are received only while a Receive screen is showing.** A host that takes
8
+ live payments without rendering `HandleReceive` (which calls it for you) must call
9
+ `useDirectPay().openReceiveScreen()` while its receive UI is showing, and the function it
10
+ returns when that UI goes. Otherwise it no longer receives live payments; payers use the
11
+ message box.
12
+
13
+ ### Live payments
14
+
15
+ - **Answered only while the Receive screen is showing.** `DirectPayManager.openReceiveScreen()`
16
+ (and `useDirectPay().openReceiveScreen`) starts receiving while at least one Receive screen
17
+ is open, on top of the user's switch and the foreground rule; `HandleReceive` opens it while
18
+ focused, for BSV. The rest of the time this wallet answers no dial and holds no relay
19
+ socket, so nobody can learn its address or that the app is open; payers get the message box.
20
+ Opening and closing the screen starts and stops receiving on the same client, so a payment
21
+ being sent is not cut off.
22
+ - **BSVA STUN only.** The default STUN list is `stun:stun-us-1.bsvb.tech:3478`. A stored list
23
+ that is exactly the previous default is read as the new one; STUN urls in the relay's TURN
24
+ answer are dropped (`onlyOwnStun`).
25
+ - **1 MB live payments, payments only.** Live sessions take at most a payment with a 1 MB
26
+ transaction (`MAX_LIVE_TRANSACTION_BYTES`, `MAX_LIVE_MESSAGE_BYTES`, passed as the client's
27
+ `maxMessageBytes` and `limits.maxMessageBytes`). A larger outgoing payment is released before
28
+ anything is spent and fails with `failure: 'too_large'`, which `payIdentity` answers with the
29
+ `too_large` message box fallback (`direct_pay_fallback_too_large`).
30
+ - **The payer is told the truth about a recipient who is not receiving live.** Most
31
+ recipients are now off the Receive screen, so the fallback no longer says "isn't online right
32
+ now" (`direct_pay_fallback_offline`, `direct_pay_failed_offline`): it says they aren't taking
33
+ live payments right now. The prompt title (`direct_pay_fallback_title`), also shown for the
34
+ link-failed and too-large prompts, is now "Can't pay live right now".
35
+
36
+ ## 0.20.0
37
+
38
+ ### Breaking
39
+
40
+ - `AppChain` gains `'scaletest'` (the scaling teratestnet; toolbox chain
41
+ `'regtest'`), and `WalletChain` gains `'regtest'`. `toWalletChain` now
42
+ returns the toolbox's own `Chain` type. Exhaustive `Record<AppChain, …>`
43
+ maps in a host need an entry for it.
44
+ - `wocConfigFor(network)` returns `undefined` for a network with no
45
+ WhatsOnChain (scaletest). `makeBeefRepair` accepts that and never repairs.
46
+ - `createWocBroadcastService(woc, apiKey?)` takes the network's WhatsOnChain
47
+ endpoints (`NETWORKS[chain].woc`) instead of a chain string.
48
+ - `makePeerPayClient` requires `network`. `useMessageBoxConfig(t, network)` and
49
+ `useOfflineNoticeActions({ …, network })` take the open network.
50
+ - `KNOWN_ARC_URLS` is per network (`Record<AppChain, KnownArcUrl[]>`): test
51
+ chains no longer offer mainnet ARC presets.
52
+
53
+ ### Networks
54
+
55
+ - `NETWORKS` (`core/networks.ts`) is the one per-network table: Arcade,
56
+ MessageBox, WhatsOnChain/explorer, TAAL/GorillaPool/Bitails fallbacks,
57
+ overlay preset, push. The ternaries that sent any unnamed network to
58
+ teratest's endpoints are gone.
59
+ - **Each network has its own MessageBox server**: `messagebox-testnet`,
60
+ `messagebox-ttn` and `messagebox-tstn` `.bsvblockchain.tech` beside mainnet's
61
+ `messagebox.bsvblockchain.tech`. A saved preference equal to any network's
62
+ default (or the retired one) follows the open network's default; a server the
63
+ user chose is kept. Hosts can override a chain's default with
64
+ `services.<chain>.messageBoxUrl`.
65
+ - MessageBox / PeerPay clients now look recipients up in the open network's
66
+ overlay (`bindMessageBoxNetwork`). `PeerPayClient` 2.5.3 does not pass
67
+ `networkPreset` through, so every network had been asking mainnet's overlay.
68
+ A network with no overlay routes only to the configured host.
69
+ - Identity lookups use the open network's overlay (teratest had been using
70
+ testnet's).
71
+ - Push registration happens only for profiles on a network whose MessageBox
72
+ sends push (mainnet). A test-chain profile's existing registration at
73
+ mainnet's box is skipped, not withdrawn.
74
+ - Upgrading moves a testnet/teratest profile on the default server to its own
75
+ network's box: anything still unread in mainnet's box for that profile is no
76
+ longer read. Queued outbox retries keep the host recorded per entry.
77
+ - Settings › MessageBox stores a network default (any network's) as "no
78
+ preference", so the screen shows the host the rails actually use.
79
+ - Bitails is no longer registered as a broadcast / proof fallback on teratest.
80
+ Teratest no longer takes a TAAL key.
81
+ - **Fix:** a teratest wallet's storage reports chain `'ttn'`, but
82
+ `storageMatchesNetwork` expected `'test'`, so the home screen always treated
83
+ a teratest wallet as the previous network's. It now compares the toolbox
84
+ chain.
85
+ - Scaling teratestnet (`scaletest`) is wired through but **not available** in
86
+ the network picker (`NETWORKS.scaletest.available = false`). The deployed
87
+ chain runs Teranode regtest parameters (regtest genesis, bits `0x207fffff`),
88
+ so its toolbox chain is `'regtest'`, not `'tstn'`, and its header window is
89
+ anchored at the regtest genesis. The installed
90
+ `@bsv/wallet-toolbox-mobile` 2.14.x has no `'regtest'` chain and rejects
91
+ every header above the mainnet proof-of-work limit; `regtest` support lands
92
+ in 2.15.0 (bsv-blockchain/ts-stack#819). With no WhatsOnChain it also has no
93
+ address rail, sweep, BEEF repair or explorer link; Pay shows the address
94
+ option as unavailable.
95
+
96
+ ### Changed
97
+
98
+ - **`UniversalSend` review no longer warns about a live payment's route.**
99
+ When the wallet can pay live, review says "Pays live, straight to their
100
+ wallet, when they're online" (`pay_review_route_live`) instead of a
101
+ warning-toned "Delivering to {host}". A link-named host (XR-053) now
102
+ appears in the message-box fallback prompt (`direct_pay_fallback_host`),
103
+ where the payer chooses that route. When live payments aren't available it
104
+ still shows on review, as information rather than a warning.
105
+ - **No "Not verified" line for a bare identity key.** Review shows a trust
106
+ line only for a contact or a registered handle. `pay_trust_unverified` is
107
+ removed.
108
+ - **The receiving wallet broadcasts an incoming payment as it takes it in.**
109
+ The `@bsv/wallet-toolbox-mobile` peer is now `^2.14.9`. Up to 2.14.6,
110
+ `internalizeAction` was meant to post an unproven payment that is new to the
111
+ wallet, but the step was gated on an `isNew` flag storage never set, so it
112
+ never ran: the payee only queued the transaction and the payer's and
113
+ payee's monitors each sent it later. Now a live payment is posted before
114
+ it is acknowledged, and a nearby payment right after the "got it" reply.
115
+ Offline, `StorageExpoSQLite` still parks the post (`holdReqsOffline`), so
116
+ the payment is credited and sent when the device is back online.
117
+ - A post that no broadcaster could take is environmental:
118
+ `classifyCreditError` reads the `WERR_REVIEW_ACTIONS` results, so a live
119
+ payment is kept and acknowledged as received, an inbox payment does not
120
+ use up its tries, and a nearby payment does not use up its attempts. A
121
+ double spend is `double_spend`; an invalid transaction is `structural`.
122
+ - New `failedPostReason(error)` gives the reason in words for callers that
123
+ keep only a message.
124
+ - The app's `patches/@bsv+wallet-toolbox-mobile` patch is rebased onto
125
+ 2.14.9 unchanged.
126
+
3
127
  ## 0.19.0
4
128
 
5
129
  ### Added
@@ -26,7 +150,7 @@
26
150
  the message box as the fallback.
27
151
  - **Opt in.** It turns on when the host installs `@bsv/webrtpay` (an
28
152
  optional peer, `^0.2.1`), sets `configureToolbox({ directPay: { enabled:
29
- true, RTCPeerConnection } })` and mounts `DirectPayProvider` inside
153
+ true, RTCPeerConnection } })` and mounts `DirectPayProvider` inside
30
154
  `WalletContextProvider`. Without all three nothing changes.
31
155
  - **`DirectPayManager`.** Wallets find each other through the relay by
32
156
  default. If the relay is not online within 5 s, receiving falls back to
@@ -86,6 +210,7 @@
86
210
 
87
211
  Nothing is wired into `WalletContext` or a screen yet. The live manager
88
212
  and receive/send rails follow in a later release.
213
+
89
214
  - **`deriveCallbackToken` is exported.** Known-answer vectors pin it. BSV
90
215
  Desktop now derives the same Arcade callback token, so a wallet open in both
91
216
  apps hears one status stream. No behaviour change.
@@ -171,9 +296,9 @@
171
296
  it behaves as before, and each prewarmed read is used once; a later run
172
297
  (after logout) does its own.
173
298
  - **A host-configurable minimum handle length.** `configureToolbox({
174
- handleMinLength: 1 | 2 | 3 })` (default 3) sets the shortest handle
299
+ handleMinLength: 1 | 2 | 3 })` (default 3) sets the shortest handle
175
300
  `isValidHandleFormat` accepts; `getHandleMinLength()` reads it. The rest of
176
- the format is unchanged (a-z 0-9 . _ -, at most 32, starting and ending
301
+ the format is unchanged (a-z 0-9 . \_ -, at most 32, starting and ending
177
302
  with a letter or digit). A host that lowers it must use a registry that
178
303
  accepts the shorter handles.
179
304
  - **Payment links carry a note.** `peerpay:` links may carry a `note`
@@ -257,7 +382,6 @@
257
382
  fixes it, apps must carry a `patch-package` patch for `@bsv/mandala` 0.4.1
258
383
  that pads the description the same way.
259
384
 
260
-
261
385
  ## 0.15.2
262
386
 
263
387
  ### Fixed
@@ -327,7 +451,7 @@
327
451
  `[2, 'mandala token']` stays reserved, and privileged calls are still
328
452
  refused. So are the address rail's own key IDs: a BRC-29 call from a
329
453
  connected origin whose key ID is `base64(YYYY-MM-DD) + ' ' +
330
- base64('legacy')` is refused for every key-using method and counterparty
454
+ base64('legacy')` is refused for every key-using method and counterparty
331
455
  (`isAddressRailKeyID`, exported from the vault guard).
332
456
  - **BRC-29 signing asks every time.** An approval under `3241645161d8` is
333
457
  never reused: each signature gets its own prompt, and one app's concurrent
@@ -363,7 +487,7 @@
363
487
  ### Breaking
364
488
 
365
489
  - **The privileged key is no longer the BIP32 master.** A mnemonic wallet's
366
- `PrivilegedKeyManager` now gets profile *n*'s own key at `m/1'/n'` (`m/1'/0'`
490
+ `PrivilegedKeyManager` now gets profile _n_'s own key at `m/1'/n'` (`m/1'/0'`
367
491
  for the default profile) instead of the master key `m`, so no two profiles
368
492
  share key material. Anything a host derived with `privileged: true` under an
369
493
  existing wallet derives differently after upgrading. A recovered-key (WIF)
@@ -620,7 +744,7 @@ corrects them until the library ships the same fixes (bsv-blockchain/ts-stack#67
620
744
 
621
745
  - A `createAction` with `noSend` returned `noSendChange` outpoints on the
622
746
  unsigned txid next to the signed `txid` (`noSendChange[0]: expected an
623
- outpoint of the returned transaction`). They now name the signed transaction.
747
+ outpoint of the returned transaction`). They now name the signed transaction.
624
748
  - That no-send action could not be released: the caller only has its `txid`,
625
749
  and the permissions manager refused `abortAction` by txid from any non-admin
626
750
  origin, so its inputs stayed locked until no-send expiry. The origin that
@@ -924,7 +1048,7 @@ committed key and its PIN, could spend without the mnemonic.
924
1048
  arbitrary-depth unconfirmed ancestor BEEF was considered and rejected as
925
1049
  open-ended complexity for a narrow confirmation-window edge case, not
926
1050
  required by the availability guarantee's core promise (surviving loss of
927
- a *settled* deposit). An unconfirmed candidate is surfaced as "pending
1051
+ a _settled_ deposit). An unconfirmed candidate is surfaced as "pending
928
1052
  confirmation," never silently dropped.
929
1053
  - ARC/indexer acceptance of a transaction carrying a ~45 KB R1C lock plus a
930
1054
  1-sat P2PKH plus a ~1.5 KB `OP_RETURN` in one broadcast has not been
@@ -1220,7 +1344,7 @@ committed key and its PIN, could spend without the mnemonic.
1220
1344
  enabled for retry instead of reporting a clean deletion that didn't happen.
1221
1345
  - **KEK provisioning can no longer be silently downgraded or hijacked (XR-108,
1222
1346
  XR-109, XR-111, XR-116).** A self-consistent but forged `{policy:'degraded',
1223
- kekId}` sentinel could previously ride the app's own automatic degraded-to-
1347
+ kekId}` sentinel could previously ride the app's own automatic degraded-to-
1224
1348
  biometric upgrade and silently overwrite the real biometric KEK with an
1225
1349
  attacker's key; `upgradeToBiometric()` now reads the existing authenticated
1226
1350
  KEK first and refuses the upgrade outright if one is already there, and
@@ -1313,7 +1437,7 @@ committed key and its PIN, could spend without the mnemonic.
1313
1437
  peak memory. Concurrent messages on one connection now also share a
1314
1438
  `MAX_IN_FLIGHT_RPC_BYTES` budget equal to the existing single-message
1315
1439
  ceiling. Separately, `encrypt`/`decrypt`/`createHmac`/`verifyHmac`/`createSig
1316
- nature`/`verifySignature` had no per-call size cap at all beyond the
1440
+ nature`/`verifySignature` had no per-call size cap at all beyond the
1317
1441
  transport ceiling; they now share a 1 MiB `cryptoPayload` ceiling (halved on
1318
1442
  low-tier devices). A connected app sending an oversized crypto-call payload,
1319
1443
  or enough concurrent large messages to cross the shared budget, now has the
@@ -1473,7 +1597,7 @@ committed key and its PIN, could spend without the mnemonic.
1473
1597
  - **Token decimals bounded everywhere one is read (XR-043).** An extreme
1474
1598
  `decimals` value from a session QR or a registry entry had no upper bound;
1475
1599
  `formatTokenAmount(500, Number.MAX_SAFE_INTEGER)` reliably threw `RangeError:
1476
- Invalid string length`, and the crash re-triggered on every later render
1600
+ Invalid string length`, and the crash re-triggered on every later render
1477
1601
  since the metadata persists. Decode, registry resolution, formatting/parsing,
1478
1602
  and the input mask now all clamp or reject outside `[0, 18]` — a host calling
1479
1603
  `formatTokenAmount`/`parseTokenAmount` directly with an out-of-range value
@@ -1482,7 +1606,7 @@ committed key and its PIN, could spend without the mnemonic.
1482
1606
  sharing a ticker (a look-alike distributed by a malicious issuer) were
1483
1607
  visually indistinguishable through the whole select-to-send flow. The asset
1484
1608
  switcher, asset picker, and the Send review step now all show `issuerName ·
1485
- fingerprint` alongside the ticker.
1609
+ fingerprint` alongside the ticker.
1486
1610
  - **Real token actions now reach the consent gate (XR-037).** Two different
1487
1611
  constants both named `MANDALA_ACTION_LABEL` — one for home-screen
1488
1612
  recognition, one for the P-routed `listActions` consent gate — and only the
@@ -1599,7 +1723,7 @@ committed key and its PIN, could spend without the mnemonic.
1599
1723
  - **Duplicate-delivery detection narrowed to the structured code (XR-046).**
1600
1724
  `isDuplicateMessageError` matched free prose in a thrown error's message,
1601
1725
  entirely attacker/host-controlled; it now requires `@bsv/message-box-
1602
- client`'s own structured `ERR_DUPLICATE_MESSAGE` code, which the client
1726
+ client`'s own structured `ERR_DUPLICATE_MESSAGE` code, which the client
1603
1727
  validates before embedding.
1604
1728
  - **Inbox shape-check bounded (XR-047).** An unbounded
1605
1729
  `transaction`/derivation-string length in a poisoned inbox message re-
@@ -1732,7 +1856,7 @@ committed key and its PIN, could spend without the mnemonic.
1732
1856
  BUMP/root check only proves the requested txid is confirmed; nothing checked
1733
1857
  that a separately-fetched raw-tx response actually hashed to that txid before
1734
1858
  completing a transaction on it. It now requires `doubleSha256(rawTx) ===
1735
- txid`.
1859
+ txid`.
1736
1860
  - **Only an authoritative 404 proves chain absence (XR-030).** A manual proof
1737
1861
  refresh treated any non-2xx response (a rate limit, a 5xx, an auth error)
1738
1862
  identically to a definitive 404 and released reserved inputs on a stale row;
@@ -1860,7 +1984,7 @@ committed key and its PIN, could spend without the mnemonic.
1860
1984
  release a `nosend` action's reserved inputs — including one already handed to
1861
1985
  a counterparty over PeerPay or LocalPay, turning a chain-status outage into a
1862
1986
  payer-side double-spend race. The patch (`patches/@bsv+wallet-toolbox-
1863
- mobile+2.14.0.patch`) now retries the chain-status check once and, if still
1987
+ mobile+2.14.0.patch`) now retries the chain-status check once and, if still
1864
1988
  unresolved, throws instead of invalidating — every in-app `abortAction`
1865
1989
  caller already handles a thrown result sensibly, and Vault's own abort calls
1866
1990
  (strictly unsigned-only) are unaffected. Verified end to end through Vault's
@@ -1951,7 +2075,7 @@ surfaced above, collected here for visibility:
1951
2075
  - **Pairing QR signatures verify in the `@bsv/wallet-relay` 0.5.x format.**
1952
2076
  `buildPairingSignatureMessage` (`walletConnectionValidation.ts`) had drifted
1953
2077
  to a domained `bsv-wallet-pairing-v1|topic|backendIdentityKey|protocolID|
1954
- origin|expiry` transcript, while wallet-relay backends sign
2078
+ origin|expiry` transcript, while wallet-relay backends sign
1955
2079
  `topic|backendIdentityKey|origin|expiry`, so every real pairing QR failed
1956
2080
  with "Signature is not valid". Any future transcript change must be
1957
2081
  coordinated with wallet-relay and its backends.
@@ -2171,7 +2295,7 @@ block:
2171
2295
  only blocks an abort once the payer's own settlement row has already
2172
2296
  advanced to handed-over, which never happens on a decline. It now accepts
2173
2297
  an optional `watchDeclinedAbort?: (entry: { txid: string; reference:
2174
- string }) => Promise<void>` dependency, called after every decline (BSV or
2298
+ string }) => Promise<void>` dependency, called after every decline (BSV or
2175
2299
  token) it has a txid for, whether or not the abort itself succeeded.
2176
2300
  `core/localpay/pendingAborts.ts` gains a durable watch list
2177
2301
  (`queueDeclinedAbortWatch` / `verifyDeclinedAborts`, backed by a new
@@ -2208,7 +2332,7 @@ wallet" state as soon as the payment was durably queued, before
2208
2332
  the overlay never retracted or recoloured, claiming a credit the device
2209
2333
  could not back yet. `PaymentSuccessOverlay` gains an optional
2210
2334
  `verification?: 'pending' | 'verified' | 'not-credited'` prop, defaulting to
2211
- `'verified'` so every existing caller is unaffected. The overlay's *timing*
2335
+ `'verified'` so every existing caller is unaffected. The overlay's _timing_
2212
2336
  is unchanged — still shown the instant the payment is durably queued; only
2213
2337
  the claim is gated: `'pending'` shows a neutral "Confirming with your
2214
2338
  wallet…" (`local_pay_received_confirming`) the moment it appears, resolving
@@ -2315,9 +2439,9 @@ Three fixes sharing `WalletContext.tsx`'s wiring:
2315
2439
  to `AsyncStorage` so an app restart does not reset the cap.
2316
2440
  - **Broadcast callback token**: the Arcade `X-CallbackToken` was
2317
2441
  `keyDeriver.identityKey.substring(0, 32)` — the first 32 hex chars of the
2318
- wallet's own *public* identity key, a value any past counterparty already
2442
+ wallet's own _public_ identity key, a value any past counterparty already
2319
2443
  has. `core/services/callbackToken.ts`'s `deriveCallbackToken` derives it
2320
- from a BRC-42 *private* key instead (fixed protocol/keyID, counterparty
2444
+ from a BRC-42 _private_ key instead (fixed protocol/keyID, counterparty
2321
2445
  `'self'`, then hashed) — deterministic per wallet, but only this wallet's
2322
2446
  root key can compute it. The token is recomputed on every wallet build and
2323
2447
  used for both the Arcade broadcast service and the Monitor's
@@ -2331,7 +2455,7 @@ Three fixes sharing `WalletContext.tsx`'s wiring:
2331
2455
  answering for the wrong network, and this path never writes `spentBy`, so
2332
2456
  nothing could ever undo a wrong call. `core/walletRepair/shouldMarkUnspendable.ts`
2333
2457
  now requires the toolbox's own configured `getUtxoStatus` provider to
2334
- *also* report the output as no longer a UTXO before committing to
2458
+ _also_ report the output as no longer a UTXO before committing to
2335
2459
  `spendable: false`; either way, the claimed spender is now recorded in
2336
2460
  `outputs.spendingDescription` as a paper trail (a free-text column
2337
2461
  nothing else in this app reads or writes).
@@ -2346,7 +2470,7 @@ single timeout-guarded `getExchangeRate()` instead of re-implementing an
2346
2470
  untimed fetch and its own cache/fallback.
2347
2471
 
2348
2472
  Separately, that background refresh used to be fire-and-forget — its result
2349
- only ever reached the UI on the *next* cold start, so a session that opened
2473
+ only ever reached the UI on the _next_ cold start, so a session that opened
2350
2474
  with a stale cached/fallback rate stayed stale until closed and reopened.
2351
2475
  `getExchangeRate()` now returns an additional `refreshed: Promise<number |
2352
2476
  undefined>` field (never rejects — every failure mode is still caught and
@@ -2380,7 +2504,7 @@ vetting. A foreign-domain match now gets `pay_trust_handle_domain_attested`
2380
2504
  with no in-app way to resolve it. `core/services/vault/transfers.ts` gains
2381
2505
  `resolveHeldVaultDeposit(w, adminOriginator, meta, scopeToken?)`: it asks
2382
2506
  the network for the held txid's status first (`already-known` if the
2383
- network already has it, otherwise re-broadcasts the *exact*
2507
+ network already has it, otherwise re-broadcasts the _exact_
2384
2508
  already-signed bytes via the same `sendWith` call the normal release
2385
2509
  uses — never a second transaction, never `abortAction`). `VaultScreen`
2386
2510
  shows a "Finish the interrupted deposit" notice and button
@@ -2410,7 +2534,7 @@ vetting. A foreign-domain match now gets `pay_trust_handle_domain_attested`
2410
2534
  `hasVaultMeta` flag, backed by the existing `vaultStore.isEnrolled()`
2411
2535
  read (no new network call). `WalletHomeScreen` and `SettingsScreen` now
2412
2536
  show their Vault entry point when `isVaultAvailable(selectedNetwork) ||
2413
- hasVaultMeta`, so an already-funded vault stays reachable even with
2537
+ hasVaultMeta`, so an already-funded vault stays reachable even with
2414
2538
  `EXPO_PUBLIC_VAULT_ENABLED` off or the network switched away from
2415
2539
  mainnet. `VaultScreen`'s own withdraw/deposit gating is unchanged.
2416
2540
  - **Vendored patch.** The `@bsv+wallet-toolbox-mobile+2.14.0.patch` funding
@@ -2420,12 +2544,12 @@ vetting. A foreign-domain match now gets `pay_trust_handle_domain_attested`
2420
2544
  `validateSignableVaultPlan`'s strict input-count check then rejected
2421
2545
  outright — spuriously failing an otherwise-legitimate withdraw or relock.
2422
2546
  Re-keyed to the already-computed `vargs.__bsvVaultAdminAuthorized ===
2423
- true` flag, which covers deposit, withdraw and relock alike.
2547
+ true` flag, which covers deposit, withdraw and relock alike.
2424
2548
 
2425
2549
  ### Mandala: a handle-rail token is held before it is internalized
2426
2550
 
2427
2551
  `@bsv/mandala`'s own `receiveTokens` calls `wallet.internalizeAction()`
2428
- *before* it calls the settle hook that finally writes a `token_settlements`
2552
+ _before_ it calls the settle hook that finally writes a `token_settlements`
2429
2553
  row — on a handle-rail token's first credit, that row does not exist yet, so
2430
2554
  `StorageExpoSQLite.attemptToPostReqsToNetwork`'s guard (which looks up
2431
2555
  exactly that row) finds nothing and lets an unmediated broadcast through
@@ -2651,7 +2775,7 @@ under Node again.
2651
2775
  optional arguments. **A host calling it directly must pass `incoming` (and
2652
2776
  `labels`)**: without them, `completed`, `unproven` and `sending` now resolve
2653
2777
  to "Spent". New exports from `ui/txStatus.ts`: `activityKind(incoming,
2654
- labels)`, the one place a row's word is decided, returning the new
2778
+ labels)`, the one place a row's word is decided, returning the new
2655
2779
  `ActivityKind` (`'sent' | 'received' | 'spent' | 'transferred'`), and
2656
2780
  `isPaymentAction(labels)`.
2657
2781
  - Token (Mandala) rows use the same words: "Sent" or "Received" once settled,
@@ -2883,8 +3007,8 @@ New:
2883
3007
  `VaultProgress.signed/total`.
2884
3008
  - Transfers: `depositToVault(w, adminOriginator, satoshis, opts?)` needs no
2885
3009
  hardware; `withdrawFromVault(w, adminOriginator, amount, reason,
2886
- chosenSerial, opts?)`; `previewVaultWithdrawal(w, adminOriginator,
2887
- chosenSerial, amount)` — the chosen key's selectable total, capped count
3010
+ chosenSerial, opts?)`; `previewVaultWithdrawal(w, adminOriginator,
3011
+ chosenSerial, amount)` — the chosen key's selectable total, capped count
2888
3012
  and unreachable set without reserving or tapping, for the remainder
2889
3013
  confirmation before the tap; `relockVault`; `estimateRelockFee`;
2890
3014
  `getVaultKeyCoverage`; `orphanedIfRemoved`;
@@ -3278,7 +3402,7 @@ pay-first UX, recipient-submits offline settlement (specs:
3278
3402
  registers an InteractionManager handle for the duration of the animation, and
3279
3403
  `Animated.loop` means that duration never ends — so the handle was held for
3280
3404
  as long as the component stayed mounted, and while any handle is held
3281
- `InteractionManager.runAfterInteractions` never fires for *anyone* in the
3405
+ `InteractionManager.runAfterInteractions` never fires for _anyone_ in the
3282
3406
  process. `Balance` renders `<AppLogo rotate />` whenever a balance is loading,
3283
3407
  so this was reachable in normal use: `PayScreen`'s deferred proof sweep never
3284
3408
  ran, and a host that defers real work the same way could hang indefinitely
package/README.md CHANGED
@@ -47,68 +47,68 @@ Expo SDK line.
47
47
 
48
48
  ### React / Expo core (required)
49
49
 
50
- | Package | Version |
51
- | --- | --- |
52
- | `react` | 19.2.0 |
53
- | `react-native` | 0.83.6 |
54
- | `expo-router` | ~55.0.16 |
50
+ | Package | Version |
51
+ | -------------- | -------- |
52
+ | `react` | 19.2.0 |
53
+ | `react-native` | 0.83.6 |
54
+ | `expo-router` | ~55.0.16 |
55
55
 
56
56
  ### BSV SDK & protocol libraries (required)
57
57
 
58
- | Package | Version |
59
- | --- | --- |
60
- | `@bsv/sdk` | ^2.4.1 |
61
- | `@bsv/wallet-toolbox-mobile` | ^2.4.3 |
62
- | `@bsv/btms-permission-module` | ^1.1.0 |
63
- | `@bsv/air-gap` | ^0.1.1 |
64
- | `@bsv/backup-cache-client` | ^0.1.0 |
65
- | `@bsv/message-box-client` | ^2.2.1 |
66
- | `@bsv/templates` | ^1.10.0 |
67
- | `@noble/curves` | ^2.3.0 |
68
- | `qrcode` | ^1.5.4 |
58
+ | Package | Version |
59
+ | ----------------------------- | ------- |
60
+ | `@bsv/sdk` | ^2.4.1 |
61
+ | `@bsv/wallet-toolbox-mobile` | ^2.4.3 |
62
+ | `@bsv/btms-permission-module` | ^1.1.0 |
63
+ | `@bsv/air-gap` | ^0.1.1 |
64
+ | `@bsv/backup-cache-client` | ^0.1.0 |
65
+ | `@bsv/message-box-client` | ^2.2.1 |
66
+ | `@bsv/templates` | ^1.10.0 |
67
+ | `@noble/curves` | ^2.3.0 |
68
+ | `qrcode` | ^1.5.4 |
69
69
 
70
70
  ### Expo native modules (required — each needs its own autolinking/config)
71
71
 
72
- | Package | Version |
73
- | --- | --- |
74
- | `expo-sqlite` | ~55.0.16 |
75
- | `expo-secure-store` | ~55.0.14 |
76
- | `expo-camera` | ~55.0.19 |
77
- | `expo-audio` | ~55.0.16 |
78
- | `expo-clipboard` | ~55.0.13 |
79
- | `expo-crypto` | ~55.0.15 |
80
- | `expo-device` | ~55.0.17 |
81
- | `expo-document-picker` | ~55.0.13 |
82
- | `expo-file-system` | ~55.0.20 |
83
- | `expo-haptics` | ~55.0.14 |
72
+ | Package | Version |
73
+ | --------------------------- | -------- |
74
+ | `expo-sqlite` | ~55.0.16 |
75
+ | `expo-secure-store` | ~55.0.14 |
76
+ | `expo-camera` | ~55.0.19 |
77
+ | `expo-audio` | ~55.0.16 |
78
+ | `expo-clipboard` | ~55.0.13 |
79
+ | `expo-crypto` | ~55.0.15 |
80
+ | `expo-device` | ~55.0.17 |
81
+ | `expo-document-picker` | ~55.0.13 |
82
+ | `expo-file-system` | ~55.0.20 |
83
+ | `expo-haptics` | ~55.0.14 |
84
84
  | `expo-local-authentication` | ~55.0.14 |
85
- | `expo-localization` | ~55.0.15 |
86
- | `expo-print` | ~55.0.15 |
87
- | `expo-sharing` | ~55.0.19 |
88
- | `expo-status-bar` | ~55.0.6 |
89
- | `expo-blur` | ~55.0.14 |
90
- | `@expo/vector-icons` | ^15.0.3 |
85
+ | `expo-localization` | ~55.0.15 |
86
+ | `expo-print` | ~55.0.15 |
87
+ | `expo-sharing` | ~55.0.19 |
88
+ | `expo-status-bar` | ~55.0.6 |
89
+ | `expo-blur` | ~55.0.14 |
90
+ | `@expo/vector-icons` | ^15.0.3 |
91
91
 
92
92
  ### React Native native modules (required)
93
93
 
94
- | Package | Version |
95
- | --- | --- |
96
- | `@react-native-async-storage/async-storage` | 2.2.0 |
97
- | `@react-native-clipboard/clipboard` | ^1.16.2 |
98
- | `@react-native-community/netinfo` | 11.5.2 |
99
- | `react-native-gesture-handler` | ~2.30.0 |
100
- | `react-native-localize` | ^3.4.1 |
101
- | `react-native-qrcode-svg` | ^6.3.15 |
102
- | `react-native-reanimated` | 4.2.1 |
103
- | `react-native-safe-area-context` | ~5.6.0 |
104
- | `react-native-svg` | 15.15.3 |
105
- | `react-native-sse` | ^1.2.1 |
94
+ | Package | Version |
95
+ | ------------------------------------------- | ------- |
96
+ | `@react-native-async-storage/async-storage` | 2.2.0 |
97
+ | `@react-native-clipboard/clipboard` | ^1.16.2 |
98
+ | `@react-native-community/netinfo` | 11.5.2 |
99
+ | `react-native-gesture-handler` | ~2.30.0 |
100
+ | `react-native-localize` | ^3.4.1 |
101
+ | `react-native-qrcode-svg` | ^6.3.15 |
102
+ | `react-native-reanimated` | 4.2.1 |
103
+ | `react-native-safe-area-context` | ~5.6.0 |
104
+ | `react-native-svg` | 15.15.3 |
105
+ | `react-native-sse` | ^1.2.1 |
106
106
 
107
107
  ### Pure JS rendering (required)
108
108
 
109
- | Package | Version |
110
- | --- | --- |
111
- | `@urbit/sigil-js` | ^2.2.0 |
109
+ | Package | Version |
110
+ | ----------------- | ------- |
111
+ | `@urbit/sigil-js` | ^2.2.0 |
112
112
 
113
113
  Draws the counterparty avatar on activity rows. This package imports only
114
114
  its `./core` entry: the package root pulls in a DOM renderer that touches
@@ -126,22 +126,22 @@ the fix is a `resolveRequest` that maps `@urbit/sigil-js/core` to
126
126
 
127
127
  ### State & i18n (required)
128
128
 
129
- | Package | Version |
130
- | --- | --- |
131
- | `mobx` | ^6.13.7 |
132
- | `mobx-react-lite` | ^4.1.0 |
133
- | `i18next` | ^25.2.1 |
134
- | `react-i18next` | ^15.5.3 |
135
- | `date-fns` | ^4.1.0 |
129
+ | Package | Version |
130
+ | ----------------- | ------- |
131
+ | `mobx` | ^6.13.7 |
132
+ | `mobx-react-lite` | ^4.1.0 |
133
+ | `i18next` | ^25.2.1 |
134
+ | `react-i18next` | ^15.5.3 |
135
+ | `date-fns` | ^4.1.0 |
136
136
 
137
137
  ### Nitro native modules — this repo's own packages (required)
138
138
 
139
- | Package | Notes |
140
- | --- | --- |
141
- | `react-native-nitro-modules` | ^0.35.2. Nitro codegen runtime the three below build on. |
139
+ | Package | Notes |
140
+ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
141
+ | `react-native-nitro-modules` | ^0.35.2. Nitro codegen runtime the three below build on. |
142
142
  | `@bsv/react-native-localpay-transport` | Local WiFi/Bluetooth/BLE P2P payment transport. Published independently — see `packages/react-native-localpay-transport`. |
143
- | `react-native-engine-native` | Native wallet-toolbox engine bindings. |
144
- | `react-native-secp-native` | Native secp256k1 signing. |
143
+ | `react-native-engine-native` | Native wallet-toolbox engine bindings. |
144
+ | `react-native-secp-native` | Native secp256k1 signing. |
145
145
 
146
146
  `react-native-engine-native` and `react-native-secp-native` ship as sibling
147
147
  `packages/` in this repo and are not yet published to npm independently —
@@ -151,8 +151,8 @@ dependencies.
151
151
 
152
152
  ### Optional
153
153
 
154
- | Package | Notes |
155
- | --- | --- |
154
+ | Package | Notes |
155
+ | ---------------------- | ------------------------------------------------------------------------------------------------- |
156
156
  | `react-native-yubikey` | Vault/hardware-key support. Absence is detected at runtime and vault features degrade gracefully. |
157
157
 
158
158
  ## Configuration
@@ -302,18 +302,18 @@ this is the pattern `bsv-wallet`'s own route files use:
302
302
  export { WalletHomeScreen as default } from '@bsv/expo-wallet-toolbox/ui'
303
303
  ```
304
304
 
305
- | Screen | Source route in this repo |
306
- | --- | --- |
307
- | `WalletHomeScreen` | `app/index.tsx` |
308
- | `PayScreen` | `app/pay.tsx` |
309
- | `SettingsScreen` | `app/settings.tsx` |
310
- | `WalletConfigScreen` | `app/wallet-config.tsx` |
311
- | `VaultScreen` | `app/vault.tsx` |
312
- | `VaultTransferScreen` | `app/vault-transfer.tsx` |
313
- | `ConnectionsScreen` | `app/connections.tsx` |
314
- | `PairScreen` | `app/pair.tsx` |
315
- | `TrustScreen` | `app/trust.tsx` |
316
- | `LogsScreen` | `app/logs.tsx` |
305
+ | Screen | Source route in this repo |
306
+ | --------------------- | ------------------------- |
307
+ | `WalletHomeScreen` | `app/index.tsx` |
308
+ | `PayScreen` | `app/pay.tsx` |
309
+ | `SettingsScreen` | `app/settings.tsx` |
310
+ | `WalletConfigScreen` | `app/wallet-config.tsx` |
311
+ | `VaultScreen` | `app/vault.tsx` |
312
+ | `VaultTransferScreen` | `app/vault-transfer.tsx` |
313
+ | `ConnectionsScreen` | `app/connections.tsx` |
314
+ | `PairScreen` | `app/pair.tsx` |
315
+ | `TrustScreen` | `app/trust.tsx` |
316
+ | `LogsScreen` | `app/logs.tsx` |
317
317
 
318
318
  > **Note:** `ConnectionsScreen` accepts pairing codes using `bsv-wallet://`
319
319
  > or `bsv-browser://`. OS-level links also require native scheme registration
@@ -382,8 +382,8 @@ wraps `@expo/config-plugins`' `withEntitlementsPlist`:
382
382
  ```js
383
383
  const { withEntitlementsPlist } = require('@expo/config-plugins')
384
384
 
385
- module.exports = (config) =>
386
- withEntitlementsPlist(config, (mod) => {
385
+ module.exports = config =>
386
+ withEntitlementsPlist(config, mod => {
387
387
  mod.modResults['com.apple.developer.nfc.readersession.formats'] = ['TAG']
388
388
  return mod
389
389
  })
@@ -540,7 +540,7 @@ are required — both hard-won during this package's extraction:
540
540
  before writing a single test that touches wallet behavior:
541
541
  `core/backup/client.ts` statically imports it, and it's re-exported
542
542
  through the core barrel (`core/index.ts`), so any test that imports
543
- *anything* from `@bsv/expo-wallet-toolbox` pulls it in. The package
543
+ _anything_ from `@bsv/expo-wallet-toolbox` pulls it in. The package
544
544
  is `"type": "module"` (ESM-only, no CJS `require` export condition),
545
545
  which Jest's default CJS-based resolver can't load — hence the
546
546
  explicit redirect straight to its `dist/index.js` build. This bites
@@ -646,7 +646,7 @@ package imports itself by name, relying on the workspace's self-referencing
646
646
  `node_modules` directory-walk resolution — the installed copy sits inside a
647
647
  consumer's `node_modules` and is found there like any other dependency, not
648
648
  through Node's dedicated package-self-reference feature). That feature only
649
- kicks in when an `exports` map is present *and* includes a `"."` entry — adding an
649
+ kicks in when an `exports` map is present _and_ includes a `"."` entry — adding an
650
650
  `exports` map without one would silently break every one of those ~50
651
651
  imports at publish time, and adding one with only `"."` (no `"./ui"` entry)
652
652
  would break every consumer's `/ui` subpath import instead.