@bsv/expo-wallet-toolbox 0.11.0 → 0.11.3
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
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.3
|
|
4
|
+
|
|
5
|
+
### Identity lookups: default certifier descriptions fit BRC-100
|
|
6
|
+
|
|
7
|
+
`IdentityClient.resolveByAttributes` and `resolveByIdentityKey` failed in dApps
|
|
8
|
+
using `@bsv/sdk` 2.8.8 or later with `Invalid discoverByAttributes result
|
|
9
|
+
certificates[n].certifierInfo.description: expected 5–50 UTF-8 bytes`. The
|
|
10
|
+
wallet copies each trusted certifier's description into `certifierInfo`, and
|
|
11
|
+
the library's default SocialCert and Metanet Trust Services descriptions are 56
|
|
12
|
+
and 55 bytes. `DEFAULT_SETTINGS` now carries shorter descriptions for those two
|
|
13
|
+
(same wording as bsv-blockchain/ts-stack#665, which fixes the library), so
|
|
14
|
+
their certificates pass the SDK's result validation. Nothing else about either
|
|
15
|
+
certifier changes. `DEFAULT_SETTINGS` moves to `core/context/defaultWalletSettings.ts`.
|
|
16
|
+
|
|
17
|
+
## 0.11.2
|
|
18
|
+
|
|
19
|
+
0.11.1 was tagged but never reached npm: its publish run failed on a test-only
|
|
20
|
+
leak (the `expo-image` virtual mock bleeding between test files, fixed in #28).
|
|
21
|
+
0.11.2 is the first published release carrying the 0.11.1 changes below, and
|
|
22
|
+
changes nothing else in the package. Upgrade from 0.11.0 straight to 0.11.2.
|
|
23
|
+
|
|
24
|
+
## 0.11.1
|
|
25
|
+
|
|
26
|
+
### External-wallet guard: `listOutputs` keeps `include`
|
|
27
|
+
|
|
28
|
+
The size bound on an external `listOutputs` (XR-019, added in 0.9.0) forwarded
|
|
29
|
+
the SDK's validated form of the request instead of the caller's own args. That
|
|
30
|
+
form replaces `include` with `includeTransactions`/`includeLockingScripts`, and
|
|
31
|
+
the wallet validates again downstream, so `include` was lost: every non-admin
|
|
32
|
+
caller (in-tab dApps, paired peers) got no `BEEF` for
|
|
33
|
+
`include: 'entire transactions'` and no locking scripts for
|
|
34
|
+
`include: 'locking scripts'`. A dApp that then spent those outputs with
|
|
35
|
+
`createAction` failed with "Every signableTransaction input must have a
|
|
36
|
+
sourceTransaction". The bound still refuses the same requests; an allowed one
|
|
37
|
+
now reaches the wallet unchanged.
|
|
38
|
+
|
|
39
|
+
### External-wallet guard: `listOutputs` caps admit the SDK's contacts calls
|
|
40
|
+
|
|
41
|
+
The same bound refused any external `listOutputs` above 200 rows, or above 25
|
|
42
|
+
with `include: 'entire transactions'`. `@bsv/sdk`'s own `ContactsManager` asks
|
|
43
|
+
for 1000 rows with locking scripts (`getContacts`) and 100 with entire
|
|
44
|
+
transactions (`saveContact`, `removeContact`), so
|
|
45
|
+
`IdentityClient.resolveByAttributes`, `resolveByIdentityKey` and saving a
|
|
46
|
+
contact failed in every dApp with 'Wallet operation "listOutputs" is not
|
|
47
|
+
permitted for origin "…"'. The caps are now 1000 and 100. Larger pages are still
|
|
48
|
+
refused.
|
|
49
|
+
|
|
3
50
|
## 0.11.0
|
|
4
51
|
|
|
5
52
|
### Upgrading from 0.10.0
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
PermissionRequest,
|
|
11
11
|
SimpleWalletManager,
|
|
12
12
|
Monitor,
|
|
13
|
-
DEFAULT_SETTINGS as LIB_DEFAULT_SETTINGS,
|
|
14
13
|
WalletSettings,
|
|
15
14
|
WalletSettingsManager
|
|
16
15
|
} from '@bsv/wallet-toolbox-mobile'
|
|
17
16
|
import { KeyDeriver, PrivateKey, MerklePath, Transaction, Utils } from '@bsv/sdk'
|
|
17
|
+
import { DEFAULT_SETTINGS } from './defaultWalletSettings'
|
|
18
18
|
import { VAULT_RETENTION_MS, ceremony as vaultCeremony } from '../services/vault/ceremonyHost'
|
|
19
19
|
import { getVaultDriver } from '../services/vault/driver'
|
|
20
20
|
import { backupAttestation } from '../services/vault/backupAttestation'
|
|
@@ -133,34 +133,6 @@ async function resolveMandalaAssetMetadata(assetId: string): Promise<MandalaAsse
|
|
|
133
133
|
const MANDALA_OUTPOINT_LIST_PAGE = 1000
|
|
134
134
|
const MANDALA_OUTPOINT_LIST_MAX_PAGES = 1000
|
|
135
135
|
|
|
136
|
-
const DEFAULT_SETTINGS: WalletSettings = {
|
|
137
|
-
...LIB_DEFAULT_SETTINGS,
|
|
138
|
-
trustSettings: {
|
|
139
|
-
...LIB_DEFAULT_SETTINGS.trustSettings,
|
|
140
|
-
trustedCertifiers: [
|
|
141
|
-
...LIB_DEFAULT_SETTINGS.trustSettings.trustedCertifiers,
|
|
142
|
-
{
|
|
143
|
-
name: 'Who I Am',
|
|
144
|
-
description: 'Certifies email, phone, and X account ownership',
|
|
145
|
-
iconUrl: 'https://whoiam.bsvblockchain.tech/whoiam.png',
|
|
146
|
-
identityKey: '02e7eeb3986273db6843b790a1595ed0ff1b2ae8f43ae2e7f1a0c9db4dd3fb9441',
|
|
147
|
-
trust: 5
|
|
148
|
-
},
|
|
149
|
-
// Values as published in https://auth.sigmaidentity.com/manifest.json
|
|
150
|
-
// (babbage.trust). Lowest trust of the shipped set: it is the newest
|
|
151
|
-
// certifier here and the list is ordered by trust on the Trust screen.
|
|
152
|
-
// The icon is an SVG; the Trust screen draws those with react-native-svg
|
|
153
|
-
// rather than the platform decoder, which mispositions its <text> glyph.
|
|
154
|
-
{
|
|
155
|
-
name: 'Sigma Identity',
|
|
156
|
-
description: 'Certifies verified identity claims',
|
|
157
|
-
iconUrl: 'https://auth.sigmaidentity.com/sigma-mark.svg',
|
|
158
|
-
identityKey: '02250905f0383085b53409876aefbf01fc8e7fd841922dc4ce55ae035b31341e6d',
|
|
159
|
-
trust: 2
|
|
160
|
-
}
|
|
161
|
-
]
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
136
|
import type { AppChain } from '../config'
|
|
165
137
|
import { DEFAULT_STORAGE_URL, DEFAULT_CHAIN, ADMIN_ORIGINATOR, toWalletChain } from '../config'
|
|
166
138
|
import { getBackupUrl, getMandalaEndpoints } from '../toolboxConfig'
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DEFAULT_SETTINGS as LIB_DEFAULT_SETTINGS, WalletSettings } from '@bsv/wallet-toolbox-mobile'
|
|
2
|
+
|
|
3
|
+
// BRC-100 bounds certifierInfo.description to 5-50 UTF-8 bytes, and @bsv/sdk
|
|
4
|
+
// 2.8.8+ rejects a discovery result outside it. The wallet copies these
|
|
5
|
+
// descriptions into certifierInfo, and the library ships Metanet Trust Services
|
|
6
|
+
// and SocialCert at 55 and 56 bytes, so every identity lookup returning one of
|
|
7
|
+
// their certificates threw in the dApp. Same wording as ts-stack#665, which
|
|
8
|
+
// fixes the library; drop this once @bsv/wallet-toolbox-mobile ships it.
|
|
9
|
+
const LIB_CERTIFIER_DESCRIPTIONS: Record<string, string> = {
|
|
10
|
+
'03daf815fe38f83da0ad83b5bedc520aa488aef5cbc93a93c67a7fe60406cbffe8': 'Registry of protocols, baskets, certificate types',
|
|
11
|
+
'02cf6cdf466951d8dfc9e7c9367511d0007ed6fba35ed42d425cc412fd6cfd4a17': 'Certifies social media handles, phones and emails'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const DEFAULT_SETTINGS: WalletSettings = {
|
|
15
|
+
...LIB_DEFAULT_SETTINGS,
|
|
16
|
+
trustSettings: {
|
|
17
|
+
...LIB_DEFAULT_SETTINGS.trustSettings,
|
|
18
|
+
trustedCertifiers: [
|
|
19
|
+
...LIB_DEFAULT_SETTINGS.trustSettings.trustedCertifiers.map(certifier => ({
|
|
20
|
+
...certifier,
|
|
21
|
+
description: LIB_CERTIFIER_DESCRIPTIONS[certifier.identityKey] ?? certifier.description
|
|
22
|
+
})),
|
|
23
|
+
{
|
|
24
|
+
name: 'Who I Am',
|
|
25
|
+
description: 'Certifies email, phone, and X account ownership',
|
|
26
|
+
iconUrl: 'https://whoiam.bsvblockchain.tech/whoiam.png',
|
|
27
|
+
identityKey: '02e7eeb3986273db6843b790a1595ed0ff1b2ae8f43ae2e7f1a0c9db4dd3fb9441',
|
|
28
|
+
trust: 5
|
|
29
|
+
},
|
|
30
|
+
// Values as published in https://auth.sigmaidentity.com/manifest.json
|
|
31
|
+
// (babbage.trust). Lowest trust of the shipped set: it is the newest
|
|
32
|
+
// certifier here and the list is ordered by trust on the Trust screen.
|
|
33
|
+
// The icon is an SVG; the Trust screen draws those with react-native-svg
|
|
34
|
+
// rather than the platform decoder, which mispositions its <text> glyph.
|
|
35
|
+
{
|
|
36
|
+
name: 'Sigma Identity',
|
|
37
|
+
description: 'Certifies verified identity claims',
|
|
38
|
+
iconUrl: 'https://auth.sigmaidentity.com/sigma-mark.svg',
|
|
39
|
+
identityKey: '02250905f0383085b53409876aefbf01fc8e7fd841922dc4ce55ae035b31341e6d',
|
|
40
|
+
trust: 2
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -49,15 +49,16 @@ const MAX_EXTERNAL_ACTION_OFFSET = MAX_ACTION_SCAN
|
|
|
49
49
|
* hard ceiling (limit <= 10000) — a normal-sized *request* from an
|
|
50
50
|
* authenticated paired peer can still force a normal-sized *response* to
|
|
51
51
|
* balloon, because each row can carry a full aggregate BEEF
|
|
52
|
-
* (includeTransactions) or a locking script. These
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
52
|
+
* (includeTransactions) or a locking script. These stay well below the SDK's
|
|
53
|
+
* 10000 cap but must admit the largest page the SDK's own clients request:
|
|
54
|
+
* ContactsManager.getContacts asks for 1000 rows with locking scripts
|
|
55
|
+
* (MAX_CONTACTS), and its save/remove lookups 100 with entire transactions.
|
|
56
|
+
* Anything tighter refuses IdentityClient.resolveByAttributes and friends in
|
|
57
|
+
* every dApp. The transactions variant is tighter because the response then
|
|
58
|
+
* also carries those rows' BEEF, not just an outpoint + locking script.
|
|
58
59
|
*/
|
|
59
|
-
const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS =
|
|
60
|
-
const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS_WITH_TRANSACTIONS =
|
|
60
|
+
const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS = 1000
|
|
61
|
+
const MAX_EXTERNAL_LIST_OUTPUTS_RESULTS_WITH_TRANSACTIONS = 100
|
|
61
62
|
/** Permission-backed reads must never retain the exclusive listActions slot
|
|
62
63
|
* indefinitely while a connected origin leaves a prompt unanswered. */
|
|
63
64
|
export const EXTERNAL_ACTION_READ_TIMEOUT_MS = 30_000
|
|
@@ -629,13 +630,15 @@ export function guardVaultAccess<T extends WalletInterface>(
|
|
|
629
630
|
// admin-vault listOutputs one layer further out (see this test's
|
|
630
631
|
// own file: proofBar.railIsolation.test.ts's I3 listOutputs case)
|
|
631
632
|
// throws its own specific error, and this bound must never mask it.
|
|
632
|
-
let requested: ValidatedListOutputsArgs
|
|
633
633
|
try {
|
|
634
|
-
|
|
634
|
+
validateExternalListOutputsArgs(args)
|
|
635
635
|
} catch {
|
|
636
636
|
return deny(String(method), originator)
|
|
637
637
|
}
|
|
638
|
-
|
|
638
|
+
// Forward the caller's own args, not the validated form: that swaps
|
|
639
|
+
// `include` for includeTransactions/includeLockingScripts, and the
|
|
640
|
+
// wallet validates again, so passing it on would drop both.
|
|
641
|
+
return await bound(args, originator)
|
|
639
642
|
}
|
|
640
643
|
}
|
|
641
644
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsv/expo-wallet-toolbox",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Wallet screens and P2P local-payment backend for Expo/React Native apps, extracted from BSV Wallet.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|