@bsv/expo-wallet-toolbox 0.21.0 → 0.23.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 +222 -0
- package/README.md +82 -13
- 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 +464 -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 +222 -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/contacts/contactActivity.ts +48 -28
- package/core/contacts/contactsStore.ts +2 -2
- package/core/context/WalletConnectionContext.tsx +7 -1
- package/core/context/WalletContext.tsx +420 -348
- package/core/context/sessionTeardown.ts +46 -0
- package/core/demo/demoAssets.ts +8 -10
- package/core/demo/demoLedger.ts +32 -38
- package/core/demo/demoMandalaRuntime.ts +67 -49
- package/core/demo/index.ts +1 -1
- package/core/hooks/usePermissionQueue.ts +89 -34
- package/core/i18n/translations.tsx +983 -12
- package/core/index.ts +70 -37
- package/core/localpay/build.ts +110 -569
- package/core/localpay/codec.ts +190 -93
- package/core/localpay/pending.ts +217 -202
- package/core/localpay/session.ts +99 -25
- package/core/localpay/types.ts +6 -5
- package/core/localpay/verify.ts +118 -173
- package/core/mandala/abortGuard.ts +97 -120
- package/core/mandala/accessPolicy.ts +133 -0
- package/core/mandala/assets.ts +370 -0
- package/core/mandala/colorGuard.ts +178 -0
- package/core/mandala/colorModule.ts +82 -0
- package/core/mandala/createRuntime.ts +483 -2392
- package/core/mandala/handle.ts +694 -0
- package/core/mandala/kvStore.ts +105 -0
- package/core/mandala/nearby.ts +185 -0
- package/core/mandala/receipt.ts +121 -0
- package/core/mandala/runtime.ts +166 -312
- package/core/mandala/settle.ts +540 -0
- package/core/mandala/transferJournal.ts +395 -0
- package/core/mandala/types.ts +61 -311
- package/core/networks.ts +5 -5
- package/core/offline/cancelParked.ts +80 -63
- package/core/offline/payerHold.ts +52 -118
- package/core/parsePeerPayURI.ts +25 -12
- package/core/pay/rails/handle.ts +15 -14
- package/core/pay/rails/index.ts +5 -3
- package/core/pay/rails/nearby.ts +25 -87
- package/core/profiles/assertProfileEmpty.ts +19 -10
- package/core/services/autoApprovePolicy.ts +7 -1
- package/core/services/capWalletArgs.ts +2 -1
- package/core/services/permissionPrompts.ts +132 -0
- package/core/services/signingPermissionPolicy.ts +230 -2
- package/core/services/vault/guard.ts +15 -4
- package/core/services/walletArgLimits.ts +17 -2
- package/core/storage/StorageExpoSQLite.ts +93 -229
- package/core/storage/encryptedDbImage.ts +325 -0
- package/core/storage/methods/processOfflineActions.ts +86 -136
- package/core/storage/schema/createTables.ts +9 -184
- package/core/toolboxConfig.ts +18 -1
- package/package.json +9 -8
- package/ui/bridgeSheet/ContextRelay.tsx +86 -0
- package/ui/bridgeSheet/relayedContexts.ts +21 -0
- package/ui/components/pay/AssetPicker.tsx +2 -2
- package/ui/components/pay/HandleReceive.tsx +4 -4
- package/ui/components/pay/NearbyFlow.tsx +324 -239
- package/ui/components/pay/RequestHub.tsx +10 -0
- package/ui/components/pay/UniversalSend.tsx +31 -28
- package/ui/components/pay/useRecipientInput.ts +2 -2
- package/ui/components/ui/PermissionSheet.tsx +625 -315
- package/ui/components/ui/Sheet.tsx +59 -7
- package/ui/components/ui/colorPrompt.ts +236 -0
- package/ui/components/ui/sheetResumeSignal.ts +19 -0
- package/ui/components/wallet/AmountInput.tsx +9 -6
- package/ui/components/wallet/AssetAmount.tsx +6 -6
- package/ui/components/wallet/AssetSwitcherDropdown.tsx +26 -7
- package/ui/components/wallet/Balance.tsx +3 -1
- package/ui/components/wallet/ContactActivityList.tsx +10 -13
- package/ui/components/wallet/tokenEviction.ts +9 -9
- package/ui/exportDatabases.ts +94 -5
- package/ui/hooks/useExportWalletData.ts +37 -24
- package/ui/hooks/useMandala.ts +6 -6
- package/ui/hooks/useSpendableBalance.ts +3 -1
- package/ui/importDatabases.ts +124 -29
- package/ui/index.ts +4 -0
- package/ui/screens/PayScreen.tsx +14 -20
- package/ui/screens/SettingsScreen.tsx +3 -1
- package/ui/screens/WalletCheckScreen.tsx +7 -2
- package/ui/screens/WalletConfigScreen.tsx +13 -1
- package/ui/screens/WalletHomeScreen.tsx +40 -14
- package/ui/screens/tokenRowTitle.ts +28 -15
- package/ui/tokenFormat.ts +133 -69
- package/ui/tokenStatus.ts +5 -8
- package/core/localpay/settlementAck.ts +0 -155
- package/core/mandala/basketMigration.ts +0 -166
- package/core/mandala/bundle.ts +0 -244
- package/core/mandala/drain.ts +0 -754
- package/core/mandala/inboxPrehold.ts +0 -193
- package/core/mandala/permissionModule.ts +0 -931
- package/core/mandala/resendTransfer.ts +0 -178
- package/core/mandala/settlementStore.ts +0 -434
- package/core/mandala/token.ts +0 -45
- package/core/offline/tokenFrames.ts +0 -197
package/core/index.ts
CHANGED
|
@@ -132,6 +132,8 @@ export * from './directpay/deviceStore'
|
|
|
132
132
|
export * from './directpay/receive'
|
|
133
133
|
export * from './directpay/DirectPayManager'
|
|
134
134
|
export * from './directpay/DirectPayProvider'
|
|
135
|
+
// The browser bridge's public API (BRC-185 core): see './bridge/index'.
|
|
136
|
+
export * from './bridge'
|
|
135
137
|
export * from './peerpay/outbox'
|
|
136
138
|
export * from './peerpay/control'
|
|
137
139
|
export * from './peerpay/handleResendRequests'
|
|
@@ -146,7 +148,6 @@ export * from './offline/hold'
|
|
|
146
148
|
export * from './offline/order'
|
|
147
149
|
export * from './offline/plan'
|
|
148
150
|
export * from './offline/payerHold'
|
|
149
|
-
export * from './offline/tokenFrames'
|
|
150
151
|
export {
|
|
151
152
|
cancelParkedPayment,
|
|
152
153
|
chainAlreadyKnows,
|
|
@@ -156,81 +157,113 @@ export {
|
|
|
156
157
|
type CancelParkedSettlementDeps
|
|
157
158
|
} from './offline/cancelParked'
|
|
158
159
|
|
|
159
|
-
//
|
|
160
|
-
//
|
|
160
|
+
// 1Color transfers — the journal types, the `color_transfers` journal (the
|
|
161
|
+
// one key for the broadcast hold and the abort refusal), and the one-time
|
|
162
|
+
// migration off the Mandala settlement tables.
|
|
161
163
|
export * from './mandala/types'
|
|
162
|
-
export {
|
|
164
|
+
export {
|
|
165
|
+
createTransferJournal,
|
|
166
|
+
migrateMandalaToColor,
|
|
167
|
+
COLOR_MIGRATION_MARKER,
|
|
168
|
+
type JournalDb,
|
|
169
|
+
type TransferJournal
|
|
170
|
+
} from './mandala/transferJournal'
|
|
163
171
|
// Guard #4: an abortAction may not release the inputs of a token payment the
|
|
164
172
|
// overlay already has (the 2026-09-15 incident).
|
|
165
173
|
export {
|
|
166
174
|
abortIsBlockedBy,
|
|
167
175
|
wrapAbortActionForSettlements,
|
|
168
|
-
|
|
176
|
+
ABORT_BLOCKED_TRANSFER_STATES,
|
|
169
177
|
type AbortableManager,
|
|
170
|
-
type
|
|
178
|
+
type TransferJournalLookup,
|
|
179
|
+
type TokenSettlementPossible
|
|
171
180
|
} from './mandala/abortGuard'
|
|
172
|
-
export {
|
|
173
|
-
deriveTokenEdges,
|
|
174
|
-
isRetriableInternalizeFailure,
|
|
175
|
-
listStuckSettlements,
|
|
176
|
-
populateEvidenceFromFrame,
|
|
177
|
-
postTokenStep,
|
|
178
|
-
reconcileSettlements,
|
|
179
|
-
NON_TERMINAL_SETTLEMENT_STATES,
|
|
180
|
-
TERMINAL_SETTLEMENT_STATES,
|
|
181
|
-
type EvidenceFrame,
|
|
182
|
-
type EvidencePopulated,
|
|
183
|
-
type EvidenceTokenBlock,
|
|
184
|
-
type EvidenceTrustAnchor,
|
|
185
|
-
type TokenFrameSource,
|
|
186
|
-
type TokenStepDeps
|
|
187
|
-
} from './mandala/drain'
|
|
188
181
|
// The runtime the UI consumes: its pure interface, and its one construction
|
|
189
182
|
// site. `useMandala()` reads `useWallet().mandala`; nothing above this line in
|
|
190
183
|
// an app may import `@bsv/mandala` itself.
|
|
191
184
|
export type {
|
|
192
185
|
MandalaRuntime,
|
|
186
|
+
NearbyTokenDeps,
|
|
193
187
|
TokenActivityRow,
|
|
194
188
|
TokenActivityStatus,
|
|
195
189
|
TokenAssetInfo,
|
|
190
|
+
TokenAssetStatus,
|
|
196
191
|
TokenBalance,
|
|
197
|
-
|
|
192
|
+
TokenHoldingsReview,
|
|
193
|
+
TokenSendResult,
|
|
194
|
+
TokenSettleState
|
|
198
195
|
} from './mandala/runtime'
|
|
196
|
+
export {
|
|
197
|
+
createAssetMetadata,
|
|
198
|
+
offlineUnitsOf,
|
|
199
|
+
readAvailable,
|
|
200
|
+
readInventory,
|
|
201
|
+
readPending,
|
|
202
|
+
shortAssetId,
|
|
203
|
+
type InventoryRecord
|
|
204
|
+
} from './mandala/assets'
|
|
199
205
|
export {
|
|
200
206
|
activityStatusOf,
|
|
201
207
|
bindOriginator,
|
|
202
208
|
createMandalaKvStorage,
|
|
203
209
|
createMandalaRuntime,
|
|
204
|
-
verdictFromError,
|
|
205
210
|
type CreateMandalaRuntimeArgs,
|
|
206
211
|
type MandalaKvStorage,
|
|
207
212
|
type MandalaMessageBox
|
|
208
213
|
} from './mandala/createRuntime'
|
|
214
|
+
// The BRC-207 color module as WalletContext registers it
|
|
215
|
+
// (`permissionModules.color`): the module with the Mandala issuer-v1 profile
|
|
216
|
+
// and the host ledger it credits from (B7), its `ColorModuleStore` over
|
|
217
|
+
// `key_value_store`, and the host consent policy. A host that builds its own
|
|
218
|
+
// permissions manager needs all of them to give `createMandalaRuntime` a
|
|
219
|
+
// module, a provider and a ledger.
|
|
220
|
+
export { buildColorModule, type BuildColorModuleArgs, type BuiltColorModule } from './mandala/colorModule'
|
|
221
|
+
export { createColorModuleStore, type WalletKv } from './mandala/kvStore'
|
|
209
222
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
type
|
|
214
|
-
type
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
createColorAccessPolicy,
|
|
224
|
+
colorPromptType,
|
|
225
|
+
COLOR_PROMPT_TYPES,
|
|
226
|
+
type ColorAccessPolicyOptions,
|
|
227
|
+
type ColorPromptType
|
|
228
|
+
} from './mandala/accessPolicy'
|
|
229
|
+
// A nearby token frame as the v4 hand-over body (B7, IC §7.3), and how a
|
|
230
|
+
// failed receipt is classified.
|
|
231
|
+
export {
|
|
232
|
+
bodyFromFrame,
|
|
233
|
+
isRetriableReceiptFailure,
|
|
234
|
+
isTransportReceiptFailure,
|
|
235
|
+
receiptFailureCode,
|
|
236
|
+
tokenPaymentOfHandover
|
|
237
|
+
} from './mandala/receipt'
|
|
238
|
+
export { createHandoverBodies, handoverBodyKey, type HandoverBodies } from './mandala/handle'
|
|
219
239
|
|
|
220
240
|
// Contacts
|
|
221
241
|
export { mergeContactCache, type ContactCache } from './contacts/contactCache'
|
|
222
242
|
|
|
223
243
|
// Local SQLite storage layer
|
|
224
244
|
export { StorageExpoSQLite } from './storage/StorageExpoSQLite'
|
|
225
|
-
export type { StorageExpoSQLiteOptions
|
|
226
|
-
export { createTables, ensureOfflineActionsColumns
|
|
245
|
+
export type { StorageExpoSQLiteOptions } from './storage/StorageExpoSQLite'
|
|
246
|
+
export { createTables, ensureOfflineActionsColumns } from './storage/schema/createTables'
|
|
227
247
|
export { findOfflineActions, findOfflineActionByTxid, updateOfflineAction } from './storage/methods/offlineActions'
|
|
228
248
|
export type { OfflineActionRow, OfflineActionStatus, BindValue } from './storage/methods/offlineActions'
|
|
229
249
|
export { readWalletBalance } from './storage/methods/walletBalanceSql'
|
|
230
|
-
export { processOfflineActions
|
|
231
|
-
export {
|
|
250
|
+
export { processOfflineActions } from './storage/methods/processOfflineActions'
|
|
251
|
+
export { colorHeldTxids, txHasColorOutput } from './mandala/colorGuard'
|
|
232
252
|
export * from './storage/skipQueuedAncestors'
|
|
233
253
|
export { prepareSqliteImageForDeserialize } from './storage/dbImage'
|
|
254
|
+
export {
|
|
255
|
+
encryptDbImage,
|
|
256
|
+
decryptDbImage,
|
|
257
|
+
isEncryptedDbImage,
|
|
258
|
+
EncryptedDbError,
|
|
259
|
+
ENCRYPTED_DB_EXTENSION,
|
|
260
|
+
DB_EXPORT_PROTOCOL,
|
|
261
|
+
type DbExportWallet,
|
|
262
|
+
type EncryptedDbErrorCode,
|
|
263
|
+
type EncryptedDbOptions,
|
|
264
|
+
type ByteSource,
|
|
265
|
+
type ByteSink
|
|
266
|
+
} from './storage/encryptedDbImage'
|
|
234
267
|
|
|
235
268
|
// Local secrets storage
|
|
236
269
|
export {
|