@getpara/core-sdk 2.16.0 → 2.17.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.
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -403,9 +403,8 @@ const _ParaCore = class _ParaCore {
|
|
|
403
403
|
}
|
|
404
404
|
if (!opts) opts = {};
|
|
405
405
|
__privateSet(this, _debugLogsEnabled, !!opts.enableDebugLogs);
|
|
406
|
-
|
|
407
|
-
if (env
|
|
408
|
-
isE2E = true;
|
|
406
|
+
const isE2E = env === "E2E" || envOrApiKey === "E2E";
|
|
407
|
+
if (isE2E && env !== import_types.Environment.SANDBOX) {
|
|
409
408
|
env = import_types.Environment.SANDBOX;
|
|
410
409
|
}
|
|
411
410
|
this.externalWalletConnectionOnly = opts.externalWalletConnectionOnly;
|
|
@@ -116,7 +116,7 @@ function encryptPrivateKey(keyPair, key) {
|
|
|
116
116
|
const ciphertext = yield window.crypto.subtle.encrypt(
|
|
117
117
|
{ name: "AES-GCM", iv: CONSTANT_IV_AES },
|
|
118
118
|
cryptoKey,
|
|
119
|
-
encodedPlaintext
|
|
119
|
+
encodedPlaintext.buffer
|
|
120
120
|
);
|
|
121
121
|
return Buffer.from(ciphertext).toString("base64");
|
|
122
122
|
});
|
|
@@ -299,7 +299,7 @@ function encryptPrivateKeyWithPassword(keyPair, hashedPassword) {
|
|
|
299
299
|
const ciphertext = yield window.crypto.subtle.encrypt(
|
|
300
300
|
{ name: "AES-GCM", iv: CONSTANT_IV_AES },
|
|
301
301
|
cryptoKey,
|
|
302
|
-
encodedPlaintext
|
|
302
|
+
encodedPlaintext.buffer
|
|
303
303
|
);
|
|
304
304
|
return Buffer.from(ciphertext).toString("base64");
|
|
305
305
|
});
|
|
@@ -105,6 +105,9 @@ class PortalUrlService {
|
|
|
105
105
|
* @returns - portal URL
|
|
106
106
|
*/
|
|
107
107
|
this.getPortalURL = (isLegacy) => __async(this, null, function* () {
|
|
108
|
+
if (__privateGet(this, _paraCoreInterface).ctx.isE2E) {
|
|
109
|
+
return (0, import_url.getPortalBaseURL)(__privateGet(this, _paraCoreInterface).ctx, false, false, isLegacy);
|
|
110
|
+
}
|
|
108
111
|
return __privateGet(this, _paraCoreInterface).ctx.portalUrlOverride || (yield this.getPartnerURL()) || (0, import_url.getPortalBaseURL)(__privateGet(this, _paraCoreInterface).ctx, false, false, isLegacy);
|
|
109
112
|
});
|
|
110
113
|
this.constructPortalUrl = (_0, ..._1) => __async(this, [_0, ..._1], function* (type, opts = {}) {
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -345,9 +345,8 @@ const _ParaCore = class _ParaCore {
|
|
|
345
345
|
}
|
|
346
346
|
if (!opts) opts = {};
|
|
347
347
|
__privateSet(this, _debugLogsEnabled, !!opts.enableDebugLogs);
|
|
348
|
-
|
|
349
|
-
if (env
|
|
350
|
-
isE2E = true;
|
|
348
|
+
const isE2E = env === "E2E" || envOrApiKey === "E2E";
|
|
349
|
+
if (isE2E && env !== Environment.SANDBOX) {
|
|
351
350
|
env = Environment.SANDBOX;
|
|
352
351
|
}
|
|
353
352
|
this.externalWalletConnectionOnly = opts.externalWalletConnectionOnly;
|
|
@@ -49,7 +49,7 @@ function encryptPrivateKey(keyPair, key) {
|
|
|
49
49
|
const ciphertext = yield window.crypto.subtle.encrypt(
|
|
50
50
|
{ name: "AES-GCM", iv: CONSTANT_IV_AES },
|
|
51
51
|
cryptoKey,
|
|
52
|
-
encodedPlaintext
|
|
52
|
+
encodedPlaintext.buffer
|
|
53
53
|
);
|
|
54
54
|
return Buffer.from(ciphertext).toString("base64");
|
|
55
55
|
});
|
|
@@ -232,7 +232,7 @@ function encryptPrivateKeyWithPassword(keyPair, hashedPassword) {
|
|
|
232
232
|
const ciphertext = yield window.crypto.subtle.encrypt(
|
|
233
233
|
{ name: "AES-GCM", iv: CONSTANT_IV_AES },
|
|
234
234
|
cryptoKey,
|
|
235
|
-
encodedPlaintext
|
|
235
|
+
encodedPlaintext.buffer
|
|
236
236
|
);
|
|
237
237
|
return Buffer.from(ciphertext).toString("base64");
|
|
238
238
|
});
|
|
@@ -47,6 +47,9 @@ class PortalUrlService {
|
|
|
47
47
|
* @returns - portal URL
|
|
48
48
|
*/
|
|
49
49
|
this.getPortalURL = (isLegacy) => __async(this, null, function* () {
|
|
50
|
+
if (__privateGet(this, _paraCoreInterface).ctx.isE2E) {
|
|
51
|
+
return getPortalBaseURL(__privateGet(this, _paraCoreInterface).ctx, false, false, isLegacy);
|
|
52
|
+
}
|
|
50
53
|
return __privateGet(this, _paraCoreInterface).ctx.portalUrlOverride || (yield this.getPartnerURL()) || getPortalBaseURL(__privateGet(this, _paraCoreInterface).ctx, false, false, isLegacy);
|
|
51
54
|
});
|
|
52
55
|
this.constructPortalUrl = (_0, ..._1) => __async(this, [_0, ..._1], function* (type, opts = {}) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
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.
|
|
8
|
+
"@getpara/user-management-client": "2.17.0",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
|
+
"axios": "^1.8.4",
|
|
10
11
|
"base64url": "^3.0.1",
|
|
12
|
+
"elliptic": "^6.6.1",
|
|
11
13
|
"libphonenumber-js": "^1.11.7",
|
|
12
14
|
"node-forge": "^1.3.1",
|
|
13
15
|
"uuid": "^11.1.0",
|
|
@@ -28,7 +30,7 @@
|
|
|
28
30
|
"dist",
|
|
29
31
|
"package.json"
|
|
30
32
|
],
|
|
31
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "3ed1f835b97ae720f1ac747611296e3b86f61138",
|
|
32
34
|
"main": "dist/cjs/index.js",
|
|
33
35
|
"module": "dist/esm/index.js",
|
|
34
36
|
"scripts": {
|