@getpara/core-sdk 2.0.0-alpha.40 → 2.0.0-alpha.42

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.
@@ -1420,12 +1420,17 @@ const _ParaCore = class _ParaCore {
1420
1420
  "cosmosPublicKeyHex",
1421
1421
  "cosmosSigner"
1422
1422
  ]);
1423
+ var _a;
1423
1424
  const serverAuthState = yield this.ctx.client.verifyExternalWallet(this.userId, {
1424
1425
  externalWallet,
1425
1426
  signedMessage,
1426
1427
  cosmosPublicKeyHex,
1427
1428
  cosmosSigner
1428
1429
  });
1430
+ if (serverAuthState.stage === "login" && ((_a = serverAuthState.loginAuthMethods) == null ? void 0 : _a.includes(import_user_management_client.AuthMethod.PIN))) {
1431
+ const { sessionLookupId } = yield this.touchSession();
1432
+ return __privateMethod(this, _ParaCore_instances, prepareLoginState_fn).call(this, serverAuthState, __spreadProps(__spreadValues({}, urlOptions), { sessionLookupId }));
1433
+ }
1429
1434
  return __privateMethod(this, _ParaCore_instances, prepareAuthState_fn).call(this, serverAuthState, urlOptions);
1430
1435
  });
1431
1436
  }
@@ -3379,7 +3384,8 @@ createPregenWallet_fn = function(opts) {
3379
3384
  _isCreateGuestWalletsPending = new WeakMap();
3380
3385
  prepareAuthState_fn = function(_0) {
3381
3386
  return __async(this, arguments, function* (serverAuthState, opts = {}) {
3382
- if (!opts.sessionLookupId && serverAuthState.stage === "login") {
3387
+ var _a, _b;
3388
+ if (!opts.sessionLookupId && serverAuthState.stage === "login" && (!serverAuthState.externalWallet || !(((_a = serverAuthState.externalWallet) == null ? void 0 : _a.withFullParaAuth) && ((_b = serverAuthState.loginAuthMethods) == null ? void 0 : _b.includes(import_user_management_client.AuthMethod.PIN))))) {
3383
3389
  opts.sessionLookupId = yield this.prepareLogin();
3384
3390
  }
3385
3391
  const { auth, externalWallet, userId, displayName, pfpUrl, username } = serverAuthState;
@@ -40,7 +40,7 @@ __export(constants_exports, {
40
40
  SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
41
41
  });
42
42
  module.exports = __toCommonJS(constants_exports);
43
- const PARA_CORE_VERSION = "2.0.0-alpha.40";
43
+ const PARA_CORE_VERSION = "2.0.0-alpha.42";
44
44
  const PREFIX = "@CAPSULE/";
45
45
  const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
46
46
  const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
@@ -1385,12 +1385,17 @@ const _ParaCore = class _ParaCore {
1385
1385
  "cosmosPublicKeyHex",
1386
1386
  "cosmosSigner"
1387
1387
  ]);
1388
+ var _a;
1388
1389
  const serverAuthState = yield this.ctx.client.verifyExternalWallet(this.userId, {
1389
1390
  externalWallet,
1390
1391
  signedMessage,
1391
1392
  cosmosPublicKeyHex,
1392
1393
  cosmosSigner
1393
1394
  });
1395
+ if (serverAuthState.stage === "login" && ((_a = serverAuthState.loginAuthMethods) == null ? void 0 : _a.includes(AuthMethod.PIN))) {
1396
+ const { sessionLookupId } = yield this.touchSession();
1397
+ return __privateMethod(this, _ParaCore_instances, prepareLoginState_fn).call(this, serverAuthState, __spreadProps(__spreadValues({}, urlOptions), { sessionLookupId }));
1398
+ }
1394
1399
  return __privateMethod(this, _ParaCore_instances, prepareAuthState_fn).call(this, serverAuthState, urlOptions);
1395
1400
  });
1396
1401
  }
@@ -3344,7 +3349,8 @@ createPregenWallet_fn = function(opts) {
3344
3349
  _isCreateGuestWalletsPending = new WeakMap();
3345
3350
  prepareAuthState_fn = function(_0) {
3346
3351
  return __async(this, arguments, function* (serverAuthState, opts = {}) {
3347
- if (!opts.sessionLookupId && serverAuthState.stage === "login") {
3352
+ var _a, _b;
3353
+ if (!opts.sessionLookupId && serverAuthState.stage === "login" && (!serverAuthState.externalWallet || !(((_a = serverAuthState.externalWallet) == null ? void 0 : _a.withFullParaAuth) && ((_b = serverAuthState.loginAuthMethods) == null ? void 0 : _b.includes(AuthMethod.PIN))))) {
3348
3354
  opts.sessionLookupId = yield this.prepareLogin();
3349
3355
  }
3350
3356
  const { auth, externalWallet, userId, displayName, pfpUrl, username } = serverAuthState;
@@ -1,5 +1,5 @@
1
1
  import "./chunk-7B52C2XE.js";
2
- const PARA_CORE_VERSION = "2.0.0-alpha.40";
2
+ const PARA_CORE_VERSION = "2.0.0-alpha.42";
3
3
  const PREFIX = "@CAPSULE/";
4
4
  const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
5
5
  const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
@@ -148,7 +148,7 @@ export type CoreMethods = Record<CoreMethodName, {
148
148
  };
149
149
  verifyExternalWallet: {
150
150
  params: AuthStateBaseParams & VerifyExternalWalletParams;
151
- response: AuthStateSignup;
151
+ response: AuthStateSignup | AuthStateLogin;
152
152
  };
153
153
  resendVerificationCode: {
154
154
  params: {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@getpara/core-sdk",
3
- "version": "2.0.0-alpha.40",
3
+ "version": "2.0.0-alpha.42",
4
4
  "dependencies": {
5
5
  "@celo/utils": "^8.0.2",
6
6
  "@cosmjs/encoding": "^0.32.4",
7
7
  "@ethereumjs/util": "^9.1.0",
8
- "@getpara/user-management-client": "2.0.0-alpha.40",
8
+ "@getpara/user-management-client": "2.0.0-alpha.42",
9
9
  "@noble/hashes": "^1.5.0",
10
10
  "base64url": "^3.0.1",
11
11
  "libphonenumber-js": "^1.11.7",
@@ -27,7 +27,7 @@
27
27
  "dist",
28
28
  "package.json"
29
29
  ],
30
- "gitHead": "2506044cd3ed127774fb7d537ae850b43acfe8b7",
30
+ "gitHead": "6f44dc050550a1f567088c81b3ae06c7f1f8ebcb",
31
31
  "main": "dist/cjs/index.js",
32
32
  "module": "dist/esm/index.js",
33
33
  "scripts": {