@bsv/expo-wallet-toolbox 0.19.0 → 0.20.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 (135) hide show
  1. package/CHANGELOG.md +121 -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/DirectPayProvider.tsx +15 -24
  24. package/core/directpay/receive.ts +2 -1
  25. package/core/headers/checkpoints.ts +10 -1
  26. package/core/headers/headerStore.ts +13 -2
  27. package/core/hooks/useConfirmationSound.ts +3 -3
  28. package/core/hooks/useHaptics.ts +23 -6
  29. package/core/i18n/translations.tsx +269 -125
  30. package/core/index.ts +2 -0
  31. package/core/localpay/codec.ts +12 -6
  32. package/core/localpay/deviceCaps.ts +4 -14
  33. package/core/localpay/pending.ts +2 -1
  34. package/core/localpay/qr.ts +1 -1
  35. package/core/localpay/settlementAck.ts +1 -4
  36. package/core/localpay/transport/ble.ts +2 -2
  37. package/core/localpay/transport/socket.ts +1 -1
  38. package/core/mandala/abortGuard.ts +1 -1
  39. package/core/mandala/drain.ts +3 -0
  40. package/core/mandala/permissionModule.ts +3 -2
  41. package/core/mandala/resendTransfer.ts +4 -1
  42. package/core/mandala/runtime.ts +4 -4
  43. package/core/monitor/TaskBackupPush.ts +10 -13
  44. package/core/net/chainMatch.ts +8 -5
  45. package/core/networks.ts +145 -0
  46. package/core/parsePeerPayURI.ts +4 -1
  47. package/core/pay/beefRepair.ts +6 -3
  48. package/core/pay/creditErrors.ts +37 -1
  49. package/core/pay/rails/address.ts +10 -6
  50. package/core/pay/rails/handle.ts +84 -11
  51. package/core/pay/rails/index.ts +18 -2
  52. package/core/pay/receiveHistory.ts +8 -8
  53. package/core/peerpay/handleResendRequests.ts +11 -18
  54. package/core/peerpay/inboxAttempts.ts +1 -4
  55. package/core/peerpay/rebuildToken.ts +12 -9
  56. package/core/profiles/profileStore.ts +2 -1
  57. package/core/profiles/removalProblems.ts +3 -1
  58. package/core/services/arcTokenStorage.ts +2 -1
  59. package/core/services/arcadeBroadcastProvider.ts +7 -17
  60. package/core/services/secrets/envelope.ts +1 -6
  61. package/core/services/secrets/hkdf.ts +1 -6
  62. package/core/services/secrets/index.ts +3 -22
  63. package/core/services/usdFxRates.ts +1 -4
  64. package/core/services/vault/VaultKeyService.ts +2 -1
  65. package/core/services/vault/chainRecovery.ts +48 -21
  66. package/core/services/vault/metaAuthority.ts +4 -1
  67. package/core/services/vault/r1comb.ts +113 -51
  68. package/core/services/vault/session.ts +5 -1
  69. package/core/services/vault/transfers.ts +699 -576
  70. package/core/services/vault/vaultStore.ts +12 -10
  71. package/core/services/walletArgLimits.ts +1 -2
  72. package/core/services/walletConnectionValidation.ts +44 -28
  73. package/core/services/walletServiceConfig.ts +9 -40
  74. package/core/storage/StorageExpoSQLite.ts +7 -21
  75. package/core/storage/methods/listActionsSql.ts +81 -67
  76. package/core/storage/methods/listOutputsSql.ts +21 -16
  77. package/core/storage/methods/reviewStatusSql.ts +1 -4
  78. package/core/stores/ConnectionStore.ts +1 -1
  79. package/core/theme/ThemeContext.tsx +12 -16
  80. package/core/theme/motion.ts +3 -3
  81. package/core/theme/tokens.ts +6 -6
  82. package/core/toolboxConfig.ts +23 -0
  83. package/core/walletDbRegistry.ts +7 -5
  84. package/core/walletRepair/runWalletCheck.ts +1 -4
  85. package/package.json +2 -2
  86. package/ui/components/pay/AddressReceive.tsx +3 -3
  87. package/ui/components/pay/HandleReceive.tsx +15 -15
  88. package/ui/components/pay/MessageBoxConfig.tsx +46 -20
  89. package/ui/components/pay/NearbyFlow.tsx +575 -507
  90. package/ui/components/pay/OfflineNotice.tsx +1 -3
  91. package/ui/components/pay/PayCellRow.tsx +1 -4
  92. package/ui/components/pay/PayForm.tsx +1 -3
  93. package/ui/components/pay/RequestHub.tsx +14 -6
  94. package/ui/components/pay/UniversalSend.tsx +79 -27
  95. package/ui/components/pay/tokenSendCopy.ts +1 -2
  96. package/ui/components/pay/useRecipientInput.ts +2 -2
  97. package/ui/components/security/WalletLockNotice.tsx +1 -3
  98. package/ui/components/ui/AlertCard.tsx +44 -45
  99. package/ui/components/ui/BlurChrome.tsx +4 -15
  100. package/ui/components/ui/Celebration.tsx +3 -3
  101. package/ui/components/ui/ChoiceSheet.ts +1 -3
  102. package/ui/components/ui/ErrorBoundary.tsx +2 -6
  103. package/ui/components/ui/GroupedList.tsx +13 -31
  104. package/ui/components/ui/IconButton.tsx +6 -9
  105. package/ui/components/ui/ListRow.tsx +19 -25
  106. package/ui/components/ui/PresenceRow.tsx +4 -4
  107. package/ui/components/ui/PressableScale.tsx +24 -20
  108. package/ui/components/ui/Toast.tsx +23 -16
  109. package/ui/components/vault/KeyChooser.tsx +9 -6
  110. package/ui/components/vault/VaultBackdrop.tsx +1 -8
  111. package/ui/components/vault/VaultCeremonySheet.tsx +5 -5
  112. package/ui/components/wallet/ActivityRow.tsx +3 -2
  113. package/ui/components/wallet/BackupReminderSheet.tsx +1 -5
  114. package/ui/components/wallet/Balance.tsx +4 -1
  115. package/ui/components/wallet/ContactActivityList.tsx +7 -7
  116. package/ui/components/wallet/IconPickerSheet.tsx +1 -5
  117. package/ui/components/wallet/ProfileSwitcherPopover.tsx +6 -1
  118. package/ui/components/wallet/tokenEviction.ts +4 -1
  119. package/ui/hooks/useMandala.ts +1 -7
  120. package/ui/hooks/useOfflineNoticeActions.ts +21 -27
  121. package/ui/hooks/useSpendableBalance.ts +2 -2
  122. package/ui/hooks/useVaultCoverage.ts +7 -1
  123. package/ui/index.ts +9 -1
  124. package/ui/resolveIdentity.ts +20 -8
  125. package/ui/screens/ConnectionsScreen.tsx +44 -18
  126. package/ui/screens/LogsScreen.tsx +24 -22
  127. package/ui/screens/PairScreen.tsx +85 -54
  128. package/ui/screens/PayScreen.tsx +5 -1
  129. package/ui/screens/ProfileScreen.tsx +0 -3
  130. package/ui/screens/TrustScreen.tsx +125 -80
  131. package/ui/screens/VaultScreen.tsx +19 -7
  132. package/ui/screens/VaultTransferScreen.tsx +5 -1
  133. package/ui/screens/WalletCheckScreen.tsx +14 -17
  134. package/ui/screens/WalletConfigScreen.tsx +414 -376
  135. package/ui/screens/WalletHomeScreen.tsx +47 -42
@@ -1,14 +1,5 @@
1
1
  import React, { useCallback, useEffect, useMemo, useState } from 'react'
2
- import {
3
- View,
4
- Text,
5
- StyleSheet,
6
- ScrollView,
7
- TextInput,
8
- TouchableOpacity,
9
- Modal,
10
- ActivityIndicator
11
- } from 'react-native'
2
+ import { View, Text, StyleSheet, ScrollView, TextInput, TouchableOpacity, Modal, ActivityIndicator } from 'react-native'
12
3
  import type { StyleProp, ViewStyle } from 'react-native'
13
4
  import { SvgUri } from 'react-native-svg'
14
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
@@ -258,10 +249,7 @@ export function TrustScreen() {
258
249
 
259
250
  // Source of truth from Settings — sort by trust descending so position matches priority
260
251
  const initialTrusted: Certifier[] = useMemo(
261
- () =>
262
- (settings?.trustSettings?.trustedCertifiers || [])
263
- .map(normaliseCertifier)
264
- .sort((a, b) => b.trust - a.trust),
252
+ () => (settings?.trustSettings?.trustedCertifiers || []).map(normaliseCertifier).sort((a, b) => b.trust - a.trust),
265
253
  [settings?.trustSettings?.trustedCertifiers]
266
254
  )
267
255
 
@@ -304,9 +292,7 @@ export function TrustScreen() {
304
292
  const filtered = useMemo(() => {
305
293
  if (!query.trim()) return trustedEntities
306
294
  const q = query.toLowerCase()
307
- return trustedEntities.filter(
308
- e => e.name.toLowerCase().includes(q) || e.description?.toLowerCase?.().includes(q)
309
- )
295
+ return trustedEntities.filter(e => e.name.toLowerCase().includes(q) || e.description?.toLowerCase?.().includes(q))
310
296
  }, [trustedEntities, query])
311
297
 
312
298
  const isSearching = query.trim().length > 0
@@ -339,8 +325,8 @@ export function TrustScreen() {
339
325
  message: t('confirm_delete_body'),
340
326
  buttons: [
341
327
  { text: t('cancel'), style: 'cancel', key: 'cancel' },
342
- { text: t('delete'), style: 'destructive', key: 'delete' },
343
- ],
328
+ { text: t('delete'), style: 'destructive', key: 'delete' }
329
+ ]
344
330
  })
345
331
  if (choice !== 'delete') return
346
332
  setTrustedEntities(prev => prev.filter(c => c.identityKey !== identityKey))
@@ -365,14 +351,17 @@ export function TrustScreen() {
365
351
  keyboardShouldPersistTaps="handled"
366
352
  >
367
353
  {/* Description */}
368
- <Text style={[styles.description, { color: colors.textSecondary }]}>
369
- {t('order_certifiers_hint')}
370
- </Text>
354
+ <Text style={[styles.description, { color: colors.textSecondary }]}>{t('order_certifiers_hint')}</Text>
371
355
 
372
356
  {/* ── Certifiers ── */}
373
357
  <GroupedSection header={t('certifiers')}>
374
358
  {/* Search bar */}
375
- <View style={[styles.searchRow, { borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: colors.separator }]}>
359
+ <View
360
+ style={[
361
+ styles.searchRow,
362
+ { borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: colors.separator }
363
+ ]}
364
+ >
376
365
  <Ionicons name="search" size={16} color={colors.textSecondary} style={{ marginRight: spacing.sm }} />
377
366
  <TextInput
378
367
  style={[styles.searchInput, { color: colors.textPrimary }]}
@@ -399,7 +388,10 @@ export function TrustScreen() {
399
388
  key={item.identityKey}
400
389
  style={[
401
390
  styles.certifierCard,
402
- idx < filtered.length - 1 && { borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: colors.separator }
391
+ idx < filtered.length - 1 && {
392
+ borderBottomWidth: StyleSheet.hairlineWidth,
393
+ borderBottomColor: colors.separator
394
+ }
403
395
  ]}
404
396
  >
405
397
  <View style={styles.certifierHeader}>
@@ -441,7 +433,10 @@ export function TrustScreen() {
441
433
 
442
434
  {/* Add Provider button */}
443
435
  <TouchableOpacity
444
- style={[styles.addProviderBtn, { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.separator }]}
436
+ style={[
437
+ styles.addProviderBtn,
438
+ { borderTopWidth: StyleSheet.hairlineWidth, borderTopColor: colors.separator }
439
+ ]}
445
440
  onPress={() => setShowAdd(true)}
446
441
  >
447
442
  <Ionicons name="add" size={18} color={colors.accent} style={{ marginRight: spacing.sm }} />
@@ -452,7 +447,9 @@ export function TrustScreen() {
452
447
 
453
448
  {/* Save bar */}
454
449
  {settingsNeedsUpdate && (
455
- <View style={[styles.saveBar, { backgroundColor: colors.backgroundElevated, borderTopColor: colors.separator }]}>
450
+ <View
451
+ style={[styles.saveBar, { backgroundColor: colors.backgroundElevated, borderTopColor: colors.separator }]}
452
+ >
456
453
  <Text style={[styles.saveBarText, { color: colors.textSecondary }]}>{t('unsaved_changes')}</Text>
457
454
  <TouchableOpacity
458
455
  onPress={handleSave}
@@ -483,7 +480,7 @@ export function TrustScreen() {
483
480
  <AddProviderModal
484
481
  visible={showAdd}
485
482
  onClose={() => setShowAdd(false)}
486
- onAdd={(c) => {
483
+ onAdd={c => {
487
484
  if (trustedEntities.some(x => x.identityKey === c.identityKey)) {
488
485
  setSnack(t('duplicate_key_error'))
489
486
  return
@@ -572,7 +569,9 @@ function AddProviderModal({
572
569
  const json = (await res.json()) as any
573
570
  const trust = json?.babbage?.trust
574
571
  if (!json?.babbage || !trust || typeof trust !== 'object') {
575
- throw new Error('This domain does not support importing a trust relationship (it needs to follow the BRC-68 protocol)')
572
+ throw new Error(
573
+ 'This domain does not support importing a trust relationship (it needs to follow the BRC-68 protocol)'
574
+ )
576
575
  }
577
576
  await validateTrust(trust)
578
577
  setName(trust.name)
@@ -624,9 +623,16 @@ function AddProviderModal({
624
623
 
625
624
  {!advanced ? (
626
625
  <>
627
- <Text style={[styles.modalDesc, { color: colors.textSecondary }]}>Enter the domain name for the provider you&apos;d like to add.</Text>
626
+ <Text style={[styles.modalDesc, { color: colors.textSecondary }]}>
627
+ Enter the domain name for the provider you&apos;d like to add.
628
+ </Text>
628
629
  <View style={[styles.inputRow, { borderColor: colors.separator, backgroundColor: colors.fillTertiary }]}>
629
- <Ionicons name="globe-outline" size={16} color={colors.textSecondary} style={{ marginRight: spacing.sm }} />
630
+ <Ionicons
631
+ name="globe-outline"
632
+ size={16}
633
+ color={colors.textSecondary}
634
+ style={{ marginRight: spacing.sm }}
635
+ />
630
636
  <TextInput
631
637
  placeholder="trustedentity.com"
632
638
  placeholderTextColor={colors.textSecondary}
@@ -645,7 +651,10 @@ function AddProviderModal({
645
651
  {loading ? (
646
652
  <ActivityIndicator style={{ marginTop: spacing.md }} />
647
653
  ) : (
648
- <TouchableOpacity onPress={handleDomainSubmit} style={[styles.primaryBtn, { backgroundColor: colors.accent }]}>
654
+ <TouchableOpacity
655
+ onPress={handleDomainSubmit}
656
+ style={[styles.primaryBtn, { backgroundColor: colors.accent }]}
657
+ >
649
658
  <Ionicons name="document-text-outline" size={16} color={colors.background} />
650
659
  <Text style={[styles.primaryBtnText, { color: colors.background }]}>{t('get_provider_details')}</Text>
651
660
  </TouchableOpacity>
@@ -653,11 +662,18 @@ function AddProviderModal({
653
662
  </>
654
663
  ) : (
655
664
  <>
656
- <Text style={[styles.modalDesc, { color: colors.textSecondary }]}>Directly enter the details for the provider you&apos;d like to add.</Text>
665
+ <Text style={[styles.modalDesc, { color: colors.textSecondary }]}>
666
+ Directly enter the details for the provider you&apos;d like to add.
667
+ </Text>
657
668
 
658
669
  {/* Name */}
659
670
  <View style={[styles.inputRow, { borderColor: colors.separator, backgroundColor: colors.fillTertiary }]}>
660
- <Ionicons name="person-outline" size={16} color={colors.textSecondary} style={{ marginRight: spacing.sm }} />
671
+ <Ionicons
672
+ name="person-outline"
673
+ size={16}
674
+ color={colors.textSecondary}
675
+ style={{ marginRight: spacing.sm }}
676
+ />
661
677
  <TextInput
662
678
  placeholder="Entity Name"
663
679
  placeholderTextColor={colors.textSecondary}
@@ -674,7 +690,12 @@ function AddProviderModal({
674
690
 
675
691
  {/* Icon */}
676
692
  <View style={[styles.inputRow, { borderColor: colors.separator, backgroundColor: colors.fillTertiary }]}>
677
- <Ionicons name="image-outline" size={16} color={colors.textSecondary} style={{ marginRight: spacing.sm }} />
693
+ <Ionicons
694
+ name="image-outline"
695
+ size={16}
696
+ color={colors.textSecondary}
697
+ style={{ marginRight: spacing.sm }}
698
+ />
678
699
  <TextInput
679
700
  placeholder="https://trustedentity.com/icon.png"
680
701
  placeholderTextColor={colors.textSecondary}
@@ -693,7 +714,12 @@ function AddProviderModal({
693
714
 
694
715
  {/* Public key */}
695
716
  <View style={[styles.inputRow, { borderColor: colors.separator, backgroundColor: colors.fillTertiary }]}>
696
- <Ionicons name="key-outline" size={16} color={colors.textSecondary} style={{ marginRight: spacing.sm }} />
717
+ <Ionicons
718
+ name="key-outline"
719
+ size={16}
720
+ color={colors.textSecondary}
721
+ style={{ marginRight: spacing.sm }}
722
+ />
697
723
  <TextInput
698
724
  placeholder="0295bf1c7842d14b..."
699
725
  placeholderTextColor={colors.textSecondary}
@@ -713,7 +739,10 @@ function AddProviderModal({
713
739
  {loading ? (
714
740
  <ActivityIndicator style={{ marginTop: spacing.md }} />
715
741
  ) : (
716
- <TouchableOpacity onPress={handleDirectValidate} style={[styles.primaryBtn, { backgroundColor: colors.accent }]}>
742
+ <TouchableOpacity
743
+ onPress={handleDirectValidate}
744
+ style={[styles.primaryBtn, { backgroundColor: colors.accent }]}
745
+ >
717
746
  <Ionicons name="shield-checkmark-outline" size={16} color={colors.background} />
718
747
  <Text style={[styles.primaryBtnText, { color: colors.background }]}>{t('validate_details')}</Text>
719
748
  </TouchableOpacity>
@@ -723,8 +752,14 @@ function AddProviderModal({
723
752
 
724
753
  {/* Toggle advanced */}
725
754
  <TouchableOpacity onPress={() => setAdvanced(v => !v)} style={styles.advancedBtn}>
726
- <Ionicons name={advanced ? 'chevron-up-outline' : 'chevron-down-outline'} size={16} color={colors.textPrimary} />
727
- <Text style={{ marginLeft: spacing.xs, color: colors.textPrimary }}>{advanced ? t('hide_advanced') : t('show_advanced')}</Text>
755
+ <Ionicons
756
+ name={advanced ? 'chevron-up-outline' : 'chevron-down-outline'}
757
+ size={16}
758
+ color={colors.textPrimary}
759
+ />
760
+ <Text style={{ marginLeft: spacing.xs, color: colors.textPrimary }}>
761
+ {advanced ? t('hide_advanced') : t('show_advanced')}
762
+ </Text>
728
763
  </TouchableOpacity>
729
764
 
730
765
  {/* Preview + description edit */}
@@ -744,8 +779,18 @@ function AddProviderModal({
744
779
  </View>
745
780
  </View>
746
781
 
747
- <View style={[styles.inputRow, { marginTop: spacing.md, borderColor: colors.separator, backgroundColor: colors.fillTertiary }]}>
748
- <Ionicons name="pricetag-outline" size={16} color={colors.textSecondary} style={{ marginRight: spacing.sm }} />
782
+ <View
783
+ style={[
784
+ styles.inputRow,
785
+ { marginTop: spacing.md, borderColor: colors.separator, backgroundColor: colors.fillTertiary }
786
+ ]}
787
+ >
788
+ <Ionicons
789
+ name="pricetag-outline"
790
+ size={16}
791
+ color={colors.textSecondary}
792
+ style={{ marginRight: spacing.sm }}
793
+ />
749
794
  <TextInput
750
795
  placeholder="Description"
751
796
  placeholderTextColor={colors.textSecondary}
@@ -788,21 +833,21 @@ const styles = StyleSheet.create({
788
833
  justifyContent: 'space-between',
789
834
  paddingHorizontal: spacing.sm,
790
835
  paddingVertical: spacing.md,
791
- borderBottomWidth: StyleSheet.hairlineWidth,
836
+ borderBottomWidth: StyleSheet.hairlineWidth
792
837
  },
793
838
  backButton: {
794
839
  width: 44,
795
840
  height: 44,
796
841
  alignItems: 'center',
797
- justifyContent: 'center',
842
+ justifyContent: 'center'
798
843
  },
799
844
  headerTitle: {
800
- ...typography.headline,
845
+ ...typography.headline
801
846
  },
802
847
  description: {
803
848
  ...typography.footnote,
804
849
  paddingHorizontal: spacing.xl,
805
- paddingBottom: spacing.lg,
850
+ paddingBottom: spacing.lg
806
851
  },
807
852
 
808
853
  // Search
@@ -810,28 +855,28 @@ const styles = StyleSheet.create({
810
855
  flexDirection: 'row',
811
856
  alignItems: 'center',
812
857
  paddingHorizontal: spacing.lg,
813
- paddingVertical: spacing.md,
858
+ paddingVertical: spacing.md
814
859
  },
815
860
  searchInput: {
816
861
  flex: 1,
817
862
  ...typography.body,
818
- padding: 0,
863
+ padding: 0
819
864
  },
820
865
 
821
866
  // Certifier cards
822
867
  certifierCard: {
823
868
  paddingHorizontal: spacing.lg,
824
- paddingVertical: spacing.md,
869
+ paddingVertical: spacing.md
825
870
  },
826
871
  certifierHeader: {
827
872
  flexDirection: 'row',
828
- alignItems: 'center',
873
+ alignItems: 'center'
829
874
  },
830
875
  certifierIcon: {
831
876
  width: 40,
832
877
  height: 40,
833
878
  borderRadius: radii.md,
834
- marginRight: spacing.md,
879
+ marginRight: spacing.md
835
880
  },
836
881
  certifierIconPlaceholder: {
837
882
  width: 40,
@@ -839,30 +884,30 @@ const styles = StyleSheet.create({
839
884
  borderRadius: radii.md,
840
885
  marginRight: spacing.md,
841
886
  justifyContent: 'center',
842
- alignItems: 'center',
887
+ alignItems: 'center'
843
888
  },
844
889
  certifierName: {
845
890
  ...typography.body,
846
- fontWeight: '700',
891
+ fontWeight: '700'
847
892
  },
848
893
  certifierDesc: {
849
894
  ...typography.footnote,
850
- marginTop: spacing.xs,
895
+ marginTop: spacing.xs
851
896
  },
852
897
  actions: {
853
898
  flexDirection: 'row',
854
899
  alignItems: 'center',
855
- marginLeft: spacing.sm,
900
+ marginLeft: spacing.sm
856
901
  },
857
902
  actionBtn: {
858
- padding: spacing.xs,
903
+ padding: spacing.xs
859
904
  },
860
905
  emptyBox: {
861
906
  alignItems: 'center',
862
- paddingVertical: spacing.xxl,
907
+ paddingVertical: spacing.xxl
863
908
  },
864
909
  emptyText: {
865
- ...typography.subhead,
910
+ ...typography.subhead
866
911
  },
867
912
 
868
913
  // Add provider button
@@ -870,11 +915,11 @@ const styles = StyleSheet.create({
870
915
  flexDirection: 'row',
871
916
  alignItems: 'center',
872
917
  justifyContent: 'center',
873
- paddingVertical: spacing.md,
918
+ paddingVertical: spacing.md
874
919
  },
875
920
  addProviderText: {
876
921
  ...typography.body,
877
- fontWeight: '600',
922
+ fontWeight: '600'
878
923
  },
879
924
 
880
925
  // Save bar
@@ -884,10 +929,10 @@ const styles = StyleSheet.create({
884
929
  paddingVertical: spacing.md,
885
930
  flexDirection: 'row',
886
931
  alignItems: 'center',
887
- justifyContent: 'space-between',
932
+ justifyContent: 'space-between'
888
933
  },
889
934
  saveBarText: {
890
- ...typography.subhead,
935
+ ...typography.subhead
891
936
  },
892
937
  saveBtn: {
893
938
  paddingHorizontal: spacing.lg,
@@ -896,11 +941,11 @@ const styles = StyleSheet.create({
896
941
  flexDirection: 'row',
897
942
  alignItems: 'center',
898
943
  justifyContent: 'center',
899
- gap: spacing.xs,
944
+ gap: spacing.xs
900
945
  },
901
946
  saveBtnText: {
902
947
  ...typography.subhead,
903
- fontWeight: '700',
948
+ fontWeight: '700'
904
949
  },
905
950
 
906
951
  // Snackbar
@@ -910,7 +955,7 @@ const styles = StyleSheet.create({
910
955
  borderRadius: radii.sm,
911
956
  borderWidth: 1,
912
957
  padding: spacing.md,
913
- alignItems: 'center',
958
+ alignItems: 'center'
914
959
  },
915
960
 
916
961
  // Modal
@@ -918,26 +963,26 @@ const styles = StyleSheet.create({
918
963
  flex: 1,
919
964
  backgroundColor: 'rgba(0,0,0,0.5)',
920
965
  justifyContent: 'center',
921
- padding: spacing.lg,
966
+ padding: spacing.lg
922
967
  },
923
968
  modalCard: {
924
969
  borderWidth: 1,
925
970
  borderRadius: radii.md,
926
- padding: spacing.lg,
971
+ padding: spacing.lg
927
972
  },
928
973
  modalHeader: {
929
974
  flexDirection: 'row',
930
975
  justifyContent: 'space-between',
931
976
  alignItems: 'center',
932
- marginBottom: spacing.md,
977
+ marginBottom: spacing.md
933
978
  },
934
979
  modalTitle: {
935
980
  ...typography.headline,
936
- fontWeight: '700',
981
+ fontWeight: '700'
937
982
  },
938
983
  modalDesc: {
939
984
  ...typography.subhead,
940
- marginBottom: spacing.sm,
985
+ marginBottom: spacing.sm
941
986
  },
942
987
  inputRow: {
943
988
  flexDirection: 'row',
@@ -946,12 +991,12 @@ const styles = StyleSheet.create({
946
991
  borderRadius: radii.sm,
947
992
  paddingHorizontal: spacing.md,
948
993
  height: 40,
949
- marginTop: spacing.sm,
994
+ marginTop: spacing.sm
950
995
  },
951
996
  textInput: {
952
997
  flex: 1,
953
998
  ...typography.subhead,
954
- padding: 0,
999
+ padding: 0
955
1000
  },
956
1001
  primaryBtn: {
957
1002
  marginTop: spacing.md,
@@ -959,12 +1004,12 @@ const styles = StyleSheet.create({
959
1004
  borderRadius: radii.sm,
960
1005
  flexDirection: 'row',
961
1006
  alignItems: 'center',
962
- justifyContent: 'center',
1007
+ justifyContent: 'center'
963
1008
  },
964
1009
  primaryBtnText: {
965
1010
  marginLeft: spacing.xs,
966
1011
  ...typography.subhead,
967
- fontWeight: '700',
1012
+ fontWeight: '700'
968
1013
  },
969
1014
  secondaryBtn: {
970
1015
  height: 44,
@@ -972,37 +1017,37 @@ const styles = StyleSheet.create({
972
1017
  borderWidth: 1,
973
1018
  alignItems: 'center',
974
1019
  justifyContent: 'center',
975
- paddingHorizontal: spacing.lg,
1020
+ paddingHorizontal: spacing.lg
976
1021
  },
977
1022
  modalActions: {
978
1023
  marginTop: spacing.lg,
979
1024
  flexDirection: 'row',
980
1025
  justifyContent: 'flex-end',
981
1026
  alignItems: 'center',
982
- gap: spacing.sm,
1027
+ gap: spacing.sm
983
1028
  },
984
1029
  advancedBtn: {
985
1030
  marginTop: spacing.sm,
986
1031
  alignSelf: 'flex-start',
987
1032
  flexDirection: 'row',
988
- alignItems: 'center',
1033
+ alignItems: 'center'
989
1034
  },
990
1035
  previewBox: {
991
1036
  marginTop: spacing.md,
992
1037
  borderWidth: 1,
993
1038
  borderRadius: radii.sm,
994
- padding: spacing.md,
1039
+ padding: spacing.md
995
1040
  },
996
1041
  previewIcon: {
997
1042
  width: 48,
998
1043
  height: 48,
999
- borderRadius: radii.sm,
1044
+ borderRadius: radii.sm
1000
1045
  },
1001
1046
  previewKey: {
1002
- ...typography.caption1,
1047
+ ...typography.caption1
1003
1048
  },
1004
1049
  err: {
1005
1050
  ...typography.footnote,
1006
- marginTop: spacing.xs,
1007
- },
1051
+ marginTop: spacing.xs
1052
+ }
1008
1053
  })
@@ -20,7 +20,16 @@
20
20
  * key can sign.
21
21
  */
22
22
  import React, { useCallback, useEffect, useRef, useState } from 'react'
23
- import { View, Text, StyleSheet, ScrollView, TouchableOpacity, ActivityIndicator, TextInput, AppState } from 'react-native'
23
+ import {
24
+ View,
25
+ Text,
26
+ StyleSheet,
27
+ ScrollView,
28
+ TouchableOpacity,
29
+ ActivityIndicator,
30
+ TextInput,
31
+ AppState
32
+ } from 'react-native'
24
33
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
25
34
  import { GroupedSection } from '../components/ui/GroupedList'
26
35
  import { ListRow } from '../components/ui/ListRow'
@@ -1291,7 +1300,10 @@ export function VaultScreen() {
1291
1300
  accessibilityState={{ disabled: keyRestoreBusy || !/^[0-9]{6,8}$/.test(keyRestorePin) }}
1292
1301
  style={[
1293
1302
  styles.primary,
1294
- { backgroundColor: colors.accent, opacity: !keyRestoreBusy && /^[0-9]{6,8}$/.test(keyRestorePin) ? 1 : 0.5 }
1303
+ {
1304
+ backgroundColor: colors.accent,
1305
+ opacity: !keyRestoreBusy && /^[0-9]{6,8}$/.test(keyRestorePin) ? 1 : 0.5
1306
+ }
1295
1307
  ]}
1296
1308
  >
1297
1309
  {keyRestoreBusy ? (
@@ -1437,10 +1449,7 @@ export function VaultScreen() {
1437
1449
  </View>
1438
1450
  )}
1439
1451
 
1440
- <GroupedSection
1441
- header={keySectionHeader}
1442
- footer={t('vault_footnote')}
1443
- >
1452
+ <GroupedSection header={keySectionHeader} footer={t('vault_footnote')}>
1444
1453
  {/* Deposits no key on the list can open (an earlier setup's) are
1445
1454
  counted once, here: a re-lock cannot reach them, so they are kept
1446
1455
  out of the two re-lock badges below. */}
@@ -1456,7 +1465,10 @@ export function VaultScreen() {
1456
1465
  )}
1457
1466
  {coverage && coverage.missingKeys.length > 0 && coverage.stale > coverage.unreachableOutputs && (
1458
1467
  <ListRow
1459
- label={t('vault_badge_missing', { count: coverage.stale - coverage.unreachableOutputs, nickname: missingNames })}
1468
+ label={t('vault_badge_missing', {
1469
+ count: coverage.stale - coverage.unreachableOutputs,
1470
+ nickname: missingNames
1471
+ })}
1460
1472
  icon="alert-circle-outline"
1461
1473
  iconColor={colors.warning}
1462
1474
  showChevron={false}
@@ -559,7 +559,11 @@ export function VaultTransferScreen() {
559
559
 
560
560
  {transfersBlocked && (
561
561
  <Text style={[styles.floor, { color: colors.warning }]}>
562
- {t(meta?.pendingRemoval?.state === 'broadcast' ? 'vault_removal_awaiting_network' : 'vault_err_relock_required')}
562
+ {t(
563
+ meta?.pendingRemoval?.state === 'broadcast'
564
+ ? 'vault_removal_awaiting_network'
565
+ : 'vault_err_relock_required'
566
+ )}
563
567
  </Text>
564
568
  )}
565
569
 
@@ -13,7 +13,6 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
13
13
  import { ActivityIndicator, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
14
14
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
15
15
  import { useTranslation } from 'react-i18next'
16
- import AsyncStorage from '@react-native-async-storage/async-storage'
17
16
  import { PeerPayClient } from '@bsv/message-box-client'
18
17
  import { showAlert } from '../components/ui/AlertCard'
19
18
  import { makeCreditClassifier } from '../../core/pay/creditErrors'
@@ -22,11 +21,9 @@ import { inboxSeenStore } from '../../core/directpay/receive'
22
21
  import { makeBeefRepair } from '../../core/pay/beefRepair'
23
22
  import {
24
23
  acceptWithRetry,
25
- DEFAULT_MESSAGE_BOX_URL,
24
+ bindMessageBoxNetwork,
26
25
  internalizeIncoming,
27
- LEGACY_MESSAGE_BOX_URL,
28
- MESSAGE_BOX_URL_KEY,
29
- NO_MESSAGE_BOX
26
+ readMessageBoxUrl
30
27
  } from '../../core/pay/rails/handle'
31
28
  import {
32
29
  derivationPrefixFor,
@@ -47,7 +44,6 @@ import { userFacingPayError } from '../../core/pay/userError'
47
44
  import { backupAttestation } from '../../core/services/vault/backupAttestation'
48
45
  import { getBackupUploadState } from '../../core/backup/status'
49
46
  import { getOnline, haptics, spacing, typography, useTheme, useWallet } from '@bsv/expo-wallet-toolbox'
50
- import { profileScopedKey } from '../../core/profiles/profileStore'
51
47
 
52
48
  /**
53
49
  * @expo/vector-icons' index barrel re-exports every icon set (AntDesign,
@@ -190,14 +186,16 @@ function useWalletCheckPorts(): WalletCheckPorts {
190
186
  },
191
187
  creditInbox: async () => {
192
188
  if (!wallet) return { accepted: 0 }
193
- const saved = await AsyncStorage.getItem(profileScopedKey(MESSAGE_BOX_URL_KEY))
194
- const messageBoxUrl = !saved || saved === LEGACY_MESSAGE_BOX_URL ? DEFAULT_MESSAGE_BOX_URL : saved
195
- if (!messageBoxUrl || messageBoxUrl === NO_MESSAGE_BOX) return { accepted: 0 }
196
- const client = new PeerPayClient({
197
- messageBoxHost: messageBoxUrl,
198
- walletClient: wallet as never,
199
- originator: adminOriginator
200
- })
189
+ const messageBoxUrl = await readMessageBoxUrl(selectedNetwork)
190
+ if (!messageBoxUrl) return { accepted: 0 }
191
+ const client = bindMessageBoxNetwork(
192
+ new PeerPayClient({
193
+ messageBoxHost: messageBoxUrl,
194
+ walletClient: wallet as never,
195
+ originator: adminOriginator
196
+ }),
197
+ selectedNetwork
198
+ )
201
199
  const repairBeef = makeBeefRepair({ woc: wocConfigFor(selectedNetwork), online: getOnline })
202
200
  const classify = await makeCreditClassifier({ getOnline, peekLastMissHeight })
203
201
  // With direct payments on, one that arrived live as well is credited once.
@@ -219,8 +217,8 @@ function useWalletCheckPorts(): WalletCheckPorts {
219
217
  return { accepted: outcome.accepted }
220
218
  },
221
219
  sweepAddresses: async () => {
222
- if (!wallet) return { imported: 0 }
223
220
  const woc = wocConfigFor(selectedNetwork)
221
+ if (!wallet || !woc) return { imported: 0 }
224
222
  let imported = 0
225
223
  // XR-055: scan every date this device has actually issued a receive address for
226
224
  // (pay/receiveHistory.ts), not a fixed 30-day lookback — a payer who sat on a
@@ -329,8 +327,7 @@ export function WalletCheckScreen(props?: { ports?: WalletCheckPorts }) {
329
327
  // Start-of-step is not tracked: activeStep is derived from what has
330
328
  // settled, which cannot disagree with the ticks beside it.
331
329
  () => {},
332
- (id: WalletCheckStepId, status: WalletCheckStepStatus) =>
333
- setStatuses(prev => ({ ...prev, [id]: status })),
330
+ (id: WalletCheckStepId, status: WalletCheckStepStatus) => setStatuses(prev => ({ ...prev, [id]: status })),
334
331
  skips
335
332
  )
336
333
  setSummary({