@getpara/core-sdk 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -408,6 +408,9 @@ const _ParaCore = class _ParaCore {
408
408
  get isMultiWallet() {
409
409
  return this.currentWalletIdsArray.length > 1;
410
410
  }
411
+ get isNoWalletConfig() {
412
+ return !!__privateGet(this, _supportedWalletTypes) && __privateGet(this, _supportedWalletTypes).length === 0;
413
+ }
411
414
  get supportedWalletTypes() {
412
415
  var _a;
413
416
  return (_a = __privateGet(this, _supportedWalletTypes)) != null ? _a : [];
@@ -1525,7 +1528,7 @@ const _ParaCore = class _ParaCore {
1525
1528
  return true;
1526
1529
  }
1527
1530
  const isSessionActive = yield this.isSessionActive();
1528
- return isSessionActive && this.currentWalletIdsArray.length > 0 && this.currentWalletIdsArray.reduce((acc, [id]) => acc && !!this.wallets[id], true);
1531
+ return isSessionActive && (this.isNoWalletConfig || this.currentWalletIdsArray.length > 0 && this.currentWalletIdsArray.reduce((acc, [id]) => acc && !!this.wallets[id], true));
1529
1532
  });
1530
1533
  }
1531
1534
  supportedAuthMethods(auth) {
@@ -1778,6 +1781,13 @@ const _ParaCore = class _ParaCore {
1778
1781
  */
1779
1782
  getOAuthURL(_0) {
1780
1783
  return __async(this, arguments, function* ({ method, deeplinkUrl }) {
1784
+ if (deeplinkUrl) {
1785
+ try {
1786
+ new URL(deeplinkUrl);
1787
+ } catch (e) {
1788
+ throw new Error("Invalid deeplink URL");
1789
+ }
1790
+ }
1781
1791
  yield this.logout();
1782
1792
  const res = yield this.touchSession(true);
1783
1793
  return (0, import_utils2.constructUrl)({
@@ -36,7 +36,7 @@ __export(constants_exports, {
36
36
  SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
37
37
  });
38
38
  module.exports = __toCommonJS(constants_exports);
39
- const PARA_CORE_VERSION = '1.8.0';
39
+ const PARA_CORE_VERSION = '1.9.0';
40
40
  const PREFIX = "@CAPSULE/";
41
41
  const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
42
42
  const LOCAL_STORAGE_PHONE = `${PREFIX}phone`;
@@ -358,6 +358,9 @@ const _ParaCore = class _ParaCore {
358
358
  get isMultiWallet() {
359
359
  return this.currentWalletIdsArray.length > 1;
360
360
  }
361
+ get isNoWalletConfig() {
362
+ return !!__privateGet(this, _supportedWalletTypes) && __privateGet(this, _supportedWalletTypes).length === 0;
363
+ }
361
364
  get supportedWalletTypes() {
362
365
  var _a;
363
366
  return (_a = __privateGet(this, _supportedWalletTypes)) != null ? _a : [];
@@ -1475,7 +1478,7 @@ const _ParaCore = class _ParaCore {
1475
1478
  return true;
1476
1479
  }
1477
1480
  const isSessionActive = yield this.isSessionActive();
1478
- return isSessionActive && this.currentWalletIdsArray.length > 0 && this.currentWalletIdsArray.reduce((acc, [id]) => acc && !!this.wallets[id], true);
1481
+ return isSessionActive && (this.isNoWalletConfig || this.currentWalletIdsArray.length > 0 && this.currentWalletIdsArray.reduce((acc, [id]) => acc && !!this.wallets[id], true));
1479
1482
  });
1480
1483
  }
1481
1484
  supportedAuthMethods(auth) {
@@ -1728,6 +1731,13 @@ const _ParaCore = class _ParaCore {
1728
1731
  */
1729
1732
  getOAuthURL(_0) {
1730
1733
  return __async(this, arguments, function* ({ method, deeplinkUrl }) {
1734
+ if (deeplinkUrl) {
1735
+ try {
1736
+ new URL(deeplinkUrl);
1737
+ } catch (e) {
1738
+ throw new Error("Invalid deeplink URL");
1739
+ }
1740
+ }
1731
1741
  yield this.logout();
1732
1742
  const res = yield this.touchSession(true);
1733
1743
  return constructUrl({
@@ -1,5 +1,5 @@
1
1
  import "./chunk-UICEQADR.js";
2
- const PARA_CORE_VERSION = '1.8.0';
2
+ const PARA_CORE_VERSION = '1.9.0';
3
3
  const PREFIX = "@CAPSULE/";
4
4
  const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
5
5
  const LOCAL_STORAGE_PHONE = `${PREFIX}phone`;
@@ -113,6 +113,7 @@ export declare abstract class ParaCore {
113
113
  */
114
114
  portalTheme?: Theme;
115
115
  private disableProviderModal?;
116
+ get isNoWalletConfig(): boolean;
116
117
  get supportedWalletTypes(): SupportedWalletTypes;
117
118
  get isWalletTypeEnabled(): Partial<Record<WalletType, boolean>>;
118
119
  private platformUtils;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/core-sdk",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "@celo/utils": "^8.0.2",
11
11
  "@cosmjs/encoding": "^0.32.4",
12
12
  "@ethereumjs/util": "^9.1.0",
13
- "@getpara/user-management-client": "1.8.0",
13
+ "@getpara/user-management-client": "1.9.0",
14
14
  "@noble/hashes": "^1.5.0",
15
15
  "base64url": "^3.0.1",
16
16
  "libphonenumber-js": "1.11.2",
@@ -40,5 +40,5 @@
40
40
  "require": "./dist/cjs/index.js"
41
41
  }
42
42
  },
43
- "gitHead": "ef96e79558695ccbe148d25a8e3611c4596d1954"
43
+ "gitHead": "3d749844bf071e2c8de2769dd16e17c026951109"
44
44
  }