@getpara/web-sdk 2.0.0-alpha.3 → 2.0.0-alpha.6
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/dist/LocalStorage.js +36 -0
- package/dist/ParaWeb.js +22 -0
- package/dist/SessionStorage.js +36 -0
- package/dist/WebUtils.d.ts +4 -3
- package/dist/WebUtils.js +110 -0
- package/dist/chunk-M66XENHI.js +25 -0
- package/dist/cryptography/webAuth.js +162 -0
- package/dist/errors.js +12 -0
- package/dist/index.js +12 -1817
- package/dist/package.json +6 -0
- package/dist/utils/emailUtils.js +10 -0
- package/dist/utils/formattingUtils.js +37 -0
- package/dist/utils/isMobile.js +47 -0
- package/dist/utils/isPasskeySupported.js +17 -0
- package/dist/utils/truncateEthAddress.js +11 -0
- package/dist/wallet/keygen.d.ts +3 -3
- package/dist/wallet/keygen.js +204 -0
- package/dist/wallet/privateKey.js +31 -0
- package/dist/wallet/signing.js +101 -0
- package/dist/wasm/wasm_exec.js +564 -0
- package/dist/workers/walletUtils.d.ts +3 -3
- package/dist/workers/walletUtils.js +337 -0
- package/dist/workers/worker.js +15 -906
- package/dist/workers/workerWrapper.js +45 -0
- package/package.json +4 -5
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/workers/worker.js.br +0 -0
- package/dist/workers/worker.js.gz +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../chunk-M66XENHI.js";
|
|
5
|
+
import { getPortalBaseURL } from "@getpara/core-sdk";
|
|
6
|
+
import { handleMessage } from "./worker.js";
|
|
7
|
+
function setupWorker(ctx, resFunction) {
|
|
8
|
+
return __async(this, null, function* () {
|
|
9
|
+
const onmessage = (event) => {
|
|
10
|
+
if (event.data.functionType === "CUSTOM") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
resFunction(event.data);
|
|
14
|
+
};
|
|
15
|
+
if (ctx.disableWorkers) {
|
|
16
|
+
const syncWorker = {
|
|
17
|
+
postMessage: function(message) {
|
|
18
|
+
(function() {
|
|
19
|
+
return __async(this, null, function* () {
|
|
20
|
+
yield handleMessage({ data: message }, (data) => onmessage({ data }), ctx.disableWorkers);
|
|
21
|
+
});
|
|
22
|
+
})();
|
|
23
|
+
},
|
|
24
|
+
terminate: () => {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return syncWorker;
|
|
29
|
+
}
|
|
30
|
+
let worker;
|
|
31
|
+
if (ctx.useLocalFiles) {
|
|
32
|
+
throw new Error("useLocalFiles only supported locally");
|
|
33
|
+
} else {
|
|
34
|
+
const workerRes = yield fetch(`${getPortalBaseURL(ctx)}/static/js/mpcWorker-bundle.js`);
|
|
35
|
+
const workerBlob = new Blob([yield workerRes.text()], { type: "application/javascript" });
|
|
36
|
+
const workerScriptURL = URL.createObjectURL(workerBlob);
|
|
37
|
+
worker = new Worker(workerScriptURL);
|
|
38
|
+
}
|
|
39
|
+
worker.onmessage = onmessage;
|
|
40
|
+
return worker;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
setupWorker
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/web-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
"wasm_exec.js"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@getpara/core-sdk": "2.0.0-alpha.
|
|
12
|
-
"@getpara/user-management-client": "2.0.0-alpha.
|
|
11
|
+
"@getpara/core-sdk": "2.0.0-alpha.6",
|
|
12
|
+
"@getpara/user-management-client": "2.0.0-alpha.6",
|
|
13
13
|
"@sentry/browser": "^9.1.0",
|
|
14
|
-
"assert": "^2.1.0",
|
|
15
14
|
"base64url": "3.0.1",
|
|
16
15
|
"buffer": "6.0.3",
|
|
17
16
|
"cbor-web": "8.1.0",
|
|
@@ -37,5 +36,5 @@
|
|
|
37
36
|
"dist",
|
|
38
37
|
"package.json"
|
|
39
38
|
],
|
|
40
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "d3b01a8fb475c2af9bf255800bc10d05e011b2eb"
|
|
41
40
|
}
|
package/dist/index.js.br
DELETED
|
Binary file
|
package/dist/index.js.gz
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|