@qrlwallet/connect 0.1.0 → 3.0.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/README.md +13 -32
- package/dist/index.d.mts +483 -113
- package/dist/index.d.ts +483 -113
- package/dist/index.js +1409 -444
- package/dist/index.mjs +1382 -442
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Connect your dApp to QRL Wallet. Users scan a QR code (desktop) or tap a button
|
|
|
10
10
|
4. Your dApp sends JSON-RPC requests, the wallet prompts for approval
|
|
11
11
|
5. Signed results come back to your dApp
|
|
12
12
|
|
|
13
|
-
All communication is end-to-end encrypted (
|
|
13
|
+
All communication is end-to-end encrypted with ML-KEM-768 (FIPS 203) key encapsulation and AES-256-GCM. The relay server never sees your data.
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
@@ -124,14 +124,16 @@ The main class. Creates a connection manager and EIP-1193 provider.
|
|
|
124
124
|
| `disconnected` | No active connection |
|
|
125
125
|
| `connecting` | Connecting to relay server |
|
|
126
126
|
| `waiting` | QR displayed, waiting for wallet to scan |
|
|
127
|
-
| `key_exchange` |
|
|
127
|
+
| `key_exchange` | Post-quantum key exchange in progress |
|
|
128
128
|
| `connected` | Wallet connected, ready for requests |
|
|
129
129
|
| `reconnecting` | Attempting to restore a previous session |
|
|
130
130
|
|
|
131
131
|
### Supported RPC methods
|
|
132
132
|
|
|
133
133
|
**Require user approval:**
|
|
134
|
-
`qrl_requestAccounts`, `qrl_sendTransaction`, `qrl_signTransaction`, `
|
|
134
|
+
`qrl_requestAccounts`, `qrl_sendTransaction`, `qrl_signTransaction`, `qrl_signMessage`, `qrl_signTypedData`, `wallet_addQrlChain`, `wallet_switchQrlChain`
|
|
135
|
+
|
|
136
|
+
`qrl_signMessage` and `qrl_signTypedData` (v3.0.0) replace the Ethereum-flavored `personal_sign` / `qrl_sign` / `qrl_signTypedData_v3` / `qrl_signTypedData_v4`. Both use SHAKE256 + native ML-DSA-87 ctx and return a rich `{ signature, publicKey, signer, digest, schemeVersion }` object; verify locally with `verifyMessage` / `verifyTypedData` exported from this package.
|
|
135
137
|
|
|
136
138
|
**Auto-proxied (no approval needed):**
|
|
137
139
|
`qrl_getBalance`, `qrl_call`, `qrl_estimateGas`, `qrl_blockNumber`, `qrl_chainId`, `qrl_getTransactionReceipt`, and 30+ more read-only methods.
|
|
@@ -151,7 +153,7 @@ Recommended lifecycle:
|
|
|
151
153
|
|
|
152
154
|
The relay is a lightweight Socket.IO server that routes encrypted messages between your dApp and the wallet. It runs at `wss://qrlwallet.com/relay`.
|
|
153
155
|
|
|
154
|
-
- Messages are
|
|
156
|
+
- Messages are end-to-end encrypted with AES-256-GCM keyed from an ML-KEM-768 handshake (the relay sees only ciphertext)
|
|
155
157
|
- Max 2 participants per channel
|
|
156
158
|
- Messages are buffered for up to 5 minutes if the wallet is temporarily offline (e.g., app backgrounded)
|
|
157
159
|
- Channels auto-expire after 30 minutes of inactivity
|
|
@@ -167,31 +169,6 @@ const qrl = new QRLConnect({
|
|
|
167
169
|
});
|
|
168
170
|
```
|
|
169
171
|
|
|
170
|
-
## Bundler setup
|
|
171
|
-
|
|
172
|
-
The SDK depends on Node's `Buffer` via `eciesjs`. If you're using Vite, add the polyfill plugin:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
npm install vite-plugin-node-polyfills
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
```js
|
|
179
|
-
// vite.config.js
|
|
180
|
-
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
181
|
-
|
|
182
|
-
export default defineConfig({
|
|
183
|
-
plugins: [
|
|
184
|
-
nodePolyfills({
|
|
185
|
-
include: ['buffer'],
|
|
186
|
-
globals: { Buffer: true },
|
|
187
|
-
}),
|
|
188
|
-
],
|
|
189
|
-
define: { global: 'globalThis' },
|
|
190
|
-
});
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
For webpack 5, add `buffer` to `resolve.fallback` and the `ProvidePlugin` for `Buffer`.
|
|
194
|
-
|
|
195
172
|
## Development
|
|
196
173
|
|
|
197
174
|
```bash
|
|
@@ -211,7 +188,7 @@ npm test
|
|
|
211
188
|
npm run lint
|
|
212
189
|
|
|
213
190
|
# E2E test (starts a local relay, simulates dApp + wallet handshake)
|
|
214
|
-
node test-e2e.
|
|
191
|
+
node test-e2e.mjs
|
|
215
192
|
```
|
|
216
193
|
|
|
217
194
|
## Running the example dApp
|
|
@@ -236,8 +213,12 @@ The example connects to the production relay at `wss://qrlwallet.com/relay` by d
|
|
|
236
213
|
## Security
|
|
237
214
|
|
|
238
215
|
- Private keys and seeds never leave the wallet
|
|
239
|
-
- All relay traffic is
|
|
240
|
-
|
|
216
|
+
- All relay traffic is end-to-end encrypted with **AES-256-GCM** bound to a
|
|
217
|
+
**transcript hash** derived from the full handshake (`LABEL || cid || pk || ct`)
|
|
218
|
+
- Session keys are established with **ML-KEM-768** (FIPS 203, NIST Level 3),
|
|
219
|
+
carried in the QR code so the relay never sees an uncommitted public key
|
|
220
|
+
- Ciphertext tampering is detected exclusively at the AES-GCM tag;
|
|
221
|
+
ML-KEM's implicit rejection is NOT used for authentication
|
|
241
222
|
- PIN or biometric authentication required for every transaction
|
|
242
223
|
- dApp URL is displayed to the user before connecting
|
|
243
224
|
- Unknown RPC methods are rejected with `-32601`
|