@bsv/expo-wallet-toolbox 0.20.0 → 0.22.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 +147 -0
- package/README.md +78 -13
- package/core/contacts/contactActivity.ts +48 -28
- package/core/contacts/contactsStore.ts +2 -2
- package/core/context/WalletContext.tsx +166 -219
- 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/directpay/DirectPayManager.ts +148 -29
- package/core/directpay/DirectPayProvider.tsx +11 -2
- package/core/directpay/payFlow.ts +10 -1
- package/core/directpay/settings.ts +56 -9
- package/core/directpay/types.ts +11 -2
- package/core/directpay/webrtpay.ts +4 -0
- package/core/i18n/translations.tsx +185 -84
- package/core/index.ts +55 -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/direct.ts +6 -2
- 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/vault/guard.ts +5 -4
- package/core/storage/StorageExpoSQLite.ts +93 -229
- package/core/storage/methods/processOfflineActions.ts +86 -136
- package/core/storage/schema/createTables.ts +9 -184
- package/package.json +6 -5
- package/ui/components/pay/AssetPicker.tsx +2 -2
- package/ui/components/pay/HandleReceive.tsx +10 -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 +94 -160
- package/ui/components/ui/colorPrompt.ts +236 -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/hooks/useMandala.ts +6 -6
- package/ui/hooks/useSpendableBalance.ts +3 -1
- package/ui/importDatabases.ts +1 -1
- package/ui/screens/PayScreen.tsx +14 -20
- package/ui/screens/SettingsScreen.tsx +3 -1
- package/ui/screens/WalletCheckScreen.tsx +7 -2
- 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
|
@@ -146,7 +146,6 @@ export * from './offline/hold'
|
|
|
146
146
|
export * from './offline/order'
|
|
147
147
|
export * from './offline/plan'
|
|
148
148
|
export * from './offline/payerHold'
|
|
149
|
-
export * from './offline/tokenFrames'
|
|
150
149
|
export {
|
|
151
150
|
cancelParkedPayment,
|
|
152
151
|
chainAlreadyKnows,
|
|
@@ -156,79 +155,98 @@ export {
|
|
|
156
155
|
type CancelParkedSettlementDeps
|
|
157
156
|
} from './offline/cancelParked'
|
|
158
157
|
|
|
159
|
-
//
|
|
160
|
-
//
|
|
158
|
+
// 1Color transfers — the journal types, the `color_transfers` journal (the
|
|
159
|
+
// one key for the broadcast hold and the abort refusal), and the one-time
|
|
160
|
+
// migration off the Mandala settlement tables.
|
|
161
161
|
export * from './mandala/types'
|
|
162
|
-
export {
|
|
162
|
+
export {
|
|
163
|
+
createTransferJournal,
|
|
164
|
+
migrateMandalaToColor,
|
|
165
|
+
COLOR_MIGRATION_MARKER,
|
|
166
|
+
type JournalDb,
|
|
167
|
+
type TransferJournal
|
|
168
|
+
} from './mandala/transferJournal'
|
|
163
169
|
// Guard #4: an abortAction may not release the inputs of a token payment the
|
|
164
170
|
// overlay already has (the 2026-09-15 incident).
|
|
165
171
|
export {
|
|
166
172
|
abortIsBlockedBy,
|
|
167
173
|
wrapAbortActionForSettlements,
|
|
168
|
-
|
|
174
|
+
ABORT_BLOCKED_TRANSFER_STATES,
|
|
169
175
|
type AbortableManager,
|
|
170
|
-
type
|
|
176
|
+
type TransferJournalLookup,
|
|
177
|
+
type TokenSettlementPossible
|
|
171
178
|
} 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
179
|
// The runtime the UI consumes: its pure interface, and its one construction
|
|
189
180
|
// site. `useMandala()` reads `useWallet().mandala`; nothing above this line in
|
|
190
181
|
// an app may import `@bsv/mandala` itself.
|
|
191
182
|
export type {
|
|
192
183
|
MandalaRuntime,
|
|
184
|
+
NearbyTokenDeps,
|
|
193
185
|
TokenActivityRow,
|
|
194
186
|
TokenActivityStatus,
|
|
195
187
|
TokenAssetInfo,
|
|
188
|
+
TokenAssetStatus,
|
|
196
189
|
TokenBalance,
|
|
197
|
-
|
|
190
|
+
TokenHoldingsReview,
|
|
191
|
+
TokenSendResult,
|
|
192
|
+
TokenSettleState
|
|
198
193
|
} from './mandala/runtime'
|
|
194
|
+
export {
|
|
195
|
+
createAssetMetadata,
|
|
196
|
+
offlineUnitsOf,
|
|
197
|
+
readAvailable,
|
|
198
|
+
readInventory,
|
|
199
|
+
readPending,
|
|
200
|
+
shortAssetId,
|
|
201
|
+
type InventoryRecord
|
|
202
|
+
} from './mandala/assets'
|
|
199
203
|
export {
|
|
200
204
|
activityStatusOf,
|
|
201
205
|
bindOriginator,
|
|
202
206
|
createMandalaKvStorage,
|
|
203
207
|
createMandalaRuntime,
|
|
204
|
-
verdictFromError,
|
|
205
208
|
type CreateMandalaRuntimeArgs,
|
|
206
209
|
type MandalaKvStorage,
|
|
207
210
|
type MandalaMessageBox
|
|
208
211
|
} from './mandala/createRuntime'
|
|
212
|
+
// The BRC-207 color module as WalletContext registers it
|
|
213
|
+
// (`permissionModules.color`): the module with the Mandala issuer-v1 profile
|
|
214
|
+
// and the host ledger it credits from (B7), its `ColorModuleStore` over
|
|
215
|
+
// `key_value_store`, and the host consent policy. A host that builds its own
|
|
216
|
+
// permissions manager needs all of them to give `createMandalaRuntime` a
|
|
217
|
+
// module, a provider and a ledger.
|
|
218
|
+
export { buildColorModule, type BuildColorModuleArgs, type BuiltColorModule } from './mandala/colorModule'
|
|
219
|
+
export { createColorModuleStore, type WalletKv } from './mandala/kvStore'
|
|
220
|
+
export {
|
|
221
|
+
createColorAccessPolicy,
|
|
222
|
+
colorPromptType,
|
|
223
|
+
COLOR_PROMPT_TYPES,
|
|
224
|
+
type ColorAccessPolicyOptions,
|
|
225
|
+
type ColorPromptType
|
|
226
|
+
} from './mandala/accessPolicy'
|
|
227
|
+
// A nearby token frame as the v4 hand-over body (B7, IC §7.3), and how a
|
|
228
|
+
// failed receipt is classified.
|
|
209
229
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
type CoverVerifier
|
|
218
|
-
} from './mandala/bundle'
|
|
230
|
+
bodyFromFrame,
|
|
231
|
+
isRetriableReceiptFailure,
|
|
232
|
+
isTransportReceiptFailure,
|
|
233
|
+
receiptFailureCode,
|
|
234
|
+
tokenPaymentOfHandover
|
|
235
|
+
} from './mandala/receipt'
|
|
236
|
+
export { createHandoverBodies, handoverBodyKey, type HandoverBodies } from './mandala/handle'
|
|
219
237
|
|
|
220
238
|
// Contacts
|
|
221
239
|
export { mergeContactCache, type ContactCache } from './contacts/contactCache'
|
|
222
240
|
|
|
223
241
|
// Local SQLite storage layer
|
|
224
242
|
export { StorageExpoSQLite } from './storage/StorageExpoSQLite'
|
|
225
|
-
export type { StorageExpoSQLiteOptions
|
|
226
|
-
export { createTables, ensureOfflineActionsColumns
|
|
243
|
+
export type { StorageExpoSQLiteOptions } from './storage/StorageExpoSQLite'
|
|
244
|
+
export { createTables, ensureOfflineActionsColumns } from './storage/schema/createTables'
|
|
227
245
|
export { findOfflineActions, findOfflineActionByTxid, updateOfflineAction } from './storage/methods/offlineActions'
|
|
228
246
|
export type { OfflineActionRow, OfflineActionStatus, BindValue } from './storage/methods/offlineActions'
|
|
229
247
|
export { readWalletBalance } from './storage/methods/walletBalanceSql'
|
|
230
|
-
export { processOfflineActions
|
|
231
|
-
export {
|
|
248
|
+
export { processOfflineActions } from './storage/methods/processOfflineActions'
|
|
249
|
+
export { colorHeldTxids, txHasColorOutput } from './mandala/colorGuard'
|
|
232
250
|
export * from './storage/skipQueuedAncestors'
|
|
233
251
|
export { prepareSqliteImageForDeserialize } from './storage/dbImage'
|
|
234
252
|
|