@bsv/expo-wallet-toolbox 0.22.0 → 0.24.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 +241 -0
- package/README.md +10 -9
- package/android/build.gradle +15 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/org/bsv/boundedfetch/BoundedBody.java +19 -0
- package/android/src/main/java/org/bsv/boundedfetch/BoundedConnection.java +28 -0
- package/android/src/main/java/org/bsv/boundedfetch/BsvBoundedFetchModule.kt +114 -0
- package/core/backup/RemoteSyncReader.ts +71 -46
- package/core/backup/client.ts +6 -15
- package/core/backup/codec.ts +78 -13
- package/core/backup/constants.ts +3 -9
- package/core/backup/cursor.ts +8 -0
- package/core/backup/push.ts +26 -16
- package/core/backup/restore.ts +6 -5
- package/core/bridge/BrowserBridgeProvider.tsx +273 -0
- package/core/bridge/bindings.ts +459 -0
- package/core/bridge/conformance.ts +222 -0
- package/core/bridge/consent.ts +494 -0
- package/core/bridge/consentSheetSource.ts +98 -0
- package/core/bridge/dispatcher.ts +621 -0
- package/core/bridge/inbox.ts +569 -0
- package/core/bridge/index.ts +48 -0
- package/core/bridge/loopback/cors.ts +57 -0
- package/core/bridge/loopback/endpoints.ts +11 -0
- package/core/bridge/loopback/hostCheck.ts +25 -0
- package/core/bridge/loopback/index.ts +7 -0
- package/core/bridge/loopback/launchProof.ts +166 -0
- package/core/bridge/loopback/router.ts +770 -0
- package/core/bridge/loopback/routerTypes.ts +115 -0
- package/core/bridge/loopback/status.ts +52 -0
- package/core/bridge/memoryInboxStore.ts +231 -0
- package/core/bridge/permissionPolicy.ts +247 -0
- package/core/bridge/policy.ts +72 -0
- package/core/bridge/protocol/base64url.ts +64 -0
- package/core/bridge/protocol/connectionError.ts +79 -0
- package/core/bridge/protocol/constants.ts +21 -0
- package/core/bridge/protocol/continuity.ts +21 -0
- package/core/bridge/protocol/descriptor.ts +395 -0
- package/core/bridge/protocol/envelopes.ts +188 -0
- package/core/bridge/protocol/errorCodec.ts +164 -0
- package/core/bridge/protocol/json.ts +237 -0
- package/core/bridge/protocol/limits.ts +43 -0
- package/core/bridge/protocol/methods.ts +55 -0
- package/core/bridge/protocol/origin.ts +130 -0
- package/core/bridge/runtime.ts +642 -0
- package/core/bridge/runtimeFlags.ts +34 -0
- package/core/bridge/testing/conformanceCases.ts +149 -0
- package/core/bridge/testing/pageClient.ts +44 -0
- package/core/bridge/unverifiedManager.ts +97 -0
- package/core/bridge/unverifiedOriginator.ts +79 -0
- package/core/config.tsx +1 -16
- package/core/constants.ts +7 -11
- package/core/context/WalletConnectionContext.tsx +92 -49
- package/core/context/WalletContext.tsx +288 -165
- package/core/context/sessionTeardown.ts +46 -0
- package/core/context/usePairingAttempt.ts +31 -0
- package/core/e2e/broadcaster.ts +25 -0
- package/core/e2e/consentFixture.ts +46 -0
- package/core/e2e/mode.ts +42 -0
- package/core/headers/OfflineFirstChaintracks.ts +57 -107
- package/core/headers/headerConsensus.ts +230 -0
- package/core/headers/headerStore.ts +344 -122
- package/core/headers/prewarm.ts +4 -7
- package/core/headers/syncHeaders.ts +82 -12
- package/core/hooks/usePermissionQueue.ts +89 -34
- package/core/i18n/translations.tsx +958 -24
- package/core/identity/handleRegistry/client.ts +4 -2
- package/core/identity/handleRegistry/resolver.ts +7 -11
- package/core/index.ts +17 -0
- package/core/localpay/pending.ts +39 -4
- package/core/network/boundedFetch.ts +101 -0
- package/core/networks.ts +11 -13
- package/core/pay/rails/address.ts +5 -4
- package/core/pay/rails/handle.ts +3 -1
- package/core/pay/rails/sweep.ts +791 -0
- package/core/peerpay/brc29.ts +4 -0
- package/core/peerpay/handleResendRequests.ts +15 -2
- package/core/peerpay/outbox.ts +115 -2
- package/core/profiles/assertProfileEmpty.ts +2 -2
- package/core/profiles/profileStore.ts +3 -2
- package/core/services/arcadeBroadcastProvider.ts +260 -114
- package/core/services/autoApprovePolicy.ts +7 -1
- package/core/services/capWalletArgs.ts +2 -1
- package/core/services/permissionPrompts.ts +132 -0
- package/core/services/secrets/kek.ts +5 -0
- package/core/services/secrets/migration.ts +27 -2
- package/core/services/secrets/policy.ts +6 -0
- package/core/services/signingPermissionPolicy.ts +230 -2
- package/core/services/vault/VaultKeyService.ts +5 -2
- package/core/services/vault/ceremony.ts +2 -2
- package/core/services/vault/ceremonyHost.ts +1 -1
- package/core/services/vault/guard.ts +20 -0
- package/core/services/vault/outputAuthority.ts +76 -0
- package/core/services/vault/transfers.ts +52 -28
- package/core/services/vault/vaultStore.ts +60 -14
- package/core/services/walletArgLimits.ts +17 -2
- package/core/services/walletConnectionValidation.ts +13 -1
- package/core/services/walletServiceConfig.ts +8 -7
- package/core/storage/encryptedDbImage.ts +325 -0
- package/core/stores/ConnectionStore.ts +17 -0
- package/core/toolboxConfig.ts +78 -2
- package/expo-module.config.json +5 -0
- package/ios/BoundedBody.swift +15 -0
- package/ios/BsvBoundedFetch.podspec +17 -0
- package/ios/BsvBoundedFetchModule.swift +121 -0
- package/package.json +12 -8
- package/ui/bridgeSheet/ContextRelay.tsx +86 -0
- package/ui/bridgeSheet/relayedContexts.ts +21 -0
- package/ui/components/pay/AddressReceive.tsx +6 -2
- package/ui/components/pay/ImportedOutboxApproval.tsx +142 -0
- package/ui/components/pay/PayCellRow.tsx +3 -1
- package/ui/components/pay/PayForm.tsx +12 -2
- package/ui/components/pay/RecipientField.tsx +1 -0
- package/ui/components/pay/RequestHub.tsx +1 -0
- package/ui/components/pay/UniversalSend.tsx +110 -42
- package/ui/components/ui/ListRow.tsx +10 -2
- package/ui/components/ui/PermissionSheet.tsx +534 -158
- package/ui/components/ui/Sheet.tsx +59 -7
- package/ui/components/ui/sheetResumeSignal.ts +19 -0
- package/ui/components/vault/KeyChooser.tsx +1 -1
- package/ui/components/wallet/AmountInput.tsx +4 -1
- package/ui/components/wallet/BackupReminderSheet.tsx +8 -1
- package/ui/components/wallet/BiometricAdvisoryModal.tsx +2 -0
- package/ui/components/wallet/ImportFromBackupPrompt.tsx +6 -1
- package/ui/components/wallet/ProfileButton.tsx +1 -0
- package/ui/exportDatabases.ts +94 -5
- package/ui/hooks/useExportWalletData.ts +37 -24
- package/ui/importDatabases.ts +154 -34
- package/ui/index.ts +4 -0
- package/ui/screens/ConnectionsScreen.tsx +12 -3
- package/ui/screens/PairScreen.tsx +10 -3
- package/ui/screens/PayScreen.tsx +1 -0
- package/ui/screens/TrustScreen.tsx +6 -3
- package/ui/screens/VaultScreen.tsx +13 -3
- package/ui/screens/VaultTransferScreen.tsx +6 -3
- package/ui/screens/WalletConfigScreen.tsx +30 -3
- package/ui/screens/WalletHomeScreen.tsx +7 -1
|
@@ -71,6 +71,7 @@ import { PrivateKey } from '@bsv/sdk'
|
|
|
71
71
|
import { useExportWalletData } from '../hooks/useExportWalletData'
|
|
72
72
|
import { importWalletDatabase } from '../importDatabases'
|
|
73
73
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
74
|
+
import { isE2eBuild } from '../../core/e2e/mode'
|
|
74
75
|
import { profileScopedKey } from '../../core/profiles/profileStore'
|
|
75
76
|
import { profileLabel } from '../../core/profiles/profileLabel'
|
|
76
77
|
import { NETWORKS } from '../../core/networks'
|
|
@@ -436,7 +437,10 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
436
437
|
if (isImporting) return
|
|
437
438
|
setIsImporting(true)
|
|
438
439
|
try {
|
|
439
|
-
const result = await importWalletDatabase(storage
|
|
440
|
+
const result = await importWalletDatabase(storage, {
|
|
441
|
+
wallet: managers.permissionsManager,
|
|
442
|
+
originator: adminOriginator
|
|
443
|
+
})
|
|
440
444
|
if (result.imported) {
|
|
441
445
|
showToast(t('import_success'), { type: 'success' })
|
|
442
446
|
// Not restoreFromBackup: a raw db import already carries a complete
|
|
@@ -533,9 +537,10 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
533
537
|
{ id: 'teratest', label: t('teratest'), color: colors.info },
|
|
534
538
|
{ id: 'scaletest', label: t('scaletest'), color: colors.accent }
|
|
535
539
|
] as { id: AppChain; label: string; color: string }[]
|
|
536
|
-
).filter(n => NETWORKS[n.id].available || n.id === selectedNetwork)
|
|
540
|
+
).filter(n => (isE2eBuild() ? n.id !== 'main' : true) && (NETWORKS[n.id].available || n.id === selectedNetwork))
|
|
537
541
|
|
|
538
542
|
const handleSelectNetwork = async (target: AppChain) => {
|
|
543
|
+
if (isE2eBuild() && target === 'main') return
|
|
539
544
|
if (target === selectedNetwork) {
|
|
540
545
|
setNetworkExpanded(false)
|
|
541
546
|
return
|
|
@@ -555,7 +560,13 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
555
560
|
<View style={{ flex: 1, backgroundColor: colors.backgroundSecondary, paddingTop: insets.top }}>
|
|
556
561
|
{/* Header */}
|
|
557
562
|
<View style={[localStyles.header, { borderBottomColor: colors.separator }]}>
|
|
558
|
-
<TouchableOpacity
|
|
563
|
+
<TouchableOpacity
|
|
564
|
+
onPress={() => router.back()}
|
|
565
|
+
testID="settings-back"
|
|
566
|
+
accessibilityRole="button"
|
|
567
|
+
accessibilityLabel={t('go_back')}
|
|
568
|
+
style={localStyles.headerBack}
|
|
569
|
+
>
|
|
559
570
|
<Ionicons name="chevron-back" size={24} color={colors.textSecondary} />
|
|
560
571
|
</TouchableOpacity>
|
|
561
572
|
<Text style={[localStyles.headerTitle, { color: colors.textPrimary }]}>{t('settings')}</Text>
|
|
@@ -608,6 +619,7 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
608
619
|
</View>
|
|
609
620
|
)}
|
|
610
621
|
<ListRow
|
|
622
|
+
testID="settings-connections"
|
|
611
623
|
label={t('connect_to_app')}
|
|
612
624
|
icon="qr-code-outline"
|
|
613
625
|
iconColor="#0A84FF"
|
|
@@ -617,6 +629,7 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
617
629
|
reaches for when something looks wrong, and they must not have to
|
|
618
630
|
open a section labelled "Advanced" to find it. */}
|
|
619
631
|
<ListRow
|
|
632
|
+
testID="settings-troubleshooting"
|
|
620
633
|
label={t('check_wallet')}
|
|
621
634
|
icon="checkmark-done-circle-outline"
|
|
622
635
|
iconColor="#30D158"
|
|
@@ -628,6 +641,7 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
628
641
|
{/* ── Advanced ── */}
|
|
629
642
|
<GroupedSection>
|
|
630
643
|
<ListRow
|
|
644
|
+
testID="settings-advanced"
|
|
631
645
|
label={t('advanced')}
|
|
632
646
|
icon="construct-outline"
|
|
633
647
|
iconColor="#8E8E93"
|
|
@@ -654,6 +668,7 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
654
668
|
}
|
|
655
669
|
>
|
|
656
670
|
<ListRow
|
|
671
|
+
testID="settings-network"
|
|
657
672
|
label={t('bsv_network')}
|
|
658
673
|
value={
|
|
659
674
|
switchingNetwork
|
|
@@ -898,6 +913,7 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
898
913
|
</View>
|
|
899
914
|
)}
|
|
900
915
|
<ListRow
|
|
916
|
+
testID="settings-trust"
|
|
901
917
|
label={t('trust_network')}
|
|
902
918
|
icon="shield-checkmark-outline"
|
|
903
919
|
iconColor="#BF5AF2"
|
|
@@ -995,6 +1011,15 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
995
1011
|
showChevron={false}
|
|
996
1012
|
trailing={exporting ? <ActivityIndicator size="small" /> : undefined}
|
|
997
1013
|
/>
|
|
1014
|
+
{__DEV__ && (
|
|
1015
|
+
<ListRow
|
|
1016
|
+
label="Export Wallet Data (unencrypted)"
|
|
1017
|
+
icon="share-outline"
|
|
1018
|
+
iconColor="#8E8E93"
|
|
1019
|
+
onPress={() => void exportData({ encrypt: false })}
|
|
1020
|
+
showChevron={false}
|
|
1021
|
+
/>
|
|
1022
|
+
)}
|
|
998
1023
|
<ListRow
|
|
999
1024
|
label={t('import_wallet_data')}
|
|
1000
1025
|
icon="download-outline"
|
|
@@ -1004,6 +1029,7 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
1004
1029
|
trailing={isImporting ? <ActivityIndicator size="small" /> : undefined}
|
|
1005
1030
|
/>
|
|
1006
1031
|
<ListRow
|
|
1032
|
+
testID="settings-logs"
|
|
1007
1033
|
label="Debugging"
|
|
1008
1034
|
icon="terminal-outline"
|
|
1009
1035
|
iconColor="#8E8E93"
|
|
@@ -1049,6 +1075,7 @@ export function WalletConfigScreen({ hideLogout = false }: { hideLogout?: boolea
|
|
|
1049
1075
|
{!hideLogout && (
|
|
1050
1076
|
<GroupedSection>
|
|
1051
1077
|
<ListRow
|
|
1078
|
+
testID="settings-log-out"
|
|
1052
1079
|
label={t('log_out')}
|
|
1053
1080
|
icon="log-out-outline"
|
|
1054
1081
|
iconColor={colors.error}
|
|
@@ -1741,6 +1741,7 @@ export function WalletHomeScreen({ topLeft }: WalletHomeScreenProps = {}) {
|
|
|
1741
1741
|
onPress={heldAsset ? undefined : () => setFlipped(f => !f)}
|
|
1742
1742
|
disabled={Boolean(heldAsset)}
|
|
1743
1743
|
activeOpacity={0.7}
|
|
1744
|
+
testID="home-balance"
|
|
1744
1745
|
style={styles.balanceBlock}
|
|
1745
1746
|
accessibilityLabel={
|
|
1746
1747
|
heldAsset
|
|
@@ -1798,6 +1799,7 @@ export function WalletHomeScreen({ topLeft }: WalletHomeScreenProps = {}) {
|
|
|
1798
1799
|
<PressableScale
|
|
1799
1800
|
haptic="confirm"
|
|
1800
1801
|
onPress={() => destinationPress(payDestination('pay'))}
|
|
1802
|
+
testID="home-pay"
|
|
1801
1803
|
style={[styles.dest, styles.destPrimary, { backgroundColor: colors.accent }]}
|
|
1802
1804
|
>
|
|
1803
1805
|
<MaterialCommunityIcons name="arrow-top-right" size={19} color={colors.textOnAccent} />
|
|
@@ -1809,6 +1811,7 @@ export function WalletHomeScreen({ topLeft }: WalletHomeScreenProps = {}) {
|
|
|
1809
1811
|
<PressableScale
|
|
1810
1812
|
haptic="confirm"
|
|
1811
1813
|
onPress={() => destinationPress(payDestination('get'))}
|
|
1814
|
+
testID="home-receive"
|
|
1812
1815
|
style={[styles.dest, { backgroundColor: colors.surfaceRaised, borderColor: colors.surfaceRaisedBorder }]}
|
|
1813
1816
|
>
|
|
1814
1817
|
<MaterialCommunityIcons name="arrow-bottom-left" size={19} color={colors.textPrimary} />
|
|
@@ -1830,6 +1833,7 @@ export function WalletHomeScreen({ topLeft }: WalletHomeScreenProps = {}) {
|
|
|
1830
1833
|
<PressableScale
|
|
1831
1834
|
haptic="confirm"
|
|
1832
1835
|
onPress={() => router.push('/vault')}
|
|
1836
|
+
testID="home-vault"
|
|
1833
1837
|
style={[styles.dest, { backgroundColor: colors.surfaceRaised, borderColor: colors.surfaceRaisedBorder }]}
|
|
1834
1838
|
>
|
|
1835
1839
|
<MaterialCommunityIcons name="safe" size={19} color={colors.textPrimary} />
|
|
@@ -1966,6 +1970,7 @@ export function WalletHomeScreen({ topLeft }: WalletHomeScreenProps = {}) {
|
|
|
1966
1970
|
controls is on screen, so the button says it is on. */}
|
|
1967
1971
|
<TouchableOpacity
|
|
1968
1972
|
onPress={toggleFilter}
|
|
1973
|
+
testID="activity-filter"
|
|
1969
1974
|
// Never disabled while open: an emptied list (a network switch)
|
|
1970
1975
|
// must not strand the panel with no way to close it.
|
|
1971
1976
|
disabled={actions.length === 0 && !filterOpen}
|
|
@@ -2159,6 +2164,7 @@ export function WalletHomeScreen({ topLeft }: WalletHomeScreenProps = {}) {
|
|
|
2159
2164
|
<View style={[styles.headerSide, styles.headerSideEnd]}>
|
|
2160
2165
|
<TouchableOpacity
|
|
2161
2166
|
onPress={() => router.push('/wallet-config')}
|
|
2167
|
+
testID="home-settings"
|
|
2162
2168
|
style={[styles.iconBtn, { backgroundColor: colors.surfaceRaised, borderColor: colors.surfaceRaisedBorder }]}
|
|
2163
2169
|
accessibilityRole="button"
|
|
2164
2170
|
accessibilityLabel={t('wallet_settings')}
|
|
@@ -2214,7 +2220,7 @@ export function WalletHomeScreen({ topLeft }: WalletHomeScreenProps = {}) {
|
|
|
2214
2220
|
<ActivityIndicator style={styles.pad} color={colors.textSecondary} />
|
|
2215
2221
|
)
|
|
2216
2222
|
) : (
|
|
2217
|
-
<Text style={[styles.empty, { color: colors.textSecondary }]}>
|
|
2223
|
+
<Text testID="activity-empty" style={[styles.empty, { color: colors.textSecondary }]}>
|
|
2218
2224
|
{heldAsset
|
|
2219
2225
|
? t('wallet_activity_empty_asset', { ticker: heldAsset.asset.ticker })
|
|
2220
2226
|
: t('no_transactions')}
|