@bsv/expo-wallet-toolbox 0.25.0 → 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.
- package/CHANGELOG.md +43 -0
- package/core/context/WalletContext.tsx +11 -15
- package/core/i18n/translations.tsx +221 -36
- package/core/identity/handleRegistry/client.ts +110 -16
- package/core/identity/handleRegistry/registration.ts +115 -17
- package/core/index.ts +8 -0
- package/core/net/wocLimiter.ts +133 -0
- package/core/pay/beefRepair.ts +3 -1
- package/core/pay/rails/address.ts +2 -2
- package/core/profiles/profileStore.ts +4 -1
- package/core/services/arcadeBroadcastProvider.ts +6 -0
- package/core/services/exchangeRate.ts +8 -1
- package/core/services/groupSpendingLimit.ts +26 -0
- package/core/services/signingPermissionPolicy.ts +14 -8
- package/core/services/vault/ceremony.ts +13 -0
- package/core/services/vault/ceremonyHost.ts +58 -0
- package/core/services/vault/failedVaultSpend.ts +40 -0
- package/core/services/vault/outputAuthority.ts +13 -6
- package/core/services/vault/transfers.ts +56 -12
- package/core/services/vault/wocLookup.ts +5 -2
- package/core/storage/encryptedDbImage.ts +11 -2
- package/core/theme/tokens.ts +26 -12
- package/package.json +2 -1
- package/ui/components/QRScanner.tsx +24 -22
- package/ui/components/pay/MessageBoxConfig.tsx +10 -16
- package/ui/components/pay/NearbyAdvisoryModal.tsx +6 -13
- package/ui/components/pay/NearbyFlow.tsx +72 -35
- package/ui/components/pay/PayForm.tsx +27 -19
- package/ui/components/pay/PaymentSuccessOverlay.tsx +8 -6
- package/ui/components/pay/UniversalSend.tsx +4 -1
- package/ui/components/ui/AlertCard.tsx +3 -2
- package/ui/components/ui/BalancedText.tsx +117 -0
- package/ui/components/ui/ErrorBoundary.tsx +31 -14
- package/ui/components/ui/GroupedList.tsx +28 -22
- package/ui/components/ui/ListRow.tsx +126 -35
- package/ui/components/ui/PermissionSheet.tsx +31 -24
- package/ui/components/ui/PresenceRow.tsx +15 -23
- package/ui/components/ui/Sheet.tsx +11 -17
- package/ui/components/ui/Toast.tsx +13 -17
- package/ui/components/vault/EnrollWizard.tsx +446 -196
- package/ui/components/vault/KeyChooser.tsx +7 -20
- package/ui/components/vault/VaultCeremonySheet.tsx +44 -36
- package/ui/components/wallet/AmountInput.tsx +11 -17
- package/ui/components/wallet/BiometricAdvisoryModal.tsx +13 -17
- package/ui/index.ts +1 -1
- package/ui/screens/TrustScreen.tsx +49 -61
- package/ui/screens/VaultScreen.tsx +99 -60
- package/ui/screens/VaultTransferScreen.tsx +34 -27
- package/ui/screens/WalletCheckScreen.tsx +25 -24
- package/ui/screens/WalletConfigScreen.tsx +66 -72
|
@@ -26,21 +26,18 @@ function loadExpoCamera(): ExpoCameraModule {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* lucide, like every other glyph this app draws.
|
|
30
|
+
*
|
|
31
|
+
* Imported at module scope rather than behind a lazy loader. What had to be
|
|
32
|
+
* deferred is @expo/vector-icons' index barrel, which re-exports every icon
|
|
33
|
+
* set and so reaches expo-font -> expo-asset as untransformed ESM; nothing
|
|
34
|
+
* here pulls that barrel in any more. lucide publishes both module formats
|
|
35
|
+
* and Jest resolves the ESM one, so the app pins this name to lucide's CJS
|
|
36
|
+
* entry in jest.moduleNameMapper (package.json), as it already does for its
|
|
37
|
+
* other ESM-only dependencies.
|
|
34
38
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
function loadIonicons(): IoniconsComponent {
|
|
38
|
-
if (!ioniconsComponent) {
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
40
|
-
ioniconsComponent = require('@expo/vector-icons').Ionicons as IoniconsComponent
|
|
41
|
-
}
|
|
42
|
-
return ioniconsComponent
|
|
43
|
-
}
|
|
39
|
+
import { Camera, X } from 'lucide-react-native'
|
|
40
|
+
import { BalancedText } from './ui/BalancedText'
|
|
44
41
|
|
|
45
42
|
/* -------------------------------------------------------------------------- */
|
|
46
43
|
/* Types */
|
|
@@ -97,7 +94,6 @@ export default function QRScanner({
|
|
|
97
94
|
}: QRScannerProps) {
|
|
98
95
|
const { t } = useTranslation()
|
|
99
96
|
const { colors } = useTheme()
|
|
100
|
-
const Ionicons = loadIonicons()
|
|
101
97
|
const { CameraView, useCameraPermissions } = loadExpoCamera()
|
|
102
98
|
const [permission, requestPermission] = useCameraPermissions()
|
|
103
99
|
|
|
@@ -144,10 +140,10 @@ export default function QRScanner({
|
|
|
144
140
|
return (
|
|
145
141
|
<View style={styles.permScreen}>
|
|
146
142
|
<View style={styles.permIconWrap}>
|
|
147
|
-
<
|
|
143
|
+
<Camera size={40} color="#fff" />
|
|
148
144
|
</View>
|
|
149
145
|
<Text style={styles.permTitle}>{t('scan_shares_camera_needed')}</Text>
|
|
150
|
-
<
|
|
146
|
+
<BalancedText style={styles.permBody}>{t('camera_denied_description')}</BalancedText>
|
|
151
147
|
<TouchableOpacity style={styles.permBtn} onPress={() => Linking.openSettings()}>
|
|
152
148
|
<Text style={styles.permBtnText}>{t('open_settings')}</Text>
|
|
153
149
|
</TouchableOpacity>
|
|
@@ -163,10 +159,10 @@ export default function QRScanner({
|
|
|
163
159
|
return (
|
|
164
160
|
<View style={styles.permScreen}>
|
|
165
161
|
<View style={styles.permIconWrap}>
|
|
166
|
-
<
|
|
162
|
+
<Camera size={40} color="#fff" />
|
|
167
163
|
</View>
|
|
168
164
|
<Text style={styles.permTitle}>{t('scan_shares_camera_needed')}</Text>
|
|
169
|
-
<
|
|
165
|
+
<BalancedText style={styles.permBody}>{t('scan_shares_camera_description')}</BalancedText>
|
|
170
166
|
<TouchableOpacity style={styles.permBtn} onPress={requestPermission}>
|
|
171
167
|
<Text style={styles.permBtnText}>{t('continue_action')}</Text>
|
|
172
168
|
</TouchableOpacity>
|
|
@@ -188,8 +184,14 @@ export default function QRScanner({
|
|
|
188
184
|
<View style={styles.overlay}>
|
|
189
185
|
{/* Top bar */}
|
|
190
186
|
<View style={styles.overlayTop}>
|
|
191
|
-
<TouchableOpacity
|
|
192
|
-
|
|
187
|
+
<TouchableOpacity
|
|
188
|
+
style={styles.closeButton}
|
|
189
|
+
onPress={onClose}
|
|
190
|
+
accessibilityRole="button"
|
|
191
|
+
accessibilityLabel="Close"
|
|
192
|
+
testID="scanner-close"
|
|
193
|
+
>
|
|
194
|
+
<X size={26} color="#fff" />
|
|
193
195
|
</TouchableOpacity>
|
|
194
196
|
</View>
|
|
195
197
|
|
|
@@ -207,7 +209,7 @@ export default function QRScanner({
|
|
|
207
209
|
|
|
208
210
|
{/* Bottom info */}
|
|
209
211
|
<View style={styles.overlayBottom}>
|
|
210
|
-
<
|
|
212
|
+
<BalancedText style={styles.hintText}>{hintText ?? t('scan_qr_default_hint')}</BalancedText>
|
|
211
213
|
{renderBottom?.()}
|
|
212
214
|
</View>
|
|
213
215
|
</View>
|
|
@@ -26,21 +26,16 @@ import { defaultMessageBoxUrlFor, resolveMessageBoxUrl } from '../../../core/pay
|
|
|
26
26
|
import type { AppChain } from '../../../core/networks'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* lucide, like every other glyph this app draws. Imported at module scope
|
|
30
|
+
* rather than behind a lazy loader: what had to be deferred is
|
|
31
|
+
* @expo/vector-icons' index barrel, which re-exports every icon set and so
|
|
32
|
+
* reaches expo-font -> expo-asset as untransformed ESM; nothing here pulls
|
|
33
|
+
* that barrel in any more. lucide publishes both module formats and Jest
|
|
34
|
+
* resolves the ESM one, so the app pins this name to lucide's CJS entry in
|
|
35
|
+
* jest.moduleNameMapper (package.json), as it already does for its other
|
|
36
|
+
* ESM-only dependencies.
|
|
34
37
|
*/
|
|
35
|
-
|
|
36
|
-
let ioniconsComponent: IoniconsComponent | undefined
|
|
37
|
-
function loadIonicons(): IoniconsComponent {
|
|
38
|
-
if (!ioniconsComponent) {
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
40
|
-
ioniconsComponent = require('@expo/vector-icons').Ionicons as IoniconsComponent
|
|
41
|
-
}
|
|
42
|
-
return ioniconsComponent
|
|
43
|
-
}
|
|
38
|
+
import { RefreshCw } from 'lucide-react-native'
|
|
44
39
|
|
|
45
40
|
export function useMessageBoxConfig(
|
|
46
41
|
t: ReturnType<typeof import('react-i18next').useTranslation>['t'],
|
|
@@ -175,7 +170,6 @@ export function ConfigPanel({
|
|
|
175
170
|
onReset,
|
|
176
171
|
onNone
|
|
177
172
|
}: ConfigPanelProps) {
|
|
178
|
-
const Ionicons = loadIonicons()
|
|
179
173
|
const hasUrl = !!urlInput.trim()
|
|
180
174
|
const isNonDefault = urlInput.trim() !== defaultUrl && urlInput !== NO_MESSAGE_BOX
|
|
181
175
|
return (
|
|
@@ -220,7 +214,7 @@ export function ConfigPanel({
|
|
|
220
214
|
<View style={styles.configSecondaryActions}>
|
|
221
215
|
{isNonDefault && (
|
|
222
216
|
<TouchableOpacity onPress={onReset} style={[styles.configResetPill, { borderColor: colors.textSecondary }]}>
|
|
223
|
-
<
|
|
217
|
+
<RefreshCw size={12} color={colors.textSecondary} />
|
|
224
218
|
<Text style={[styles.configResetText, { color: colors.textSecondary }]}>Default</Text>
|
|
225
219
|
</TouchableOpacity>
|
|
226
220
|
)}
|
|
@@ -13,26 +13,17 @@ import React from 'react'
|
|
|
13
13
|
import { Modal, Platform, Pressable, StyleSheet, Text, View } from 'react-native'
|
|
14
14
|
import { useTheme, spacing, radii, typography, i18n } from '@bsv/expo-wallet-toolbox'
|
|
15
15
|
import PressableScale from '../ui/PressableScale'
|
|
16
|
+
import { Wifi } from 'lucide-react-native'
|
|
17
|
+
import { BalancedText } from '../ui/BalancedText'
|
|
16
18
|
|
|
17
19
|
const t = (k: string, o?: Record<string, unknown>) => i18n.t(k, o) as string
|
|
18
20
|
|
|
19
|
-
type IoniconsComponent = typeof import('@expo/vector-icons').Ionicons
|
|
20
|
-
let ioniconsComponent: IoniconsComponent | undefined
|
|
21
|
-
function loadIonicons(): IoniconsComponent {
|
|
22
|
-
if (!ioniconsComponent) {
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
24
|
-
ioniconsComponent = require('@expo/vector-icons').Ionicons as IoniconsComponent
|
|
25
|
-
}
|
|
26
|
-
return ioniconsComponent
|
|
27
|
-
}
|
|
28
|
-
|
|
29
21
|
export const NearbyAdvisoryModal: React.FC<{
|
|
30
22
|
visible: boolean
|
|
31
23
|
onCancel: () => void
|
|
32
24
|
onContinue: () => void
|
|
33
25
|
}> = ({ visible, onCancel, onContinue }) => {
|
|
34
26
|
const { colors } = useTheme()
|
|
35
|
-
const Ionicons = loadIonicons()
|
|
36
27
|
|
|
37
28
|
if (!visible) return null
|
|
38
29
|
|
|
@@ -56,10 +47,12 @@ export const NearbyAdvisoryModal: React.FC<{
|
|
|
56
47
|
/>
|
|
57
48
|
<View style={[styles.card, { backgroundColor: colors.sheetBackground, borderColor: colors.separator }]}>
|
|
58
49
|
<View style={[styles.heroIcon, { backgroundColor: colors.fillTertiary }]}>
|
|
59
|
-
<
|
|
50
|
+
<Wifi size={26} color={colors.accent} />
|
|
60
51
|
</View>
|
|
61
52
|
<Text style={[styles.title, { color: colors.textPrimary }]}>{t('nearby_advisory_title')}</Text>
|
|
62
|
-
<
|
|
53
|
+
<BalancedText style={[styles.body, { color: colors.textSecondary }]}>
|
|
54
|
+
{t('nearby_advisory_body')}
|
|
55
|
+
</BalancedText>
|
|
63
56
|
|
|
64
57
|
<PressableScale
|
|
65
58
|
haptic="confirm"
|
|
@@ -196,20 +196,49 @@ import type { AmountInputAsset } from '../wallet/AmountInput'
|
|
|
196
196
|
import type { DismissTarget } from '../../dismissTarget'
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
199
|
+
* Every glyph this flow draws comes from lucide, as the rest of this app does
|
|
200
|
+
* (src/settings/Rows.tsx, the headers, the sheets). Two icon families in one
|
|
201
|
+
* flow is visible at a glance: Ionicons' filled-corner, closed shapes next to
|
|
202
|
+
* lucide's open 2px strokes read as two apps.
|
|
203
|
+
*
|
|
204
|
+
* Imported at module scope rather than behind a lazy loader. What had to be
|
|
205
|
+
* deferred is @expo/vector-icons' index barrel, which re-exports every icon
|
|
206
|
+
* set and so reaches expo-font -> expo-asset as untransformed ESM; nothing
|
|
207
|
+
* here pulls that barrel in any more. lucide publishes both module formats
|
|
208
|
+
* and Jest resolves the ESM one, so the app pins this name to lucide's CJS
|
|
209
|
+
* entry in jest.moduleNameMapper (package.json), as it already does for its
|
|
210
|
+
* other ESM-only dependencies. Only the glyph-name type below still refers to
|
|
211
|
+
* @expo/vector-icons, and a `typeof import(...)` type is erased at compile
|
|
212
|
+
* time.
|
|
213
|
+
*
|
|
214
|
+
* The button props stay Ionicons names, because that is what every call site
|
|
215
|
+
* in this file passes; this maps each one to its nearest lucide counterpart.
|
|
204
216
|
*/
|
|
217
|
+
import {
|
|
218
|
+
ArrowUp,
|
|
219
|
+
CircleAlert,
|
|
220
|
+
CircleCheckBig,
|
|
221
|
+
Clock,
|
|
222
|
+
CloudOff,
|
|
223
|
+
Info,
|
|
224
|
+
QrCode,
|
|
225
|
+
RefreshCw,
|
|
226
|
+
ScanLine,
|
|
227
|
+
Settings,
|
|
228
|
+
Wallet,
|
|
229
|
+
Wrench,
|
|
230
|
+
type LucideIcon
|
|
231
|
+
} from 'lucide-react-native'
|
|
232
|
+
|
|
205
233
|
type IoniconsComponent = typeof import('@expo/vector-icons').Ionicons
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
234
|
+
|
|
235
|
+
const LUCIDE: Record<string, LucideIcon> = {
|
|
236
|
+
'arrow-up': ArrowUp,
|
|
237
|
+
construct: Wrench,
|
|
238
|
+
'qr-code-outline': QrCode,
|
|
239
|
+
refresh: RefreshCw,
|
|
240
|
+
'scan-outline': ScanLine,
|
|
241
|
+
'settings-outline': Settings
|
|
213
242
|
}
|
|
214
243
|
|
|
215
244
|
/**
|
|
@@ -364,10 +393,10 @@ const FLOOR_KEYS: Record<Exclude<FloorReason, 'none'>, string> = {
|
|
|
364
393
|
cross_os_no_ble: 'local_pay_floor_cross_os'
|
|
365
394
|
}
|
|
366
395
|
|
|
367
|
-
const NOTICE_ICONS: Record<NoticeTone,
|
|
368
|
-
success:
|
|
369
|
-
info:
|
|
370
|
-
warning:
|
|
396
|
+
const NOTICE_ICONS: Record<NoticeTone, LucideIcon> = {
|
|
397
|
+
success: Wallet,
|
|
398
|
+
info: Clock,
|
|
399
|
+
warning: CloudOff
|
|
371
400
|
}
|
|
372
401
|
|
|
373
402
|
// ── Helpers ──
|
|
@@ -635,8 +664,13 @@ export interface NearbyFlowProps {
|
|
|
635
664
|
* `onBusy` reports when a payment is in hand (the payer's-code scanner,
|
|
636
665
|
* saving, the paid overlay, a failure): the host must not remount or
|
|
637
666
|
* unmount the flow then — no new amount, no switching away.
|
|
667
|
+
*
|
|
668
|
+
* `renderQr` draws the pairing code in the host's own style (its card, a
|
|
669
|
+
* mark in the middle) in place of the built-in one. It is handed the code's
|
|
670
|
+
* text and must render it at `qrSize` with error correction that survives
|
|
671
|
+
* whatever it draws over it.
|
|
638
672
|
*/
|
|
639
|
-
embedded?: { qrSize?: number; onBusy?: (busy: boolean) => void }
|
|
673
|
+
embedded?: { qrSize?: number; onBusy?: (busy: boolean) => void; renderQr?: (value: string) => React.ReactNode }
|
|
640
674
|
/**
|
|
641
675
|
* Payer only: draw these steps yourself, in the host's own style. Each is
|
|
642
676
|
* optional; a step without one shows the built-in screen. The logic stays
|
|
@@ -668,7 +702,6 @@ function NearbyFlow({
|
|
|
668
702
|
}: NearbyFlowProps) {
|
|
669
703
|
const { t } = useTranslation()
|
|
670
704
|
const { colors } = useTheme()
|
|
671
|
-
const Ionicons = loadIonicons()
|
|
672
705
|
const QRCode = loadQRCode()
|
|
673
706
|
const StatusBar = loadStatusBar()
|
|
674
707
|
const { router, useFocusEffect, useNavigation } = loadExpoRouter()
|
|
@@ -2821,7 +2854,7 @@ function NearbyFlow({
|
|
|
2821
2854
|
]}
|
|
2822
2855
|
accessibilityRole="text"
|
|
2823
2856
|
>
|
|
2824
|
-
|
|
2857
|
+
{React.createElement(NOTICE_ICONS[n.tone], { size: 16, color: tint })}
|
|
2825
2858
|
<Text style={[styles.noticeText, { color: n.tone === 'info' ? colors.textSecondary : tint }]}>{n.text}</Text>
|
|
2826
2859
|
</Animated.View>
|
|
2827
2860
|
)
|
|
@@ -2842,7 +2875,7 @@ function NearbyFlow({
|
|
|
2842
2875
|
{phase === 'entry' && initialRole === 'payer' && (
|
|
2843
2876
|
<Animated.View entering={settleIn} style={styles.stage}>
|
|
2844
2877
|
<View style={[styles.heroCircle, { backgroundColor: colors.fillTertiary }]}>
|
|
2845
|
-
<
|
|
2878
|
+
<QrCode size={44} color={colors.textSecondary} />
|
|
2846
2879
|
</View>
|
|
2847
2880
|
<View style={styles.gapLg} />
|
|
2848
2881
|
{phaseTitle(t('local_pay_scan_qr'))}
|
|
@@ -2973,7 +3006,7 @@ function NearbyFlow({
|
|
|
2973
3006
|
style={[styles.qrError, { backgroundColor: colors.fillTertiary, borderColor: colors.separator }]}
|
|
2974
3007
|
accessibilityRole="alert"
|
|
2975
3008
|
>
|
|
2976
|
-
<
|
|
3009
|
+
<CircleAlert size={28} color={colors.error} />
|
|
2977
3010
|
<View style={styles.gapSm} />
|
|
2978
3011
|
<Text style={[styles.support, { color: colors.textSecondary }]}>{t('local_pay_qr_unavailable')}</Text>
|
|
2979
3012
|
</View>
|
|
@@ -3000,7 +3033,7 @@ function NearbyFlow({
|
|
|
3000
3033
|
style={[styles.notice, { backgroundColor: colors.error + '15', borderColor: colors.error + '40' }]}
|
|
3001
3034
|
accessibilityRole="alert"
|
|
3002
3035
|
>
|
|
3003
|
-
<
|
|
3036
|
+
<CircleAlert size={16} color={colors.error} />
|
|
3004
3037
|
<Text style={[styles.noticeText, { color: colors.error }]}>{t('local_pay_wrong_session')}</Text>
|
|
3005
3038
|
</Animated.View>
|
|
3006
3039
|
)}
|
|
@@ -3017,7 +3050,7 @@ function NearbyFlow({
|
|
|
3017
3050
|
entering={fadeIn}
|
|
3018
3051
|
style={[styles.notice, { backgroundColor: colors.fillTertiary, borderColor: colors.separator }]}
|
|
3019
3052
|
>
|
|
3020
|
-
<
|
|
3053
|
+
<Info size={16} color={colors.textSecondary} />
|
|
3021
3054
|
<Text style={[styles.noticeText, { color: colors.textSecondary }]}>
|
|
3022
3055
|
{err.networkDenied
|
|
3023
3056
|
? t('local_pay_network_denied')
|
|
@@ -3268,7 +3301,7 @@ function NearbyFlow({
|
|
|
3268
3301
|
saw a second payment — so nothing here is at display scale. */}
|
|
3269
3302
|
{phase === 'already_paid' && (
|
|
3270
3303
|
<Animated.View entering={settleIn} style={styles.stage}>
|
|
3271
|
-
<
|
|
3304
|
+
<CircleCheckBig size={56} color={colors.textSecondary} />
|
|
3272
3305
|
<View style={styles.gapLg} />
|
|
3273
3306
|
{phaseTitle(t('local_pay_already_paid'))}
|
|
3274
3307
|
{supportText(t('local_pay_queued'))}
|
|
@@ -3285,7 +3318,7 @@ function NearbyFlow({
|
|
|
3285
3318
|
{phase === 'failed' && (
|
|
3286
3319
|
<Animated.View entering={settleIn} style={styles.stage} accessibilityRole="alert">
|
|
3287
3320
|
<View style={[styles.heroCircle, { backgroundColor: colors.error + '15' }]}>
|
|
3288
|
-
<
|
|
3321
|
+
<CircleAlert size={40} color={colors.error} />
|
|
3289
3322
|
</View>
|
|
3290
3323
|
<View style={styles.gapLg} />
|
|
3291
3324
|
{phaseTitle(t('local_pay_failed'))}
|
|
@@ -3385,7 +3418,9 @@ function NearbyFlow({
|
|
|
3385
3418
|
|
|
3386
3419
|
const inlineBody = (
|
|
3387
3420
|
<View style={styles.embedded}>
|
|
3388
|
-
{phase === 'receive_wait' && hostedSession && sessionQr && !sessionQrBroken ? (
|
|
3421
|
+
{phase === 'receive_wait' && hostedSession && sessionQr && !sessionQrBroken && embedded?.renderQr ? (
|
|
3422
|
+
embedded.renderQr(sessionQr)
|
|
3423
|
+
) : phase === 'receive_wait' && hostedSession && sessionQr && !sessionQrBroken ? (
|
|
3389
3424
|
<View style={[styles.qrCard, { shadowColor: colors.textPrimary }]}>
|
|
3390
3425
|
<View style={styles.qrPlate}>
|
|
3391
3426
|
<QRCode
|
|
@@ -3411,7 +3446,7 @@ function NearbyFlow({
|
|
|
3411
3446
|
]}
|
|
3412
3447
|
accessibilityRole="alert"
|
|
3413
3448
|
>
|
|
3414
|
-
<
|
|
3449
|
+
<CircleAlert size={28} color={colors.error} />
|
|
3415
3450
|
<View style={styles.gapSm} />
|
|
3416
3451
|
<Text style={[styles.support, { color: colors.textSecondary }]}>{t('local_pay_qr_unavailable')}</Text>
|
|
3417
3452
|
</View>
|
|
@@ -3442,7 +3477,7 @@ function NearbyFlow({
|
|
|
3442
3477
|
style={[styles.notice, { backgroundColor: colors.error + '15', borderColor: colors.error + '40' }]}
|
|
3443
3478
|
accessibilityRole="alert"
|
|
3444
3479
|
>
|
|
3445
|
-
<
|
|
3480
|
+
<CircleAlert size={16} color={colors.error} />
|
|
3446
3481
|
<Text style={[styles.noticeText, { color: colors.error }]}>{t('local_pay_wrong_session')}</Text>
|
|
3447
3482
|
</View>
|
|
3448
3483
|
)}
|
|
@@ -3453,7 +3488,7 @@ function NearbyFlow({
|
|
|
3453
3488
|
<React.Fragment key={kind}>
|
|
3454
3489
|
<View style={styles.gapMd} />
|
|
3455
3490
|
<View style={[styles.notice, { backgroundColor: colors.fillTertiary, borderColor: colors.separator }]}>
|
|
3456
|
-
<
|
|
3491
|
+
<Info size={16} color={colors.textSecondary} />
|
|
3457
3492
|
<Text style={[styles.noticeText, { color: colors.textSecondary }]}>
|
|
3458
3493
|
{err.networkDenied
|
|
3459
3494
|
? t('local_pay_network_denied')
|
|
@@ -3487,7 +3522,7 @@ function NearbyFlow({
|
|
|
3487
3522
|
accessibilityRole="button"
|
|
3488
3523
|
accessibilityLabel={t('local_pay_scan_payer_qr')}
|
|
3489
3524
|
>
|
|
3490
|
-
<
|
|
3525
|
+
<ScanLine size={16} color={colors.textSecondary} />
|
|
3491
3526
|
<Text style={[styles.embeddedScanText, { color: colors.textSecondary }]}>
|
|
3492
3527
|
{t('local_pay_scan_payer_qr')}
|
|
3493
3528
|
</Text>
|
|
@@ -3746,7 +3781,6 @@ function PrimaryButton({
|
|
|
3746
3781
|
onPress: () => void
|
|
3747
3782
|
disabled?: boolean
|
|
3748
3783
|
}) {
|
|
3749
|
-
const Ionicons = loadIonicons()
|
|
3750
3784
|
return (
|
|
3751
3785
|
<PressableScale
|
|
3752
3786
|
onPress={onPress}
|
|
@@ -3757,7 +3791,9 @@ function PrimaryButton({
|
|
|
3757
3791
|
accessibilityLabel={label}
|
|
3758
3792
|
accessibilityState={{ disabled: !!disabled }}
|
|
3759
3793
|
>
|
|
3760
|
-
{!!icon &&
|
|
3794
|
+
{!!icon &&
|
|
3795
|
+
!!LUCIDE[icon] &&
|
|
3796
|
+
React.createElement(LUCIDE[icon], { size: 20, color: disabled ? colors.textTertiary : colors.textOnAccent })}
|
|
3761
3797
|
<Text style={[styles.buttonText, { color: disabled ? colors.textTertiary : colors.textOnAccent }]}>{label}</Text>
|
|
3762
3798
|
</PressableScale>
|
|
3763
3799
|
)
|
|
@@ -3778,7 +3814,6 @@ function SecondaryButton({
|
|
|
3778
3814
|
onPress: () => void
|
|
3779
3815
|
disabled?: boolean
|
|
3780
3816
|
}) {
|
|
3781
|
-
const Ionicons = loadIonicons()
|
|
3782
3817
|
return (
|
|
3783
3818
|
<PressableScale
|
|
3784
3819
|
onPress={onPress}
|
|
@@ -3789,7 +3824,9 @@ function SecondaryButton({
|
|
|
3789
3824
|
accessibilityLabel={label}
|
|
3790
3825
|
accessibilityState={{ disabled: !!disabled }}
|
|
3791
3826
|
>
|
|
3792
|
-
{!!icon &&
|
|
3827
|
+
{!!icon &&
|
|
3828
|
+
!!LUCIDE[icon] &&
|
|
3829
|
+
React.createElement(LUCIDE[icon], { size: 18, color: disabled ? colors.textTertiary : colors.accent })}
|
|
3793
3830
|
<Text style={[styles.buttonText, { color: disabled ? colors.textTertiary : colors.accent }]}>{label}</Text>
|
|
3794
3831
|
</PressableScale>
|
|
3795
3832
|
)
|
|
@@ -3839,7 +3876,7 @@ function makeStyles() {
|
|
|
3839
3876
|
embedded: { alignItems: 'center', alignSelf: 'stretch' },
|
|
3840
3877
|
embeddedPending: { alignItems: 'center', justifyContent: 'center' },
|
|
3841
3878
|
embeddedScan: { flexDirection: 'row', alignItems: 'center', gap: 6, paddingVertical: 6, paddingHorizontal: 12 },
|
|
3842
|
-
embeddedScanText: { fontSize: 13, lineHeight: 18 },
|
|
3879
|
+
embeddedScanText: { fontFamily: 'Nunito', fontSize: 13, lineHeight: 18 },
|
|
3843
3880
|
header: {
|
|
3844
3881
|
flexDirection: 'row',
|
|
3845
3882
|
alignItems: 'center',
|
|
@@ -21,21 +21,19 @@ import { AmountInput, type AmountInputAsset } from '../wallet/AmountInput'
|
|
|
21
21
|
import PressableScale from '../ui/PressableScale'
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* lucide, like every other glyph this app draws. Imported at module scope
|
|
25
|
+
* rather than behind a lazy loader: what had to be deferred is
|
|
26
|
+
* @expo/vector-icons' index barrel, which re-exports every icon set and so
|
|
27
|
+
* reaches expo-font -> expo-asset as untransformed ESM; nothing here pulls
|
|
28
|
+
* that barrel in any more. lucide publishes both module formats and Jest
|
|
29
|
+
* resolves the ESM one, so the app pins this name to lucide's CJS entry in
|
|
30
|
+
* jest.moduleNameMapper (package.json), as it already does for its other
|
|
31
|
+
* ESM-only dependencies.
|
|
29
32
|
*/
|
|
33
|
+
import { ArrowRight, ArrowUp, Info, User, type LucideIcon } from 'lucide-react-native'
|
|
34
|
+
|
|
35
|
+
/** The icon props below stay Ionicons names; LUCIDE draws their twins. */
|
|
30
36
|
type IoniconsComponent = typeof import('@expo/vector-icons').Ionicons
|
|
31
|
-
let ioniconsComponent: IoniconsComponent | undefined
|
|
32
|
-
function loadIonicons(): IoniconsComponent {
|
|
33
|
-
if (!ioniconsComponent) {
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
35
|
-
ioniconsComponent = require('@expo/vector-icons').Ionicons as IoniconsComponent
|
|
36
|
-
}
|
|
37
|
-
return ioniconsComponent
|
|
38
|
-
}
|
|
39
37
|
|
|
40
38
|
/** One field section: the uppercase caption, then whatever asks the question. */
|
|
41
39
|
export function PayField({ labelKey, children }: { labelKey: string; children: React.ReactNode }) {
|
|
@@ -126,10 +124,9 @@ export function ConsequenceNote({
|
|
|
126
124
|
}) {
|
|
127
125
|
const { t } = useTranslation()
|
|
128
126
|
const { colors } = useTheme()
|
|
129
|
-
const Ionicons = loadIonicons()
|
|
130
127
|
return (
|
|
131
128
|
<View style={[styles.consequence, { backgroundColor: colors.fillTertiary, borderColor: colors.separator }]}>
|
|
132
|
-
<
|
|
129
|
+
<Info size={16} color={colors.textSecondary} />
|
|
133
130
|
<Text style={[styles.consequenceText, { color: colors.textSecondary }]}>{text ?? t(textKey, values)}</Text>
|
|
134
131
|
{action && (
|
|
135
132
|
<PressableScale
|
|
@@ -150,6 +147,18 @@ export function ConsequenceNote({
|
|
|
150
147
|
}
|
|
151
148
|
|
|
152
149
|
/** The submit button every rail sends with. */
|
|
150
|
+
/**
|
|
151
|
+
* The two icon props below stay Ionicons names, because that is what every
|
|
152
|
+
* call site already passes; this maps each name used in this package to its
|
|
153
|
+
* lucide counterpart. A name with no entry draws nothing rather than a glyph
|
|
154
|
+
* from the wrong family -- the seam this whole change exists to close.
|
|
155
|
+
*/
|
|
156
|
+
const LUCIDE: Record<string, LucideIcon> = {
|
|
157
|
+
'arrow-up': ArrowUp,
|
|
158
|
+
'arrow-forward': ArrowRight,
|
|
159
|
+
person: User
|
|
160
|
+
}
|
|
161
|
+
|
|
153
162
|
export function PayCta({
|
|
154
163
|
onPress,
|
|
155
164
|
disabled,
|
|
@@ -175,7 +184,6 @@ export function PayCta({
|
|
|
175
184
|
}) {
|
|
176
185
|
const { t } = useTranslation()
|
|
177
186
|
const { colors } = useTheme()
|
|
178
|
-
const Ionicons = loadIonicons()
|
|
179
187
|
const enabled = !disabled
|
|
180
188
|
const text = label ?? t(labelKey)
|
|
181
189
|
return (
|
|
@@ -193,7 +201,8 @@ export function PayCta({
|
|
|
193
201
|
<ActivityIndicator size="small" color={enabled ? colors.background : colors.textTertiary} />
|
|
194
202
|
) : (
|
|
195
203
|
<>
|
|
196
|
-
|
|
204
|
+
{!!LUCIDE[icon] &&
|
|
205
|
+
React.createElement(LUCIDE[icon], { size: 20, color: enabled ? colors.textOnAccent : colors.textTertiary })}
|
|
197
206
|
<Text style={[styles.ctaText, { color: enabled ? colors.textOnAccent : colors.textTertiary }]}>{text}</Text>
|
|
198
207
|
</>
|
|
199
208
|
)}
|
|
@@ -217,11 +226,10 @@ export function RecipientSummary({
|
|
|
217
226
|
}) {
|
|
218
227
|
const { t } = useTranslation()
|
|
219
228
|
const { colors } = useTheme()
|
|
220
|
-
const Ionicons = loadIonicons()
|
|
221
229
|
return (
|
|
222
230
|
<View style={[styles.idCard, { backgroundColor: colors.backgroundElevated, borderColor: colors.separator }]}>
|
|
223
231
|
<View style={[styles.avatar, { backgroundColor: colors.fillTertiary }]}>
|
|
224
|
-
|
|
232
|
+
{!!LUCIDE[icon] && React.createElement(LUCIDE[icon], { size: 20, color: colors.textSecondary })}
|
|
225
233
|
</View>
|
|
226
234
|
<View style={styles.idText}>
|
|
227
235
|
<Text style={[styles.idLabel, { color: colors.textTertiary }]}>{t('recipient')}</Text>
|
|
@@ -28,6 +28,7 @@ import AmountDisplay from '../wallet/AmountDisplay'
|
|
|
28
28
|
import Celebration from '../ui/Celebration'
|
|
29
29
|
import PressableScale from '../ui/PressableScale'
|
|
30
30
|
import type { DismissTarget } from '../../dismissTarget'
|
|
31
|
+
import { BalancedText } from '../ui/BalancedText'
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* expo-router is required lazily rather than imported at module scope: this
|
|
@@ -282,12 +283,14 @@ export default function PaymentSuccessOverlay({
|
|
|
282
283
|
rendered ungated by direction; a sent payment gets its own, because
|
|
283
284
|
"Received offline" over an outgoing payment is simply wrong. */}
|
|
284
285
|
{!broadcast && (
|
|
285
|
-
<
|
|
286
|
+
<BalancedText style={[styles.pending, { color: colors.textSecondary }]}>
|
|
286
287
|
{t(sent ? 'pay_sent_not_broadcast' : 'pay_received_not_broadcast')}
|
|
287
|
-
</
|
|
288
|
+
</BalancedText>
|
|
288
289
|
)}
|
|
289
290
|
|
|
290
|
-
{!!statusNote &&
|
|
291
|
+
{!!statusNote && (
|
|
292
|
+
<BalancedText style={[styles.pending, { color: colors.textSecondary }]}>{statusNote}</BalancedText>
|
|
293
|
+
)}
|
|
291
294
|
|
|
292
295
|
{!!firstHoldNote && (
|
|
293
296
|
<Text
|
|
@@ -342,10 +345,9 @@ const styles = StyleSheet.create({
|
|
|
342
345
|
alignSelf: 'stretch',
|
|
343
346
|
alignItems: 'center'
|
|
344
347
|
},
|
|
348
|
+
// the display ramp exactly, which this used to restate by hand
|
|
345
349
|
amount: {
|
|
346
|
-
|
|
347
|
-
lineHeight: 52,
|
|
348
|
-
fontWeight: '700',
|
|
350
|
+
...typography.display,
|
|
349
351
|
textAlign: 'center'
|
|
350
352
|
},
|
|
351
353
|
support: {
|
|
@@ -587,7 +587,10 @@ function UniversalSendInner(
|
|
|
587
587
|
setRegistrySearching(true)
|
|
588
588
|
const timer = setTimeout(async () => {
|
|
589
589
|
try {
|
|
590
|
-
|
|
590
|
+
// A complete address whose key is not the one pinned here comes back
|
|
591
|
+
// flagged `changedFrom` (XR-071). This screen has no key-change
|
|
592
|
+
// warning, so such a row is dropped, as before the flag existed.
|
|
593
|
+
const rows = (await registryClient.search(query)).filter(row => !row.changedFrom)
|
|
591
594
|
if (cancelled) return
|
|
592
595
|
setRegistryMatches(rows)
|
|
593
596
|
setRegistryError(false)
|
|
@@ -25,6 +25,7 @@ import Animated, {
|
|
|
25
25
|
useReducedMotion
|
|
26
26
|
} from 'react-native-reanimated'
|
|
27
27
|
import { useTheme, spacing, radii, typography, springs, durations, haptics } from '@bsv/expo-wallet-toolbox'
|
|
28
|
+
import { BalancedText } from './BalancedText'
|
|
28
29
|
|
|
29
30
|
export interface AlertButton {
|
|
30
31
|
text: string
|
|
@@ -167,9 +168,9 @@ export function AlertHost() {
|
|
|
167
168
|
<Animated.View
|
|
168
169
|
style={[styles.card, { backgroundColor: colors.sheetBackground, borderColor: colors.separator }, cardStyle]}
|
|
169
170
|
>
|
|
170
|
-
<
|
|
171
|
+
<BalancedText style={[styles.title, { color: colors.textPrimary }]}>{current.title}</BalancedText>
|
|
171
172
|
{!!current.message && (
|
|
172
|
-
<
|
|
173
|
+
<BalancedText style={[styles.message, { color: colors.textSecondary }]}>{current.message}</BalancedText>
|
|
173
174
|
)}
|
|
174
175
|
<View
|
|
175
176
|
style={[styles.buttonGroup, { borderTopColor: colors.separator }, !sideBySide && styles.buttonGroupStacked]}
|