@bsv/expo-wallet-toolbox 0.25.1 → 0.26.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 (43) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/core/context/WalletContext.tsx +3 -1
  3. package/core/i18n/translations.tsx +221 -36
  4. package/core/identity/handleRegistry/client.ts +110 -16
  5. package/core/identity/handleRegistry/registration.ts +115 -17
  6. package/core/profiles/profileStore.ts +4 -1
  7. package/core/services/groupSpendingLimit.ts +26 -0
  8. package/core/services/signingPermissionPolicy.ts +14 -8
  9. package/core/services/vault/ceremony.ts +13 -0
  10. package/core/services/vault/ceremonyHost.ts +58 -0
  11. package/core/services/vault/failedVaultSpend.ts +40 -0
  12. package/core/services/vault/outputAuthority.ts +13 -6
  13. package/core/services/vault/transfers.ts +56 -12
  14. package/core/storage/encryptedDbImage.ts +11 -2
  15. package/core/theme/tokens.ts +26 -12
  16. package/package.json +2 -1
  17. package/ui/components/QRScanner.tsx +24 -22
  18. package/ui/components/pay/MessageBoxConfig.tsx +10 -16
  19. package/ui/components/pay/NearbyAdvisoryModal.tsx +6 -13
  20. package/ui/components/pay/NearbyFlow.tsx +72 -35
  21. package/ui/components/pay/PayForm.tsx +27 -19
  22. package/ui/components/pay/PaymentSuccessOverlay.tsx +8 -6
  23. package/ui/components/pay/UniversalSend.tsx +4 -1
  24. package/ui/components/ui/AlertCard.tsx +3 -2
  25. package/ui/components/ui/BalancedText.tsx +117 -0
  26. package/ui/components/ui/ErrorBoundary.tsx +31 -14
  27. package/ui/components/ui/GroupedList.tsx +28 -22
  28. package/ui/components/ui/ListRow.tsx +126 -35
  29. package/ui/components/ui/PermissionSheet.tsx +31 -24
  30. package/ui/components/ui/PresenceRow.tsx +15 -23
  31. package/ui/components/ui/Sheet.tsx +11 -17
  32. package/ui/components/ui/Toast.tsx +13 -17
  33. package/ui/components/vault/EnrollWizard.tsx +446 -196
  34. package/ui/components/vault/KeyChooser.tsx +7 -20
  35. package/ui/components/vault/VaultCeremonySheet.tsx +44 -36
  36. package/ui/components/wallet/AmountInput.tsx +11 -17
  37. package/ui/components/wallet/BiometricAdvisoryModal.tsx +13 -17
  38. package/ui/index.ts +1 -1
  39. package/ui/screens/TrustScreen.tsx +49 -61
  40. package/ui/screens/VaultScreen.tsx +99 -60
  41. package/ui/screens/VaultTransferScreen.tsx +34 -27
  42. package/ui/screens/WalletCheckScreen.tsx +25 -24
  43. package/ui/screens/WalletConfigScreen.tsx +66 -72
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.26.0
6
+
7
+ The BSV Wallet app's launch changes, upstreamed from its patch of 0.25.1: one key tap for a Vault spend, a key removal that can finish, a monthly limit for group spending grants, and a new icon set. No native change: hosts do not rebuild.
8
+
9
+ ### Breaking / host action
10
+
11
+ - **`lucide-react-native` ^1.27.0 is a new peer.** The UI draws its glyphs with lucide instead of `@expo/vector-icons`. Install it next to `react-native-svg`. A Jest host maps `^lucide-react-native$` to `lucide-react-native/dist/cjs/lucide-react-native.js`, because Jest resolves its ESM entry otherwise.
12
+ - **The typography tokens name a font family, `Nunito`.** Every ramp in `typography` now sets `fontFamily: 'Nunito'`, so the toolbox screens match a host that embeds Nunito 400, 600 and 700 (for example with the `expo-font` config plugin). A host that does not embed it gets the platform fallback face, and must embed Nunito or override `fontFamily`.
13
+ - **`HandleRegistryClient` has two new required methods, `resolveHandle` and `acceptKey`.** A host with its own client implementation adds them. `createHandleRegistryClient` already has them.
14
+ - **`search()` can return a row with `changedFrom`.** For a complete address (`handle@domain`) whose certificate is valid but whose key is not the one pinned on this device (XR-071), the row comes back flagged with the pinned key instead of being dropped, so the caller can warn. The pin does not move until `acceptKey`. A partial query still drops such a row. A host that shows search rows must check `changedFrom` before it pays. `UniversalSend` drops these rows, as before.
15
+
16
+ ### Added
17
+
18
+ - **`openVaultSignerSession` and `VaultSignerSession`.** One key session for a spend that also creates a Vault output: a withdrawal with a re-vaulted remainder, or a re-lock. One PIN entry and one tap now cover the new output's possession proof and the input signatures. Before, the person entered the PIN and tapped twice. If the session ends between the two steps (a timeout or a detach), the spend asks for a second tap and does not fail. A cancelled session stays cancelled. A deposit keeps its own ceremony.
19
+ - **`failedVaultSpendBlocksRemoval`.** A failed Vault spend now holds a pending key removal open only when it has a transaction ID and began at or after the removal started. Before, any failed spend in the history blocked the removal for good. A spend with no readable time still blocks.
20
+ - **`groupSpendingLimit` and `clampGroupSpending`.** A site's one-time group grant may spend at most the auto-approve threshold each month. A threshold of 0 removes the spending part of the grant.
21
+ - **`resolveHandle` (`found`, `changed`, `none`, `failed`) and `acceptKey`** on the handle registry client. A one-character handle is now looked up as a complete address (`r@domain`).
22
+ - **`HardwareKeyArtComponent`** type, exported with `EnrollWizard`.
23
+ - **Paid handle claims.** `putCertificate` takes an App Store or Google Play purchase (`StorePurchase`) and a fallback certificate. A refused claim whose reclaim is also refused returns `notRestored` with the handle that did not come back.
24
+ - **15 strings** for the Vault card check and the spending limit, in all 12 locales.
25
+
26
+ ### Changed
27
+
28
+ - **Add-key copy.** A new key is saved but not active until another key confirms it.
29
+ - **Enrollment.** The PIN is confirmed on a page of its own (4 steps per key). Replace and reset of a card first check the blockchain for a vault the card opens, and need an extra acknowledgement.
30
+ - **E2E builds** start a fresh install on testnet when `globalThis.__BSV_E2E_CHAIN` is `test`.
31
+
32
+ ### Fixed
33
+
34
+ - **The encrypted database image** no longer crashes the app when written. The crypto helper returned a `Buffer`, which expo-file-system's `writeBytes` does not accept; it now returns a plain `Uint8Array`.
35
+
5
36
  ## 0.25.1
6
37
 
7
38
  WhatsOnChain rate limit. No native change: hosts do not rebuild.
@@ -303,6 +303,7 @@ import { HeaderStore } from '../headers/headerStore'
303
303
  import { OfflineFirstChaintracks } from '../headers/OfflineFirstChaintracks'
304
304
  import { prewarmOwnRoots } from '../headers/prewarm'
305
305
  import { syncHeaders } from '../headers/syncHeaders'
306
+ import { groupSpendingLimit, clampGroupSpending } from '../services/groupSpendingLimit'
306
307
  import type { HeaderSource } from '../headers/syncHeaders'
307
308
  import { startHeaderSyncTriggers } from '../headers/headerSyncTriggers'
308
309
  import { wocLimitedFetch } from '../net/wocLimiter'
@@ -1397,7 +1398,8 @@ export const WalletContextProvider: React.FC<WalletContextProps> = ({ children =
1397
1398
  async (args: GroupPermissionRequest, manager?: SigningPolicyPermissionsManager): Promise<void> => {
1398
1399
  const { requestID, originator, permissions } = args ?? ({} as GroupPermissionRequest)
1399
1400
  if (!requestID || !permissions) return
1400
- groupQueue.enqueue({ requestID, originator, permissions, manager })
1401
+ const limit = await groupSpendingLimit()
1402
+ groupQueue.enqueue({ requestID, originator, permissions: clampGroupSpending(permissions, limit), manager })
1401
1403
  },
1402
1404
  [groupQueue.enqueue]
1403
1405
  )