@getpara/web-sdk 2.0.0-alpha.13 → 2.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "./chunk-M66XENHI.js";
2
+ import "./chunk-WLGKV3EF.js";
3
3
  class LocalStorage {
4
4
  constructor() {
5
5
  this.get = (key) => {
package/dist/ParaWeb.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import ParaCore, { ConstructorOpts, Environment } from '@getpara/core-sdk';
2
2
  import { WebUtils } from './WebUtils.js';
3
3
  export declare class Para extends ParaCore {
4
+ #private;
4
5
  constructor(env: Environment, apiKey?: string, opts?: ConstructorOpts);
5
6
  protected getPlatformUtils(): WebUtils;
7
+ isPasskeySupported(): Promise<boolean>;
6
8
  }
package/dist/ParaWeb.js CHANGED
@@ -1,11 +1,19 @@
1
1
  "use client";
2
- import "./chunk-M66XENHI.js";
2
+ import {
3
+ __async,
4
+ __privateAdd,
5
+ __privateGet,
6
+ __privateSet
7
+ } from "./chunk-WLGKV3EF.js";
8
+ var _isPasskeySupported;
3
9
  import * as Sentry from "@sentry/browser";
4
10
  import ParaCore, { Environment } from "@getpara/core-sdk";
5
11
  import { WebUtils } from "./WebUtils.js";
12
+ import { isPasskeySupported } from "./utils/isPasskeySupported.js";
6
13
  class Para extends ParaCore {
7
14
  constructor(env, apiKey, opts) {
8
15
  super(env, apiKey, opts);
16
+ __privateAdd(this, _isPasskeySupported);
9
17
  if (env !== Environment.PROD && env !== Environment.DEV) {
10
18
  Sentry.init({
11
19
  environment: env.toLowerCase(),
@@ -16,7 +24,16 @@ class Para extends ParaCore {
16
24
  getPlatformUtils() {
17
25
  return new WebUtils();
18
26
  }
27
+ isPasskeySupported() {
28
+ return __async(this, null, function* () {
29
+ if (__privateGet(this, _isPasskeySupported) === void 0) {
30
+ __privateSet(this, _isPasskeySupported, yield isPasskeySupported());
31
+ }
32
+ return __privateGet(this, _isPasskeySupported);
33
+ });
34
+ }
19
35
  }
36
+ _isPasskeySupported = new WeakMap();
20
37
  export {
21
38
  Para
22
39
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "./chunk-M66XENHI.js";
2
+ import "./chunk-WLGKV3EF.js";
3
3
  class SessionStorage {
4
4
  constructor() {
5
5
  this.get = (key) => {
package/dist/WebUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "./chunk-M66XENHI.js";
2
+ import "./chunk-WLGKV3EF.js";
3
3
  import { PopupType } from "@getpara/core-sdk";
4
4
  import { LocalStorage } from "./LocalStorage.js";
5
5
  import { SessionStorage } from "./SessionStorage.js";
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ var __typeError = (msg) => {
3
+ throw TypeError(msg);
4
+ };
5
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
6
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
7
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
8
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
9
+ var __async = (__this, __arguments, generator) => {
10
+ return new Promise((resolve, reject) => {
11
+ var fulfilled = (value) => {
12
+ try {
13
+ step(generator.next(value));
14
+ } catch (e) {
15
+ reject(e);
16
+ }
17
+ };
18
+ var rejected = (value) => {
19
+ try {
20
+ step(generator.throw(value));
21
+ } catch (e) {
22
+ reject(e);
23
+ }
24
+ };
25
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
26
+ step((generator = generator.apply(__this, __arguments)).next());
27
+ });
28
+ };
29
+
30
+ export {
31
+ __privateGet,
32
+ __privateAdd,
33
+ __privateSet,
34
+ __async
35
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  import base64url from "base64url";
6
6
  import * as cbor from "cbor-web";
7
7
  import forge from "node-forge";
package/dist/errors.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "./chunk-M66XENHI.js";
2
+ import "./chunk-WLGKV3EF.js";
3
3
  class TransactionReviewError extends Error {
4
4
  constructor(transactionReviewUrl) {
5
5
  super("transaction review error");
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "./chunk-M66XENHI.js";
2
+ import "./chunk-WLGKV3EF.js";
3
3
  export * from "@getpara/core-sdk";
4
4
  import { Para as ParaWeb } from "./ParaWeb.js";
5
5
  import ParaCore from "@getpara/core-sdk";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "../chunk-M66XENHI.js";
2
+ import "../chunk-WLGKV3EF.js";
3
3
  function getMailtoLink(email, recoveryShare) {
4
4
  const emailBody = `Hello,%0D%0DBelow is your Para Recovery Secret. Keep this safe!%0D%0D${recoveryShare}%0D%0DPlease get in touch via support@getpara.com if you have any questions`;
5
5
  const mailText = `mailto:${email}?subject=Para%20Recovery%20Secret&body=${emailBody}`;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "../chunk-M66XENHI.js";
2
+ import "../chunk-WLGKV3EF.js";
3
3
  function hexStringToBase64(hexString) {
4
4
  if (hexString.substring(0, 2) === "0x") {
5
5
  hexString = hexString.substring(2);
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "../chunk-M66XENHI.js";
2
+ import "../chunk-WLGKV3EF.js";
3
3
  function isAndroid() {
4
4
  return typeof navigator !== "undefined" && /android/i.test(navigator.userAgent);
5
5
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  import { UAParser } from "ua-parser-js";
6
6
  const isPasskeySupported = (userAgent) => __async(void 0, null, function* () {
7
7
  var _a, _b, _c;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import "../chunk-M66XENHI.js";
2
+ import "../chunk-WLGKV3EF.js";
3
3
  const truncateRegex = /^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;
4
4
  const truncateEthAddress = (address) => {
5
5
  const match = address.match(truncateRegex);
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  import { setupWorker } from "../workers/workerWrapper.js";
6
6
  import { distributeNewShare, waitUntilTrue } from "@getpara/core-sdk";
7
7
  function isKeygenComplete(ctx, userId, walletId) {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  import { setupWorker } from "../workers/workerWrapper.js";
6
6
  function getPrivateKey(ctx, userId, walletId, share, sessionCookie) {
7
7
  return __async(this, null, function* () {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  import { setupWorker } from "../workers/workerWrapper.js";
6
6
  function signTransaction(ctx, userId, walletId, share, tx, chainId, sessionCookie, isDKLS) {
7
7
  return __async(this, null, function* () {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  (() => {
6
6
  const enosys = () => {
7
7
  const err = new Error("not implemented");
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  import { getBaseMPCNetworkUrl } from "@getpara/core-sdk";
6
6
  const configCGGMPBase = (serverUrl, walletId, id) => `{"ServerUrl":"${serverUrl}", "WalletId": "${walletId}", "Id":"${id}", "Ids":["USER","CAPSULE"], "Threshold":1}`;
7
7
  const configDKLSBase = (walletId, id, disableWebSockets) => `{"walletId": "${walletId}", "id":"${id}", "otherId":"CAPSULE", "isReceiver": false, "disableWebSockets": ${disableWebSockets}}`;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  __async
4
- } from "../chunk-M66XENHI.js";
4
+ } from "../chunk-WLGKV3EF.js";
5
5
  import { getPortalBaseURL } from "@getpara/core-sdk";
6
6
  import { handleMessage } from "./worker.js";
7
7
  function setupWorker(ctx, resFunction) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/web-sdk",
3
- "version": "2.0.0-alpha.13",
3
+ "version": "2.0.0-alpha.14",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,8 +8,8 @@
8
8
  "wasm_exec.js"
9
9
  ],
10
10
  "dependencies": {
11
- "@getpara/core-sdk": "2.0.0-alpha.13",
12
- "@getpara/user-management-client": "2.0.0-alpha.13",
11
+ "@getpara/core-sdk": "2.0.0-alpha.14",
12
+ "@getpara/user-management-client": "2.0.0-alpha.14",
13
13
  "@sentry/browser": "^9.1.0",
14
14
  "base64url": "3.0.1",
15
15
  "buffer": "6.0.3",
@@ -36,5 +36,5 @@
36
36
  "dist",
37
37
  "package.json"
38
38
  ],
39
- "gitHead": "fbd9384b1b3fb8577f9d6c323d4e41d0de1ac83b"
39
+ "gitHead": "03898846281bf37536a6ed12dede119e6171ad45"
40
40
  }
@@ -1,25 +0,0 @@
1
- "use client";
2
- var __async = (__this, __arguments, generator) => {
3
- return new Promise((resolve, reject) => {
4
- var fulfilled = (value) => {
5
- try {
6
- step(generator.next(value));
7
- } catch (e) {
8
- reject(e);
9
- }
10
- };
11
- var rejected = (value) => {
12
- try {
13
- step(generator.throw(value));
14
- } catch (e) {
15
- reject(e);
16
- }
17
- };
18
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
19
- step((generator = generator.apply(__this, __arguments)).next());
20
- });
21
- };
22
-
23
- export {
24
- __async
25
- };