@prosopo/account 2.8.0 → 2.8.36

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/account@2.8.0 build:cjs
2
+ > @prosopo/account@2.8.36 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -7,10 +7,12 @@ ViteCommonJSConfig: .
7
7
  tsConfigPaths: [
8
8
  '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
9
9
  '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
10
- '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
10
+ '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
11
11
  '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
12
+ '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
12
13
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
13
14
  '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
15
+ '/home/runner/work/captcha/captcha/packages/fingerprintjs/tsconfig.json',
14
16
  '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'
15
17
  ]
16
18
  }
@@ -18,10 +20,12 @@ ViteCommonJSConfig: .
18
20
  externals: [
19
21
  '@prosopo/common',
20
22
  '@prosopo/locale',
21
- '@prosopo/types',
23
+ '@prosopo/logger',
22
24
  '@prosopo/util',
25
+ '@prosopo/types',
23
26
  '@prosopo/util-crypto',
24
27
  '@prosopo/fingerprint',
28
+ '@prosopo/fingerprintjs',
25
29
  '@prosopo/keyring'
26
30
  ]
27
31
  }
@@ -56,7 +60,7 @@ rendering chunks...
56
60
  dist/cjs/extension/Extension.cjs  0.14 kB
57
61
  dist/cjs/index.cjs  0.42 kB
58
62
  dist/cjs/extension/ExtensionWeb3.cjs  1.31 kB
59
- dist/cjs/extension/ExtensionWeb2.cjs  3.77 kB
60
- dist/cjs/workers/CryptoWorkerManager.cjs  4.50 kB
63
+ dist/cjs/extension/ExtensionWeb2.cjs  3.78 kB
64
+ dist/cjs/workers/CryptoWorkerManager.cjs  4.77 kB
61
65
  dist/cjs/workers/cryptoWorker.cjs 19.63 kB
62
- ✓ built in 1.45s
66
+ ✓ built in 1.35s
@@ -1,17 +1,17 @@
1
1
 
2
- > @prosopo/account@2.8.0 build:tsc
2
+ > @prosopo/account@2.8.36 build:tsc
3
3
  > npm run typecheck && npm run build
4
4
 
5
5
 
6
- > @prosopo/account@2.8.0 typecheck
6
+ > @prosopo/account@2.8.36 typecheck
7
7
  > tsc --project tsconfig.types.json
8
8
 
9
9
 
10
- > @prosopo/account@2.8.0 build
10
+ > @prosopo/account@2.8.36 build
11
11
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
12
12
 
13
13
 
14
- > @prosopo/account@2.8.0 build:cross-env
14
+ > @prosopo/account@2.8.36 build:cross-env
15
15
  > vite build --config vite.esm.config.ts --mode production
16
16
 
17
17
  ViteEsmConfig: .
@@ -19,10 +19,12 @@ ViteEsmConfig: .
19
19
  tsConfigPaths: [
20
20
  '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
21
21
  '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
22
- '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
22
+ '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
23
23
  '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
24
+ '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
24
25
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
25
26
  '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
27
+ '/home/runner/work/captcha/captcha/packages/fingerprintjs/tsconfig.json',
26
28
  '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'
27
29
  ]
28
30
  }
@@ -30,10 +32,12 @@ ViteEsmConfig: .
30
32
  externals: [
31
33
  '@prosopo/common',
32
34
  '@prosopo/locale',
33
- '@prosopo/types',
35
+ '@prosopo/logger',
34
36
  '@prosopo/util',
37
+ '@prosopo/types',
35
38
  '@prosopo/util-crypto',
36
39
  '@prosopo/fingerprint',
40
+ '@prosopo/fingerprintjs',
37
41
  '@prosopo/keyring'
38
42
  ]
39
43
  }
@@ -45,6 +49,11 @@ transforming...
45
49
  "/*#__PURE__*/"
46
50
 
47
51
  in "../../node_modules/@polkadot/x-randomvalues/node_modules/@polkadot/x-global/index.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
52
+ ../../node_modules/@polkadot/util/node_modules/@polkadot/x-global/index.js (9:23): A comment
53
+
54
+ "/*#__PURE__*/"
55
+
56
+ in "../../node_modules/@polkadot/util/node_modules/@polkadot/x-global/index.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
48
57
  ../../node_modules/@polkadot/x-textdecoder/node_modules/@polkadot/x-global/index.js (9:23): A comment
49
58
 
50
59
  "/*#__PURE__*/"
@@ -55,18 +64,13 @@ in "../../node_modules/@polkadot/x-textdecoder/node_modules/@polkadot/x-global/i
55
64
  "/*#__PURE__*/"
56
65
 
57
66
  in "../../node_modules/@polkadot/x-textencoder/node_modules/@polkadot/x-global/index.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
58
- ../../node_modules/@polkadot/util/node_modules/@polkadot/x-global/index.js (9:23): A comment
59
-
60
- "/*#__PURE__*/"
61
-
62
- in "../../node_modules/@polkadot/util/node_modules/@polkadot/x-global/index.js" contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues.
63
67
  Build end
64
68
  ✓ 6 modules transformed.
65
69
  rendering chunks...
66
70
  dist/extension/Extension.js  0.04 kB
67
71
  dist/index.js  0.24 kB
68
72
  dist/extension/ExtensionWeb3.js  1.11 kB
69
- dist/extension/ExtensionWeb2.js  2.39 kB
70
- dist/workers/CryptoWorkerManager.js  4.36 kB
73
+ dist/extension/ExtensionWeb2.js  2.38 kB
74
+ dist/workers/CryptoWorkerManager.js  4.63 kB
71
75
  dist/workers/cryptoWorker.js 19.64 kB
72
- ✓ built in 1.16s
76
+ ✓ built in 1.15s
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/account@2.8.0 build
2
+ > @prosopo/account@2.8.36 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/account@2.8.0 build:cross-env
6
+ > @prosopo/account@2.8.36 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -11,10 +11,12 @@ ViteEsmConfig: .
11
11
  tsConfigPaths: [
12
12
  '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
13
13
  '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
14
- '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
14
+ '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
15
15
  '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
16
+ '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
16
17
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
17
18
  '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
19
+ '/home/runner/work/captcha/captcha/packages/fingerprintjs/tsconfig.json',
18
20
  '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'
19
21
  ]
20
22
  }
@@ -22,10 +24,12 @@ ViteEsmConfig: .
22
24
  externals: [
23
25
  '@prosopo/common',
24
26
  '@prosopo/locale',
25
- '@prosopo/types',
27
+ '@prosopo/logger',
26
28
  '@prosopo/util',
29
+ '@prosopo/types',
27
30
  '@prosopo/util-crypto',
28
31
  '@prosopo/fingerprint',
32
+ '@prosopo/fingerprintjs',
29
33
  '@prosopo/keyring'
30
34
  ]
31
35
  }
@@ -58,7 +62,7 @@ rendering chunks...
58
62
  dist/extension/Extension.js  0.04 kB
59
63
  dist/index.js  0.24 kB
60
64
  dist/extension/ExtensionWeb3.js  1.11 kB
61
- dist/extension/ExtensionWeb2.js  2.39 kB
62
- dist/workers/CryptoWorkerManager.js  4.36 kB
65
+ dist/extension/ExtensionWeb2.js  2.38 kB
66
+ dist/workers/CryptoWorkerManager.js  4.63 kB
63
67
  dist/workers/cryptoWorker.js 19.63 kB
64
- ✓ built in 1.56s
68
+ ✓ built in 1.36s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,349 @@
1
1
  # @prosopo/account
2
2
 
3
+ ## 2.8.36
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [b03dad1]
7
+ - @prosopo/types@4.3.1
8
+ - @prosopo/keyring@2.9.35
9
+
10
+ ## 2.8.35
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [a1d60db]
14
+ - Updated dependencies [2392aaf]
15
+ - Updated dependencies [6ca1125]
16
+ - @prosopo/types@4.3.0
17
+ - @prosopo/util@3.2.15
18
+ - @prosopo/common@3.1.38
19
+ - @prosopo/keyring@2.9.34
20
+
21
+ ## 2.8.34
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [6c26669]
25
+ - Updated dependencies [f7f9ec5]
26
+ - @prosopo/types@4.2.1
27
+ - @prosopo/keyring@2.9.33
28
+
29
+ ## 2.8.33
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [0fd81af]
33
+ - @prosopo/common@3.1.37
34
+ - @prosopo/keyring@2.9.32
35
+
36
+ ## 2.8.32
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [20cae63]
40
+ - Updated dependencies [4d9923e]
41
+ - @prosopo/types@4.2.0
42
+ - @prosopo/keyring@2.9.31
43
+
44
+ ## 2.8.31
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [d351362]
48
+ - @prosopo/types@4.1.4
49
+ - @prosopo/keyring@2.9.30
50
+
51
+ ## 2.8.30
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [6567ce0]
55
+ - Updated dependencies [e2711ae]
56
+ - Updated dependencies [5786629]
57
+ - @prosopo/util@3.2.14
58
+ - @prosopo/types@4.1.3
59
+ - @prosopo/keyring@2.9.29
60
+ - @prosopo/common@3.1.36
61
+
62
+ ## 2.8.29
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [72a1218]
66
+ - @prosopo/util@3.2.13
67
+ - @prosopo/keyring@2.9.28
68
+ - @prosopo/types@4.1.2
69
+
70
+ ## 2.8.28
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [91958da]
74
+ - @prosopo/types@4.1.1
75
+ - @prosopo/common@3.1.35
76
+ - @prosopo/keyring@2.9.27
77
+
78
+ ## 2.8.27
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [6a741ce]
82
+ - @prosopo/types@4.1.0
83
+ - @prosopo/keyring@2.9.26
84
+
85
+ ## 2.8.26
86
+ ### Patch Changes
87
+
88
+ - 642d064: Fix `CryptoWorkerManager` import path so downstream Vite bundles resolve
89
+ the inlined worker. The import was `./cryptoWorker.ts?worker&inline`,
90
+ which kept the `.ts` extension through TypeScript compilation; the
91
+ emitted `dist/workers/CryptoWorkerManager.js` then referenced a
92
+ non-existent `.ts` file when consumed by `procaptcha-bundle`'s Rollup
93
+ build, breaking the cypress workflow with
94
+ `Could not resolve "./cryptoWorker.ts?worker&inline"`. Aligning with
95
+ the catcher pattern (`*.js?worker&inline`).
96
+ - Updated dependencies [642d064]
97
+ - @prosopo/fingerprint@2.6.31
98
+
99
+ ## 2.8.25
100
+ ### Patch Changes
101
+
102
+ - 4aae4e6: Pull the frictionless POST critical path down by ~340ms on the test
103
+ hardware via four focused changes:
104
+
105
+ - **Inline Signer.** `@polkadot/extension-base/page/Signer` is now a
106
+ static import in `ExtensionWeb2`. It's 0.5KB on disk but its dynamic
107
+ import was costing ~190ms of network round-trip; inlining removes
108
+ one separate chunk fetch + parse from the critical path.
109
+
110
+ - **Pre-warm the CryptoWorker.** `CryptoWorkerManager` gains a public
111
+ `prewarm()` that actually spawns the Worker and lets its script
112
+ parse during chunk-load time. Previously the call at module load
113
+ only instantiated the manager class; the worker itself spun up
114
+ lazily on the first `runTask`, putting the ~500ms worker module-eval
115
+ inside the first `createAccount()` call. Now it overlaps with chunk
116
+ loading and is hot by the time it's needed.
117
+
118
+ - **Prefetch providers at module load with an env-keyed cache.**
119
+ `prefetchProviders` and `getRandomActiveProvider` share an in-flight
120
+ `Promise<HardcodedProvider[]>` keyed by environment, so a module-load
121
+ prefetch and the later `customDetectBot` Promise.all reuse the same
122
+ network call. `procaptcha-frictionless` triggers the prefetch from
123
+ module-import time using `PROSOPO_DEFAULT_ENVIRONMENT` (browser-safe
124
+ `typeof process` guard + `EnvironmentTypesSchema.safeParse`), so the
125
+ HTTP fetch overlaps with chunk download instead of running as part
126
+ of the detection Promise.all.
127
+
128
+ - **Lazy-load the three captcha solvers.** `ProcaptchaFrictionless`
129
+ no longer statically imports `Procaptcha`, `ProcaptchaPuzzle`, and
130
+ `ProcaptchaPow`; each is `await import(...)` at the point the
131
+ frictionless response picks a type. Two of the three wrappers used
132
+ to be dead weight in the initial bundle; now only the chosen solver
133
+ is downloaded, after the frictionless POST has fired. Pulls ~64KB
134
+ of solver UI (chosen wrapper + Emotion dev runtime + builder + lazy
135
+ shim) out of the initial captchaRenderer chunk.
136
+
137
+ Combined with the earlier worker-related changes, the frictionless POST
138
+ on the puzzle-implicit test page is now ~1290ms vs ~1630ms before this
139
+ batch, and ~6500ms in the original baseline. The remaining floor is
140
+ dominated by the BotScoreWorker's obfuscated bundle parse + run.
141
+ - Updated dependencies [3c0be68]
142
+ - Updated dependencies [4aae4e6]
143
+ - Updated dependencies [f9ea09d]
144
+ - Updated dependencies [4aae4e6]
145
+ - Updated dependencies [d865319]
146
+ - Updated dependencies [753304b]
147
+ - Updated dependencies [8bb7286]
148
+ - Updated dependencies [f9ea09d]
149
+ - Updated dependencies [4aae4e6]
150
+ - Updated dependencies [4993813]
151
+ - @prosopo/types@4.0.0
152
+ - @prosopo/fingerprint@2.6.30
153
+ - @prosopo/util@3.2.12
154
+ - @prosopo/keyring@2.9.25
155
+ - @prosopo/common@3.1.34
156
+
157
+ ## 2.8.24
158
+ ### Patch Changes
159
+
160
+ - Updated dependencies [819ed95]
161
+ - @prosopo/types@3.16.1
162
+ - @prosopo/keyring@2.9.24
163
+
164
+ ## 2.8.23
165
+ ### Patch Changes
166
+
167
+ - Updated dependencies [f6a4402]
168
+ - Updated dependencies [99dfb44]
169
+ - @prosopo/types@3.16.0
170
+ - @prosopo/keyring@2.9.23
171
+
172
+ ## 2.8.22
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies [3e54c0a]
176
+ - @prosopo/types@3.15.0
177
+ - @prosopo/keyring@2.9.22
178
+
179
+ ## 2.8.21
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies [946a8ba]
183
+ - Updated dependencies [5614814]
184
+ - @prosopo/types@3.14.1
185
+ - @prosopo/common@3.1.33
186
+ - @prosopo/keyring@2.9.21
187
+
188
+ ## 2.8.20
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [fc514dd]
192
+ - Updated dependencies [42650db]
193
+ - @prosopo/types@3.14.0
194
+ - @prosopo/common@3.1.32
195
+ - @prosopo/keyring@2.9.20
196
+
197
+ ## 2.8.19
198
+ ### Patch Changes
199
+
200
+ - Updated dependencies [4a9c518]
201
+ - @prosopo/common@3.1.31
202
+ - @prosopo/keyring@2.9.19
203
+
204
+ ## 2.8.18
205
+ ### Patch Changes
206
+
207
+ - Updated dependencies [a25dffa]
208
+ - @prosopo/util@3.2.11
209
+ - @prosopo/keyring@2.9.18
210
+ - @prosopo/types@3.13.3
211
+
212
+ ## 2.8.17
213
+ ### Patch Changes
214
+
215
+ - Updated dependencies [346edd7]
216
+ - @prosopo/util@3.2.10
217
+ - @prosopo/keyring@2.9.17
218
+ - @prosopo/types@3.13.2
219
+
220
+ ## 2.8.16
221
+ ### Patch Changes
222
+
223
+ - Updated dependencies [22bfee7]
224
+ - @prosopo/util@3.2.9
225
+ - @prosopo/keyring@2.9.16
226
+ - @prosopo/types@3.13.1
227
+
228
+ ## 2.8.15
229
+ ### Patch Changes
230
+
231
+ - Updated dependencies [e0fb3d6]
232
+ - Updated dependencies [e6d9553]
233
+ - Updated dependencies [f3f23e3]
234
+ - @prosopo/util@3.2.8
235
+ - @prosopo/types@3.13.0
236
+ - @prosopo/keyring@2.9.15
237
+
238
+ ## 2.8.14
239
+ ### Patch Changes
240
+
241
+ - 730c61e: Speed up captcha
242
+ - Updated dependencies [730c61e]
243
+ - Updated dependencies [d5082a9]
244
+ - Updated dependencies [e1ea65f]
245
+ - Updated dependencies [c316257]
246
+ - @prosopo/fingerprint@2.6.29
247
+ - @prosopo/types@3.12.3
248
+ - @prosopo/util@3.2.7
249
+ - @prosopo/keyring@2.9.14
250
+
251
+ ## 2.8.13
252
+ ### Patch Changes
253
+
254
+ - Updated dependencies [adb89a6]
255
+ - @prosopo/types@3.12.2
256
+ - @prosopo/util@3.2.6
257
+ - @prosopo/common@3.1.30
258
+ - @prosopo/keyring@2.9.13
259
+
260
+ ## 2.8.12
261
+ ### Patch Changes
262
+
263
+ - Updated dependencies [c5ee492]
264
+ - Updated dependencies [a90eb54]
265
+ - @prosopo/common@3.1.29
266
+ - @prosopo/types@3.12.1
267
+ - @prosopo/keyring@2.9.12
268
+
269
+ ## 2.8.11
270
+ ### Patch Changes
271
+
272
+ - Updated dependencies [676c5f2]
273
+ - Updated dependencies [feaca02]
274
+ - @prosopo/keyring@2.9.11
275
+ - @prosopo/types@3.12.0
276
+
277
+ ## 2.8.10
278
+ ### Patch Changes
279
+
280
+ - Updated dependencies [8148587]
281
+ - @prosopo/types@3.11.1
282
+ - @prosopo/keyring@2.9.10
283
+
284
+ ## 2.8.9
285
+ ### Patch Changes
286
+
287
+ - Updated dependencies [7f6ffc5]
288
+ - @prosopo/types@3.11.0
289
+ - @prosopo/keyring@2.9.9
290
+
291
+ ## 2.8.8
292
+ ### Patch Changes
293
+
294
+ - Updated dependencies [93fa086]
295
+ - @prosopo/types@3.10.2
296
+ - @prosopo/keyring@2.9.8
297
+
298
+ ## 2.8.7
299
+ ### Patch Changes
300
+
301
+ - Updated dependencies [cde7550]
302
+ - @prosopo/types@3.10.1
303
+ - @prosopo/keyring@2.9.7
304
+
305
+ ## 2.8.6
306
+ ### Patch Changes
307
+
308
+ - Updated dependencies [ad6d622]
309
+ - @prosopo/types@3.10.0
310
+ - @prosopo/keyring@2.9.6
311
+
312
+ ## 2.8.5
313
+ ### Patch Changes
314
+
315
+ - Updated dependencies [ff58a70]
316
+ - @prosopo/types@3.9.0
317
+ - @prosopo/keyring@2.9.5
318
+
319
+ ## 2.8.4
320
+ ### Patch Changes
321
+
322
+ - Updated dependencies [d2431cd]
323
+ - @prosopo/types@3.8.4
324
+ - @prosopo/keyring@2.9.4
325
+
326
+ ## 2.8.3
327
+ ### Patch Changes
328
+
329
+ - Updated dependencies [bd6995b]
330
+ - @prosopo/types@3.8.3
331
+ - @prosopo/keyring@2.9.3
332
+
333
+ ## 2.8.2
334
+ ### Patch Changes
335
+
336
+ - Updated dependencies [9633e58]
337
+ - @prosopo/types@3.8.2
338
+ - @prosopo/keyring@2.9.2
339
+
340
+ ## 2.8.1
341
+ ### Patch Changes
342
+
343
+ - Updated dependencies [f52a5c1]
344
+ - @prosopo/types@3.8.1
345
+ - @prosopo/keyring@2.9.1
346
+
3
347
  ## 2.8.0
4
348
  ### Minor Changes
5
349
 
@@ -22,6 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
25
+ const Signer = require("@polkadot/extension-base/page/Signer");
25
26
  const util$1 = require("@polkadot/util");
26
27
  const fingerprint = require("@prosopo/fingerprint");
27
28
  const keyring = require("@prosopo/keyring");
@@ -29,19 +30,19 @@ const util = require("@prosopo/util");
29
30
  const utilCrypto = require("@prosopo/util-crypto");
30
31
  const CryptoWorkerManager = require("../workers/CryptoWorkerManager.cjs");
31
32
  const Extension = require("./Extension.cjs");
32
- const SignerLoader = async () => (await import("@polkadot/extension-base/page/Signer")).default;
33
+ fingerprint.prefetchFingerprint();
34
+ CryptoWorkerManager.getCryptoWorkerManager().prewarm();
33
35
  const EntropyToMnemonicLoader = async () => (await import("@prosopo/util-crypto")).entropyToMnemonic;
34
36
  class ExtensionWeb2 extends Extension.Extension {
35
37
  async getAccount(config) {
36
38
  const account = await this.createAccount(config);
37
- const extension = await this.createExtension(account);
39
+ const extension = this.createExtension(account);
38
40
  return {
39
41
  account,
40
42
  extension
41
43
  };
42
44
  }
43
- async createExtension(account) {
44
- const Signer = await SignerLoader();
45
+ createExtension(account) {
45
46
  const signer = new Signer(async () => {
46
47
  return;
47
48
  });
@@ -73,6 +73,15 @@ class CryptoWorkerManager {
73
73
  worker.postMessage({ taskId: "test", task: "test", data: {} });
74
74
  });
75
75
  }
76
+ /**
77
+ * Eagerly spawn the worker so the first runTask() doesn't pay the
78
+ * worker-spawn + module-parse cost. Failures are swallowed because
79
+ * runTask() will reattempt initWorker() on demand.
80
+ */
81
+ prewarm() {
82
+ this.initWorker().catch(() => {
83
+ });
84
+ }
76
85
  /**
77
86
  * Run a task in the Web Worker
78
87
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionWeb2.d.ts","sourceRoot":"","sources":["../../src/extension/ExtensionWeb2.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAY3C,qBAAa,aAAc,SAAQ,SAAS;IAC9B,UAAU,CACtB,MAAM,EAAE,4BAA4B,GAClC,OAAO,CAAC,OAAO,CAAC;YAUL,eAAe;YAoCf,aAAa;CAiC3B;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ExtensionWeb2.d.ts","sourceRoot":"","sources":["../../src/extension/ExtensionWeb2.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAa3C,qBAAa,aAAc,SAAQ,SAAS;IAC9B,UAAU,CACtB,MAAM,EAAE,4BAA4B,GAClC,OAAO,CAAC,OAAO,CAAC;IAUnB,OAAO,CAAC,eAAe;YAiCT,aAAa;CAiC3B;AAED,eAAe,aAAa,CAAC"}
@@ -1,23 +1,24 @@
1
+ import Signer from "@polkadot/extension-base/page/Signer";
1
2
  import { stringToU8a } from "@polkadot/util";
2
- import { getFingerprint } from "@prosopo/fingerprint";
3
+ import { prefetchFingerprint, getFingerprint } from "@prosopo/fingerprint";
3
4
  import { Keyring } from "@prosopo/keyring";
4
5
  import { u8aToHex, version } from "@prosopo/util";
5
6
  import { hexHash } from "@prosopo/util-crypto";
6
7
  import { getCryptoWorkerManager } from "../workers/CryptoWorkerManager.js";
7
8
  import { Extension } from "./Extension.js";
8
- const SignerLoader = async () => (await import("@polkadot/extension-base/page/Signer")).default;
9
+ prefetchFingerprint();
10
+ getCryptoWorkerManager().prewarm();
9
11
  const EntropyToMnemonicLoader = async () => (await import("@prosopo/util-crypto")).entropyToMnemonic;
10
12
  class ExtensionWeb2 extends Extension {
11
13
  async getAccount(config) {
12
14
  const account = await this.createAccount(config);
13
- const extension = await this.createExtension(account);
15
+ const extension = this.createExtension(account);
14
16
  return {
15
17
  account,
16
18
  extension
17
19
  };
18
20
  }
19
- async createExtension(account) {
20
- const Signer = await SignerLoader();
21
+ createExtension(account) {
21
22
  const signer = new Signer(async () => {
22
23
  return;
23
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionWeb2.js","sourceRoot":"","sources":["../../src/extension/ExtensionWeb2.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,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OAAO;SACP,CAAC;IACH,CAAC;CACD;AAED,eAAe,aAAa,CAAC"}
@@ -3,6 +3,7 @@ export declare class CryptoWorkerManager {
3
3
  private isInitializing;
4
4
  private initWorker;
5
5
  private testWorker;
6
+ prewarm(): void;
6
7
  runTask<T>(task: string, data: Record<string, string | Uint8Array>): Promise<T>;
7
8
  entropyToMnemonic(entropy: Uint8Array): Promise<string>;
8
9
  private cleanup;
@@ -1 +1 @@
1
- {"version":3,"file":"CryptoWorkerManager.d.ts","sourceRoot":"","sources":["../../src/workers/CryptoWorkerManager.ts"],"names":[],"mappings":"AAgCA,qBAAa,mBAAmB;IAC/B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,cAAc,CAAS;YAKjB,UAAU;YAkCV,UAAU;IAsDlB,OAAO,CAAC,CAAC,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,GACvC,OAAO,CAAC,CAAC,CAAC;IAoDP,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAO7D,OAAO,CAAC,OAAO;IAWR,OAAO,IAAI,IAAI;CAGtB;AAQD,wBAAgB,sBAAsB,IAAI,mBAAmB,CAK5D"}
1
+ {"version":3,"file":"CryptoWorkerManager.d.ts","sourceRoot":"","sources":["../../src/workers/CryptoWorkerManager.ts"],"names":[],"mappings":"AA+BA,qBAAa,mBAAmB;IAC/B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,cAAc,CAAS;YAKjB,UAAU;YAkCV,UAAU;IAwDxB,OAAO,IAAI,IAAI;IAOT,OAAO,CAAC,CAAC,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,GACvC,OAAO,CAAC,CAAC,CAAC;IAoDP,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAO7D,OAAO,CAAC,OAAO;IAWR,OAAO,IAAI,IAAI;CAGtB;AAQD,wBAAgB,sBAAsB,IAAI,mBAAmB,CAK5D"}
@@ -71,6 +71,15 @@ class CryptoWorkerManager {
71
71
  worker.postMessage({ taskId: "test", task: "test", data: {} });
72
72
  });
73
73
  }
74
+ /**
75
+ * Eagerly spawn the worker so the first runTask() doesn't pay the
76
+ * worker-spawn + module-parse cost. Failures are swallowed because
77
+ * runTask() will reattempt initWorker() on demand.
78
+ */
79
+ prewarm() {
80
+ this.initWorker().catch(() => {
81
+ });
82
+ }
74
83
  /**
75
84
  * Run a task in the Web Worker
76
85
  */