@bsv/expo-wallet-toolbox 0.23.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 +133 -0
- package/README.md +1 -4
- 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/inbox.ts +169 -64
- package/core/bridge/memoryInboxStore.ts +10 -1
- package/core/constants.ts +7 -11
- package/core/context/WalletConnectionContext.tsx +85 -48
- package/core/context/WalletContext.tsx +30 -32
- 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/i18n/translations.tsx +47 -12
- package/core/identity/handleRegistry/client.ts +4 -2
- package/core/identity/handleRegistry/resolver.ts +7 -11
- package/core/index.ts +2 -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/secrets/kek.ts +5 -0
- package/core/services/secrets/migration.ts +27 -2
- package/core/services/secrets/policy.ts +6 -0
- 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 +10 -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/walletConnectionValidation.ts +13 -1
- package/core/services/walletServiceConfig.ts +8 -7
- package/core/stores/ConnectionStore.ts +17 -0
- package/core/toolboxConfig.ts +60 -1
- 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 +7 -3
- 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/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/importDatabases.ts +31 -6
- 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 +17 -2
- package/ui/screens/WalletHomeScreen.tsx +7 -1
package/core/networks.ts
CHANGED
|
@@ -52,15 +52,13 @@ export interface NetworkProfile {
|
|
|
52
52
|
* place, but no new wallet can be put on it.
|
|
53
53
|
*/
|
|
54
54
|
available: boolean
|
|
55
|
-
/** Default
|
|
55
|
+
/** Default BSV Broadcaster origin (broadcast, SSE, and `/chaintracks/v1`). */
|
|
56
56
|
arcadeUrl: string
|
|
57
57
|
/** Default MessageBox origin. Each network has its own server. */
|
|
58
58
|
messageBoxUrl: string
|
|
59
59
|
/** Undefined on a network with no WhatsOnChain: address rails, WoC proofs and explorer links are off. */
|
|
60
60
|
woc?: WocEndpoints
|
|
61
|
-
/**
|
|
62
|
-
taalArcUrl?: string
|
|
63
|
-
/** GorillaPool ARC broadcast fallback, where GorillaPool runs one. */
|
|
61
|
+
/** GorillaPool's BSV Broadcaster root (posts to `/tx`), where GorillaPool runs one. */
|
|
64
62
|
gorillaPoolArcUrl?: string
|
|
65
63
|
/** Whether Bitails (the toolbox's built-in provider) serves this network. */
|
|
66
64
|
bitails: boolean
|
|
@@ -80,11 +78,10 @@ export const NETWORKS: Record<AppChain, NetworkProfile> = {
|
|
|
80
78
|
main: {
|
|
81
79
|
available: true,
|
|
82
80
|
walletChain: 'main',
|
|
83
|
-
arcadeUrl: 'https://
|
|
81
|
+
arcadeUrl: 'https://broadcast.bsvblockchain.tech',
|
|
84
82
|
messageBoxUrl: 'https://messagebox.bsvblockchain.tech',
|
|
85
83
|
woc: { apiBase: 'https://api.whatsonchain.com', segment: 'main', explorerBase: 'https://whatsonchain.com' },
|
|
86
|
-
|
|
87
|
-
gorillaPoolArcUrl: 'https://arc.gorillapool.io',
|
|
84
|
+
gorillaPoolArcUrl: 'https://arcade.gorillapool.io',
|
|
88
85
|
bitails: true,
|
|
89
86
|
overlayPreset: 'mainnet',
|
|
90
87
|
push: true
|
|
@@ -92,10 +89,10 @@ export const NETWORKS: Record<AppChain, NetworkProfile> = {
|
|
|
92
89
|
test: {
|
|
93
90
|
available: true,
|
|
94
91
|
walletChain: 'test',
|
|
95
|
-
arcadeUrl: 'https://
|
|
92
|
+
arcadeUrl: 'https://broadcast.bsvblockchain.tech/testnet',
|
|
96
93
|
messageBoxUrl: 'https://messagebox-testnet.bsvblockchain.tech',
|
|
97
94
|
woc: { apiBase: 'https://api.whatsonchain.com', segment: 'test', explorerBase: 'https://test.whatsonchain.com' },
|
|
98
|
-
|
|
95
|
+
gorillaPoolArcUrl: 'https://testnet.arcade.gorillapool.io',
|
|
99
96
|
bitails: true,
|
|
100
97
|
overlayPreset: 'testnet',
|
|
101
98
|
push: false
|
|
@@ -103,7 +100,7 @@ export const NETWORKS: Record<AppChain, NetworkProfile> = {
|
|
|
103
100
|
teratest: {
|
|
104
101
|
available: true,
|
|
105
102
|
walletChain: 'ttn',
|
|
106
|
-
arcadeUrl: 'https://
|
|
103
|
+
arcadeUrl: 'https://broadcast.bsvblockchain.tech/ttn',
|
|
107
104
|
messageBoxUrl: 'https://messagebox-ttn.bsvblockchain.tech',
|
|
108
105
|
woc: {
|
|
109
106
|
apiBase: 'https://api.woc-ttn.bsvblockchain.tech',
|
|
@@ -114,8 +111,9 @@ export const NETWORKS: Record<AppChain, NetworkProfile> = {
|
|
|
114
111
|
overlayPreset: 'teratestnet',
|
|
115
112
|
push: false
|
|
116
113
|
},
|
|
117
|
-
// The scaling teratestnet.
|
|
118
|
-
// no WhatsOnChain, explorer or overlay for it.
|
|
114
|
+
// The scaling teratestnet. BSV Broadcaster, chaintracks and MessageBox only:
|
|
115
|
+
// there is no WhatsOnChain, explorer or overlay for it. The `/tstn`
|
|
116
|
+
// chaintracks now reports `tstn`; `available` stays false.
|
|
119
117
|
//
|
|
120
118
|
// Not available yet. The deployed chain runs Teranode regtest parameters
|
|
121
119
|
// (regtest genesis 0f9188f1…, bits 0x207fffff; its chaintracks reports
|
|
@@ -127,7 +125,7 @@ export const NETWORKS: Record<AppChain, NetworkProfile> = {
|
|
|
127
125
|
scaletest: {
|
|
128
126
|
walletChain: 'regtest',
|
|
129
127
|
available: false,
|
|
130
|
-
arcadeUrl: 'https://
|
|
128
|
+
arcadeUrl: 'https://broadcast.bsvblockchain.tech/tstn',
|
|
131
129
|
messageBoxUrl: 'https://messagebox-tstn.bsvblockchain.tech',
|
|
132
130
|
bitails: false,
|
|
133
131
|
overlayPreset: 'local',
|
|
@@ -18,15 +18,15 @@ import {
|
|
|
18
18
|
Transaction,
|
|
19
19
|
Utils,
|
|
20
20
|
type InternalizeActionArgs,
|
|
21
|
-
type InternalizeOutput
|
|
22
|
-
type WalletProtocol
|
|
21
|
+
type InternalizeOutput
|
|
23
22
|
} from '@bsv/sdk'
|
|
24
23
|
import type { AppChain } from '../../config'
|
|
25
24
|
import { NETWORKS } from '../../networks'
|
|
26
25
|
import { abbreviateKey, addressLabel, FROM_ADDRESS_LABEL_PREFIX, TO_ADDRESS_LABEL_PREFIX } from '../counterparty'
|
|
27
26
|
import { addressNetwork, isValidBsvAddress } from './index'
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
import { BRC29_PROTOCOL_ID } from '../../peerpay/brc29'
|
|
29
|
+
export { BRC29_PROTOCOL_ID } from '../../peerpay/brc29'
|
|
30
30
|
|
|
31
31
|
/** Whether the address rail can carry a particular payment, and why not when it cannot. */
|
|
32
32
|
export type AddressRailAvailability = { kind: 'available' } | { kind: 'unavailable'; reason: string }
|
|
@@ -181,7 +181,8 @@ export function wocRequestInit(woc: WocConfig): { headers: Record<string, string
|
|
|
181
181
|
return woc.apiKey ? { headers: { 'woc-api-key': woc.apiKey } } : undefined
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
|
|
184
|
+
/** A WhatsOnChain GET that turns a 429 into WocRateLimited. Shared with pay/rails/sweep.ts. */
|
|
185
|
+
export async function wocFetch(woc: WocConfig, url: string): Promise<Response> {
|
|
185
186
|
const init = wocRequestInit(woc)
|
|
186
187
|
const response = init ? await fetch(url, init) : await fetch(url)
|
|
187
188
|
if (response.status === 429) throw new WocRateLimited()
|
package/core/pay/rails/handle.ts
CHANGED
|
@@ -923,6 +923,7 @@ export async function retryDelivery(args: {
|
|
|
923
923
|
entry: OutboxEntry
|
|
924
924
|
}): Promise<void> {
|
|
925
925
|
const { wallet, adminOriginator, client, storage, entry } = args
|
|
926
|
+
if (entry.status !== 'unsent') return
|
|
926
927
|
await updateOutboxEntry(storage, entry.id, { lastAttemptAt: new Date().toISOString() })
|
|
927
928
|
// XR-052: a concurrent UI abandon (cancelOutboxPayment) can remove this same
|
|
928
929
|
// row between awaits — it shares no lock with the background drain beyond
|
|
@@ -931,7 +932,8 @@ export async function retryDelivery(args: {
|
|
|
931
932
|
// (mirrors cancelOutboxPayment's own re-read for its 'undelivered' mode) and
|
|
932
933
|
// stop cleanly if the row is gone, so an in-flight retry cannot still
|
|
933
934
|
// deliver or broadcast a payment the user just cancelled.
|
|
934
|
-
const stillPending = async (): Promise<boolean> =>
|
|
935
|
+
const stillPending = async (): Promise<boolean> =>
|
|
936
|
+
(await getOutboxEntries(storage)).some(e => e.id === entry.id && e.status === 'unsent')
|
|
935
937
|
try {
|
|
936
938
|
if (entry.delivered !== true) {
|
|
937
939
|
if (!(await stillPending())) return
|