@bsv/expo-wallet-toolbox 0.5.0 → 0.9.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 (200) hide show
  1. package/CHANGELOG.md +2000 -0
  2. package/README.md +66 -1
  3. package/core/amountFormatHelpers.ts +258 -36
  4. package/core/backup/RemoteSyncReader.ts +133 -24
  5. package/core/backup/appData.ts +157 -0
  6. package/core/backup/client.ts +15 -1
  7. package/core/backup/codec.ts +149 -11
  8. package/core/backup/constants.ts +30 -1
  9. package/core/backup/cursor.ts +31 -2
  10. package/core/backup/push.ts +71 -5
  11. package/core/backup/restore.ts +104 -16
  12. package/core/backup/restoreOnImport.ts +94 -30
  13. package/core/backup/status.ts +13 -8
  14. package/core/config.tsx +12 -5
  15. package/core/constants.ts +14 -1
  16. package/core/contacts/contactActivity.ts +153 -0
  17. package/core/contacts/contactCache.ts +41 -0
  18. package/core/contacts/contactsStore.ts +183 -0
  19. package/core/context/ExchangeRateContext.tsx +34 -27
  20. package/core/context/LocalStorageProvider.tsx +43 -40
  21. package/core/context/UserContext.tsx +18 -7
  22. package/core/context/VaultContext.tsx +49 -2
  23. package/core/context/WalletConnectionContext.tsx +203 -11
  24. package/core/context/WalletContext.tsx +685 -171
  25. package/core/demo/demoAssets.ts +60 -0
  26. package/core/demo/demoLedger.ts +240 -0
  27. package/core/demo/demoMandalaRuntime.ts +96 -0
  28. package/core/demo/demoMode.ts +38 -0
  29. package/core/demo/demoWallet.ts +25 -0
  30. package/core/demo/index.ts +26 -0
  31. package/core/demo/useDemo.ts +59 -0
  32. package/core/headers/OfflineFirstChaintracks.ts +99 -17
  33. package/core/headers/headerStore.ts +33 -14
  34. package/core/headers/syncHeaders.ts +12 -1
  35. package/core/i18n/translations.tsx +2186 -98
  36. package/core/identity/contactLink.ts +36 -0
  37. package/core/identity/handleRegistry/client.ts +314 -0
  38. package/core/identity/handleRegistry/keyPinStore.ts +70 -0
  39. package/core/identity/handleRegistry/profileCert.ts +254 -0
  40. package/core/identity/handleRegistry/registration.ts +559 -0
  41. package/core/identity/handleRegistry/resolver.ts +315 -0
  42. package/core/identity/handleRegistry/rules.ts +104 -0
  43. package/core/index.ts +53 -5
  44. package/core/localpay/build.ts +225 -24
  45. package/core/localpay/pending.ts +110 -7
  46. package/core/localpay/pendingAbortAuthority.ts +95 -0
  47. package/core/localpay/pendingAborts.ts +266 -26
  48. package/core/localpay/session.ts +42 -17
  49. package/core/localpay/settlementAck.ts +10 -1
  50. package/core/localpay/transport/socket.ts +52 -3
  51. package/core/localpay/verify.ts +100 -10
  52. package/core/mandala/abortGuard.ts +96 -20
  53. package/core/mandala/createRuntime.ts +206 -33
  54. package/core/mandala/drain.ts +89 -11
  55. package/core/mandala/inboxPrehold.ts +186 -0
  56. package/core/mandala/permissionModule.ts +202 -20
  57. package/core/mandala/settlementStore.ts +24 -2
  58. package/core/mandala/types.ts +40 -5
  59. package/core/monitor/MonitorSupervisor.ts +121 -0
  60. package/core/monitor/TaskBackupPush.ts +15 -1
  61. package/core/monitor/TaskCreditInbox.ts +1 -1
  62. package/core/monitor/TaskDrainOutbox.ts +15 -1
  63. package/core/monitor/TaskSendOffline.ts +15 -1
  64. package/core/net/online.ts +49 -0
  65. package/core/net/publicDestination.ts +91 -0
  66. package/core/net/validateArcUrl.ts +22 -0
  67. package/core/numberFormat.ts +19 -0
  68. package/core/offline/cancelParked.ts +134 -13
  69. package/core/offline/payerHold.ts +100 -24
  70. package/core/offline/plan.ts +37 -8
  71. package/core/pay/beefRepair.ts +6 -2
  72. package/core/pay/damagedInbox.ts +24 -0
  73. package/core/pay/rails/address.ts +107 -12
  74. package/core/pay/rails/handle.ts +117 -22
  75. package/core/pay/rails/index.ts +45 -7
  76. package/core/pay/rails/nativeIntent.ts +61 -0
  77. package/core/pay/receiveHistory.ts +93 -0
  78. package/core/pay/recordProof.ts +21 -7
  79. package/core/pay/refreshProofGuard.ts +42 -1
  80. package/core/pay/watchlist.ts +5 -2
  81. package/core/peerpay/control.ts +17 -18
  82. package/core/peerpay/handleResendRequests.ts +58 -4
  83. package/core/peerpay/outbox.ts +3 -1
  84. package/core/recovery/backupMaterial.ts +61 -0
  85. package/core/recovery/createWallet.ts +95 -0
  86. package/core/recovery/recoverWallet.ts +120 -0
  87. package/core/recovery/restoreWallet.ts +170 -0
  88. package/core/recovery/secret.ts +92 -0
  89. package/core/recovery/shareCollector.ts +71 -0
  90. package/core/recovery/shareParsing.ts +87 -0
  91. package/core/recovery/shares.ts +116 -0
  92. package/core/recovery/useRecoveryDeps.ts +70 -0
  93. package/core/services/arcTokenStorage.ts +52 -0
  94. package/core/services/arcadeBroadcastProvider.ts +233 -52
  95. package/core/services/autoApprovePolicy.ts +105 -0
  96. package/core/services/callbackToken.ts +19 -0
  97. package/core/services/capWalletArgs.ts +14 -2
  98. package/core/services/connectionAuthority.ts +98 -0
  99. package/core/services/exchangeRate.ts +36 -13
  100. package/core/services/externalOrigin.ts +16 -2
  101. package/core/services/secrets/kek.ts +126 -29
  102. package/core/services/secrets/migration.ts +16 -4
  103. package/core/services/secrets/store.ts +42 -14
  104. package/core/services/vault/VaultKeyService.ts +228 -45
  105. package/core/services/vault/chainRecovery.ts +483 -0
  106. package/core/services/vault/driver.ts +9 -1
  107. package/core/services/vault/enrolledSerialRegistry.ts +150 -0
  108. package/core/services/vault/guard.ts +218 -32
  109. package/core/services/vault/hardwareLease.ts +19 -0
  110. package/core/services/vault/metaAuthority.ts +210 -0
  111. package/core/services/vault/pivReset.ts +64 -23
  112. package/core/services/vault/r1comb.ts +139 -3
  113. package/core/services/vault/session.ts +25 -4
  114. package/core/services/vault/transfers.ts +868 -172
  115. package/core/services/vault/types.ts +19 -4
  116. package/core/services/vault/vaultStore.ts +256 -29
  117. package/core/services/walletArgLimits.ts +45 -2
  118. package/core/services/walletConnectionValidation.ts +76 -6
  119. package/core/services/walletServiceConfig.ts +40 -27
  120. package/core/storage/StorageExpoSQLite.ts +88 -47
  121. package/core/storage/methods/findSql.ts +24 -2
  122. package/core/storage/methods/listActionsSql.ts +8 -5
  123. package/core/storage/methods/listOutputsSql.ts +2 -2
  124. package/core/storage/methods/offlineActions.ts +10 -1
  125. package/core/storage/methods/processOfflineActions.ts +117 -25
  126. package/core/storage/methods/reviewStatusSql.ts +7 -2
  127. package/core/storage/schema/createTables.ts +155 -2
  128. package/core/stores/ConnectionStore.ts +34 -0
  129. package/core/toolboxConfig.ts +104 -0
  130. package/core/toolboxTypes.ts +40 -0
  131. package/core/userAvatar.ts +79 -0
  132. package/core/walletDbRegistry.ts +63 -0
  133. package/core/walletMonitor.ts +25 -4
  134. package/core/walletRepair/releaseStuckReservations.ts +72 -0
  135. package/core/walletRepair/shouldMarkUnspendable.ts +20 -0
  136. package/core/walletRepair/spenderConsumesOutpoint.ts +29 -0
  137. package/package.json +7 -7
  138. package/ui/activityFilter.ts +115 -0
  139. package/ui/backupShares.ts +26 -169
  140. package/ui/components/pay/AddressReceive.tsx +13 -6
  141. package/ui/components/pay/AssetPicker.tsx +30 -9
  142. package/ui/components/pay/MessageBoxConfig.tsx +16 -0
  143. package/ui/components/pay/NearbyFlow.tsx +480 -243
  144. package/ui/components/pay/PaymentSuccessOverlay.tsx +85 -10
  145. package/ui/components/pay/RecipientField.tsx +84 -70
  146. package/ui/components/pay/StepBar.tsx +32 -0
  147. package/ui/components/pay/UniversalSend.tsx +827 -205
  148. package/ui/components/ui/AlertCard.tsx +38 -5
  149. package/ui/components/ui/PencilEditField.tsx +109 -0
  150. package/ui/components/ui/PermissionSheet.tsx +197 -66
  151. package/ui/components/ui/SlideOverFromRight.tsx +86 -0
  152. package/ui/components/vault/EnrollWizard.tsx +61 -13
  153. package/ui/components/vault/vaultErrorCopy.ts +3 -1
  154. package/ui/components/wallet/ActivityRow.tsx +227 -123
  155. package/ui/components/wallet/AmountInput.tsx +26 -8
  156. package/ui/components/wallet/AssetSwitcherDropdown.tsx +22 -2
  157. package/ui/components/wallet/Balance.tsx +42 -23
  158. package/ui/components/wallet/BiometricAdvisoryModal.tsx +16 -3
  159. package/ui/components/wallet/ContactActivityList.tsx +149 -0
  160. package/ui/components/wallet/ContactSigil.tsx +49 -0
  161. package/ui/components/wallet/EditPictureSheet.tsx +99 -0
  162. package/ui/components/wallet/FitAmount.tsx +148 -0
  163. package/ui/components/wallet/IconPickerSheet.tsx +168 -0
  164. package/ui/components/wallet/IdentifierRow.tsx +69 -0
  165. package/ui/components/wallet/ImportFromBackupPrompt.tsx +35 -13
  166. package/ui/components/wallet/ProfileButton.tsx +62 -0
  167. package/ui/components/wallet/UserAvatar.tsx +85 -0
  168. package/ui/components/wallet/avatarIcons.ts +122 -0
  169. package/ui/exportTransactions.ts +36 -4
  170. package/ui/hooks/useContactsStore.ts +10 -0
  171. package/ui/hooks/useExportWalletData.ts +25 -2
  172. package/ui/hooks/useMandala.ts +18 -1
  173. package/ui/hooks/useOnline.ts +65 -20
  174. package/ui/importDatabases.ts +339 -24
  175. package/ui/index.ts +33 -2
  176. package/ui/isImageUrl.ts +6 -0
  177. package/ui/printRecoveryShares.ts +9 -10
  178. package/ui/recoveryPrompts.ts +91 -0
  179. package/ui/resolveIdentity.ts +31 -9
  180. package/ui/screens/ConnectionsScreen.tsx +86 -19
  181. package/ui/screens/ContactScreen.tsx +289 -0
  182. package/ui/screens/ContactsScreen.tsx +373 -0
  183. package/ui/screens/IdentifierScreen.tsx +256 -0
  184. package/ui/screens/NewContactScreen.tsx +362 -0
  185. package/ui/screens/PairScreen.tsx +74 -2
  186. package/ui/screens/PayScreen.tsx +20 -7
  187. package/ui/screens/ProfileScreen.tsx +783 -0
  188. package/ui/screens/SettingsScreen.tsx +10 -4
  189. package/ui/screens/TransactionDetailScreen.tsx +419 -0
  190. package/ui/screens/TrustScreen.tsx +100 -5
  191. package/ui/screens/VaultScreen.tsx +410 -61
  192. package/ui/screens/VaultTransferScreen.tsx +59 -7
  193. package/ui/screens/WalletCheckScreen.tsx +17 -6
  194. package/ui/screens/WalletConfigScreen.tsx +124 -28
  195. package/ui/screens/WalletHomeScreen.tsx +640 -104
  196. package/ui/screens/detailActionKeys.ts +55 -0
  197. package/ui/tokenFormat.ts +44 -4
  198. package/ui/tokenStatus.ts +21 -0
  199. package/ui/txStatus.ts +48 -5
  200. package/core/storage/LocalStorageAdapter.ts +0 -58
@@ -84,6 +84,26 @@ export interface ReceivedOverlayProps {
84
84
  * tell them yet". Never a claim of settlement the wallet does not have.
85
85
  */
86
86
  statusNote?: string
87
+ /**
88
+ * Received only (P1-1). The overlay's TIMING never changes — it is shown
89
+ * as soon as the payment is durably queued, before internalizeAction has
90
+ * necessarily run — but the green success CLAIM is gated on this:
91
+ *
92
+ * 'pending' — internalizeAction has not resolved yet. Neutral copy
93
+ * (t('local_pay_received_confirming')), no green.
94
+ * 'verified' — credited. Today's unchanged green 'local_pay_added'.
95
+ * 'not-credited' — internalizeAction failed or returned no success.
96
+ * The money is still safely queued and will resolve —
97
+ * this is not a decline and not a loss — but claiming
98
+ * it is already "Added to your wallet" would be a
99
+ * claim this device cannot back yet. Neutral copy
100
+ * (t('local_pay_received_not_credited')), no green.
101
+ *
102
+ * Defaults to 'verified' so every existing caller (and the whole 'sent'
103
+ * direction, where the payer's money already left and there is nothing
104
+ * left here to confirm) is unaffected.
105
+ */
106
+ verification?: 'pending' | 'verified' | 'not-credited'
87
107
  /**
88
108
  * First time this wallet has ever held this asset: who issues it and what
89
109
  * they can do. Disclosure at the one moment the user is definitely looking.
@@ -95,6 +115,14 @@ export interface ReceivedOverlayProps {
95
115
  * (rather than as the app root) should pass its own wallet-home route here.
96
116
  */
97
117
  dismissTo?: DismissTarget
118
+ /**
119
+ * Sent only, and only when the recipient resolved to an identity key that
120
+ * is not already a saved contact: offers a "Save as a contact" text
121
+ * action under the recipient's name. The caller owns the whole action (cleanup and
122
+ * navigation both) — this component stays presentational and only decides
123
+ * whether to show the button at all.
124
+ */
125
+ onAddContact?: () => void
98
126
  /**
99
127
  * Acknowledged. The only way this screen closes. Clean up local state here —
100
128
  * the overlay itself then returns the user to the wallet, so the updated
@@ -113,7 +141,9 @@ export default function PaymentSuccessOverlay({
113
141
  statusNote,
114
142
  firstHoldNote,
115
143
  dismissTo = '/',
116
- onDismiss
144
+ onAddContact,
145
+ onDismiss,
146
+ verification = 'verified'
117
147
  }: ReceivedOverlayProps) {
118
148
  const sent = direction === 'sent'
119
149
  const { t } = useTranslation()
@@ -159,6 +189,17 @@ export default function PaymentSuccessOverlay({
159
189
  router.dismissTo(dismissTo)
160
190
  }, [onDismiss, dismissTo])
161
191
 
192
+ // Received-only (see the `verification` prop doc). Computed once so the
193
+ // same sentence backs both the visible text and its accessibility label.
194
+ const receivedSupportText =
195
+ verification === 'pending'
196
+ ? t('local_pay_received_confirming')
197
+ : verification === 'not-credited'
198
+ ? t('local_pay_received_not_credited')
199
+ : count > 1
200
+ ? t('local_pay_added_multiple', { count })
201
+ : t('local_pay_added')
202
+
162
203
  const settleIn = reducedMotion
163
204
  ? undefined
164
205
  : FadeInDown.springify()
@@ -180,7 +221,7 @@ export default function PaymentSuccessOverlay({
180
221
  style={[styles.container, { backgroundColor: colors.background }]}
181
222
  accessibilityViewIsModal
182
223
  accessibilityRole="alert"
183
- accessibilityLabel={sent ? t('local_pay_sent') : `${t('local_pay_received')}. ${t('local_pay_added')}`}
224
+ accessibilityLabel={sent ? t('local_pay_sent') : `${t('local_pay_received')}. ${receivedSupportText}`}
184
225
  >
185
226
  <View style={styles.stage}>
186
227
  <Celebration onDone={onMarkDone} />
@@ -204,14 +245,36 @@ export default function PaymentSuccessOverlay({
204
245
  </Animated.View>
205
246
 
206
247
  {sent ? (
207
- !!recipientName && (
208
- <Text style={[styles.support, { color: colors.textSecondary }]} numberOfLines={1} ellipsizeMode="middle">
209
- {recipientName}
210
- </Text>
211
- )
248
+ <>
249
+ {!!recipientName && (
250
+ <Text
251
+ style={[styles.support, { color: colors.textSecondary }]}
252
+ numberOfLines={1}
253
+ ellipsizeMode="middle"
254
+ >
255
+ {t('pay_sent_to', { name: recipientName })}
256
+ </Text>
257
+ )}
258
+ {/* A text button under the name, not a second filled control: Done
259
+ stays the one accent-filled control on this screen. */}
260
+ {!!onAddContact && (
261
+ <PressableScale
262
+ onPress={onAddContact}
263
+ haptic="tap"
264
+ style={styles.saveContact}
265
+ accessibilityRole="button"
266
+ accessibilityLabel={t('pay_save_as_contact')}
267
+ >
268
+ <Text style={[styles.saveContactText, { color: colors.accent }]}>{t('pay_save_as_contact')}</Text>
269
+ </PressableScale>
270
+ )}
271
+ </>
212
272
  ) : (
213
- <Text style={[styles.support, { color: colors.success }]} textBreakStrategy="balanced">
214
- {count > 1 ? t('local_pay_added_multiple', { count }) : t('local_pay_added')}
273
+ <Text
274
+ style={[styles.support, { color: verification === 'verified' ? colors.success : colors.textSecondary }]}
275
+ textBreakStrategy="balanced"
276
+ >
277
+ {receivedSupportText}
215
278
  </Text>
216
279
  )}
217
280
 
@@ -299,7 +362,8 @@ const styles = StyleSheet.create({
299
362
  maxWidth: 300
300
363
  },
301
364
  footer: {
302
- paddingBottom: spacing.md
365
+ paddingBottom: spacing.md,
366
+ gap: spacing.sm
303
367
  },
304
368
  button: {
305
369
  flexDirection: 'row',
@@ -311,5 +375,16 @@ const styles = StyleSheet.create({
311
375
  buttonText: {
312
376
  ...typography.headline,
313
377
  fontWeight: '600'
378
+ },
379
+ saveContact: {
380
+ minHeight: 44,
381
+ paddingHorizontal: spacing.lg,
382
+ paddingVertical: spacing.md,
383
+ alignItems: 'center',
384
+ justifyContent: 'center'
385
+ },
386
+ saveContactText: {
387
+ ...typography.footnote,
388
+ fontWeight: '600'
314
389
  }
315
390
  })
@@ -7,10 +7,11 @@
7
7
  * useRecipientInput; this file only renders that state.
8
8
  */
9
9
  import React from 'react'
10
- import { ActivityIndicator, Image, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'
10
+ import { ActivityIndicator, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native'
11
11
  import type { DisplayableIdentity } from '@bsv/sdk'
12
12
  import Animated, { FadeInDown, useReducedMotion } from 'react-native-reanimated'
13
13
  import { spacing, typography, radii, springs } from '@bsv/expo-wallet-toolbox'
14
+ import ContactSigil from '../wallet/ContactSigil'
14
15
  import type { RecipientInlineError, RecipientTarget } from './useRecipientInput'
15
16
 
16
17
  /**
@@ -30,17 +31,29 @@ function loadIonicons(): IoniconsComponent {
30
31
  return ioniconsComponent
31
32
  }
32
33
 
34
+ /**
35
+ * A dropdown row. `DisplayableIdentity` is a fixed seven-string SDK interface
36
+ * with nowhere to put a handle, so the one line this list needs that it does
37
+ * not carry is added here — supplied by the caller, because only the caller
38
+ * knows whether a row came from a contact, the registry or the overlay.
39
+ */
40
+ export interface RecipientRow extends DisplayableIdentity {
41
+ /** Drawn under the name: a registry row's full `handle@domain`, a contact's
42
+ * `cachedHandle`. Falls back to the abbreviated identity key. */
43
+ readonly secondaryLine?: string
44
+ }
45
+
33
46
  interface RecipientFieldProps {
34
47
  readonly selectedIdentity: DisplayableIdentity | null
35
48
  readonly inputText: string
36
49
  readonly target: RecipientTarget | null
37
50
  readonly inlineError: RecipientInlineError | null
38
51
  readonly isSearching: boolean
39
- readonly searchResults: DisplayableIdentity[]
52
+ readonly searchResults: RecipientRow[]
40
53
  readonly colors: ReturnType<typeof import('@bsv/expo-wallet-toolbox').useTheme>['colors']
41
54
  readonly t: ReturnType<typeof import('react-i18next').useTranslation>['t']
42
55
  readonly onChangeText: (v: string) => void
43
- readonly onSelectIdentity: (i: DisplayableIdentity) => void
56
+ readonly onSelectIdentity: (i: RecipientRow) => void
44
57
  readonly onClear: () => void
45
58
  readonly onOpenScanner: () => void
46
59
  /**
@@ -61,6 +74,13 @@ interface RecipientFieldProps {
61
74
  * Rendered in place of the resolved-target line.
62
75
  */
63
76
  readonly statusOverride?: { readonly text: string; readonly tone: 'warning' | 'error' }
77
+ /**
78
+ * A heading shown above the dropdown when it is showing local contacts on
79
+ * an empty query rather than overlay search hits (Pay's "Recent" tier,
80
+ * 2026-09 design). The caller merges local contacts into `searchResults`
81
+ * itself — this component only draws the label they ask for.
82
+ */
83
+ readonly recentLabel?: string
64
84
  }
65
85
 
66
86
  export default function RecipientField({
@@ -77,7 +97,8 @@ export default function RecipientField({
77
97
  onClear,
78
98
  onOpenScanner,
79
99
  assetTicker,
80
- statusOverride
100
+ statusOverride,
101
+ recentLabel
81
102
  }: RecipientFieldProps) {
82
103
  const Ionicons = loadIonicons()
83
104
  const reducedMotion = useReducedMotion()
@@ -92,13 +113,14 @@ export default function RecipientField({
92
113
  entering={identityEntering}
93
114
  style={[styles.selectedRecipient, { backgroundColor: colors.backgroundSecondary }]}
94
115
  >
95
- {selectedIdentity.avatarURL ? (
96
- <Image source={{ uri: selectedIdentity.avatarURL }} style={styles.avatar} />
97
- ) : (
98
- <View style={[styles.avatarPlaceholder, { backgroundColor: colors.accent }]}>
99
- <Ionicons name="person" size={20} color={colors.background} />
100
- </View>
101
- )}
116
+ {/* Their avatar, else their sigil — never an initials/person placeholder
117
+ (2026-09-18 ruling): the same face Contacts and the review card draw. */}
118
+ <ContactSigil
119
+ identityKey={selectedIdentity.identityKey}
120
+ avatarUrl={selectedIdentity.avatarURL || undefined}
121
+ size={36}
122
+ radius={18}
123
+ />
102
124
  <View style={styles.selectedInfo}>
103
125
  <Text style={[styles.selectedName, { color: colors.textPrimary }]} numberOfLines={1}>
104
126
  {selectedIdentity.name || t('unknown')}
@@ -175,46 +197,52 @@ export default function RecipientField({
175
197
  <View
176
198
  style={[styles.searchResults, { backgroundColor: colors.backgroundSecondary, borderColor: colors.separator }]}
177
199
  >
178
- {isSearching ? (
200
+ {!!recentLabel && inputText.trim() === '' && (
201
+ <Text style={[styles.recentLabel, { color: colors.textTertiary }]}>{recentLabel}</Text>
202
+ )}
203
+ {searchResults.map((identity, idx) => (
204
+ <TouchableOpacity
205
+ key={identity.identityKey + idx}
206
+ onPress={() => onSelectIdentity(identity)}
207
+ style={[
208
+ styles.searchResultRow,
209
+ (idx < searchResults.length - 1 || isSearching) && {
210
+ borderBottomWidth: StyleSheet.hairlineWidth,
211
+ borderBottomColor: colors.separator
212
+ }
213
+ ]}
214
+ >
215
+ <View style={styles.searchAvatar}>
216
+ <ContactSigil
217
+ identityKey={identity.identityKey}
218
+ avatarUrl={identity.avatarURL || undefined}
219
+ size={32}
220
+ radius={16}
221
+ />
222
+ </View>
223
+ <View style={styles.searchResultInfo}>
224
+ <Text style={[styles.searchResultName, { color: colors.textPrimary }]} numberOfLines={1}>
225
+ {identity.name || t('unknown')}
226
+ </Text>
227
+ <Text style={[styles.searchResultKey, { color: colors.textSecondary }]} numberOfLines={1}>
228
+ {identity.secondaryLine || identity.abbreviatedKey || `${identity.identityKey.slice(0, 20)}...`}
229
+ </Text>
230
+ </View>
231
+ {identity.badgeLabel ? (
232
+ <View style={[styles.badge, { backgroundColor: colors.fill }]}>
233
+ <Text style={[styles.badgeText, { color: colors.accent }]}>{identity.badgeLabel}</Text>
234
+ </View>
235
+ ) : null}
236
+ </TouchableOpacity>
237
+ ))}
238
+ {/* A footer, not a replacement: the instant tier is already on screen
239
+ and hiding it for the remote tier's whole debounce made "instant"
240
+ a claim the user never saw. */}
241
+ {isSearching && (
179
242
  <View style={styles.searchLoading}>
180
243
  <ActivityIndicator size="small" color={colors.accent} />
181
244
  <Text style={[styles.searchLoadingText, { color: colors.textSecondary }]}>{t('searching')}</Text>
182
245
  </View>
183
- ) : (
184
- searchResults.map((identity, idx) => (
185
- <TouchableOpacity
186
- key={identity.identityKey + idx}
187
- onPress={() => onSelectIdentity(identity)}
188
- style={[
189
- styles.searchResultRow,
190
- idx < searchResults.length - 1 && {
191
- borderBottomWidth: StyleSheet.hairlineWidth,
192
- borderBottomColor: colors.separator
193
- }
194
- ]}
195
- >
196
- {identity.avatarURL ? (
197
- <Image source={{ uri: identity.avatarURL }} style={styles.searchAvatar} />
198
- ) : (
199
- <View style={[styles.searchAvatarPlaceholder, { backgroundColor: colors.accent }]}>
200
- <Ionicons name="person" size={18} color={colors.background} />
201
- </View>
202
- )}
203
- <View style={styles.searchResultInfo}>
204
- <Text style={[styles.searchResultName, { color: colors.textPrimary }]} numberOfLines={1}>
205
- {identity.name || t('unknown')}
206
- </Text>
207
- <Text style={[styles.searchResultKey, { color: colors.textSecondary }]} numberOfLines={1}>
208
- {identity.abbreviatedKey || `${identity.identityKey.slice(0, 20)}...`}
209
- </Text>
210
- </View>
211
- {identity.badgeLabel ? (
212
- <View style={[styles.badge, { backgroundColor: colors.fill }]}>
213
- <Text style={[styles.badgeText, { color: colors.accent }]}>{identity.badgeLabel}</Text>
214
- </View>
215
- ) : null}
216
- </TouchableOpacity>
217
- ))
218
246
  )}
219
247
  </View>
220
248
  )}
@@ -230,18 +258,6 @@ const styles = StyleSheet.create({
230
258
  padding: spacing.md,
231
259
  borderRadius: radii.md
232
260
  },
233
- avatar: {
234
- width: 36,
235
- height: 36,
236
- borderRadius: 18
237
- },
238
- avatarPlaceholder: {
239
- width: 36,
240
- height: 36,
241
- borderRadius: 18,
242
- alignItems: 'center',
243
- justifyContent: 'center'
244
- },
245
261
  selectedInfo: {
246
262
  flex: 1,
247
263
  marginLeft: spacing.md
@@ -287,23 +303,21 @@ const styles = StyleSheet.create({
287
303
  searchLoadingText: {
288
304
  ...typography.subhead
289
305
  },
306
+ recentLabel: {
307
+ ...typography.caption2,
308
+ fontWeight: '700',
309
+ letterSpacing: 0.8,
310
+ textTransform: 'uppercase',
311
+ paddingHorizontal: spacing.md,
312
+ paddingTop: spacing.sm,
313
+ paddingBottom: spacing.xs
314
+ },
290
315
  searchResultRow: {
291
316
  flexDirection: 'row',
292
317
  alignItems: 'center',
293
318
  padding: spacing.md
294
319
  },
295
320
  searchAvatar: {
296
- width: 32,
297
- height: 32,
298
- borderRadius: 16,
299
- marginRight: spacing.md
300
- },
301
- searchAvatarPlaceholder: {
302
- width: 32,
303
- height: 32,
304
- borderRadius: 16,
305
- alignItems: 'center',
306
- justifyContent: 'center',
307
321
  marginRight: spacing.md
308
322
  },
309
323
  searchResultInfo: {
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The thin progress bar across the top of Pay's three steps (who / amount /
3
+ * review). No "Step n of 3" caption (2026-09-18 design ruling) — just the
4
+ * track. Same visual weight as `EnrollWizard`'s `StepProgress`, which this is
5
+ * lifted from, minus the label.
6
+ */
7
+ import React from 'react'
8
+ import { StyleSheet, View } from 'react-native'
9
+ import { useTheme, radii, spacing } from '@bsv/expo-wallet-toolbox'
10
+
11
+ export type PayStep = 'who' | 'amount' | 'review'
12
+
13
+ const STEPS: PayStep[] = ['who', 'amount', 'review']
14
+
15
+ export default function StepBar({ step }: { step: PayStep }) {
16
+ const { colors } = useTheme()
17
+ const n = STEPS.indexOf(step) + 1
18
+ const total = STEPS.length
19
+ return (
20
+ <View style={styles.wrap} accessibilityRole="progressbar" accessibilityValue={{ min: 1, max: total, now: n }}>
21
+ <View style={[styles.track, { backgroundColor: colors.backgroundSecondary }]}>
22
+ <View style={[styles.fill, { backgroundColor: colors.accent, width: `${(n / total) * 100}%` }]} />
23
+ </View>
24
+ </View>
25
+ )
26
+ }
27
+
28
+ const styles = StyleSheet.create({
29
+ wrap: { paddingHorizontal: spacing.lg, paddingTop: spacing.sm, paddingBottom: spacing.md },
30
+ track: { height: 4, borderRadius: radii.sm, overflow: 'hidden' },
31
+ fill: { height: 4, borderRadius: radii.sm }
32
+ })