@prosopo/account 2.8.57 → 2.8.59
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/.turbo/turbo-build$colon$cjs.log +10 -10
- package/.turbo/turbo-build$colon$tsc.log +8 -8
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +42 -0
- package/dist/cjs/extension/ExtensionWeb2.cjs +11 -15
- package/dist/cjs/workers/CryptoWorkerManager.cjs +28 -58
- package/dist/cjs/workers/cryptoWorker.cjs +1 -1
- package/dist/extension/ExtensionWeb2.d.ts.map +1 -1
- package/dist/extension/ExtensionWeb2.js +11 -15
- package/dist/extension/ExtensionWeb2.js.map +1 -1
- package/dist/tests/ExtensionWeb2.unit.test.d.ts +2 -0
- package/dist/tests/ExtensionWeb2.unit.test.d.ts.map +1 -0
- package/dist/tests/ExtensionWeb2.unit.test.js +93 -0
- package/dist/tests/ExtensionWeb2.unit.test.js.map +1 -0
- package/dist/tests/cryptoWorker.unit.test.d.ts +2 -0
- package/dist/tests/cryptoWorker.unit.test.d.ts.map +1 -0
- package/dist/tests/cryptoWorker.unit.test.js +74 -0
- package/dist/tests/cryptoWorker.unit.test.js.map +1 -0
- package/dist/workers/CryptoWorkerManager.d.ts +8 -1
- package/dist/workers/CryptoWorkerManager.d.ts.map +1 -1
- package/dist/workers/CryptoWorkerManager.js +28 -58
- package/dist/workers/CryptoWorkerManager.js.map +1 -1
- package/dist/workers/cryptoWorker.js +1 -1
- package/dist/workers/cryptoWorker.js.map +1 -1
- package/package.json +3 -1
- package/src/extension/ExtensionWeb2.ts +26 -18
- package/src/tests/ExtensionWeb2.unit.test.ts +172 -0
- package/src/tests/cryptoWorker.unit.test.ts +146 -0
- package/src/workers/CryptoWorkerManager.ts +43 -76
- package/src/workers/cryptoWorker.ts +34 -15
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.test.config.ts +28 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/account@2.8.
|
|
2
|
+
> @prosopo/account@2.8.59 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -37,11 +37,6 @@ transforming...
|
|
|
37
37
|
"/*#__PURE__*/"
|
|
38
38
|
|
|
39
39
|
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.[39m
|
|
40
|
-
[33m../../node_modules/@polkadot/util/node_modules/@polkadot/x-global/index.js (9:23): A comment
|
|
41
|
-
|
|
42
|
-
"/*#__PURE__*/"
|
|
43
|
-
|
|
44
|
-
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.[39m
|
|
45
40
|
[33m../../node_modules/@polkadot/x-textdecoder/node_modules/@polkadot/x-global/index.js (9:23): A comment
|
|
46
41
|
|
|
47
42
|
"/*#__PURE__*/"
|
|
@@ -52,6 +47,11 @@ in "../../node_modules/@polkadot/x-textdecoder/node_modules/@polkadot/x-global/i
|
|
|
52
47
|
"/*#__PURE__*/"
|
|
53
48
|
|
|
54
49
|
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.[39m
|
|
50
|
+
[33m../../node_modules/@polkadot/util/node_modules/@polkadot/x-global/index.js (9:23): A comment
|
|
51
|
+
|
|
52
|
+
"/*#__PURE__*/"
|
|
53
|
+
|
|
54
|
+
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.[39m
|
|
55
55
|
Build end
|
|
56
56
|
[32m✓[39m 6 modules transformed.
|
|
57
57
|
[33mEntry module "src/extension/ExtensionWeb2.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.[39m
|
|
@@ -60,7 +60,7 @@ rendering chunks...
|
|
|
60
60
|
[2mdist/cjs/[22m[36mextension/Extension.cjs [39m[1m[2m 0.14 kB[22m[1m[22m
|
|
61
61
|
[2mdist/cjs/[22m[36mindex.cjs [39m[1m[2m 0.42 kB[22m[1m[22m
|
|
62
62
|
[2mdist/cjs/[22m[36mextension/ExtensionWeb3.cjs [39m[1m[2m 1.31 kB[22m[1m[22m
|
|
63
|
-
[2mdist/cjs/[22m[36mextension/ExtensionWeb2.cjs [39m[1m[2m 3.
|
|
64
|
-
[2mdist/cjs/[22m[36mworkers/CryptoWorkerManager.cjs [39m[1m[2m 4.
|
|
65
|
-
[2mdist/cjs/[22m[36mworkers/cryptoWorker.cjs [39m[1m[
|
|
66
|
-
[32m✓ built in 1.
|
|
63
|
+
[2mdist/cjs/[22m[36mextension/ExtensionWeb2.cjs [39m[1m[2m 3.93 kB[22m[1m[22m
|
|
64
|
+
[2mdist/cjs/[22m[36mworkers/CryptoWorkerManager.cjs [39m[1m[2m 4.14 kB[22m[1m[22m
|
|
65
|
+
[2mdist/cjs/[22m[36mworkers/cryptoWorker.cjs [39m[1m[2m51.55 kB[22m[1m[22m
|
|
66
|
+
[32m✓ built in 1.59s[39m
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/account@2.8.
|
|
2
|
+
> @prosopo/account@2.8.59 build:tsc
|
|
3
3
|
> npm run typecheck && npm run build
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/account@2.8.
|
|
6
|
+
> @prosopo/account@2.8.59 typecheck
|
|
7
7
|
> tsc --project tsconfig.types.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @prosopo/account@2.8.
|
|
10
|
+
> @prosopo/account@2.8.59 build
|
|
11
11
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
> @prosopo/account@2.8.
|
|
14
|
+
> @prosopo/account@2.8.59 build:cross-env
|
|
15
15
|
> vite build --config vite.esm.config.ts --mode production
|
|
16
16
|
|
|
17
17
|
ViteEsmConfig: .
|
|
@@ -70,7 +70,7 @@ rendering chunks...
|
|
|
70
70
|
[2mdist/[22m[36mextension/Extension.js [39m[1m[2m 0.04 kB[22m[1m[22m
|
|
71
71
|
[2mdist/[22m[36mindex.js [39m[1m[2m 0.24 kB[22m[1m[22m
|
|
72
72
|
[2mdist/[22m[36mextension/ExtensionWeb3.js [39m[1m[2m 1.11 kB[22m[1m[22m
|
|
73
|
-
[2mdist/[22m[36mextension/ExtensionWeb2.js [39m[1m[2m 2.
|
|
74
|
-
[2mdist/[22m[36mworkers/CryptoWorkerManager.js [39m[1m[2m 4.
|
|
75
|
-
[2mdist/[22m[36mworkers/cryptoWorker.js [39m[1m[
|
|
76
|
-
[32m✓ built in 1.
|
|
73
|
+
[2mdist/[22m[36mextension/ExtensionWeb2.js [39m[1m[2m 2.53 kB[22m[1m[22m
|
|
74
|
+
[2mdist/[22m[36mworkers/CryptoWorkerManager.js [39m[1m[2m 4.00 kB[22m[1m[22m
|
|
75
|
+
[2mdist/[22m[36mworkers/cryptoWorker.js [39m[1m[2m51.55 kB[22m[1m[22m
|
|
76
|
+
[32m✓ built in 1.11s[39m
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/account@2.8.
|
|
2
|
+
> @prosopo/account@2.8.59 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/account@2.8.
|
|
6
|
+
> @prosopo/account@2.8.59 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -62,7 +62,7 @@ rendering chunks...
|
|
|
62
62
|
[2mdist/[22m[36mextension/Extension.js [39m[1m[2m 0.04 kB[22m[1m[22m
|
|
63
63
|
[2mdist/[22m[36mindex.js [39m[1m[2m 0.24 kB[22m[1m[22m
|
|
64
64
|
[2mdist/[22m[36mextension/ExtensionWeb3.js [39m[1m[2m 1.11 kB[22m[1m[22m
|
|
65
|
-
[2mdist/[22m[36mextension/ExtensionWeb2.js [39m[1m[2m 2.
|
|
66
|
-
[2mdist/[22m[36mworkers/CryptoWorkerManager.js [39m[1m[2m 4.
|
|
67
|
-
[2mdist/[22m[36mworkers/cryptoWorker.js [39m[1m[
|
|
68
|
-
[32m✓ built in 1.
|
|
65
|
+
[2mdist/[22m[36mextension/ExtensionWeb2.js [39m[1m[2m 2.53 kB[22m[1m[22m
|
|
66
|
+
[2mdist/[22m[36mworkers/CryptoWorkerManager.js [39m[1m[2m 4.00 kB[22m[1m[22m
|
|
67
|
+
[2mdist/[22m[36mworkers/cryptoWorker.js [39m[1m[2m51.54 kB[22m[1m[22m
|
|
68
|
+
[32m✓ built in 1.67s[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @prosopo/account
|
|
2
2
|
|
|
3
|
+
## 2.8.59
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- b0d446f: test(account): unit tests for CryptoWorker + ExtensionWeb2 keypair-derivation paths
|
|
7
|
+
|
|
8
|
+
Adds unit coverage for the code changed in the sr25519-in-worker perf PR (#2830):
|
|
9
|
+
|
|
10
|
+
- `cryptoWorker.unit.test.ts` — exercises the primitives (`entropyToMnemonic`, `mnemonicToMiniSecret`, `sr25519FromSeed`) the CryptoWorker's task dispatch calls into, and asserts the composed `entropyToKeypair` pipeline produces:
|
|
11
|
+
- a keypair byte-equivalent (address + publicKey) to `keyring.addFromMnemonic(mnemonic)`
|
|
12
|
+
- signatures that verify cross-instance (`addFromPair`-derived sig verifies against `addFromMnemonic`'s public key, and vice-versa)
|
|
13
|
+
- deterministic output for identical entropy input
|
|
14
|
+
- proper input-validation rejection for non-BIP39 entropy sizes
|
|
15
|
+
- `ExtensionWeb2.unit.test.ts` — mocks `getCryptoWorkerManager` + `getFingerprint` to lock down both branches of `createAccount`:
|
|
16
|
+
- **worker branch** — `entropyToKeypair` resolves with raw bytes, `addFromPair` produces the expected address
|
|
17
|
+
- **fallback branch** — `entropyToKeypair` rejects (worker unavailable), falls through to `entropyToMnemonic` + `addFromMnemonic` on main thread, produces the *same* address
|
|
18
|
+
- A/B check confirming worker and fallback branches derive identical addresses for the same fingerprint — the invariant that lets us swap the paths without breaking session identity for users whose worker fails
|
|
19
|
+
|
|
20
|
+
Also wires up a `test` script and `vite.test.config.ts` in `@prosopo/account`, which had none previously.
|
|
21
|
+
|
|
22
|
+
**cli patch**: sync bump so the release cuts a new tag (root version follows `@prosopo/cli`) and the tag-triggered `publish_release` + downstream `deploy-procaptcha-bundle` republishes the CDN bundle with the sr25519-in-worker perf improvements from #2830. Without this, the `test(account)` bump alone leaves cli at its current version, the release script computes the same root version as the previous tag, and no new `v*.*.*` tag → no publish → no CDN republish.
|
|
23
|
+
|
|
24
|
+
## 2.8.58
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- ced80a4: perf(account,procaptcha-frictionless): move sr25519 keypair derivation into CryptoWorker + trim critical-path round-trips
|
|
28
|
+
|
|
29
|
+
Reduces the frictionless client-side gap (last widget-bundle chunk → `POST /v1/prosopo/provider/client/captcha/frictionless`) by ~1s on constrained hardware (measured at 30x CPU throttle, mean over 5 samples: **3431ms → 2434ms, −997ms / −29%**).
|
|
30
|
+
|
|
31
|
+
Three changes in one PR because they interact:
|
|
32
|
+
|
|
33
|
+
1. **sr25519 keypair derivation moves off the main thread.** `ExtensionWeb2.createAccount` was calling `keyring.addFromMnemonic(mnemonic)` synchronously on the main thread. Internally that's `mnemonicToMiniSecret` → `sr25519FromSeed` → a scalar multiplication on Ristretto25519 via `@noble/curves`, dominated by `wNAFCached` / `getPrecomputes` / `multiply`. On a mid-tier laptop that's ~500ms of blocking main-thread work sitting inside the giant `HandlePostMessage → RunMicrotasks` task that also runs the DOM-bound detectors. CryptoWorker now does the derivation and returns the raw `{publicKey, secretKey}` bytes; main thread wraps them with `keyring.addFromPair(...)` which is cheap byte-packaging — no ECC work.
|
|
34
|
+
|
|
35
|
+
2. **`entropyToMnemonic` + keypair derivation fused into a single worker task (`entropyToKeypair`).** Previously two sequential worker round-trips would have been needed (entropy → mnemonic on worker → return → mnemonic → keypair on worker → return). Fusing saves one postMessage transit (~30-80ms under throttle) on the critical path. The existing `entropyToMnemonic` task stays for callers that still want the mnemonic string standalone.
|
|
36
|
+
|
|
37
|
+
3. **`CryptoWorkerManager.testWorker()` removed.** It was a Blob-URL-era defensive check — post-construction failures already surface via `worker.onerror` (which cleans up so the next `runTask` reinitialises), and task-level failures surface via `runTask`'s 10s timeout + reject (which triggers the main-thread fallback). Under Vite's `?worker&inline` constructor the round-trip is pure overhead. Removing it saves ~30-80ms per worker init on constrained hardware.
|
|
38
|
+
|
|
39
|
+
Also: `customDetectBot` starts `ext.getAccount(config)` before calling `detect()` so the CryptoWorker task overlaps with the detector's module.evaluate + botScore work instead of gating them at the end.
|
|
40
|
+
|
|
41
|
+
Fallback path is preserved end-to-end: worker construction failure or task timeout falls back to synchronous main-thread derivation via `entropyToMnemonic` + `keyring.addFromMnemonic`, matching prior behaviour for browsers that block workers (CSP, embedded WebViews).
|
|
42
|
+
|
|
43
|
+
Measurement setup: Chrome via CDP, 30x CPU throttling, 5 samples each on identical hardware, gap timed from last js chunk `finish` → `healthz` request start (proxy for “widget can send frictionless POST”). Both sides use the same generation of the catcher-derived detector blob, so the delta reflects only the captcha-side changes.
|
|
44
|
+
|
|
3
45
|
## 2.8.57
|
|
4
46
|
### Patch Changes
|
|
5
47
|
|
|
@@ -74,25 +74,21 @@ class ExtensionWeb2 extends Extension.Extension {
|
|
|
74
74
|
const browserEntropy = await fingerprint.getFingerprint();
|
|
75
75
|
const entropy = utilCrypto.hexHash(browserEntropy, 128).slice(2);
|
|
76
76
|
const u8Entropy = util$1.stringToU8a(entropy);
|
|
77
|
-
|
|
77
|
+
const type = "sr25519";
|
|
78
|
+
const keyring$1 = new keyring.Keyring({ type });
|
|
79
|
+
const workerManager = CryptoWorkerManager.getCryptoWorkerManager();
|
|
78
80
|
try {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
+
const { publicKey, secretKey } = await workerManager.entropyToKeypair(u8Entropy);
|
|
82
|
+
const keypair = keyring$1.addFromPair({ publicKey, secretKey }, {}, type);
|
|
83
|
+
const address = keypair.address;
|
|
84
|
+
return { address, name: address, keypair };
|
|
81
85
|
} catch (workerError) {
|
|
82
86
|
const entropyToMnemonic = await EntropyToMnemonicLoader();
|
|
83
|
-
mnemonic = entropyToMnemonic(u8Entropy);
|
|
87
|
+
const mnemonic = entropyToMnemonic(u8Entropy);
|
|
88
|
+
const keypair = keyring$1.addFromMnemonic(mnemonic);
|
|
89
|
+
const address = keypair.address;
|
|
90
|
+
return { address, name: address, keypair };
|
|
84
91
|
}
|
|
85
|
-
const type = "sr25519";
|
|
86
|
-
const keyring$1 = new keyring.Keyring({
|
|
87
|
-
type
|
|
88
|
-
});
|
|
89
|
-
const keypair = keyring$1.addFromMnemonic(mnemonic);
|
|
90
|
-
const address = keypair.address;
|
|
91
|
-
return {
|
|
92
|
-
address,
|
|
93
|
-
name: address,
|
|
94
|
-
keypair
|
|
95
|
-
};
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
exports.ExtensionWeb2 = ExtensionWeb2;
|
|
@@ -7,86 +7,43 @@ class CryptoWorkerManager {
|
|
|
7
7
|
this.isInitializing = false;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Initialize the worker
|
|
10
|
+
* Initialize the worker. No test round-trip — construction failure throws
|
|
11
|
+
* synchronously (caught below); post-construction failures surface via
|
|
12
|
+
* `worker.onerror` (cleans up so the next call retries); anything that
|
|
13
|
+
* gets past both surfaces via `runTask`'s timeout + reject path, which
|
|
14
|
+
* already falls back to main-thread crypto. The prior `testWorker()` ping
|
|
15
|
+
* was a Blob-URL-era defensive check that no longer earns its ~30–80ms
|
|
16
|
+
* critical-path cost under Vite's `?worker&inline` constructor.
|
|
11
17
|
*/
|
|
12
|
-
|
|
18
|
+
initWorker() {
|
|
13
19
|
if (this.worker || this.isInitializing) {
|
|
14
20
|
return;
|
|
15
21
|
}
|
|
16
22
|
this.isInitializing = true;
|
|
17
23
|
try {
|
|
18
24
|
this.worker = new cryptoWorker({ type: "module" });
|
|
19
|
-
this.worker.onerror = (
|
|
25
|
+
this.worker.onerror = () => {
|
|
20
26
|
this.cleanup();
|
|
21
27
|
};
|
|
22
|
-
|
|
23
|
-
} catch (error) {
|
|
28
|
+
} catch {
|
|
24
29
|
this.cleanup();
|
|
25
|
-
throw error;
|
|
26
30
|
} finally {
|
|
27
|
-
|
|
28
|
-
this.isInitializing = false;
|
|
29
|
-
}
|
|
31
|
+
this.isInitializing = false;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Test if the worker is functioning properly
|
|
34
|
-
*/
|
|
35
|
-
async testWorker() {
|
|
36
|
-
if (!this.worker) {
|
|
37
|
-
throw new Error("Worker not initialized");
|
|
38
|
-
}
|
|
39
|
-
const worker = this.worker;
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
const testTimeout = setTimeout(() => {
|
|
42
|
-
worker.removeEventListener("message", handleMessage);
|
|
43
|
-
worker.removeEventListener("error", handleError);
|
|
44
|
-
reject(new Error("Worker test timeout"));
|
|
45
|
-
}, 5e3);
|
|
46
|
-
const handleMessage = (event) => {
|
|
47
|
-
const { taskId, error, result } = event.data;
|
|
48
|
-
if (taskId === "test") {
|
|
49
|
-
clearTimeout(testTimeout);
|
|
50
|
-
worker.removeEventListener("message", handleMessage);
|
|
51
|
-
worker.removeEventListener("error", handleError);
|
|
52
|
-
if (error || result !== "ready") {
|
|
53
|
-
reject(
|
|
54
|
-
new Error(
|
|
55
|
-
`Worker test failed: ${error || 'Did not return "ready"'}`
|
|
56
|
-
)
|
|
57
|
-
);
|
|
58
|
-
} else {
|
|
59
|
-
resolve();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const handleError = (error) => {
|
|
64
|
-
clearTimeout(testTimeout);
|
|
65
|
-
worker.removeEventListener("message", handleMessage);
|
|
66
|
-
worker.removeEventListener("error", handleError);
|
|
67
|
-
reject(
|
|
68
|
-
new Error(`Worker test failed with error event: ${error.message}`)
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
worker.addEventListener("message", handleMessage);
|
|
72
|
-
worker.addEventListener("error", handleError);
|
|
73
|
-
worker.postMessage({ taskId: "test", task: "test", data: {} });
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
34
|
/**
|
|
77
35
|
* Eagerly spawn the worker so the first runTask() doesn't pay the
|
|
78
|
-
* worker-spawn + module-parse cost.
|
|
79
|
-
*
|
|
36
|
+
* worker-spawn + module-parse cost. Synchronous now — construction is
|
|
37
|
+
* fire-and-forget with cleanup via `worker.onerror`.
|
|
80
38
|
*/
|
|
81
39
|
prewarm() {
|
|
82
|
-
this.initWorker()
|
|
83
|
-
});
|
|
40
|
+
this.initWorker();
|
|
84
41
|
}
|
|
85
42
|
/**
|
|
86
43
|
* Run a task in the Web Worker
|
|
87
44
|
*/
|
|
88
45
|
async runTask(task, data) {
|
|
89
|
-
|
|
46
|
+
this.initWorker();
|
|
90
47
|
if (!this.worker) {
|
|
91
48
|
throw new Error("Failed to initialize worker");
|
|
92
49
|
}
|
|
@@ -128,6 +85,19 @@ class CryptoWorkerManager {
|
|
|
128
85
|
async entropyToMnemonic(entropy) {
|
|
129
86
|
return this.runTask("entropyToMnemonic", { entropy });
|
|
130
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Fused: entropy → mnemonic → sr25519 keypair in a single worker
|
|
90
|
+
* round-trip. Callers that don't need the mnemonic separately should
|
|
91
|
+
* prefer this over two `entropyToMnemonic + keypairFromMnemonic` hops —
|
|
92
|
+
* saves one postMessage transit (~30–80ms on constrained hardware / under
|
|
93
|
+
* throttle) on the frictionless critical path. sr25519 derivation is a
|
|
94
|
+
* ~500ms main-thread cost otherwise.
|
|
95
|
+
*/
|
|
96
|
+
async entropyToKeypair(entropy) {
|
|
97
|
+
return this.runTask("entropyToKeypair", {
|
|
98
|
+
entropy
|
|
99
|
+
});
|
|
100
|
+
}
|
|
131
101
|
/**
|
|
132
102
|
* Clean up worker resources
|
|
133
103
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const jsContent = '(function(){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function b(t,...e){if(!A(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function k(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function E(t,e){b(t);const a=e.outputLen;if(t.length<a)throw new Error("digestInto() expects output buffer of length at least "+a)}function y(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function w(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function d(t,e){return t<<32-e|t>>>e}function U(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function x(t){return typeof t=="string"&&(t=U(t)),b(t),t}class q{}function B(t){const e=r=>t().update(x(r)).digest(),a=t();return e.outputLen=a.outputLen,e.blockLen=a.blockLen,e.create=()=>t(),e}function L(t,e,a,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,a,r);const o=BigInt(32),n=BigInt(4294967295),i=Number(a>>o&n),l=Number(a&n),c=r?4:0,u=r?0:4;t.setUint32(e+c,i,r),t.setUint32(e+u,l,r)}function I(t,e,a){return t&e^~t&a}function H(t,e,a){return t&e^t&a^e&a}class T extends q{constructor(e,a,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=a,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(e),this.view=w(this.buffer)}update(e){k(this),e=x(e),b(e);const{view:a,buffer:r,blockLen:o}=this,n=e.length;for(let i=0;i<n;){const l=Math.min(o-this.pos,n-i);if(l===o){const c=w(e);for(;o<=n-i;i+=o)this.process(c,i);continue}r.set(e.subarray(i,i+l),this.pos),this.pos+=l,i+=l,this.pos===o&&(this.process(a,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){k(this),E(e,this),this.finished=!0;const{buffer:a,view:r,blockLen:o,isLE:n}=this;let{pos:i}=this;a[i++]=128,y(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let s=i;s<o;s++)a[s]=0;L(r,o-8,BigInt(this.length*8),n),this.process(r,0);const l=w(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,m=this.get();if(u>m.length)throw new Error("_sha2: outputLen bigger than state");for(let s=0;s<u;s++)l.setUint32(4*s,m[s],n)}digest(){const{buffer:e,outputLen:a}=this;this.digestInto(e);const r=e.slice(0,a);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:a,buffer:r,length:o,finished:n,destroyed:i,pos:l}=this;return e.destroyed=i,e.finished=n,e.length=o,e.pos=l,o%a&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const h=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),_=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),p=new Uint32Array(64);class D extends T{constructor(e=32){super(64,e,8,!1),this.A=h[0]|0,this.B=h[1]|0,this.C=h[2]|0,this.D=h[3]|0,this.E=h[4]|0,this.F=h[5]|0,this.G=h[6]|0,this.H=h[7]|0}get(){const{A:e,B:a,C:r,D:o,E:n,F:i,G:l,H:c}=this;return[e,a,r,o,n,i,l,c]}set(e,a,r,o,n,i,l,c){this.A=e|0,this.B=a|0,this.C=r|0,this.D=o|0,this.E=n|0,this.F=i|0,this.G=l|0,this.H=c|0}process(e,a){for(let s=0;s<16;s++,a+=4)p[s]=e.getUint32(a,!1);for(let s=16;s<64;s++){const g=p[s-15],f=p[s-2],z=d(g,7)^d(g,18)^g>>>3,v=d(f,17)^d(f,19)^f>>>10;p[s]=v+p[s-7]+z+p[s-16]|0}let{A:r,B:o,C:n,D:i,E:l,F:c,G:u,H:m}=this;for(let s=0;s<64;s++){const g=d(l,6)^d(l,11)^d(l,25),f=m+g+I(l,c,u)+_[s]+p[s]|0,v=(d(r,2)^d(r,13)^d(r,22))+H(r,o,n)|0;m=u,u=c,c=l,l=i+f|0,i=n,n=o,o=r,r=f+v|0}r=r+this.A|0,o=o+this.B|0,n=n+this.C|0,i=i+this.D|0,l=l+this.E|0,c=c+this.F|0,u=u+this.G|0,m=m+this.H|0,this.set(r,o,n,i,l,c,u,m)}roundClean(){y(p)}destroy(){this.set(0,0,0,0,0,0,0,0),y(this.buffer)}}const C={256:B(()=>new D)}[256],M="abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split("|"),F="Invalid entropy";function S(t){return Number.parseInt(t,2)}function j(t){return t.map(e=>e.toString(2).padStart(8,"0")).join("")}function V(t){return j(Array.from(C(t))).slice(0,t.length*8/32)}function $(t,e=M){if(t.length%4!==0||t.length<16||t.length>32)throw new Error(F);const r=`${j(Array.from(t))}${V(t)}`.match(/(.{1,11})/g)?.map(o=>e[S(o)]);if(!r||r.length<12)throw new Error("Unable to map entropy to mnemonic");return r.join(" ")}self.addEventListener("message",async t=>{const{taskId:e,task:a,data:r}=t.data;try{let o;switch(a){case"test":o="ready";break;case"entropyToMnemonic":if(!r.entropy)throw new Error("Entropy data is required");o=await G(r.entropy);break;default:throw new Error(`Unknown task: ${a}`)}const n={taskId:e,result:o};self.postMessage(n)}catch(o){const n={taskId:e,error:o instanceof Error?o.message:"Unknown error"};self.postMessage(n)}});async function G(t){try{return $(t)}catch(e){throw new Error(`Failed to process entropy: ${e instanceof Error?e.message:"Unknown error"}`)}}})();\n';
|
|
2
|
+
const jsContent = '(function(){"use strict";function Dt(e){return e("return this")}const Fe=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:Dt(Function);function Mt(e,t){return typeof Fe[e]>"u"?t:Fe[e]}const Ot=Mt("TextEncoder",class{encode(t){const n=t.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=t.charCodeAt(o);return r}});function $t(e){return e("return this")}const ne=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:$t(Function);function Zt(e,t){return typeof ne[e]>"u"?t:ne[e]}function Gt(e){return typeof e=="function"}function Ft(){return Number.NaN}const Ve=Zt("BigInt",Ft),Ee="0123456789abcdef",ue=new Uint8Array(256),Ye=new Uint8Array(256*256);for(let e=0,t=Ee.length;e<t;e++)ue[Ee[e].charCodeAt(0)|0]=e|0,e>9&&(ue[Ee[e].toUpperCase().charCodeAt(0)|0]=e|0);for(let e=0;e<256;e++){const t=e<<8;for(let n=0;n<256;n++)Ye[t|n]=ue[e]<<4|ue[n]}function Vt(e,t=-1){if(!e)return new Uint8Array;let n=e.startsWith("0x")?2:0;const r=Math.ceil((e.length-n)/2),o=Math.ceil(t===-1?r:t/8),s=new Uint8Array(o),a=o>r?o-r:0;for(let i=a;i<o;i++,n+=2)s[i]=Ye[e.charCodeAt(n)<<8|e.charCodeAt(n+1)];return s}const Yt=/^0x[\\da-fA-F]+$/;function Kt(e,t=-1,n){return typeof e=="string"&&(e==="0x"||Yt.test(e))&&(t===-1?n||e.length%2===0:e.length===2+Math.ceil(t/4))}typeof Ve=="function"&&Ve.asIntN;const Xt=typeof ne.Buffer=="function"&&typeof ne.Buffer.isBuffer=="function";ne.process;function Wt(e){return Xt&&!!e&&Gt(e.readDoubleLE)&&ne.Buffer.isBuffer(e)}function Pt(e){return(e&&e.constructor)===Uint8Array||e instanceof Uint8Array}const Qt=new Ot;function Ke(e){return e?Qt.encode(e.toString()):new Uint8Array}function de(e,t=!1){if(t&&e==null)throw new Error("u8aToU8a: Expected non-null, non-undefined value");return Pt(e)?Wt(e)?new Uint8Array(e):e:Kt(e)?Vt(e):Array.isArray(e)?new Uint8Array(e):Ke(e)}const re=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ke(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function oe(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function M(e,...t){if(!ke(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Xe(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");oe(e.outputLen),oe(e.blockLen)}function he(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Jt(e,t){M(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function J(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function pe(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function O(e,t){return e<<32-t|e>>>t}const We=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",en=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ge(e){if(M(e),We)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=en[e[n]];return t}const G={_0:48,_9:57,A:65,F:70,a:97,f:102};function Pe(e){if(e>=G._0&&e<=G._9)return e-G._0;if(e>=G.A&&e<=G.F)return e-(G.A-10);if(e>=G.a&&e<=G.f)return e-(G.a-10)}function Qe(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(We)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const a=Pe(e.charCodeAt(s)),i=Pe(e.charCodeAt(s+1));if(a===void 0||i===void 0){const l=e[s]+e[s+1];throw new Error(\'hex string expected, got non-hex character "\'+l+\'" at index \'+s)}r[o]=a*16+i}return r}function Be(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ae(e){return typeof e=="string"&&(e=Be(e)),M(e),e}function Je(e){return typeof e=="string"&&(e=Be(e)),M(e),e}function Ie(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];M(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}function tn(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}class et{}function tt(e){const t=r=>e().update(Ae(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function nn(e=32){if(re&&typeof re.getRandomValues=="function")return re.getRandomValues(new Uint8Array(e));if(re&&typeof re.randomBytes=="function")return Uint8Array.from(re.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function rn(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),a=Number(n>>o&s),i=Number(n&s),l=r?4:0,d=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+d,i,r)}function on(e,t,n){return e&t^~e&n}function sn(e,t,n){return e&t^e&n^t&n}class nt extends et{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=pe(this.buffer)}update(t){he(this),t=Ae(t),M(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let a=0;a<s;){const i=Math.min(o-this.pos,s-a);if(i===o){const l=pe(t);for(;o<=s-a;a+=o)this.process(l,a);continue}r.set(t.subarray(a,a+i),this.pos),this.pos+=i,a+=i,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){he(this),Jt(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:a}=this;n[a++]=128,J(this.buffer.subarray(a)),this.padOffset>o-a&&(this.process(r,0),a=0);for(let f=a;f<o;f++)n[f]=0;rn(r,o-8,BigInt(this.length*8),s),this.process(r,0);const i=pe(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const d=l/4,c=this.get();if(d>c.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<d;f++)i.setUint32(4*f,c[f],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:o,finished:s,destroyed:a,pos:i}=this;return t.destroyed=a,t.finished=s,t.length=o,t.pos=i,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const Y=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),q=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),be=BigInt(2**32-1),rt=BigInt(32);function an(e,t=!1){return t?{h:Number(e&be),l:Number(e>>rt&be)}:{h:Number(e>>rt&be)|0,l:Number(e&be)|0}}function cn(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:a,l:i}=an(e[s],t);[r[s],o[s]]=[a,i]}return[r,o]}const ot=(e,t,n)=>e>>>n,st=(e,t,n)=>e<<32-n|t>>>n,se=(e,t,n)=>e>>>n|t<<32-n,ie=(e,t,n)=>e<<32-n|t>>>n,me=(e,t,n)=>e<<64-n|t>>>n-32,ye=(e,t,n)=>e>>>n-32|t<<64-n;function F(e,t,n,r){const o=(t>>>0)+(r>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}const ln=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),fn=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,un=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),dn=(e,t,n,r,o)=>t+n+r+o+(e/2**32|0)|0,hn=(e,t,n,r,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(o>>>0),pn=(e,t,n,r,o,s)=>t+n+r+o+s+(e/2**32|0)|0;function gn(e){return e("return this")}const bn=(typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:gn(Function)).crypto;function mn(e){return bn.getRandomValues(e)}function yn(e=32){return mn(new Uint8Array(e))}class it extends et{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Xe(t);const r=Ae(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),J(s)}update(t){return he(this),this.iHash.update(t),this}digestInto(t){he(this),M(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:o,destroyed:s,blockLen:a,outputLen:i}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=i,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const at=(e,t,n)=>new it(e,t).update(n).digest();at.create=(e,t)=>new it(e,t);function wn(e,t,n,r){Xe(e);const o=tn({dkLen:32,asyncTick:10},r),{c:s,dkLen:a,asyncTick:i}=o;if(oe(s),oe(a),oe(i),s<1)throw new Error("iterations (c) should be >= 1");const l=Je(t),d=Je(n),c=new Uint8Array(a),f=at.create(e,l),p=f._cloneInto().update(d);return{c:s,dkLen:a,asyncTick:i,DK:c,PRF:f,PRFSalt:p}}function xn(e,t,n,r,o){return e.destroy(),t.destroy(),r&&r.destroy(),J(o),n}function vn(e,t,n,r){const{c:o,dkLen:s,DK:a,PRF:i,PRFSalt:l}=wn(e,t,n,r);let d;const c=new Uint8Array(4),f=pe(c),p=new Uint8Array(i.outputLen);for(let h=1,w=0;w<s;h++,w+=i.outputLen){const g=a.subarray(w,w+i.outputLen);f.setInt32(0,h,!1),(d=l._cloneInto(d)).update(c).digestInto(p),g.set(p.subarray(0,g.length));for(let u=1;u<o;u++){i._cloneInto(d).update(p).digestInto(p);for(let b=0;b<g.length;b++)g[b]^=p[b]}}return xn(i,l,a,d,p)}const En=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),K=new Uint32Array(64);class kn extends nt{constructor(t=32){super(64,t,8,!1),this.A=Y[0]|0,this.B=Y[1]|0,this.C=Y[2]|0,this.D=Y[3]|0,this.E=Y[4]|0,this.F=Y[5]|0,this.G=Y[6]|0,this.H=Y[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:a,G:i,H:l}=this;return[t,n,r,o,s,a,i,l]}set(t,n,r,o,s,a,i,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=i|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)K[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=K[f-15],h=K[f-2],w=O(p,7)^O(p,18)^p>>>3,g=O(h,17)^O(h,19)^h>>>10;K[f]=g+K[f-7]+w+K[f-16]|0}let{A:r,B:o,C:s,D:a,E:i,F:l,G:d,H:c}=this;for(let f=0;f<64;f++){const p=O(i,6)^O(i,11)^O(i,25),h=c+p+on(i,l,d)+En[f]+K[f]|0,g=(O(r,2)^O(r,13)^O(r,22))+sn(r,o,s)|0;c=d,d=l,l=i,i=a+h|0,a=s,s=o,o=r,r=h+g|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,i=i+this.E|0,l=l+this.F|0,d=d+this.G|0,c=c+this.H|0,this.set(r,o,s,a,i,l,d,c)}roundClean(){J(K)}destroy(){this.set(0,0,0,0,0,0,0,0),J(this.buffer)}}const ct=cn(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Bn=ct[0],An=ct[1],X=new Uint32Array(80),W=new Uint32Array(80);class In extends nt{constructor(t=64){super(128,t,16,!1),this.Ah=q[0]|0,this.Al=q[1]|0,this.Bh=q[2]|0,this.Bl=q[3]|0,this.Ch=q[4]|0,this.Cl=q[5]|0,this.Dh=q[6]|0,this.Dl=q[7]|0,this.Eh=q[8]|0,this.El=q[9]|0,this.Fh=q[10]|0,this.Fl=q[11]|0,this.Gh=q[12]|0,this.Gl=q[13]|0,this.Hh=q[14]|0,this.Hl=q[15]|0}get(){const{Ah:t,Al:n,Bh:r,Bl:o,Ch:s,Cl:a,Dh:i,Dl:l,Eh:d,El:c,Fh:f,Fl:p,Gh:h,Gl:w,Hh:g,Hl:u}=this;return[t,n,r,o,s,a,i,l,d,c,f,p,h,w,g,u]}set(t,n,r,o,s,a,i,l,d,c,f,p,h,w,g,u){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=i|0,this.Dl=l|0,this.Eh=d|0,this.El=c|0,this.Fh=f|0,this.Fl=p|0,this.Gh=h|0,this.Gl=w|0,this.Hh=g|0,this.Hl=u|0}process(t,n){for(let y=0;y<16;y++,n+=4)X[y]=t.getUint32(n),W[y]=t.getUint32(n+=4);for(let y=16;y<80;y++){const B=X[y-15]|0,m=W[y-15]|0,v=se(B,m,1)^se(B,m,8)^ot(B,m,7),E=ie(B,m,1)^ie(B,m,8)^st(B,m,7),k=X[y-2]|0,A=W[y-2]|0,I=se(k,A,19)^me(k,A,61)^ot(k,A,6),_=ie(k,A,19)^ye(k,A,61)^st(k,A,6),U=un(E,_,W[y-7],W[y-16]),S=dn(U,v,I,X[y-7],X[y-16]);X[y]=S|0,W[y]=U|0}let{Ah:r,Al:o,Bh:s,Bl:a,Ch:i,Cl:l,Dh:d,Dl:c,Eh:f,El:p,Fh:h,Fl:w,Gh:g,Gl:u,Hh:b,Hl:x}=this;for(let y=0;y<80;y++){const B=se(f,p,14)^se(f,p,18)^me(f,p,41),m=ie(f,p,14)^ie(f,p,18)^ye(f,p,41),v=f&h^~f&g,E=p&w^~p&u,k=hn(x,m,E,An[y],W[y]),A=pn(k,b,B,v,Bn[y],X[y]),I=k|0,_=se(r,o,28)^me(r,o,34)^me(r,o,39),U=ie(r,o,28)^ye(r,o,34)^ye(r,o,39),S=r&s^r&i^s&i,N=o&a^o&l^a&l;b=g|0,x=u|0,g=h|0,u=w|0,h=f|0,w=p|0,{h:f,l:p}=F(d|0,c|0,A|0,I|0),d=i|0,c=l|0,i=s|0,l=a|0,s=r|0,a=o|0;const z=ln(I,U,N);r=fn(z,A,_,S),o=z|0}({h:r,l:o}=F(this.Ah|0,this.Al|0,r|0,o|0)),{h:s,l:a}=F(this.Bh|0,this.Bl|0,s|0,a|0),{h:i,l}=F(this.Ch|0,this.Cl|0,i|0,l|0),{h:d,l:c}=F(this.Dh|0,this.Dl|0,d|0,c|0),{h:f,l:p}=F(this.Eh|0,this.El|0,f|0,p|0),{h,l:w}=F(this.Fh|0,this.Fl|0,h|0,w|0),{h:g,l:u}=F(this.Gh|0,this.Gl|0,g|0,u|0),{h:b,l:x}=F(this.Hh|0,this.Hl|0,b|0,x|0),this.set(r,o,s,a,i,l,d,c,f,p,h,w,g,u,b,x)}roundClean(){J(X,W)}destroy(){J(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Sn=tt(()=>new kn),lt=tt(()=>new In);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Se=BigInt(0),_e=BigInt(1);function He(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function ft(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Se:BigInt("0x"+e)}function _n(e){return ft(ge(e))}function ee(e){return M(e),ft(ge(Uint8Array.from(e).reverse()))}function ut(e,t){return Qe(e.toString(16).padStart(t*2,"0"))}function ae(e,t){return ut(e,t).reverse()}function D(e,t,n){let r;if(typeof t=="string")try{r=Qe(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(ke(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function Hn(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}const Ue=e=>typeof e=="bigint"&&Se<=e;function Un(e,t,n){return Ue(e)&&Ue(t)&&Ue(n)&&t<=e&&e<n}function le(e,t,n,r){if(!Un(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function Tn(e){let t;for(t=0;e>Se;e>>=_e,t+=1);return t}const we=e=>(_e<<BigInt(e))-_e;function Te(e,t,n={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function r(o,s,a){const i=e[o];if(a&&i===void 0)return;const l=typeof i;if(l!==s||i===null)throw new Error(`param "${o}" is invalid: expected ${s}, got ${l}`)}Object.entries(t).forEach(([o,s])=>r(o,s,!1)),Object.entries(n).forEach(([o,s])=>r(o,s,!0))}function dt(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const R=BigInt(0),j=BigInt(1),te=BigInt(2),Nn=BigInt(3),ht=BigInt(4),pt=BigInt(5),gt=BigInt(8);function T(e,t){const n=e%t;return n>=R?n:t+n}function $(e,t,n){let r=e;for(;t-- >R;)r*=r,r%=n;return r}function bt(e,t){if(e===R)throw new Error("invert: expected non-zero number");if(t<=R)throw new Error("invert: expected positive modulus, got "+t);let n=T(e,t),r=t,o=R,s=j;for(;n!==R;){const i=r/n,l=r%n,d=o-s*i;r=n,n=l,o=s,s=d}if(r!==j)throw new Error("invert: does not exist");return T(o,t)}function mt(e,t){const n=(e.ORDER+j)/ht,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function qn(e,t){const n=(e.ORDER-pt)/gt,r=e.mul(t,te),o=e.pow(r,n),s=e.mul(t,o),a=e.mul(e.mul(s,te),o),i=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(i),t))throw new Error("Cannot find square root");return i}function zn(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-j,n=0;for(;t%te===R;)t/=te,n++;let r=te;const o=fe(e);for(;wt(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return mt;let s=o.pow(r,t);const a=(t+j)/te;return function(l,d){if(l.is0(d))return d;if(wt(l,d)!==1)throw new Error("Cannot find square root");let c=n,f=l.mul(l.ONE,s),p=l.pow(d,t),h=l.pow(d,a);for(;!l.eql(p,l.ONE);){if(l.is0(p))return l.ZERO;let w=1,g=l.sqr(p);for(;!l.eql(g,l.ONE);)if(w++,g=l.sqr(g),w===c)throw new Error("Cannot find square root");const u=j<<BigInt(c-w-1),b=l.pow(f,u);c=w,f=l.sqr(b),p=l.mul(p,f),h=l.mul(h,b)}return h}}function jn(e){return e%ht===Nn?mt:e%gt===pt?qn:zn(e)}const P=(e,t)=>(T(e,t)&j)===j,Ln=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Rn(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=Ln.reduce((r,o)=>(r[o]="function",r),t);return Te(e,n),e}function Cn(e,t,n){if(n<R)throw new Error("invalid exponent, negatives unsupported");if(n===R)return e.ONE;if(n===j)return t;let r=e.ONE,o=t;for(;n>R;)n&j&&(r=e.mul(r,o)),o=e.sqr(o),n>>=j;return r}function yt(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((a,i,l)=>e.is0(i)?a:(r[l]=a,e.mul(a,i)),e.ONE),s=e.inv(o);return t.reduceRight((a,i,l)=>e.is0(i)?a:(r[l]=e.mul(a,r[l]),e.mul(a,i)),s),r}function wt(e,t){const n=(e.ORDER-j)/te,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),a=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!a)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function Dn(e,t){t!==void 0&&oe(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function fe(e,t,n=!1,r={}){if(e<=R)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,s;if(typeof t=="object"&&t!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const c=t;c.BITS&&(o=c.BITS),c.sqrt&&(s=c.sqrt),typeof c.isLE=="boolean"&&(n=c.isLE)}else typeof t=="number"&&(o=t),r.sqrt&&(s=r.sqrt);const{nBitLength:a,nByteLength:i}=Dn(e,o);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let l;const d=Object.freeze({ORDER:e,isLE:n,BITS:a,BYTES:i,MASK:we(a),ZERO:R,ONE:j,create:c=>T(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return R<=c&&c<e},is0:c=>c===R,isValidNot0:c=>!d.is0(c)&&d.isValid(c),isOdd:c=>(c&j)===j,neg:c=>T(-c,e),eql:(c,f)=>c===f,sqr:c=>T(c*c,e),add:(c,f)=>T(c+f,e),sub:(c,f)=>T(c-f,e),mul:(c,f)=>T(c*f,e),pow:(c,f)=>Cn(d,c,f),div:(c,f)=>T(c*bt(f,e),e),sqrN:c=>c*c,addN:(c,f)=>c+f,subN:(c,f)=>c-f,mulN:(c,f)=>c*f,inv:c=>bt(c,e),sqrt:s||(c=>(l||(l=jn(e)),l(d,c))),toBytes:c=>n?ae(c,i):ut(c,i),fromBytes:c=>{if(c.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+c.length);return n?ee(c):_n(c)},invertBatch:c=>yt(d,c),cmov:(c,f,p)=>p?f:c});return Object.freeze(d)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const xe=BigInt(0),Ne=BigInt(1);function qe(e,t){const n=t.negate();return e?n:t}function Mn(e,t,n){const r=a=>a.ez,o=yt(e.Fp,n.map(r));return n.map((a,i)=>a.toAffine(o[i])).map(e.fromAffine)}function xt(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ze(e,t){xt(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=we(e),a=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:a}}function vt(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:a}=n;let i=Number(e&o),l=e>>a;i>r&&(i-=s,l+=Ne);const d=t*r,c=d+Math.abs(i)-1,f=i===0,p=i<0,h=t%2!==0;return{nextN:l,offset:c,isZero:f,isNeg:p,isNegF:h,offsetF:d}}function On(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function $n(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const je=new WeakMap,Et=new WeakMap;function Le(e){return Et.get(e)||1}function kt(e){if(e!==xe)throw new Error("invalid wNAF")}function Zn(e,t){return{constTimeNegate:qe,hasPrecomputes(n){return Le(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>xe;)r&Ne&&(o=o.add(s)),s=s.double(),r>>=Ne;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=ze(r,t),a=[];let i=n,l=i;for(let d=0;d<o;d++){l=i,a.push(l);for(let c=1;c<s;c++)l=l.add(i),a.push(l);i=l.double()}return a},wNAF(n,r,o){let s=e.ZERO,a=e.BASE;const i=ze(n,t);for(let l=0;l<i.windows;l++){const{nextN:d,offset:c,isZero:f,isNeg:p,isNegF:h,offsetF:w}=vt(o,l,i);o=d,f?a=a.add(qe(h,r[w])):s=s.add(qe(p,r[c]))}return kt(o),{p:s,f:a}},wNAFUnsafe(n,r,o,s=e.ZERO){const a=ze(n,t);for(let i=0;i<a.windows&&o!==xe;i++){const{nextN:l,offset:d,isZero:c,isNeg:f}=vt(o,i,a);if(o=l,!c){const p=r[d];s=s.add(f?p.negate():p)}}return kt(o),s},getPrecomputes(n,r,o){let s=je.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&(typeof o=="function"&&(s=o(s)),je.set(r,s))),s},wNAFCached(n,r,o){const s=Le(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const a=Le(n);return a===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(a,this.getPrecomputes(a,n,o),r,s)},setWindowSize(n,r){xt(r,t),Et.set(n,r),je.delete(n)}}}function Bt(e,t,n,r){On(n,e),$n(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,i=Tn(BigInt(o));let l=1;i>12?l=i-3:i>4?l=i-2:i>0&&(l=2);const d=we(l),c=new Array(Number(d)+1).fill(a),f=Math.floor((t.BITS-1)/l)*l;let p=a;for(let h=f;h>=0;h-=l){c.fill(a);for(let g=0;g<s;g++){const u=r[g],b=Number(u>>BigInt(h)&d);c[b]=c[b].add(n[g])}let w=a;for(let g=c.length-1,u=a;g>0;g--)u=u.add(c[g]),w=w.add(u);if(p=p.add(w),h!==0)for(let g=0;g<l;g++)p=p.double()}return p}function At(e,t){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Rn(t),t}else return fe(e)}function Gn(e,t,n={}){if(!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(const i of["p","n","h"]){const l=t[i];if(!(typeof l=="bigint"&&l>xe))throw new Error(`CURVE.${i} must be positive bigint`)}const r=At(t.p,n.Fp),o=At(t.n,n.Fn),a=["Gx","Gy","a","d"];for(const i of a)if(!r.isValid(t[i]))throw new Error(`CURVE.${i} must be valid field element of CURVE.Fp`);return{Fp:r,Fn:o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Z=BigInt(0),L=BigInt(1),Re=BigInt(2),Fn=BigInt(8),Vn={zip215:!0};function Yn(e,t,n,r){const o=e.sqr(n),s=e.sqr(r),a=e.add(e.mul(t.a,o),s),i=e.add(e.ONE,e.mul(t.d,e.mul(o,s)));return e.eql(a,i)}function Kn(e,t={}){const{Fp:n,Fn:r}=Gn("edwards",e,t),{h:o,n:s}=e;Te(t,{},{uvRatio:"function"});const a=Re<<BigInt(r.BYTES*8)-L,i=g=>n.create(g),l=t.uvRatio||((g,u)=>{try{return{isValid:!0,value:n.sqrt(n.div(g,u))}}catch{return{isValid:!1,value:Z}}});if(!Yn(n,e,e.Gx,e.Gy))throw new Error("bad curve params: generator point");function d(g,u,b=!1){const x=b?L:Z;return le("coordinate "+g,u,x,a),u}function c(g){if(!(g instanceof h))throw new Error("ExtendedPoint expected")}const f=dt((g,u)=>{const{ex:b,ey:x,ez:y}=g,B=g.is0();u==null&&(u=B?Fn:n.inv(y));const m=i(b*u),v=i(x*u),E=i(y*u);if(B)return{x:Z,y:L};if(E!==L)throw new Error("invZ was invalid");return{x:m,y:v}}),p=dt(g=>{const{a:u,d:b}=e;if(g.is0())throw new Error("bad point: ZERO");const{ex:x,ey:y,ez:B,et:m}=g,v=i(x*x),E=i(y*y),k=i(B*B),A=i(k*k),I=i(v*u),_=i(k*i(I+E)),U=i(A+i(b*i(v*E)));if(_!==U)throw new Error("bad point: equation left != right (1)");const S=i(x*y),N=i(B*m);if(S!==N)throw new Error("bad point: equation left != right (2)");return!0});class h{constructor(u,b,x,y){this.ex=d("x",u),this.ey=d("y",b),this.ez=d("z",x,!0),this.et=d("t",y),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(u){if(u instanceof h)throw new Error("extended point not allowed");const{x:b,y:x}=u||{};return d("x",b),d("y",x),new h(b,x,L,i(b*x))}static normalizeZ(u){return Mn(h,"ez",u)}static msm(u,b){return Bt(h,r,u,b)}_setWindowSize(u){this.precompute(u)}precompute(u=8,b=!0){return w.setWindowSize(this,u),b||this.multiply(Re),this}assertValidity(){p(this)}equals(u){c(u);const{ex:b,ey:x,ez:y}=this,{ex:B,ey:m,ez:v}=u,E=i(b*v),k=i(B*y),A=i(x*v),I=i(m*y);return E===k&&A===I}is0(){return this.equals(h.ZERO)}negate(){return new h(i(-this.ex),this.ey,this.ez,i(-this.et))}double(){const{a:u}=e,{ex:b,ey:x,ez:y}=this,B=i(b*b),m=i(x*x),v=i(Re*i(y*y)),E=i(u*B),k=b+x,A=i(i(k*k)-B-m),I=E+m,_=I-v,U=E-m,S=i(A*_),N=i(I*U),z=i(A*U),Q=i(_*I);return new h(S,N,Q,z)}add(u){c(u);const{a:b,d:x}=e,{ex:y,ey:B,ez:m,et:v}=this,{ex:E,ey:k,ez:A,et:I}=u,_=i(y*E),U=i(B*k),S=i(v*x*I),N=i(m*A),z=i((y+B)*(E+k)-_-U),Q=N-S,Ze=N+S,Ge=i(U-b*_),Sr=i(z*Q),_r=i(Ze*Ge),Hr=i(z*Ge),Ur=i(Q*Ze);return new h(Sr,_r,Ur,Hr)}subtract(u){return this.add(u.negate())}multiply(u){const b=u;le("scalar",b,L,s);const{p:x,f:y}=w.wNAFCached(this,b,h.normalizeZ);return h.normalizeZ([x,y])[0]}multiplyUnsafe(u,b=h.ZERO){const x=u;return le("scalar",x,Z,s),x===Z?h.ZERO:this.is0()||x===L?this:w.wNAFCachedUnsafe(this,x,h.normalizeZ,b)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}isTorsionFree(){return w.wNAFCachedUnsafe(this,s).is0()}toAffine(u){return f(this,u)}clearCofactor(){return o===L?this:this.multiplyUnsafe(o)}static fromBytes(u,b=!1){return M(u),this.fromHex(u,b)}static fromHex(u,b=!1){const{d:x,a:y}=e,B=n.BYTES;u=D("pointHex",u,B),He("zip215",b);const m=u.slice(),v=u[B-1];m[B-1]=v&-129;const E=ee(m),k=b?a:n.ORDER;le("pointHex.y",E,Z,k);const A=i(E*E),I=i(A-L),_=i(x*A-y);let{isValid:U,value:S}=l(I,_);if(!U)throw new Error("Point.fromHex: invalid y coordinate");const N=(S&L)===L,z=(v&128)!==0;if(!b&&S===Z&&z)throw new Error("Point.fromHex: x=0 and x_0=1");return z!==N&&(S=i(-S)),h.fromAffine({x:S,y:E})}static fromPrivateScalar(u){return h.BASE.multiply(u)}toBytes(){const{x:u,y:b}=this.toAffine(),x=ae(b,n.BYTES);return x[x.length-1]|=u&L?128:0,x}toRawBytes(){return this.toBytes()}toHex(){return ge(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}h.BASE=new h(e.Gx,e.Gy,L,i(e.Gx*e.Gy)),h.ZERO=new h(Z,L,L,Z),h.Fp=n,h.Fn=r;const w=Zn(h,r.BYTES*8);return h}function Xn(e,t){Te(t,{hash:"function"},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:n,hash:r}=t,{BASE:o,Fp:s,Fn:a}=e,i=a.ORDER,l=t.randomBytes||nn,d=t.adjustScalarBytes||(m=>m),c=t.domain||((m,v,E)=>{if(He("phflag",E),v.length||E)throw new Error("Contexts/pre-hash are not supported");return m});function f(m){return a.create(m)}function p(m){return f(ee(m))}function h(m){const v=s.BYTES;m=D("private key",m,v);const E=D("hashed private key",r(m),2*v),k=d(E.slice(0,v)),A=E.slice(v,2*v),I=p(k);return{head:k,prefix:A,scalar:I}}function w(m){const{head:v,prefix:E,scalar:k}=h(m),A=o.multiply(k),I=A.toBytes();return{head:v,prefix:E,scalar:k,point:A,pointBytes:I}}function g(m){return w(m).pointBytes}function u(m=Uint8Array.of(),...v){const E=Ie(...v);return p(r(c(E,D("context",m),!!n)))}function b(m,v,E={}){m=D("message",m),n&&(m=n(m));const{prefix:k,scalar:A,pointBytes:I}=w(v),_=u(E.context,k,m),U=o.multiply(_).toBytes(),S=u(E.context,U,I,m),N=f(_+S*A);le("signature.s",N,Z,i);const z=s.BYTES,Q=Ie(U,ae(N,z));return D("result",Q,z*2)}const x=Vn;function y(m,v,E,k=x){const{context:A,zip215:I}=k,_=s.BYTES;m=D("signature",m,2*_),v=D("message",v),E=D("publicKey",E,_),I!==void 0&&He("zip215",I),n&&(v=n(v));const U=ee(m.slice(_,2*_));let S,N,z;try{S=e.fromHex(E,I),N=e.fromHex(m.slice(0,_),I),z=o.multiplyUnsafe(U)}catch{return!1}if(!I&&S.isSmallOrder())return!1;const Q=u(A,N.toBytes(),S.toBytes(),v);return N.add(S.multiplyUnsafe(Q)).subtract(z).clearCofactor().is0()}return o.precompute(8),{getPublicKey:g,sign:b,verify:y,utils:{getExtendedPublicKey:w,randomPrivateKey:()=>l(s.BYTES),precompute(m=8,v=e.BASE){return v.precompute(m,!1)}},Point:e}}function Wn(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp,r=fe(t.n,e.nBitLength,!0),o={Fp:n,Fn:r,uvRatio:e.uvRatio},s={hash:e.hash,randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:o,eddsaOpts:s}}function Pn(e,t){return Object.assign({},t,{ExtendedPoint:t.Point,CURVE:e})}function Qn(e){const{CURVE:t,curveOpts:n,eddsaOpts:r}=Wn(e),o=Kn(t,n),s=Xn(o,r);return Pn(e,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Jn=BigInt(0),V=BigInt(1),It=BigInt(2);BigInt(3);const er=BigInt(5),tr=BigInt(8),ve={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:tr,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function nr(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),o=BigInt(80),s=ve.p,i=e*e%s*e%s,l=$(i,It,s)*i%s,d=$(l,V,s)*e%s,c=$(d,er,s)*d%s,f=$(c,t,s)*c%s,p=$(f,n,s)*f%s,h=$(p,r,s)*p%s,w=$(h,o,s)*h%s,g=$(w,o,s)*h%s,u=$(g,t,s)*c%s;return{pow_p_5_8:$(u,It,s)*e%s,b2:i}}function rr(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const Ce=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function De(e,t){const n=ve.p,r=T(t*t*t,n),o=T(r*r*t,n),s=nr(e*o).pow_p_5_8;let a=T(e*r*s,n);const i=T(t*a*a,n),l=a,d=T(a*Ce,n),c=i===e,f=i===T(-e,n),p=i===T(-e*Ce,n);return c&&(a=l),(f||p)&&(a=d),P(a,n)&&(a=T(-a,n)),{isValid:c||f,value:a}}const ce=fe(ve.p,void 0,!0),or={...ve,Fp:ce,hash:lt,adjustScalarBytes:rr,uvRatio:De},C=Qn(or);function Me(e){if(!(e instanceof H))throw new Error("RistrettoPoint expected")}const Oe=Ce,sr=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),ir=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),ar=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),cr=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),St=e=>De(V,e),lr=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),$e=e=>C.CURVE.Fp.create(ee(e)&lr);function _t(e){const{d:t}=C.CURVE,n=C.CURVE.Fp.ORDER,r=C.CURVE.Fp.create,o=r(Oe*e*e),s=r((o+V)*ar);let a=BigInt(-1);const i=r((a-t*o)*r(o+t));let{isValid:l,value:d}=De(s,i),c=r(d*e);P(c,n)||(c=r(-c)),l||(d=c),l||(a=o);const f=r(a*(o-V)*cr-i),p=d*d,h=r((d+d)*i),w=r(f*sr),g=r(V-p),u=r(V+p);return new C.Point(r(h*u),r(g*w),r(w*u),r(h*g))}class H{constructor(t){this.ep=t}static fromAffine(t){return new H(C.Point.fromAffine(t))}static hashToCurve(t){t=D("ristrettoHash",t,64);const n=$e(t.slice(0,32)),r=_t(n),o=$e(t.slice(32,64)),s=_t(o);return new H(r.add(s))}static fromBytes(t){return M(t),this.fromHex(t)}static fromHex(t){t=D("ristrettoHex",t,32);const{a:n,d:r}=C.CURVE,o=ce.ORDER,s=ce.create,a="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",i=$e(t);if(!Hn(ae(i,32),t)||P(i,o))throw new Error(a);const l=s(i*i),d=s(V+n*l),c=s(V-n*l),f=s(d*d),p=s(c*c),h=s(n*r*f-p),{isValid:w,value:g}=St(s(h*p)),u=s(g*c),b=s(g*u*h);let x=s((i+i)*u);P(x,o)&&(x=s(-x));const y=s(d*b),B=s(x*y);if(!w||P(B,o)||y===Jn)throw new Error(a);return new H(new C.Point(x,y,V,B))}static msm(t,n){const r=fe(C.CURVE.n,C.CURVE.nBitLength);return Bt(H,r,t,n)}toBytes(){let{ex:t,ey:n,ez:r,et:o}=this.ep;const s=ce.ORDER,a=ce.create,i=a(a(r+n)*a(r-n)),l=a(t*n),d=a(l*l),{value:c}=St(a(i*d)),f=a(c*i),p=a(c*l),h=a(f*p*o);let w;if(P(o*h,s)){let u=a(n*Oe),b=a(t*Oe);t=u,n=b,w=a(f*ir)}else w=p;P(t*h,s)&&(n=a(-n));let g=a((r-n)*w);return P(g,s)&&(g=a(-g)),ae(g,32)}toRawBytes(){return this.toBytes()}toHex(){return ge(this.toBytes())}toString(){return this.toHex()}equals(t){Me(t);const{ex:n,ey:r}=this.ep,{ex:o,ey:s}=t.ep,a=ce.create,i=a(n*s)===a(r*o),l=a(r*s)===a(n*o);return i||l}add(t){return Me(t),new H(this.ep.add(t.ep))}subtract(t){return Me(t),new H(this.ep.subtract(t.ep))}multiply(t){return new H(this.ep.multiply(t))}multiplyUnsafe(t){return new H(this.ep.multiplyUnsafe(t))}double(){return new H(this.ep.double())}negate(){return new H(this.ep.negate())}}const fr=(H.BASE||(H.BASE=new H(C.Point.BASE)),H.ZERO||(H.ZERO=new H(C.Point.ZERO)),H),Ht=lt;BigInt(0);const Ut=BigInt(3);function ur(e,t,...n){if(!ke(t))throw new Error(`${e}: Uint8Array expected`);if(n.length&&!n.includes(t.length))throw new Error(`${e}: Uint8Array expected of length ${n}, not of length=${t.length}`)}function dr(...e){for(const t of e)t.fill(0)}C.CURVE.n;const hr=we(256),pr=e=>ae(e<<Ut&hr,32),gr=e=>ee(e)>>Ut;function br(e){ur("seed",e,32);const t=Ht(e);t[0]&=248,t[31]&=63,t[31]|=64;const n=pr(gr(t.subarray(0,32))),r=t.subarray(32,64),o=Ie(n,r);return dr(n,r,t),o}Be("substrate");function mr(e,t=yn(),n=2048,r){const o=de(e),s=de(t);return{password:vn(Ht,o,s,{c:n,dkLen:64}),rounds:n,salt:t}}const yr={256:Sn}[256],Tt="abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split("|"),Nt="Invalid mnemonic",qt="Invalid entropy",wr="Invalid mnemonic checksum";function xr(e){return(e||"").normalize("NFKD")}function zt(e){return Number.parseInt(e,2)}function jt(e){return e.map(t=>t.toString(2).padStart(8,"0")).join("")}function Lt(e){return jt(Array.from(yr(e))).slice(0,e.length*8/32)}function Rt(e,t=Tt){const n=xr(e).split(" ");if(n.length%3!==0)throw new Error(Nt);const r=n.map(c=>{const f=t.indexOf(c);if(f===-1)throw new Error(Nt);return f.toString(2).padStart(11,"0")}).join(""),o=Math.floor(r.length/33)*32,s=r.slice(0,o),a=r.slice(o),l=s.match(/(.{1,8})/g)?.map(zt);if(!l||l.length%4!==0||l.length<16||l.length>32)throw new Error(qt);const d=de(l);if(Lt(d)!==a)throw new Error(wr);return d}function Ct(e,t=Tt){if(e.length%4!==0||e.length<16||e.length>32)throw new Error(qt);const r=`${jt(Array.from(e))}${Lt(e)}`.match(/(.{1,11})/g)?.map(o=>t[zt(o)]);if(!r||r.length<12)throw new Error("Unable to map entropy to mnemonic");return r.join(" ")}function vr(e,t){try{Rt(e,t)}catch{return!1}return!0}function Er(e,t,n){return Rt(e,t)}function kr(e,t){return vr(e,t)}function Br(e,t="",n,r){if(!kr(e,n))throw new Error("Invalid bip39 mnemonic specified");const o=Er(e,n),s=Ke(`mnemonic${t}`);return mr(o,s).password.slice(0,32)}function Ar(e){const t=de(e);if(t.length!==32)throw new Error(`Expected a seed of 32 bytes, found ${t.length}`);const n=br(t),r=ee(n.subarray(0,32))>>3n,o=fr.BASE.multiply(r).toRawBytes();return{publicKey:new Uint8Array(o),secretKey:new Uint8Array(n)}}self.addEventListener("message",async e=>{const{taskId:t,task:n,data:r}=e.data;try{let o;switch(n){case"test":o="ready";break;case"entropyToMnemonic":if(!r.entropy)throw new Error("Entropy data is required");o=Ct(r.entropy);break;case"entropyToKeypair":if(!r.entropy)throw new Error("Entropy data is required");o=Ir(r.entropy);break;default:throw new Error(`Unknown task: ${n}`)}const s={taskId:t,result:o};self.postMessage(s)}catch(o){const s={taskId:t,error:o instanceof Error?o.message:"Unknown error"};self.postMessage(s)}});function Ir(e){const t=Ct(e),n=Br(t),{publicKey:r,secretKey:o}=Ar(n);return{mnemonic:t,publicKey:r,secretKey:o}}})();\n';
|
|
3
3
|
const blob = typeof self !== "undefined" && self.Blob && new Blob([jsContent], { type: "text/javascript;charset=utf-8" });
|
|
4
4
|
function WorkerWrapper(options) {
|
|
5
5
|
let objURL;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;CAyC3B;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -50,25 +50,21 @@ class ExtensionWeb2 extends Extension {
|
|
|
50
50
|
const browserEntropy = await getFingerprint();
|
|
51
51
|
const entropy = hexHash(browserEntropy, 128).slice(2);
|
|
52
52
|
const u8Entropy = stringToU8a(entropy);
|
|
53
|
-
|
|
53
|
+
const type = "sr25519";
|
|
54
|
+
const keyring = new Keyring({ type });
|
|
55
|
+
const workerManager = getCryptoWorkerManager();
|
|
54
56
|
try {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
+
const { publicKey, secretKey } = await workerManager.entropyToKeypair(u8Entropy);
|
|
58
|
+
const keypair = keyring.addFromPair({ publicKey, secretKey }, {}, type);
|
|
59
|
+
const address = keypair.address;
|
|
60
|
+
return { address, name: address, keypair };
|
|
57
61
|
} catch (workerError) {
|
|
58
62
|
const entropyToMnemonic = await EntropyToMnemonicLoader();
|
|
59
|
-
mnemonic = entropyToMnemonic(u8Entropy);
|
|
63
|
+
const mnemonic = entropyToMnemonic(u8Entropy);
|
|
64
|
+
const keypair = keyring.addFromMnemonic(mnemonic);
|
|
65
|
+
const address = keypair.address;
|
|
66
|
+
return { address, name: address, keypair };
|
|
60
67
|
}
|
|
61
|
-
const type = "sr25519";
|
|
62
|
-
const keyring = new Keyring({
|
|
63
|
-
type
|
|
64
|
-
});
|
|
65
|
-
const keypair = keyring.addFromMnemonic(mnemonic);
|
|
66
|
-
const address = keypair.address;
|
|
67
|
-
return {
|
|
68
|
-
address,
|
|
69
|
-
name: address,
|
|
70
|
-
keypair
|
|
71
|
-
};
|
|
72
68
|
}
|
|
73
69
|
}
|
|
74
70
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionWeb2.js","sourceRoot":"","sources":["../../src/extension/ExtensionWeb2.ts"],"names":[],"mappings":"AAcA,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,mBAAmB,EAAE,CAAC;AACtB,sBAAsB,EAAE,CAAC,OAAO,EAAE,CAAC;AAEnC,MAAM,uBAAuB,GAAG,KAAK,IAAI,EAAE,CAC1C,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,iBAAiB,CAAC;AAO1D,MAAM,OAAO,aAAc,SAAQ,SAAS;IACpC,KAAK,CAAC,UAAU,CACtB,MAAoC;QAEpC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACjD,MAAM,SAAS,GAAsB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEnE,OAAO;YACN,OAAO;YACP,SAAS;SACT,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,OAA2B;QAClD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE;YACpC,OAAO;QACR,CAAC,CAAC,CAAC;QAGH,MAAM,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE;YAClC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO;gBACN,EAAE,EAAE,CAAC;gBACL,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAkB;aAC/C,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACN,QAAQ,EAAE;gBACT,GAAG,EAAE,KAAK,IAAI,EAAE;oBAEf,OAAO,CAAC,OAAO,CAAC,CAAC;gBAClB,CAAC;gBACD,SAAS,EAAE,GAAG,EAAE;oBAEf,OAAO,GAAG,EAAE;wBACX,OAAO;oBACR,CAAC,CAAC;gBACH,CAAC;aACD;YACD,IAAI,EAAE,iBAAiB;YACvB,OAAO;YACP,MAAM;SACN,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,aAAa,CAC1B,MAAoC;QAEpC,MAAM,cAAc,GAAG,MAAM,cAAc,EAAE,CAAC;QAG9C,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtD,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QAEvC,IAAI,
|
|
1
|
+
{"version":3,"file":"ExtensionWeb2.js","sourceRoot":"","sources":["../../src/extension/ExtensionWeb2.ts"],"names":[],"mappings":"AAcA,OAAO,MAAM,MAAM,sCAAsC,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,mBAAmB,EAAE,CAAC;AACtB,sBAAsB,EAAE,CAAC,OAAO,EAAE,CAAC;AAEnC,MAAM,uBAAuB,GAAG,KAAK,IAAI,EAAE,CAC1C,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,iBAAiB,CAAC;AAO1D,MAAM,OAAO,aAAc,SAAQ,SAAS;IACpC,KAAK,CAAC,UAAU,CACtB,MAAoC;QAEpC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACjD,MAAM,SAAS,GAAsB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAEnE,OAAO;YACN,OAAO;YACP,SAAS;SACT,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,OAA2B;QAClD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE;YACpC,OAAO;QACR,CAAC,CAAC,CAAC;QAGH,MAAM,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE;YAClC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrD,OAAO;gBACN,EAAE,EAAE,CAAC;gBACL,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAkB;aAC/C,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACN,QAAQ,EAAE;gBACT,GAAG,EAAE,KAAK,IAAI,EAAE;oBAEf,OAAO,CAAC,OAAO,CAAC,CAAC;gBAClB,CAAC;gBACD,SAAS,EAAE,GAAG,EAAE;oBAEf,OAAO,GAAG,EAAE;wBACX,OAAO;oBACR,CAAC,CAAC;gBACH,CAAC;aACD;YACD,IAAI,EAAE,iBAAiB;YACvB,OAAO;YACP,MAAM;SACN,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,aAAa,CAC1B,MAAoC;QAEpC,MAAM,cAAc,GAAG,MAAM,cAAc,EAAE,CAAC;QAG9C,MAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtD,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;QAEvC,MAAM,IAAI,GAAgB,SAAS,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,MAAM,aAAa,GAAG,sBAAsB,EAAE,CAAC;QAe/C,IAAI,CAAC;YACJ,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAC7B,MAAM,aAAa,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YACjD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACxE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAC5C,CAAC;QAAC,OAAO,WAAW,EAAE,CAAC;YACtB,MAAM,iBAAiB,GAAG,MAAM,uBAAuB,EAAE,CAAC;YAC1D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YAClD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAC5C,CAAC;IACF,CAAC;CACD;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionWeb2.unit.test.d.ts","sourceRoot":"","sources":["../../src/tests/ExtensionWeb2.unit.test.ts"],"names":[],"mappings":""}
|