@getpara/core-sdk 3.3.0 → 3.4.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 +5 -2
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/external/userManagementClient.js +6 -2
- package/dist/esm/ParaCore.js +5 -2
- package/dist/esm/constants.js +1 -1
- package/dist/esm/external/userManagementClient.js +6 -2
- package/dist/types/PlatformUtils.d.ts +11 -0
- package/dist/types/external/userManagementClient.d.ts +3 -1
- package/package.json +3 -3
package/dist/cjs/ParaCore.js
CHANGED
|
@@ -431,7 +431,7 @@ const _ParaCore = class _ParaCore {
|
|
|
431
431
|
this.addCredential = (params) => __async(this, null, function* () {
|
|
432
432
|
return yield __privateGet(this, _authService).addCredential(params);
|
|
433
433
|
});
|
|
434
|
-
var _a;
|
|
434
|
+
var _a, _b, _c;
|
|
435
435
|
let env, apiKey;
|
|
436
436
|
const actualArgs = Array.from(arguments).filter((arg) => arg !== void 0);
|
|
437
437
|
const actualArgumentCount = actualArgs.length;
|
|
@@ -518,6 +518,7 @@ const _ParaCore = class _ParaCore {
|
|
|
518
518
|
};
|
|
519
519
|
const rawPlatform = (_a = opts.hostPlatform) != null ? _a : this.platformUtils.sdkType;
|
|
520
520
|
this.clientType = (0, import_userManagementClient.normalizePlatform)(rawPlatform);
|
|
521
|
+
const requestAgents = (_c = (_b = this.platformUtils).getRequestAgents) == null ? void 0 : _c.call(_b);
|
|
521
522
|
const client = (0, import_userManagementClient.initClient)({
|
|
522
523
|
env,
|
|
523
524
|
version: _ParaCore.version,
|
|
@@ -528,7 +529,9 @@ const _ParaCore = class _ParaCore {
|
|
|
528
529
|
platform: rawPlatform,
|
|
529
530
|
useFetchAdapter: !!opts.disableWorkers,
|
|
530
531
|
retrieveSessionCookie: this.retrieveSessionCookie,
|
|
531
|
-
persistSessionCookie: this.persistSessionCookie
|
|
532
|
+
persistSessionCookie: this.persistSessionCookie,
|
|
533
|
+
httpAgent: requestAgents == null ? void 0 : requestAgents.httpAgent,
|
|
534
|
+
httpsAgent: requestAgents == null ? void 0 : requestAgents.httpsAgent
|
|
532
535
|
});
|
|
533
536
|
const enclaveClient = new import_enclave.EnclaveClient({
|
|
534
537
|
userManagementClient: client,
|
package/dist/cjs/constants.js
CHANGED
|
@@ -46,7 +46,7 @@ __export(constants_exports, {
|
|
|
46
46
|
TRANSACTION_REVIEW_TIMEOUT_MS: () => TRANSACTION_REVIEW_TIMEOUT_MS
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(constants_exports);
|
|
49
|
-
const PARA_CORE_VERSION = "3.
|
|
49
|
+
const PARA_CORE_VERSION = "3.4.0";
|
|
50
50
|
const PREFIX = "@CAPSULE/";
|
|
51
51
|
const PARA_PREFIX = "@PARA/";
|
|
52
52
|
const LOCAL_STORAGE_AUTH_INFO = `${PREFIX}authInfo`;
|
|
@@ -124,7 +124,9 @@ function initClient({
|
|
|
124
124
|
useFetchAdapter = false,
|
|
125
125
|
retrieveSessionCookie,
|
|
126
126
|
persistSessionCookie,
|
|
127
|
-
staticTraceContext
|
|
127
|
+
staticTraceContext,
|
|
128
|
+
httpAgent,
|
|
129
|
+
httpsAgent
|
|
128
130
|
}) {
|
|
129
131
|
return new import_user_management_client.default({
|
|
130
132
|
userManagementHost: getBaseUrl(env),
|
|
@@ -135,7 +137,9 @@ function initClient({
|
|
|
135
137
|
opts: { useFetchAdapter },
|
|
136
138
|
retrieveSessionCookie,
|
|
137
139
|
persistSessionCookie,
|
|
138
|
-
staticTraceContext
|
|
140
|
+
staticTraceContext,
|
|
141
|
+
httpAgent,
|
|
142
|
+
httpsAgent
|
|
139
143
|
});
|
|
140
144
|
}
|
|
141
145
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/esm/ParaCore.js
CHANGED
|
@@ -376,7 +376,7 @@ const _ParaCore = class _ParaCore {
|
|
|
376
376
|
this.addCredential = (params) => __async(this, null, function* () {
|
|
377
377
|
return yield __privateGet(this, _authService).addCredential(params);
|
|
378
378
|
});
|
|
379
|
-
var _a;
|
|
379
|
+
var _a, _b, _c;
|
|
380
380
|
let env, apiKey;
|
|
381
381
|
const actualArgs = Array.from(arguments).filter((arg) => arg !== void 0);
|
|
382
382
|
const actualArgumentCount = actualArgs.length;
|
|
@@ -463,6 +463,7 @@ const _ParaCore = class _ParaCore {
|
|
|
463
463
|
};
|
|
464
464
|
const rawPlatform = (_a = opts.hostPlatform) != null ? _a : this.platformUtils.sdkType;
|
|
465
465
|
this.clientType = normalizePlatform(rawPlatform);
|
|
466
|
+
const requestAgents = (_c = (_b = this.platformUtils).getRequestAgents) == null ? void 0 : _c.call(_b);
|
|
466
467
|
const client = initClient({
|
|
467
468
|
env,
|
|
468
469
|
version: _ParaCore.version,
|
|
@@ -473,7 +474,9 @@ const _ParaCore = class _ParaCore {
|
|
|
473
474
|
platform: rawPlatform,
|
|
474
475
|
useFetchAdapter: !!opts.disableWorkers,
|
|
475
476
|
retrieveSessionCookie: this.retrieveSessionCookie,
|
|
476
|
-
persistSessionCookie: this.persistSessionCookie
|
|
477
|
+
persistSessionCookie: this.persistSessionCookie,
|
|
478
|
+
httpAgent: requestAgents == null ? void 0 : requestAgents.httpAgent,
|
|
479
|
+
httpsAgent: requestAgents == null ? void 0 : requestAgents.httpsAgent
|
|
477
480
|
});
|
|
478
481
|
const enclaveClient = new EnclaveClient({
|
|
479
482
|
userManagementClient: client,
|
package/dist/esm/constants.js
CHANGED
|
@@ -89,7 +89,9 @@ function initClient({
|
|
|
89
89
|
useFetchAdapter = false,
|
|
90
90
|
retrieveSessionCookie,
|
|
91
91
|
persistSessionCookie,
|
|
92
|
-
staticTraceContext
|
|
92
|
+
staticTraceContext,
|
|
93
|
+
httpAgent,
|
|
94
|
+
httpsAgent
|
|
93
95
|
}) {
|
|
94
96
|
return new Client({
|
|
95
97
|
userManagementHost: getBaseUrl(env),
|
|
@@ -100,7 +102,9 @@ function initClient({
|
|
|
100
102
|
opts: { useFetchAdapter },
|
|
101
103
|
retrieveSessionCookie,
|
|
102
104
|
persistSessionCookie,
|
|
103
|
-
staticTraceContext
|
|
105
|
+
staticTraceContext,
|
|
106
|
+
httpAgent,
|
|
107
|
+
httpsAgent
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
export {
|
|
@@ -9,6 +9,17 @@ export interface EventData<T = any> {
|
|
|
9
9
|
export type EventHandler<T = any> = (data: T) => void;
|
|
10
10
|
export interface PlatformUtils {
|
|
11
11
|
sdkType: SDKType;
|
|
12
|
+
/**
|
|
13
|
+
* Node-only: keep-alive HTTP(S) agents for the user-management client so
|
|
14
|
+
* server-to-server callers reuse connections instead of re-handshaking
|
|
15
|
+
* TCP+TLS per request. Browser/RN platforms omit this (the runtime pools
|
|
16
|
+
* sockets itself). Returned as `unknown` to keep node:http types out of
|
|
17
|
+
* browser-bundled core-sdk.
|
|
18
|
+
*/
|
|
19
|
+
getRequestAgents?(): {
|
|
20
|
+
httpAgent?: unknown;
|
|
21
|
+
httpsAgent?: unknown;
|
|
22
|
+
} | undefined;
|
|
12
23
|
getPrivateKey(ctx: Ctx, userId: string, walletId: string, share: string, sessionCookie: string): Promise<string>;
|
|
13
24
|
getED25519PrivateKey(ctx: Ctx, userId: string, walletId: string, share: string, sessionCookie: string): Promise<string>;
|
|
14
25
|
keygen(ctx: Ctx, userId: string, type: Exclude<TWalletType, 'SOLANA'>, secretKey: string | null, // should be acceptable as null in RN as we don't pre-gen them
|
|
@@ -11,7 +11,7 @@ export declare function getBaseMPCNetworkUrl(env: Environment, useWebsocket?: bo
|
|
|
11
11
|
* outside this core SDK path.
|
|
12
12
|
*/
|
|
13
13
|
export declare function normalizePlatform(platform?: string): string | undefined;
|
|
14
|
-
export declare function initClient({ env, version, apiKey, partnerId, platform, useFetchAdapter, retrieveSessionCookie, persistSessionCookie, staticTraceContext, }: {
|
|
14
|
+
export declare function initClient({ env, version, apiKey, partnerId, platform, useFetchAdapter, retrieveSessionCookie, persistSessionCookie, staticTraceContext, httpAgent, httpsAgent, }: {
|
|
15
15
|
env: Environment;
|
|
16
16
|
version?: string;
|
|
17
17
|
apiKey: string;
|
|
@@ -22,4 +22,6 @@ export declare function initClient({ env, version, apiKey, partnerId, platform,
|
|
|
22
22
|
retrieveSessionCookie?: () => string;
|
|
23
23
|
persistSessionCookie?: (cookie: string) => void;
|
|
24
24
|
staticTraceContext?: Record<string, string>;
|
|
25
|
+
httpAgent?: unknown;
|
|
26
|
+
httpsAgent?: unknown;
|
|
25
27
|
}): Client;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/core-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.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": "3.
|
|
8
|
+
"@getpara/user-management-client": "3.4.0",
|
|
9
9
|
"@noble/hashes": "^1.5.0",
|
|
10
10
|
"@opentelemetry/api": "^1.9.1",
|
|
11
11
|
"@opentelemetry/context-zone": "^2.7.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dist",
|
|
42
42
|
"package.json"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "795829c50bb71817a84bdbf5e6561ca4df3a827d",
|
|
45
45
|
"main": "dist/cjs/index.js",
|
|
46
46
|
"module": "dist/esm/index.js",
|
|
47
47
|
"scripts": {
|