@bsv/expo-wallet-toolbox 0.25.1 → 0.27.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 +58 -0
- package/core/context/WalletContext.tsx +23 -2
- package/core/i18n/translations.tsx +245 -36
- package/core/identity/handleRegistry/classify.ts +74 -0
- package/core/identity/handleRegistry/client.ts +110 -16
- package/core/identity/handleRegistry/registration.ts +115 -17
- package/core/identity/handleRegistry/resolver.ts +77 -34
- package/core/identity/handleRegistry/rules.ts +4 -0
- package/core/index.ts +7 -0
- package/core/monitor/TaskDrainOutbox.ts +13 -3
- package/core/pay/paymail/address.ts +19 -0
- package/core/pay/paymail/client.ts +177 -0
- package/core/pay/paymail/networkCheck.ts +56 -0
- package/core/pay/rails/handle.ts +46 -9
- package/core/pay/rails/paymail.ts +542 -0
- package/core/peerpay/handleResendRequests.ts +6 -6
- package/core/peerpay/outbox.ts +185 -17
- package/core/peerpay/rebuildToken.ts +2 -2
- package/core/profiles/profileStore.ts +4 -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/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/ImportedOutboxApproval.tsx +23 -2
- 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 +79 -5
- 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
- package/ui/screens/WalletHomeScreen.tsx +104 -4
- package/ui/txStatus.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.27.0
|
|
6
|
+
|
|
7
|
+
Paymail send. No native change: hosts do not rebuild.
|
|
8
|
+
|
|
9
|
+
### Breaking / host action
|
|
10
|
+
|
|
11
|
+
- **A host that supplies its own `RegistryResolver` must add `discoverCapabilities`.** `createRegistryResolver` already has it.
|
|
12
|
+
- **A host that reads outbox rows must handle the `OutboxEntry` union.** Use `isPaymailEntry` to tell a `paymail` row from a PeerPay row.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **`classifyPaymailDomain` and `classifyPaymailDomainDetailed`.** They read a domain's capability map and return `peerpay`, `legacy`, `unsupported` or `failed`.
|
|
17
|
+
- **`sendViaPaymail`.** It pays a `legacy` paymail (for example HandCash) with BSV. It mints with `noSend`, writes an outbox row, posts the plain BEEF, then broadcasts. It throws `PaymailSendError`.
|
|
18
|
+
- **The `paymail` outbox kind**, with retry, cancel and drain.
|
|
19
|
+
- **`RegistryResolver.discoverCapabilities`.** It returns the raw capability map from the same cached and DNSSEC-checked discovery.
|
|
20
|
+
- **`createLegacyPaymailClient`, `statusFnFromStorage` and `abortNosendByTxid`.**
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **`abortPeerPayNosend` now calls the new `abortNosendByTxid`.**
|
|
25
|
+
- **`isAbortSafe` also guards `paymail` actions.**
|
|
26
|
+
- **An outgoing `paymail` action reads as sent, not spent.**
|
|
27
|
+
|
|
28
|
+
### Not added
|
|
29
|
+
|
|
30
|
+
- **No `@bsv/paymail` dependency.** The toolbox has its own small client on the bounded fetch.
|
|
31
|
+
|
|
32
|
+
## 0.26.0
|
|
33
|
+
|
|
34
|
+
The BSV Wallet app's launch changes, upstreamed from its patch of 0.25.1: one key tap for a Vault spend, a key removal that can finish, a monthly limit for group spending grants, and a new icon set. No native change: hosts do not rebuild.
|
|
35
|
+
|
|
36
|
+
### Breaking / host action
|
|
37
|
+
|
|
38
|
+
- **`lucide-react-native` ^1.27.0 is a new peer.** The UI draws its glyphs with lucide instead of `@expo/vector-icons`. Install it next to `react-native-svg`. A Jest host maps `^lucide-react-native$` to `lucide-react-native/dist/cjs/lucide-react-native.js`, because Jest resolves its ESM entry otherwise.
|
|
39
|
+
- **The typography tokens name a font family, `Nunito`.** Every ramp in `typography` now sets `fontFamily: 'Nunito'`, so the toolbox screens match a host that embeds Nunito 400, 600 and 700 (for example with the `expo-font` config plugin). A host that does not embed it gets the platform fallback face, and must embed Nunito or override `fontFamily`.
|
|
40
|
+
- **`HandleRegistryClient` has two new required methods, `resolveHandle` and `acceptKey`.** A host with its own client implementation adds them. `createHandleRegistryClient` already has them.
|
|
41
|
+
- **`search()` can return a row with `changedFrom`.** For a complete address (`handle@domain`) whose certificate is valid but whose key is not the one pinned on this device (XR-071), the row comes back flagged with the pinned key instead of being dropped, so the caller can warn. The pin does not move until `acceptKey`. A partial query still drops such a row. A host that shows search rows must check `changedFrom` before it pays. `UniversalSend` drops these rows, as before.
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- **`openVaultSignerSession` and `VaultSignerSession`.** One key session for a spend that also creates a Vault output: a withdrawal with a re-vaulted remainder, or a re-lock. One PIN entry and one tap now cover the new output's possession proof and the input signatures. Before, the person entered the PIN and tapped twice. If the session ends between the two steps (a timeout or a detach), the spend asks for a second tap and does not fail. A cancelled session stays cancelled. A deposit keeps its own ceremony.
|
|
46
|
+
- **`failedVaultSpendBlocksRemoval`.** A failed Vault spend now holds a pending key removal open only when it has a transaction ID and began at or after the removal started. Before, any failed spend in the history blocked the removal for good. A spend with no readable time still blocks.
|
|
47
|
+
- **`groupSpendingLimit` and `clampGroupSpending`.** A site's one-time group grant may spend at most the auto-approve threshold each month. A threshold of 0 removes the spending part of the grant.
|
|
48
|
+
- **`resolveHandle` (`found`, `changed`, `none`, `failed`) and `acceptKey`** on the handle registry client. A one-character handle is now looked up as a complete address (`r@domain`).
|
|
49
|
+
- **`HardwareKeyArtComponent`** type, exported with `EnrollWizard`.
|
|
50
|
+
- **Paid handle claims.** `putCertificate` takes an App Store or Google Play purchase (`StorePurchase`) and a fallback certificate. A refused claim whose reclaim is also refused returns `notRestored` with the handle that did not come back.
|
|
51
|
+
- **15 strings** for the Vault card check and the spending limit, in all 12 locales.
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
|
|
55
|
+
- **Add-key copy.** A new key is saved but not active until another key confirms it.
|
|
56
|
+
- **Enrollment.** The PIN is confirmed on a page of its own (4 steps per key). Replace and reset of a card first check the blockchain for a vault the card opens, and need an extra acknowledgement.
|
|
57
|
+
- **E2E builds** start a fresh install on testnet when `globalThis.__BSV_E2E_CHAIN` is `test`.
|
|
58
|
+
|
|
59
|
+
### Fixed
|
|
60
|
+
|
|
61
|
+
- **The encrypted database image** no longer crashes the app when written. The crypto helper returned a `Buffer`, which expo-file-system's `writeBytes` does not accept; it now returns a plain `Uint8Array`.
|
|
62
|
+
|
|
5
63
|
## 0.25.1
|
|
6
64
|
|
|
7
65
|
WhatsOnChain rate limit. No native change: hosts do not rebuild.
|
|
@@ -284,7 +284,11 @@ import {
|
|
|
284
284
|
readMessageBoxUrl,
|
|
285
285
|
retryDelivery
|
|
286
286
|
} from '../pay/rails/handle'
|
|
287
|
-
import { getOutboxEntries, pruneExpiredSent, unsentEntries } from '../peerpay/outbox'
|
|
287
|
+
import { getOutboxEntries, isPaymailEntry, isPeerPayEntry, pruneExpiredSent, unsentEntries } from '../peerpay/outbox'
|
|
288
|
+
import { retryPaymailDelivery } from '../pay/rails/paymail'
|
|
289
|
+
import { createLegacyPaymailClient } from '../pay/paymail/client'
|
|
290
|
+
import { statusFnFromStorage } from '../pay/paymail/networkCheck'
|
|
291
|
+
import { createRegistryResolver } from '../identity/handleRegistry/resolver'
|
|
288
292
|
import { MAX_HEX_RESPONSE_CHARS, wocConfigFor } from '../pay/rails/address'
|
|
289
293
|
import { PeerPayClient } from '@bsv/message-box-client'
|
|
290
294
|
import {
|
|
@@ -303,6 +307,7 @@ import { HeaderStore } from '../headers/headerStore'
|
|
|
303
307
|
import { OfflineFirstChaintracks } from '../headers/OfflineFirstChaintracks'
|
|
304
308
|
import { prewarmOwnRoots } from '../headers/prewarm'
|
|
305
309
|
import { syncHeaders } from '../headers/syncHeaders'
|
|
310
|
+
import { groupSpendingLimit, clampGroupSpending } from '../services/groupSpendingLimit'
|
|
306
311
|
import type { HeaderSource } from '../headers/syncHeaders'
|
|
307
312
|
import { startHeaderSyncTriggers } from '../headers/headerSyncTriggers'
|
|
308
313
|
import { wocLimitedFetch } from '../net/wocLimiter'
|
|
@@ -1397,7 +1402,8 @@ export const WalletContextProvider: React.FC<WalletContextProps> = ({ children =
|
|
|
1397
1402
|
async (args: GroupPermissionRequest, manager?: SigningPolicyPermissionsManager): Promise<void> => {
|
|
1398
1403
|
const { requestID, originator, permissions } = args ?? ({} as GroupPermissionRequest)
|
|
1399
1404
|
if (!requestID || !permissions) return
|
|
1400
|
-
|
|
1405
|
+
const limit = await groupSpendingLimit()
|
|
1406
|
+
groupQueue.enqueue({ requestID, originator, permissions: clampGroupSpending(permissions, limit), manager })
|
|
1401
1407
|
},
|
|
1402
1408
|
[groupQueue.enqueue]
|
|
1403
1409
|
)
|
|
@@ -2420,6 +2426,8 @@ export const WalletContextProvider: React.FC<WalletContextProps> = ({ children =
|
|
|
2420
2426
|
)
|
|
2421
2427
|
TaskCreditInbox.noteEnqueued()
|
|
2422
2428
|
|
|
2429
|
+
// One resolver per wallet build, for the paymail rail's discovery.
|
|
2430
|
+
const paymailResolver = createRegistryResolver({ pinned: getHandleRegistryConfig(chain) })
|
|
2423
2431
|
monitor.addTask(
|
|
2424
2432
|
new TaskDrainOutbox(
|
|
2425
2433
|
monitor,
|
|
@@ -2427,7 +2435,20 @@ export const WalletContextProvider: React.FC<WalletContextProps> = ({ children =
|
|
|
2427
2435
|
const entries = unsentEntries(await getOutboxEntries(phoneStorage!))
|
|
2428
2436
|
return drainUnsentEntries({
|
|
2429
2437
|
entries,
|
|
2438
|
+
isolate: isPaymailEntry,
|
|
2430
2439
|
retry: async entry => {
|
|
2440
|
+
if (isPaymailEntry(entry)) {
|
|
2441
|
+
await retryPaymailDelivery({
|
|
2442
|
+
wallet: permissionsManager as never,
|
|
2443
|
+
adminOriginator,
|
|
2444
|
+
storage: phoneStorage!,
|
|
2445
|
+
client: createLegacyPaymailClient({ resolver: paymailResolver }),
|
|
2446
|
+
getStatusForTxids: statusFnFromStorage(phoneStorage!),
|
|
2447
|
+
entry
|
|
2448
|
+
})
|
|
2449
|
+
return
|
|
2450
|
+
}
|
|
2451
|
+
if (!isPeerPayEntry(entry)) return
|
|
2431
2452
|
const client = bindMessageBoxNetwork(
|
|
2432
2453
|
new PeerPayClient({
|
|
2433
2454
|
messageBoxHost: entry.messageBoxUrl,
|