@getpara/core-sdk 2.0.0-alpha.44 → 2.0.0-alpha.46
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 +79 -14
- package/dist/cjs/constants.js +4 -1
- package/dist/cjs/index.js +2 -0
- package/dist/esm/ParaCore.js +79 -14
- package/dist/esm/constants.js +3 -1
- package/dist/esm/index.js +2 -1
- package/dist/types/ParaCore.d.ts +4 -2
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +3 -3
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -111,14 +111,7 @@ if (typeof global !== "undefined") {
|
|
|
111
111
|
}
|
|
112
112
|
const { pki, jsbn } = import_node_forge.default;
|
|
113
113
|
const _ParaCore = class _ParaCore {
|
|
114
|
-
|
|
115
|
-
* Constructs a new `ParaCore` instance.
|
|
116
|
-
* @param env - `Environment` to use.
|
|
117
|
-
* @param apiKey - API key to use.
|
|
118
|
-
* @param opts - Additional constructor options; see `ConstructorOpts`.
|
|
119
|
-
* @returns - A new ParaCore instance.
|
|
120
|
-
*/
|
|
121
|
-
constructor(env, apiKey, opts) {
|
|
114
|
+
constructor(envOrApiKey, apiKeyOrOpts, opts) {
|
|
122
115
|
__privateAdd(this, _ParaCore_instances);
|
|
123
116
|
__privateAdd(this, _authInfo);
|
|
124
117
|
this.isNativePasskey = false;
|
|
@@ -165,10 +158,17 @@ const _ParaCore = class _ParaCore {
|
|
|
165
158
|
*/
|
|
166
159
|
this.clearStorage = (type = "all") => __async(this, null, function* () {
|
|
167
160
|
const isAll = type === "all";
|
|
168
|
-
(isAll || type === "local")
|
|
169
|
-
|
|
161
|
+
if (isAll || type === "local") {
|
|
162
|
+
this.platformUtils.localStorage.clear(constants.PREFIX);
|
|
163
|
+
this.platformUtils.localStorage.clear(constants.PARA_PREFIX);
|
|
164
|
+
}
|
|
165
|
+
if (isAll || type === "session") {
|
|
166
|
+
this.platformUtils.sessionStorage.clear(constants.PREFIX);
|
|
167
|
+
this.platformUtils.sessionStorage.clear(constants.PARA_PREFIX);
|
|
168
|
+
}
|
|
170
169
|
if ((isAll || type === "secure") && this.platformUtils.secureStorage) {
|
|
171
170
|
this.platformUtils.secureStorage.clear(constants.PREFIX);
|
|
171
|
+
this.platformUtils.secureStorage.clear(constants.PARA_PREFIX);
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
this.trackError = (methodName, err) => __async(this, null, function* () {
|
|
@@ -315,8 +315,29 @@ const _ParaCore = class _ParaCore {
|
|
|
315
315
|
}) {
|
|
316
316
|
return (yield this.ctx.client.getWalletBalance({ walletId, rpcUrl })).balance;
|
|
317
317
|
});
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
let env, apiKey;
|
|
319
|
+
const actualArgs = Array.from(arguments).filter((arg) => arg !== void 0);
|
|
320
|
+
const actualArgumentCount = actualArgs.length;
|
|
321
|
+
if (actualArgumentCount === 1) {
|
|
322
|
+
if (Object.values(import_types.Environment).includes(envOrApiKey)) {
|
|
323
|
+
throw new Error("A Para API key is required.");
|
|
324
|
+
}
|
|
325
|
+
env = _ParaCore.resolveEnvironment(void 0, actualArgs[0]);
|
|
326
|
+
apiKey = actualArgs[0];
|
|
327
|
+
opts = void 0;
|
|
328
|
+
} else if (actualArgumentCount === 2) {
|
|
329
|
+
if (typeof apiKeyOrOpts === "object" && apiKeyOrOpts !== null) {
|
|
330
|
+
env = _ParaCore.resolveEnvironment(void 0, envOrApiKey);
|
|
331
|
+
apiKey = envOrApiKey;
|
|
332
|
+
opts = apiKeyOrOpts;
|
|
333
|
+
} else {
|
|
334
|
+
env = _ParaCore.resolveEnvironment(envOrApiKey, apiKeyOrOpts);
|
|
335
|
+
apiKey = apiKeyOrOpts;
|
|
336
|
+
opts = void 0;
|
|
337
|
+
}
|
|
338
|
+
} else {
|
|
339
|
+
env = _ParaCore.resolveEnvironment(envOrApiKey, apiKeyOrOpts);
|
|
340
|
+
apiKey = apiKeyOrOpts;
|
|
320
341
|
}
|
|
321
342
|
if (!opts) opts = {};
|
|
322
343
|
let isE2E = false;
|
|
@@ -796,9 +817,28 @@ const _ParaCore = class _ParaCore {
|
|
|
796
817
|
return url;
|
|
797
818
|
});
|
|
798
819
|
}
|
|
820
|
+
static resolveEnvironment(env, apiKey) {
|
|
821
|
+
var _a;
|
|
822
|
+
if (!apiKey) {
|
|
823
|
+
throw new Error("A Para API key is required.");
|
|
824
|
+
}
|
|
825
|
+
if (apiKey.includes("_")) {
|
|
826
|
+
const validEnvironmentPrefixes = Object.values(import_types.Environment);
|
|
827
|
+
const envPrefix = (_a = apiKey.split("_")[0]) == null ? void 0 : _a.toUpperCase();
|
|
828
|
+
const hasValidPrefix = validEnvironmentPrefixes.some((envValue) => envValue === envPrefix);
|
|
829
|
+
if (!hasValidPrefix) {
|
|
830
|
+
throw new Error(`Invalid API key environment prefix.`);
|
|
831
|
+
}
|
|
832
|
+
return envPrefix;
|
|
833
|
+
}
|
|
834
|
+
if (!env) {
|
|
835
|
+
throw new Error("Environment parameter is required.");
|
|
836
|
+
}
|
|
837
|
+
return env;
|
|
838
|
+
}
|
|
799
839
|
touchSession(regenerate = false) {
|
|
800
840
|
return __async(this, null, function* () {
|
|
801
|
-
var _a, _b, _c;
|
|
841
|
+
var _a, _b, _c, _d;
|
|
802
842
|
if (!this.isWorkerInitialized) {
|
|
803
843
|
this.initializeWorker();
|
|
804
844
|
}
|
|
@@ -807,7 +847,32 @@ const _ParaCore = class _ParaCore {
|
|
|
807
847
|
}
|
|
808
848
|
const session = yield this.ctx.client.touchSession(regenerate);
|
|
809
849
|
if (!this.partner || ((_a = this.partner) == null ? void 0 : _a.id) !== session.partnerId || !(0, import_utils2.supportedWalletTypesEq)(((_b = this.partner) == null ? void 0 : _b.supportedWalletTypes) || [], session.supportedWalletTypes) || (((_c = this.partner) == null ? void 0 : _c.cosmosPrefix) || "cosmos") !== session.cosmosPrefix) {
|
|
810
|
-
|
|
850
|
+
if (!session.partnerId) {
|
|
851
|
+
console.error(`
|
|
852
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
853
|
+
\u{1F6A8} PARA SDK CONFIGURATION ERROR \u{1F6A8}
|
|
854
|
+
|
|
855
|
+
INVALID API KEY FOR CONFIGURED ENVIRONMENT
|
|
856
|
+
|
|
857
|
+
Your API key does not match the configured environment. This usually means:
|
|
858
|
+
|
|
859
|
+
1. You're using a production API key with a development environment
|
|
860
|
+
2. You're using a development API key with a production environment
|
|
861
|
+
3. Your API key is invalid or has been regenerated
|
|
862
|
+
|
|
863
|
+
SOLUTION:
|
|
864
|
+
\u2022 Verify your API key at: https://developer.getpara.com
|
|
865
|
+
\u2022 If your API key doesn't contain an environment prefix, ensure your API key is the correct key for your target environment
|
|
866
|
+
|
|
867
|
+
Current Environment: ${this.ctx.env}
|
|
868
|
+
API Key Prefix: ${((_d = this.ctx.apiKey) == null ? void 0 : _d.split("_")[0].toUpperCase()) || "None"}
|
|
869
|
+
|
|
870
|
+
Need help? Visit: https://docs.getpara.com or contact support
|
|
871
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
872
|
+
`);
|
|
873
|
+
} else {
|
|
874
|
+
yield __privateMethod(this, _ParaCore_instances, getPartner_fn).call(this, session.partnerId);
|
|
875
|
+
}
|
|
811
876
|
}
|
|
812
877
|
return session;
|
|
813
878
|
});
|
package/dist/cjs/constants.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(constants_exports, {
|
|
|
33
33
|
LOCAL_STORAGE_USER_ID: () => LOCAL_STORAGE_USER_ID,
|
|
34
34
|
LOCAL_STORAGE_WALLETS: () => LOCAL_STORAGE_WALLETS,
|
|
35
35
|
PARA_CORE_VERSION: () => PARA_CORE_VERSION,
|
|
36
|
+
PARA_PREFIX: () => PARA_PREFIX,
|
|
36
37
|
POLLING_INTERVAL_MS: () => POLLING_INTERVAL_MS,
|
|
37
38
|
POLLING_TIMEOUT_MS: () => POLLING_TIMEOUT_MS,
|
|
38
39
|
PREFIX: () => PREFIX,
|
|
@@ -40,8 +41,9 @@ __export(constants_exports, {
|
|
|
40
41
|
SHORT_POLLING_INTERVAL_MS: () => SHORT_POLLING_INTERVAL_MS
|
|
41
42
|
});
|
|
42
43
|
module.exports = __toCommonJS(constants_exports);
|
|
43
|
-
const PARA_CORE_VERSION = "2.0.0-alpha.
|
|
44
|
+
const PARA_CORE_VERSION = "2.0.0-alpha.46";
|
|
44
45
|
const PREFIX = "@CAPSULE/";
|
|
46
|
+
const PARA_PREFIX = "@PARA/";
|
|
45
47
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
46
48
|
const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
|
|
47
49
|
const LOCAL_STORAGE_PHONE = `${PREFIX}phone`;
|
|
@@ -79,6 +81,7 @@ const ACCOUNT_LINK_CONFLICT = "Account already linked";
|
|
|
79
81
|
LOCAL_STORAGE_USER_ID,
|
|
80
82
|
LOCAL_STORAGE_WALLETS,
|
|
81
83
|
PARA_CORE_VERSION,
|
|
84
|
+
PARA_PREFIX,
|
|
82
85
|
POLLING_INTERVAL_MS,
|
|
83
86
|
POLLING_TIMEOUT_MS,
|
|
84
87
|
PREFIX,
|
package/dist/cjs/index.js
CHANGED
|
@@ -45,6 +45,7 @@ __export(src_exports, {
|
|
|
45
45
|
OnRampProvider: () => import_user_management_client.OnRampProvider,
|
|
46
46
|
OnRampPurchaseStatus: () => import_user_management_client.OnRampPurchaseStatus,
|
|
47
47
|
OnRampPurchaseType: () => import_user_management_client.OnRampPurchaseType,
|
|
48
|
+
PARA_STORAGE_PREFIX: () => import_constants.PARA_PREFIX,
|
|
48
49
|
PREGEN_IDENTIFIER_TYPES: () => import_user_management_client.PREGEN_IDENTIFIER_TYPES,
|
|
49
50
|
PopupType: () => import_types.PopupType,
|
|
50
51
|
PregenIdentifierType: () => import_types.PregenIdentifierType,
|
|
@@ -133,6 +134,7 @@ var src_default = import_ParaCore.ParaCore;
|
|
|
133
134
|
OnRampProvider,
|
|
134
135
|
OnRampPurchaseStatus,
|
|
135
136
|
OnRampPurchaseType,
|
|
137
|
+
PARA_STORAGE_PREFIX,
|
|
136
138
|
PREGEN_IDENTIFIER_TYPES,
|
|
137
139
|
PopupType,
|
|
138
140
|
PregenIdentifierType,
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -76,14 +76,7 @@ import {
|
|
|
76
76
|
import { TransactionReviewDenied, TransactionReviewTimeout } from "./errors.js";
|
|
77
77
|
import * as constants from "./constants.js";
|
|
78
78
|
const _ParaCore = class _ParaCore {
|
|
79
|
-
|
|
80
|
-
* Constructs a new `ParaCore` instance.
|
|
81
|
-
* @param env - `Environment` to use.
|
|
82
|
-
* @param apiKey - API key to use.
|
|
83
|
-
* @param opts - Additional constructor options; see `ConstructorOpts`.
|
|
84
|
-
* @returns - A new ParaCore instance.
|
|
85
|
-
*/
|
|
86
|
-
constructor(env, apiKey, opts) {
|
|
79
|
+
constructor(envOrApiKey, apiKeyOrOpts, opts) {
|
|
87
80
|
__privateAdd(this, _ParaCore_instances);
|
|
88
81
|
__privateAdd(this, _authInfo);
|
|
89
82
|
this.isNativePasskey = false;
|
|
@@ -130,10 +123,17 @@ const _ParaCore = class _ParaCore {
|
|
|
130
123
|
*/
|
|
131
124
|
this.clearStorage = (type = "all") => __async(this, null, function* () {
|
|
132
125
|
const isAll = type === "all";
|
|
133
|
-
(isAll || type === "local")
|
|
134
|
-
|
|
126
|
+
if (isAll || type === "local") {
|
|
127
|
+
this.platformUtils.localStorage.clear(constants.PREFIX);
|
|
128
|
+
this.platformUtils.localStorage.clear(constants.PARA_PREFIX);
|
|
129
|
+
}
|
|
130
|
+
if (isAll || type === "session") {
|
|
131
|
+
this.platformUtils.sessionStorage.clear(constants.PREFIX);
|
|
132
|
+
this.platformUtils.sessionStorage.clear(constants.PARA_PREFIX);
|
|
133
|
+
}
|
|
135
134
|
if ((isAll || type === "secure") && this.platformUtils.secureStorage) {
|
|
136
135
|
this.platformUtils.secureStorage.clear(constants.PREFIX);
|
|
136
|
+
this.platformUtils.secureStorage.clear(constants.PARA_PREFIX);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
this.trackError = (methodName, err) => __async(this, null, function* () {
|
|
@@ -280,8 +280,29 @@ const _ParaCore = class _ParaCore {
|
|
|
280
280
|
}) {
|
|
281
281
|
return (yield this.ctx.client.getWalletBalance({ walletId, rpcUrl })).balance;
|
|
282
282
|
});
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
let env, apiKey;
|
|
284
|
+
const actualArgs = Array.from(arguments).filter((arg) => arg !== void 0);
|
|
285
|
+
const actualArgumentCount = actualArgs.length;
|
|
286
|
+
if (actualArgumentCount === 1) {
|
|
287
|
+
if (Object.values(Environment).includes(envOrApiKey)) {
|
|
288
|
+
throw new Error("A Para API key is required.");
|
|
289
|
+
}
|
|
290
|
+
env = _ParaCore.resolveEnvironment(void 0, actualArgs[0]);
|
|
291
|
+
apiKey = actualArgs[0];
|
|
292
|
+
opts = void 0;
|
|
293
|
+
} else if (actualArgumentCount === 2) {
|
|
294
|
+
if (typeof apiKeyOrOpts === "object" && apiKeyOrOpts !== null) {
|
|
295
|
+
env = _ParaCore.resolveEnvironment(void 0, envOrApiKey);
|
|
296
|
+
apiKey = envOrApiKey;
|
|
297
|
+
opts = apiKeyOrOpts;
|
|
298
|
+
} else {
|
|
299
|
+
env = _ParaCore.resolveEnvironment(envOrApiKey, apiKeyOrOpts);
|
|
300
|
+
apiKey = apiKeyOrOpts;
|
|
301
|
+
opts = void 0;
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
env = _ParaCore.resolveEnvironment(envOrApiKey, apiKeyOrOpts);
|
|
305
|
+
apiKey = apiKeyOrOpts;
|
|
285
306
|
}
|
|
286
307
|
if (!opts) opts = {};
|
|
287
308
|
let isE2E = false;
|
|
@@ -761,9 +782,28 @@ const _ParaCore = class _ParaCore {
|
|
|
761
782
|
return url;
|
|
762
783
|
});
|
|
763
784
|
}
|
|
785
|
+
static resolveEnvironment(env, apiKey) {
|
|
786
|
+
var _a;
|
|
787
|
+
if (!apiKey) {
|
|
788
|
+
throw new Error("A Para API key is required.");
|
|
789
|
+
}
|
|
790
|
+
if (apiKey.includes("_")) {
|
|
791
|
+
const validEnvironmentPrefixes = Object.values(Environment);
|
|
792
|
+
const envPrefix = (_a = apiKey.split("_")[0]) == null ? void 0 : _a.toUpperCase();
|
|
793
|
+
const hasValidPrefix = validEnvironmentPrefixes.some((envValue) => envValue === envPrefix);
|
|
794
|
+
if (!hasValidPrefix) {
|
|
795
|
+
throw new Error(`Invalid API key environment prefix.`);
|
|
796
|
+
}
|
|
797
|
+
return envPrefix;
|
|
798
|
+
}
|
|
799
|
+
if (!env) {
|
|
800
|
+
throw new Error("Environment parameter is required.");
|
|
801
|
+
}
|
|
802
|
+
return env;
|
|
803
|
+
}
|
|
764
804
|
touchSession(regenerate = false) {
|
|
765
805
|
return __async(this, null, function* () {
|
|
766
|
-
var _a, _b, _c;
|
|
806
|
+
var _a, _b, _c, _d;
|
|
767
807
|
if (!this.isWorkerInitialized) {
|
|
768
808
|
this.initializeWorker();
|
|
769
809
|
}
|
|
@@ -772,7 +812,32 @@ const _ParaCore = class _ParaCore {
|
|
|
772
812
|
}
|
|
773
813
|
const session = yield this.ctx.client.touchSession(regenerate);
|
|
774
814
|
if (!this.partner || ((_a = this.partner) == null ? void 0 : _a.id) !== session.partnerId || !supportedWalletTypesEq(((_b = this.partner) == null ? void 0 : _b.supportedWalletTypes) || [], session.supportedWalletTypes) || (((_c = this.partner) == null ? void 0 : _c.cosmosPrefix) || "cosmos") !== session.cosmosPrefix) {
|
|
775
|
-
|
|
815
|
+
if (!session.partnerId) {
|
|
816
|
+
console.error(`
|
|
817
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
818
|
+
\u{1F6A8} PARA SDK CONFIGURATION ERROR \u{1F6A8}
|
|
819
|
+
|
|
820
|
+
INVALID API KEY FOR CONFIGURED ENVIRONMENT
|
|
821
|
+
|
|
822
|
+
Your API key does not match the configured environment. This usually means:
|
|
823
|
+
|
|
824
|
+
1. You're using a production API key with a development environment
|
|
825
|
+
2. You're using a development API key with a production environment
|
|
826
|
+
3. Your API key is invalid or has been regenerated
|
|
827
|
+
|
|
828
|
+
SOLUTION:
|
|
829
|
+
\u2022 Verify your API key at: https://developer.getpara.com
|
|
830
|
+
\u2022 If your API key doesn't contain an environment prefix, ensure your API key is the correct key for your target environment
|
|
831
|
+
|
|
832
|
+
Current Environment: ${this.ctx.env}
|
|
833
|
+
API Key Prefix: ${((_d = this.ctx.apiKey) == null ? void 0 : _d.split("_")[0].toUpperCase()) || "None"}
|
|
834
|
+
|
|
835
|
+
Need help? Visit: https://docs.getpara.com or contact support
|
|
836
|
+
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
837
|
+
`);
|
|
838
|
+
} else {
|
|
839
|
+
yield __privateMethod(this, _ParaCore_instances, getPartner_fn).call(this, session.partnerId);
|
|
840
|
+
}
|
|
776
841
|
}
|
|
777
842
|
return session;
|
|
778
843
|
});
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./chunk-7B52C2XE.js";
|
|
2
|
-
const PARA_CORE_VERSION = "2.0.0-alpha.
|
|
2
|
+
const PARA_CORE_VERSION = "2.0.0-alpha.46";
|
|
3
3
|
const PREFIX = "@CAPSULE/";
|
|
4
|
+
const PARA_PREFIX = "@PARA/";
|
|
4
5
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
5
6
|
const LOCAL_STORAGE_EMAIL = `${PREFIX}e-mail`;
|
|
6
7
|
const LOCAL_STORAGE_PHONE = `${PREFIX}phone`;
|
|
@@ -37,6 +38,7 @@ export {
|
|
|
37
38
|
LOCAL_STORAGE_USER_ID,
|
|
38
39
|
LOCAL_STORAGE_WALLETS,
|
|
39
40
|
PARA_CORE_VERSION,
|
|
41
|
+
PARA_PREFIX,
|
|
40
42
|
POLLING_INTERVAL_MS,
|
|
41
43
|
POLLING_TIMEOUT_MS,
|
|
42
44
|
PREFIX,
|
package/dist/esm/index.js
CHANGED
|
@@ -33,7 +33,7 @@ export * from "./types/coreApi.js";
|
|
|
33
33
|
export * from "./types/events.js";
|
|
34
34
|
export * from "./types/config.js";
|
|
35
35
|
import { getPortalDomain, entityToWallet, constructUrl, shortenUrl } from "./utils/index.js";
|
|
36
|
-
import { PREFIX } from "./constants.js";
|
|
36
|
+
import { PREFIX, PARA_PREFIX } from "./constants.js";
|
|
37
37
|
import { distributeNewShare } from "./shares/shareDistribution.js";
|
|
38
38
|
import { KeyContainer } from "./shares/KeyContainer.js";
|
|
39
39
|
import { getBaseUrl, initClient } from "./external/userManagementClient.js";
|
|
@@ -85,6 +85,7 @@ export {
|
|
|
85
85
|
OnRampProvider,
|
|
86
86
|
OnRampPurchaseStatus,
|
|
87
87
|
OnRampPurchaseType,
|
|
88
|
+
PARA_PREFIX as PARA_STORAGE_PREFIX,
|
|
88
89
|
PREGEN_IDENTIFIER_TYPES,
|
|
89
90
|
PopupType,
|
|
90
91
|
PregenIdentifierType,
|
package/dist/types/ParaCore.d.ts
CHANGED
|
@@ -187,14 +187,16 @@ export declare abstract class ParaCore implements CoreInterface {
|
|
|
187
187
|
protected abstract getPlatformUtils(): PlatformUtils;
|
|
188
188
|
abstract isPasskeySupported(): Promise<boolean>;
|
|
189
189
|
protected constructPortalUrl(type: PortalUrlType, opts?: PortalUrlOptions): Promise<string>;
|
|
190
|
+
static resolveEnvironment(env: Environment | undefined, apiKey: string | undefined): Environment;
|
|
190
191
|
/**
|
|
191
192
|
* Constructs a new `ParaCore` instance.
|
|
192
|
-
* @param env - `Environment` to use.
|
|
193
|
+
* @param env - `Environment` to use. Optional if the apiKey contains an environment prefix (e.g., "prod_your_api_key"). Updated API keys can be found at https://developer.getpara.com.
|
|
193
194
|
* @param apiKey - API key to use.
|
|
194
195
|
* @param opts - Additional constructor options; see `ConstructorOpts`.
|
|
195
196
|
* @returns - A new ParaCore instance.
|
|
196
197
|
*/
|
|
197
|
-
constructor(env: Environment, apiKey: string, opts?: ConstructorOpts);
|
|
198
|
+
constructor(env: Environment | undefined, apiKey: string, opts?: ConstructorOpts);
|
|
199
|
+
constructor(apiKey: string, opts?: ConstructorOpts);
|
|
198
200
|
private trackError;
|
|
199
201
|
private wrapMethodsWithErrorTracking;
|
|
200
202
|
private initializeFromStorage;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const PARA_CORE_VERSION: string;
|
|
2
2
|
export declare const PREFIX = "@CAPSULE/";
|
|
3
|
+
export declare const PARA_PREFIX = "@PARA/";
|
|
3
4
|
export declare const LOCAL_STORAGE_AUTH_INFO = "@CAPSULE/authInfo";
|
|
4
5
|
export declare const LOCAL_STORAGE_EMAIL = "@CAPSULE/e-mail";
|
|
5
6
|
export declare const LOCAL_STORAGE_PHONE = "@CAPSULE/phone";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export * from './types/coreApi.js';
|
|
|
5
5
|
export * from './types/events.js';
|
|
6
6
|
export * from './types/config.js';
|
|
7
7
|
export { getPortalDomain, entityToWallet, constructUrl, shortenUrl } from './utils/index.js';
|
|
8
|
-
export { PREFIX as STORAGE_PREFIX } from './constants.js';
|
|
8
|
+
export { PREFIX as STORAGE_PREFIX, PARA_PREFIX as PARA_STORAGE_PREFIX } from './constants.js';
|
|
9
9
|
export { distributeNewShare } from './shares/shareDistribution.js';
|
|
10
10
|
export { KeyContainer } from './shares/KeyContainer.js';
|
|
11
11
|
export type { PlatformUtils } from './PlatformUtils.js';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.46",
|
|
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.
|
|
8
|
+
"@getpara/user-management-client": "2.0.0-alpha.46",
|
|
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": "
|
|
30
|
+
"gitHead": "29c553622c2e33503e5ff52d4c64725ffc15922a",
|
|
31
31
|
"main": "dist/cjs/index.js",
|
|
32
32
|
"module": "dist/esm/index.js",
|
|
33
33
|
"scripts": {
|