@alephium/web3 3.0.0-test.8 → 3.0.0-test.9
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/MIGRATION.md +25 -0
- package/package.json +5 -4
package/MIGRATION.md
CHANGED
|
@@ -158,3 +158,28 @@ The following are no longer needed for `@alephium/web3` (they may still be neede
|
|
|
158
158
|
The SDK is now built with TypeScript 5.9 and uses `moduleResolution: "bundler"` internally. Consumers using `moduleResolution: "node"` (the default) are supported via the `typesVersions` field — no changes needed on your side.
|
|
159
159
|
|
|
160
160
|
If you upgrade your own project to `moduleResolution: "bundler"`, the `exports` field in `package.json` will be used for type resolution, which is more accurate.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## WalletConnect
|
|
165
|
+
|
|
166
|
+
### `@alephium/walletconnect-provider` now uses `optionalNamespaces`
|
|
167
|
+
|
|
168
|
+
The provider's `connect()` method now sends namespaces via `optionalNamespaces` instead of the deprecated `requiredNamespaces`. This follows WalletConnect SDK 2.21.6+, which auto-converts `requiredNamespaces` to `optionalNamespaces` internally.
|
|
169
|
+
|
|
170
|
+
**If your app is a dApp (initiates WalletConnect connections):** No changes needed. The provider handles this internally.
|
|
171
|
+
|
|
172
|
+
**If your app is a wallet (responds to session proposals):** Update your `session_proposal` handler to read from `optionalNamespaces`, falling back to `requiredNamespaces` for backward compatibility with older dApps:
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
// ❌ v2
|
|
176
|
+
const { requiredNamespaces } = proposal.params
|
|
177
|
+
const alephiumNamespace = requiredNamespaces['alephium']
|
|
178
|
+
|
|
179
|
+
// ✅ v3
|
|
180
|
+
const { requiredNamespaces, optionalNamespaces } = proposal.params
|
|
181
|
+
const alephiumNamespace =
|
|
182
|
+
optionalNamespaces?.['alephium'] ?? requiredNamespaces?.['alephium']
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This change is required because WalletConnect SDK 2.21.6+ moves all `requiredNamespaces` into `optionalNamespaces` before sending the proposal. Wallet code that only reads `requiredNamespaces` will see an empty object.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alephium/web3",
|
|
3
|
-
"version": "3.0.0-test.
|
|
3
|
+
"version": "3.0.0-test.9",
|
|
4
4
|
"description": "A JS/TS library to interact with the Alephium platform",
|
|
5
5
|
"license": "GPL",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@noble/curves": "1.9.7",
|
|
68
68
|
"@noble/hashes": "1.8.0",
|
|
69
69
|
"@noble/secp256k1": "1.7.2",
|
|
70
|
-
"base-x": "4.0.
|
|
70
|
+
"base-x": "4.0.1",
|
|
71
71
|
"bignumber.js": "^9.1.1",
|
|
72
72
|
"eventemitter3": "^4.0.7"
|
|
73
73
|
},
|
|
@@ -89,10 +89,11 @@
|
|
|
89
89
|
"shelljs": "^0.8.5",
|
|
90
90
|
"size-limit": "^11.0.0",
|
|
91
91
|
"swagger-typescript-api": "12.0.3",
|
|
92
|
-
"ts-node": "^10.9.
|
|
92
|
+
"ts-node": "^10.9.2",
|
|
93
93
|
"tsc-alias": "^1.8.16",
|
|
94
94
|
"tslib": "^2.5.0",
|
|
95
|
-
"typescript": "^5.9.3"
|
|
95
|
+
"typescript": "^5.9.3",
|
|
96
|
+
"vitest": "^3.1.1"
|
|
96
97
|
},
|
|
97
98
|
"engines": {
|
|
98
99
|
"node": ">=20.0.0",
|