@bsv/expo-wallet-toolbox 0.4.0 → 0.5.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 +292 -0
- package/README.md +0 -1
- package/assets/sounds/vault-deposit.wav +0 -0
- package/assets/sounds/vault-withdraw.wav +0 -0
- package/core/config.tsx +9 -1
- package/core/context/VaultContext.tsx +8 -11
- package/core/context/WalletConnectionContext.tsx +137 -52
- package/core/context/WalletContext.tsx +409 -20
- package/core/hooks/useConfirmationSound.ts +14 -8
- package/core/i18n/translations.tsx +3368 -952
- package/core/index.ts +97 -14
- package/core/localpay/build.ts +674 -37
- package/core/localpay/codec.ts +68 -5
- package/core/localpay/pending.ts +240 -22
- package/core/localpay/settlementAck.ts +149 -0
- package/core/localpay/types.ts +14 -1
- package/core/localpay/verify.ts +118 -69
- package/core/mandala/abortGuard.ts +134 -0
- package/core/mandala/basketMigration.ts +166 -0
- package/core/mandala/bundle.ts +244 -0
- package/core/mandala/createRuntime.ts +2437 -0
- package/core/mandala/drain.ts +670 -0
- package/core/mandala/permissionModule.ts +642 -0
- package/core/mandala/resendTransfer.ts +175 -0
- package/core/mandala/runtime.ts +357 -0
- package/core/mandala/settlementStore.ts +412 -0
- package/core/mandala/types.ts +290 -0
- package/core/offline/cancelParked.ts +94 -1
- package/core/offline/payerHold.ts +152 -12
- package/core/offline/tokenFrames.ts +197 -0
- package/core/parsePeerPayURI.ts +70 -17
- package/core/pay/rails/address.ts +51 -3
- package/core/pay/rails/handle.ts +88 -9
- package/core/pay/rails/index.ts +16 -6
- package/core/pay/rails/nearby.ts +114 -4
- package/core/services/capWalletArgs.ts +8 -9
- package/core/services/externalOrigin.ts +39 -0
- package/core/services/vault/VaultKeyService.ts +912 -251
- package/core/services/vault/ceremony.ts +435 -367
- package/core/services/vault/ceremonyHost.ts +27 -21
- package/core/services/vault/devMock.ts +30 -7
- package/core/services/vault/driver.ts +95 -41
- package/core/services/vault/guard.ts +514 -56
- package/core/services/vault/hardwareLease.ts +22 -0
- package/core/services/vault/mockYubiKey.ts +258 -90
- package/core/services/vault/pivReset.ts +145 -0
- package/core/services/vault/r1comb.ts +976 -0
- package/core/services/vault/session.ts +93 -26
- package/core/services/vault/transfers.ts +2617 -747
- package/core/services/vault/types.ts +100 -43
- package/core/services/vault/vaultStore.ts +991 -74
- package/core/services/walletConnectionValidation.ts +293 -0
- package/core/storage/StorageExpoSQLite.ts +382 -56
- package/core/storage/dbImage.ts +48 -0
- package/core/storage/methods/findSql.ts +0 -54
- package/core/storage/methods/listOutputsSql.ts +7 -3
- package/core/storage/methods/offlineActions.ts +15 -0
- package/core/storage/methods/processOfflineActions.ts +263 -6
- package/core/storage/methods/walletBalanceSql.ts +16 -4
- package/core/storage/schema/createTables.ts +123 -0
- package/core/storage/sqlUpdateValue.ts +24 -0
- package/core/toolboxConfig.ts +112 -1
- package/core/walletRepair/runWalletCheck.ts +19 -2
- package/package.json +25 -24
- package/ui/components/QRScanner.tsx +1 -1
- package/ui/components/pay/AdmissionNotice.tsx +99 -0
- package/ui/components/pay/AssetPicker.tsx +184 -0
- package/ui/components/pay/AvailableBalance.tsx +33 -2
- package/ui/components/pay/HandleReceive.tsx +213 -50
- package/ui/components/pay/NearbyFlow.tsx +616 -69
- package/ui/components/pay/PayForm.tsx +73 -8
- package/ui/components/pay/PaymentSuccessOverlay.tsx +43 -2
- package/ui/components/pay/RecipientField.tsx +49 -4
- package/ui/components/pay/RequestHub.tsx +68 -8
- package/ui/components/pay/ResultBanner.tsx +41 -4
- package/ui/components/pay/UniversalSend.tsx +534 -30
- package/ui/components/pay/tokenSendCopy.ts +116 -0
- package/ui/components/pay/useRecipientInput.ts +36 -7
- package/ui/components/ui/PermissionSheet.tsx +65 -4
- package/ui/components/ui/Sheet.tsx +9 -2
- package/ui/components/vault/EnrollWizard.tsx +1432 -488
- package/ui/components/vault/KeyChooser.tsx +96 -0
- package/ui/components/vault/VaultCeremonySheet.tsx +107 -43
- package/ui/components/vault/vaultErrorCopy.ts +145 -0
- package/ui/components/wallet/ActivityRow.tsx +101 -17
- package/ui/components/wallet/AmountInput.tsx +77 -25
- package/ui/components/wallet/AssetAmount.tsx +95 -0
- package/ui/components/wallet/AssetSwitcherDropdown.tsx +261 -0
- package/ui/components/wallet/tokenEviction.ts +65 -0
- package/ui/hooks/useExportWalletData.ts +39 -0
- package/ui/hooks/useMandala.ts +303 -0
- package/ui/hooks/useVaultBalance.ts +105 -7
- package/ui/hooks/useVaultCoverage.ts +52 -0
- package/ui/importDatabases.ts +7 -3
- package/ui/index.ts +50 -7
- package/ui/screens/ConnectionsScreen.tsx +46 -29
- package/ui/screens/PairScreen.tsx +12 -12
- package/ui/screens/PayScreen.tsx +130 -10
- package/ui/screens/SettingsScreen.tsx +18 -9
- package/ui/screens/VaultScreen.tsx +925 -171
- package/ui/screens/VaultTransferScreen.tsx +376 -123
- package/ui/screens/WalletCheckScreen.tsx +10 -1
- package/ui/screens/WalletConfigScreen.tsx +38 -16
- package/ui/screens/WalletHomeScreen.tsx +417 -86
- package/ui/screens/homeBadges.ts +9 -1
- package/ui/screens/tokenRowTitle.ts +68 -0
- package/ui/tokenFormat.ts +108 -0
- package/ui/tokenSeen.ts +75 -0
- package/ui/tokenStatus.ts +79 -0
- package/assets/sounds/vault-close.wav +0 -0
- package/assets/sounds/vault-open.wav +0 -0
- package/core/services/vault/k1.ts +0 -75
- package/core/services/vault/sealing.ts +0 -84
- package/core/services/vault/vaultDerivation.ts +0 -152
- package/core/services/vault/vaultPassphrase.ts +0 -287
- package/ui/components/vault/PassphraseField.tsx +0 -306
- package/ui/components/vault/PhraseBackupSheet.tsx +0 -227
- package/ui/screens/VaultRecoverScreen.tsx +0 -226
package/core/index.ts
CHANGED
|
@@ -32,9 +32,13 @@ export {
|
|
|
32
32
|
isToolboxConfigured,
|
|
33
33
|
getBackupUrl,
|
|
34
34
|
getServiceConfig,
|
|
35
|
+
getMandalaEndpoints,
|
|
36
|
+
isMandalaAvailable,
|
|
37
|
+
isVaultEnabled,
|
|
38
|
+
isVaultAvailable,
|
|
35
39
|
resetToolboxConfig
|
|
36
40
|
} from './toolboxConfig'
|
|
37
|
-
export type { ToolboxConfig, ToolboxServiceConfig } from './toolboxConfig'
|
|
41
|
+
export type { ToolboxConfig, ToolboxServiceConfig, MandalaEndpointConfig } from './toolboxConfig'
|
|
38
42
|
|
|
39
43
|
// Theme tokens and providers
|
|
40
44
|
export { ThemeProvider, useTheme } from './theme/ThemeContext'
|
|
@@ -94,18 +98,89 @@ export * from './offline/hold'
|
|
|
94
98
|
export * from './offline/order'
|
|
95
99
|
export * from './offline/plan'
|
|
96
100
|
export * from './offline/payerHold'
|
|
101
|
+
export * from './offline/tokenFrames'
|
|
102
|
+
export {
|
|
103
|
+
cancelParkedPayment,
|
|
104
|
+
type CancelParkedOutcome,
|
|
105
|
+
type CancelParkedStorage,
|
|
106
|
+
type CancelParkedWallet,
|
|
107
|
+
type CancelParkedSettlementDeps
|
|
108
|
+
} from './offline/cancelParked'
|
|
109
|
+
|
|
110
|
+
// Mandala token settlement — the four evidence tables, and the
|
|
111
|
+
// submit-before-broadcast drain over them.
|
|
112
|
+
export * from './mandala/types'
|
|
113
|
+
export { createSettlementStore, type SettlementDb, type SqlSettlementStore } from './mandala/settlementStore'
|
|
114
|
+
// Guard #4: an abortAction may not release the inputs of a token payment the
|
|
115
|
+
// overlay already has (the 2026-09-15 incident).
|
|
116
|
+
export {
|
|
117
|
+
abortIsBlockedBy,
|
|
118
|
+
wrapAbortActionForSettlements,
|
|
119
|
+
ABORT_BLOCKED_SETTLEMENT_STATES,
|
|
120
|
+
type AbortableManager,
|
|
121
|
+
type SettlementStoreLookup
|
|
122
|
+
} from './mandala/abortGuard'
|
|
123
|
+
export {
|
|
124
|
+
deriveTokenEdges,
|
|
125
|
+
isRetriableInternalizeFailure,
|
|
126
|
+
listStuckSettlements,
|
|
127
|
+
populateEvidenceFromFrame,
|
|
128
|
+
postTokenStep,
|
|
129
|
+
reconcileSettlements,
|
|
130
|
+
NON_TERMINAL_SETTLEMENT_STATES,
|
|
131
|
+
TERMINAL_SETTLEMENT_STATES,
|
|
132
|
+
type EvidenceFrame,
|
|
133
|
+
type EvidencePopulated,
|
|
134
|
+
type EvidenceTokenBlock,
|
|
135
|
+
type EvidenceTrustAnchor,
|
|
136
|
+
type TokenFrameSource,
|
|
137
|
+
type TokenStepDeps
|
|
138
|
+
} from './mandala/drain'
|
|
139
|
+
// The runtime the UI consumes: its pure interface, and its one construction
|
|
140
|
+
// site. `useMandala()` reads `useWallet().mandala`; nothing above this line in
|
|
141
|
+
// an app may import `@bsv/mandala` itself.
|
|
142
|
+
export type {
|
|
143
|
+
MandalaRuntime,
|
|
144
|
+
TokenActivityRow,
|
|
145
|
+
TokenActivityStatus,
|
|
146
|
+
TokenAssetInfo,
|
|
147
|
+
TokenBalance,
|
|
148
|
+
TokenSendResult
|
|
149
|
+
} from './mandala/runtime'
|
|
150
|
+
export {
|
|
151
|
+
activityStatusOf,
|
|
152
|
+
bindOriginator,
|
|
153
|
+
createMandalaKvStorage,
|
|
154
|
+
createMandalaRuntime,
|
|
155
|
+
verdictFromError,
|
|
156
|
+
type CreateMandalaRuntimeArgs,
|
|
157
|
+
type MandalaKvStorage,
|
|
158
|
+
type MandalaMessageBox
|
|
159
|
+
} from './mandala/createRuntime'
|
|
160
|
+
export {
|
|
161
|
+
assembleBundle,
|
|
162
|
+
coverFromFrame,
|
|
163
|
+
tokenParentsOf,
|
|
164
|
+
type AdmissionBundle,
|
|
165
|
+
type BundleStore,
|
|
166
|
+
type CoverBundle,
|
|
167
|
+
type CoverTip,
|
|
168
|
+
type CoverVerifier
|
|
169
|
+
} from './mandala/bundle'
|
|
97
170
|
|
|
98
171
|
// Local SQLite storage layer
|
|
99
172
|
export { StorageExpoSQLite } from './storage/StorageExpoSQLite'
|
|
100
|
-
export type { StorageExpoSQLiteOptions } from './storage/StorageExpoSQLite'
|
|
101
|
-
export { createTables, ensureOfflineActionsColumns } from './storage/schema/createTables'
|
|
173
|
+
export type { StorageExpoSQLiteOptions, TokenTransactionRepair } from './storage/StorageExpoSQLite'
|
|
174
|
+
export { createTables, ensureOfflineActionsColumns, ensureTokenSettlementColumns } from './storage/schema/createTables'
|
|
102
175
|
export { initializeLocalStorage, isLocalStorage, getStorageDisplayName } from './storage/LocalStorageAdapter'
|
|
103
176
|
export type { LocalStorageConfig } from './storage/LocalStorageAdapter'
|
|
104
|
-
export { findOfflineActions, updateOfflineAction } from './storage/methods/offlineActions'
|
|
177
|
+
export { findOfflineActions, findOfflineActionByTxid, updateOfflineAction } from './storage/methods/offlineActions'
|
|
105
178
|
export type { OfflineActionRow, OfflineActionStatus, BindValue } from './storage/methods/offlineActions'
|
|
106
179
|
export { readWalletBalance } from './storage/methods/walletBalanceSql'
|
|
107
|
-
export { processOfflineActions } from './storage/methods/processOfflineActions'
|
|
180
|
+
export { processOfflineActions, type OfflineTokenDeps } from './storage/methods/processOfflineActions'
|
|
181
|
+
export { createMandalaSettlementTables } from './storage/schema/createTables'
|
|
108
182
|
export * from './storage/skipQueuedAncestors'
|
|
183
|
+
export { prepareSqliteImageForDeserialize } from './storage/dbImage'
|
|
109
184
|
|
|
110
185
|
// Local secrets storage
|
|
111
186
|
export {
|
|
@@ -234,6 +309,7 @@ export * from './services/walletServiceConfig'
|
|
|
234
309
|
export * from './services/arcadeBroadcastProvider'
|
|
235
310
|
export * from './services/walletArgLimits'
|
|
236
311
|
export * from './services/capWalletArgs'
|
|
312
|
+
export * from './services/externalOrigin'
|
|
237
313
|
|
|
238
314
|
// Encrypted wallet backup log
|
|
239
315
|
export * from './backup/RemoteSyncReader'
|
|
@@ -251,9 +327,11 @@ export * from './backup/restoreOnImport'
|
|
|
251
327
|
export * from './walletRepair/runWalletCheck'
|
|
252
328
|
export { TaskBackupPush } from './monitor/TaskBackupPush'
|
|
253
329
|
|
|
254
|
-
// Hardware vault: YubiKey PIV custody
|
|
255
|
-
//
|
|
256
|
-
//
|
|
330
|
+
// Hardware vault: YubiKey PIV custody (1-of-N P-256 comb vault, spec
|
|
331
|
+
// docs/superpowers/specs/2026-09-09-r1-comb-vault-design.md), ceremony state
|
|
332
|
+
// machine, the r1comb template module, session helper, transfers
|
|
333
|
+
// (deposit / withdraw / re-lock), wallet-and-chain-scoped SecureStore
|
|
334
|
+
// persistence, access guard, and backup attestation.
|
|
257
335
|
//
|
|
258
336
|
// 'driver.ts' and 'random.ts' both reach for a native module
|
|
259
337
|
// (react-native-yubikey, expo-crypto) with a `require(...)` INSIDE a
|
|
@@ -265,10 +343,7 @@ export * from './services/vault/types'
|
|
|
265
343
|
export * from './services/vault/driver'
|
|
266
344
|
export * from './services/vault/session'
|
|
267
345
|
export * from './services/vault/random'
|
|
268
|
-
export * from './services/vault/
|
|
269
|
-
export * from './services/vault/k1'
|
|
270
|
-
export * from './services/vault/vaultDerivation'
|
|
271
|
-
export * from './services/vault/vaultPassphrase'
|
|
346
|
+
export * from './services/vault/r1comb'
|
|
272
347
|
export * from './services/vault/vaultStore'
|
|
273
348
|
export * from './services/vault/mockYubiKey'
|
|
274
349
|
export * from './services/vault/devMock'
|
|
@@ -277,6 +352,7 @@ export * from './services/vault/backupAttestation'
|
|
|
277
352
|
export * from './services/vault/ceremony'
|
|
278
353
|
export * from './services/vault/ceremonyHost'
|
|
279
354
|
export * from './services/vault/VaultKeyService'
|
|
355
|
+
export * from './services/vault/pivReset'
|
|
280
356
|
export * from './services/vault/transfers'
|
|
281
357
|
|
|
282
358
|
// Connection/pairing state (QR-paired desktop sessions), the vault ceremony
|
|
@@ -315,6 +391,13 @@ export * from './hooks/useConfirmationSound'
|
|
|
315
391
|
// takes an optional onToast prop (see WalletContext.tsx's WalletContextToast
|
|
316
392
|
// type) rather than importing a ui Toast component directly — core must
|
|
317
393
|
// never import from ui, same boundary as VaultContext's onToast above.
|
|
318
|
-
export {
|
|
319
|
-
|
|
394
|
+
export {
|
|
395
|
+
WalletContextProvider,
|
|
396
|
+
useWallet,
|
|
397
|
+
WalletContext,
|
|
398
|
+
WalletManagersContext,
|
|
399
|
+
useWalletManagers,
|
|
400
|
+
useWalletStatus
|
|
401
|
+
} from './context/WalletContext'
|
|
402
|
+
export type { WalletManagersSlice, WalletStatusSlice } from './context/WalletContext'
|
|
320
403
|
export { usePermissionQueue } from './hooks/usePermissionQueue'
|