@getpara/server-sdk 1.4.3 → 1.4.4
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/index.js +490 -1
- package/dist/cjs/index.js.br +0 -0
- package/dist/cjs/index.js.gz +0 -0
- package/dist/cjs/workers/worker.js +1008 -2
- package/dist/cjs/workers/worker.js.br +0 -0
- package/dist/cjs/workers/worker.js.gz +0 -0
- package/dist/esm/index.js +454 -1
- package/dist/esm/index.js.br +0 -0
- package/dist/esm/index.js.gz +0 -0
- package/dist/esm/workers/chunk-MCKGQKYU.js +15 -0
- package/dist/esm/workers/chunk-MCKGQKYU.js.br +0 -0
- package/dist/esm/workers/chunk-MCKGQKYU.js.gz +0 -0
- package/dist/esm/workers/wasm_exec-UV7SYRZI.js +577 -0
- package/dist/esm/workers/wasm_exec-UV7SYRZI.js.br +0 -0
- package/dist/esm/workers/wasm_exec-UV7SYRZI.js.gz +0 -0
- package/dist/esm/workers/worker.js +408 -1
- package/dist/esm/workers/worker.js.br +0 -0
- package/dist/esm/workers/worker.js.gz +0 -0
- package/package.json +4 -4
- package/dist/esm/workers/chunk-NEJSZOZX.js +0 -1
- package/dist/esm/workers/chunk-NEJSZOZX.js.br +0 -0
- package/dist/esm/workers/chunk-NEJSZOZX.js.gz +0 -0
- package/dist/esm/workers/wasm_exec-TBSO5IWG.js +0 -2
- package/dist/esm/workers/wasm_exec-TBSO5IWG.js.br +0 -0
- package/dist/esm/workers/wasm_exec-TBSO5IWG.js.gz +0 -0
|
Binary file
|
|
Binary file
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1,454 @@
|
|
|
1
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@getpara/core-sdk";
|
|
3
|
+
|
|
4
|
+
// src/ParaServer.ts
|
|
5
|
+
import ParaCore, { Environment } from "@getpara/core-sdk";
|
|
6
|
+
import * as Sentry from "@sentry/node";
|
|
7
|
+
|
|
8
|
+
// src/ServerLocalStorage.ts
|
|
9
|
+
var ServerLocalStorage = class {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.localStorage = {};
|
|
12
|
+
this.get = (key) => {
|
|
13
|
+
return this.localStorage[key] || null;
|
|
14
|
+
};
|
|
15
|
+
this.set = (key, value) => {
|
|
16
|
+
this.localStorage[key] = value;
|
|
17
|
+
};
|
|
18
|
+
this.removeItem = (key) => {
|
|
19
|
+
delete this.localStorage[key];
|
|
20
|
+
};
|
|
21
|
+
this.clear = (prefix) => {
|
|
22
|
+
const keys = Object.keys(this.localStorage);
|
|
23
|
+
for (let key in keys) {
|
|
24
|
+
if (key && key.startsWith(prefix)) {
|
|
25
|
+
this.removeItem(key);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// src/ServerSessionStorage.ts
|
|
33
|
+
var ServerSessionStorage = class {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.sessionStorage = {};
|
|
36
|
+
this.get = (key) => {
|
|
37
|
+
return this.sessionStorage[key] || null;
|
|
38
|
+
};
|
|
39
|
+
this.set = (key, value) => {
|
|
40
|
+
this.sessionStorage[key] = value;
|
|
41
|
+
};
|
|
42
|
+
this.removeItem = (key) => {
|
|
43
|
+
delete this.sessionStorage[key];
|
|
44
|
+
};
|
|
45
|
+
this.clear = (prefix) => {
|
|
46
|
+
const keys = Object.keys(this.sessionStorage);
|
|
47
|
+
for (let key in keys) {
|
|
48
|
+
if (key && key.startsWith(prefix)) {
|
|
49
|
+
this.removeItem(key);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// src/wallet/keygen.ts
|
|
57
|
+
import * as uuid from "uuid";
|
|
58
|
+
import { waitUntilTrue } from "@getpara/core-sdk";
|
|
59
|
+
|
|
60
|
+
// src/workers/workerWrapper.ts
|
|
61
|
+
import { Worker } from "worker_threads";
|
|
62
|
+
import { getPortalBaseURL } from "@getpara/core-sdk";
|
|
63
|
+
var CLEAR_WORKER_TIMEOUT_MS = 1e3 * 90;
|
|
64
|
+
var worker;
|
|
65
|
+
var resFunctionMap = {};
|
|
66
|
+
function removeWorkId(workId, skipClearTimeout) {
|
|
67
|
+
const { timeoutId } = resFunctionMap[workId];
|
|
68
|
+
delete resFunctionMap[workId];
|
|
69
|
+
if (skipClearTimeout) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
clearTimeout(timeoutId);
|
|
73
|
+
}
|
|
74
|
+
async function setupWorker(ctx, resFunction, workId) {
|
|
75
|
+
const timeoutId = setTimeout(() => {
|
|
76
|
+
removeWorkId(workId, true);
|
|
77
|
+
}, CLEAR_WORKER_TIMEOUT_MS);
|
|
78
|
+
resFunctionMap[workId] = {
|
|
79
|
+
fn: resFunction,
|
|
80
|
+
timeoutId
|
|
81
|
+
};
|
|
82
|
+
if (!worker || !worker.threadId) {
|
|
83
|
+
const workerRes = await fetch(`${getPortalBaseURL(ctx)}/static/js/mpcWorkerServer-bundle.js`);
|
|
84
|
+
worker = new Worker(await workerRes.text(), { eval: true });
|
|
85
|
+
const onmessage = async (message) => {
|
|
86
|
+
const { workId: messageWorkId } = message;
|
|
87
|
+
delete message.workId;
|
|
88
|
+
await resFunctionMap[messageWorkId].fn(message);
|
|
89
|
+
removeWorkId(messageWorkId);
|
|
90
|
+
};
|
|
91
|
+
worker.on("message", onmessage);
|
|
92
|
+
worker.on("error", (err) => {
|
|
93
|
+
throw err;
|
|
94
|
+
});
|
|
95
|
+
worker.on("exit", (code) => {
|
|
96
|
+
console.error(`worker stopped with exit code ${code}`);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return worker;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// src/wallet/keygen.ts
|
|
103
|
+
async function isKeygenComplete(ctx, userId, walletId) {
|
|
104
|
+
const wallets = await ctx.client.getWallets(userId);
|
|
105
|
+
const wallet = wallets.data.wallets.find((w) => w.id === walletId);
|
|
106
|
+
return !!wallet.address;
|
|
107
|
+
}
|
|
108
|
+
async function isPreKeygenComplete(ctx, pregenIdentifier, pregenIdentifierType, walletId) {
|
|
109
|
+
const wallets = await ctx.client.getPregenWallets({ [pregenIdentifierType]: [pregenIdentifier] });
|
|
110
|
+
const wallet = wallets.wallets.find((w) => w.id === walletId);
|
|
111
|
+
return !!wallet?.address;
|
|
112
|
+
}
|
|
113
|
+
function keygen(ctx, userId, type, secretKey, skipDistribute = false, sessionCookie, _emailProps = {}) {
|
|
114
|
+
return new Promise(async (resolve) => {
|
|
115
|
+
const workId = uuid.v4();
|
|
116
|
+
const worker2 = await setupWorker(
|
|
117
|
+
ctx,
|
|
118
|
+
async (res) => {
|
|
119
|
+
await waitUntilTrue(async () => isKeygenComplete(ctx, userId, res.walletId), 15e3, 1e3);
|
|
120
|
+
if (skipDistribute) {
|
|
121
|
+
resolve({
|
|
122
|
+
signer: res.signer,
|
|
123
|
+
walletId: res.walletId,
|
|
124
|
+
recoveryShare: null
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
workId
|
|
129
|
+
);
|
|
130
|
+
worker2.postMessage({
|
|
131
|
+
env: ctx.env,
|
|
132
|
+
apiKey: ctx.apiKey,
|
|
133
|
+
cosmosPrefix: ctx.cosmosPrefix,
|
|
134
|
+
params: { userId, secretKey, type },
|
|
135
|
+
functionType: "KEYGEN",
|
|
136
|
+
offloadMPCComputationURL: ctx.offloadMPCComputationURL,
|
|
137
|
+
disableWorkers: ctx.disableWorkers,
|
|
138
|
+
sessionCookie,
|
|
139
|
+
useDKLS: ctx.useDKLS,
|
|
140
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
141
|
+
wasmOverride: ctx.wasmOverride,
|
|
142
|
+
workId
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function preKeygen(ctx, pregenIdentifier, pregenIdentifierType, type, secretKey, _skipDistribute = false, partnerId, sessionCookie) {
|
|
147
|
+
return new Promise(async (resolve) => {
|
|
148
|
+
const workId = uuid.v4();
|
|
149
|
+
const worker2 = await setupWorker(
|
|
150
|
+
ctx,
|
|
151
|
+
async (res) => {
|
|
152
|
+
await waitUntilTrue(
|
|
153
|
+
async () => isPreKeygenComplete(ctx, pregenIdentifier, pregenIdentifierType, res.walletId),
|
|
154
|
+
15e3,
|
|
155
|
+
1e3
|
|
156
|
+
);
|
|
157
|
+
resolve({
|
|
158
|
+
signer: res.signer,
|
|
159
|
+
walletId: res.walletId,
|
|
160
|
+
recoveryShare: null
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
workId
|
|
164
|
+
);
|
|
165
|
+
const email = void 0;
|
|
166
|
+
const params = { pregenIdentifier, pregenIdentifierType, secretKey, partnerId, email, type };
|
|
167
|
+
if (pregenIdentifierType === "EMAIL") {
|
|
168
|
+
params.email = pregenIdentifier;
|
|
169
|
+
}
|
|
170
|
+
worker2.postMessage({
|
|
171
|
+
env: ctx.env,
|
|
172
|
+
apiKey: ctx.apiKey,
|
|
173
|
+
cosmosPrefix: ctx.cosmosPrefix,
|
|
174
|
+
params,
|
|
175
|
+
functionType: "PREKEYGEN",
|
|
176
|
+
offloadMPCComputationURL: ctx.offloadMPCComputationURL,
|
|
177
|
+
disableWorkers: ctx.disableWorkers,
|
|
178
|
+
sessionCookie,
|
|
179
|
+
useDKLS: ctx.useDKLS,
|
|
180
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
181
|
+
wasmOverride: ctx.wasmOverride,
|
|
182
|
+
workId
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function ed25519Keygen(ctx, userId, sessionCookie, _emailProps = {}) {
|
|
187
|
+
return new Promise(async (resolve) => {
|
|
188
|
+
const workId = uuid.v4();
|
|
189
|
+
const worker2 = await setupWorker(
|
|
190
|
+
ctx,
|
|
191
|
+
async (res) => {
|
|
192
|
+
await waitUntilTrue(async () => isKeygenComplete(ctx, userId, res.walletId), 15e3, 1e3);
|
|
193
|
+
resolve({
|
|
194
|
+
signer: res.signer,
|
|
195
|
+
walletId: res.walletId,
|
|
196
|
+
recoveryShare: null
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
workId
|
|
200
|
+
);
|
|
201
|
+
worker2.postMessage({
|
|
202
|
+
env: ctx.env,
|
|
203
|
+
apiKey: ctx.apiKey,
|
|
204
|
+
cosmosPrefix: ctx.cosmosPrefix,
|
|
205
|
+
params: { userId },
|
|
206
|
+
functionType: "ED25519_KEYGEN",
|
|
207
|
+
disableWorkers: ctx.disableWorkers,
|
|
208
|
+
sessionCookie,
|
|
209
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
210
|
+
wasmOverride: ctx.wasmOverride,
|
|
211
|
+
workId
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType, sessionCookie) {
|
|
216
|
+
return new Promise(async (resolve) => {
|
|
217
|
+
const workId = uuid.v4();
|
|
218
|
+
const worker2 = await setupWorker(
|
|
219
|
+
ctx,
|
|
220
|
+
async (res) => {
|
|
221
|
+
await waitUntilTrue(
|
|
222
|
+
async () => isPreKeygenComplete(ctx, pregenIdentifier, pregenIdentifierType, res.walletId),
|
|
223
|
+
15e3,
|
|
224
|
+
1e3
|
|
225
|
+
);
|
|
226
|
+
resolve({
|
|
227
|
+
signer: res.signer,
|
|
228
|
+
walletId: res.walletId,
|
|
229
|
+
recoveryShare: null
|
|
230
|
+
});
|
|
231
|
+
},
|
|
232
|
+
workId
|
|
233
|
+
);
|
|
234
|
+
const email = void 0;
|
|
235
|
+
const params = { pregenIdentifier, pregenIdentifierType, email };
|
|
236
|
+
if (pregenIdentifierType === "EMAIL") {
|
|
237
|
+
params.email = pregenIdentifier;
|
|
238
|
+
}
|
|
239
|
+
worker2.postMessage({
|
|
240
|
+
env: ctx.env,
|
|
241
|
+
apiKey: ctx.apiKey,
|
|
242
|
+
cosmosPrefix: ctx.cosmosPrefix,
|
|
243
|
+
params,
|
|
244
|
+
functionType: "ED25519_PREKEYGEN",
|
|
245
|
+
disableWorkers: ctx.disableWorkers,
|
|
246
|
+
sessionCookie,
|
|
247
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
248
|
+
wasmOverride: ctx.wasmOverride,
|
|
249
|
+
workId
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// src/wallet/signing.ts
|
|
255
|
+
import * as uuid2 from "uuid";
|
|
256
|
+
async function signTransaction(ctx, userId, walletId, share, tx, chainId, sessionCookie, isDKLS) {
|
|
257
|
+
return await new Promise(async (resolve) => {
|
|
258
|
+
const workId = uuid2.v4();
|
|
259
|
+
const worker2 = await setupWorker(
|
|
260
|
+
ctx,
|
|
261
|
+
async (sendTransactionRes) => {
|
|
262
|
+
resolve(sendTransactionRes);
|
|
263
|
+
},
|
|
264
|
+
workId
|
|
265
|
+
);
|
|
266
|
+
worker2.postMessage({
|
|
267
|
+
env: ctx.env,
|
|
268
|
+
apiKey: ctx.apiKey,
|
|
269
|
+
cosmosPrefix: ctx.cosmosPrefix,
|
|
270
|
+
params: { share, walletId, userId, tx, chainId },
|
|
271
|
+
functionType: "SIGN_TRANSACTION",
|
|
272
|
+
offloadMPCComputationURL: ctx.offloadMPCComputationURL,
|
|
273
|
+
disableWorkers: ctx.disableWorkers,
|
|
274
|
+
sessionCookie,
|
|
275
|
+
useDKLS: isDKLS,
|
|
276
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
277
|
+
wasmOverride: ctx.wasmOverride,
|
|
278
|
+
workId
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
async function sendTransaction(ctx, userId, walletId, share, tx, chainId, sessionCookie, isDKLS) {
|
|
283
|
+
return await new Promise(async (resolve) => {
|
|
284
|
+
const workId = uuid2.v4();
|
|
285
|
+
const worker2 = await setupWorker(
|
|
286
|
+
ctx,
|
|
287
|
+
async (sendTransactionRes) => {
|
|
288
|
+
resolve(sendTransactionRes);
|
|
289
|
+
},
|
|
290
|
+
workId
|
|
291
|
+
);
|
|
292
|
+
worker2.postMessage({
|
|
293
|
+
env: ctx.env,
|
|
294
|
+
apiKey: ctx.apiKey,
|
|
295
|
+
params: { share, walletId, userId, tx, chainId },
|
|
296
|
+
functionType: "SEND_TRANSACTION",
|
|
297
|
+
offloadMPCComputationURL: ctx.offloadMPCComputationURL,
|
|
298
|
+
disableWorkers: ctx.disableWorkers,
|
|
299
|
+
sessionCookie,
|
|
300
|
+
useDKLS: isDKLS,
|
|
301
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
302
|
+
wasmOverride: ctx.wasmOverride,
|
|
303
|
+
workId
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
async function signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS) {
|
|
308
|
+
return await new Promise(async (resolve) => {
|
|
309
|
+
const workId = uuid2.v4();
|
|
310
|
+
const worker2 = await setupWorker(
|
|
311
|
+
ctx,
|
|
312
|
+
async (signMessageRes) => {
|
|
313
|
+
resolve(signMessageRes);
|
|
314
|
+
},
|
|
315
|
+
workId
|
|
316
|
+
);
|
|
317
|
+
worker2.postMessage({
|
|
318
|
+
env: ctx.env,
|
|
319
|
+
apiKey: ctx.apiKey,
|
|
320
|
+
params: { share, walletId, userId, message },
|
|
321
|
+
functionType: "SIGN_MESSAGE",
|
|
322
|
+
offloadMPCComputationURL: ctx.offloadMPCComputationURL,
|
|
323
|
+
disableWorkers: ctx.disableWorkers,
|
|
324
|
+
sessionCookie,
|
|
325
|
+
useDKLS: isDKLS,
|
|
326
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
327
|
+
wasmOverride: ctx.wasmOverride,
|
|
328
|
+
workId
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
async function ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie) {
|
|
333
|
+
return await new Promise(async (resolve) => {
|
|
334
|
+
const workId = uuid2.v4();
|
|
335
|
+
const worker2 = await setupWorker(
|
|
336
|
+
ctx,
|
|
337
|
+
async (signMessageRes) => {
|
|
338
|
+
resolve(signMessageRes);
|
|
339
|
+
},
|
|
340
|
+
workId
|
|
341
|
+
);
|
|
342
|
+
worker2.postMessage({
|
|
343
|
+
env: ctx.env,
|
|
344
|
+
apiKey: ctx.apiKey,
|
|
345
|
+
params: { share, walletId, userId, base64Bytes },
|
|
346
|
+
functionType: "ED25519_SIGN",
|
|
347
|
+
offloadMPCComputationURL: ctx.offloadMPCComputationURL,
|
|
348
|
+
disableWorkers: ctx.disableWorkers,
|
|
349
|
+
sessionCookie,
|
|
350
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
351
|
+
wasmOverride: ctx.wasmOverride,
|
|
352
|
+
workId
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// src/wallet/privateKey.ts
|
|
358
|
+
import * as uuid3 from "uuid";
|
|
359
|
+
async function getPrivateKey(ctx, userId, walletId, share, sessionCookie) {
|
|
360
|
+
return await new Promise(async (resolve) => {
|
|
361
|
+
const workId = uuid3.v4();
|
|
362
|
+
const worker2 = await setupWorker(
|
|
363
|
+
ctx,
|
|
364
|
+
async (res) => {
|
|
365
|
+
resolve(res);
|
|
366
|
+
},
|
|
367
|
+
workId
|
|
368
|
+
);
|
|
369
|
+
worker2.postMessage({
|
|
370
|
+
env: ctx.env,
|
|
371
|
+
apiKey: ctx.apiKey,
|
|
372
|
+
cosmosPrefix: ctx.cosmosPrefix,
|
|
373
|
+
params: { share, walletId, userId },
|
|
374
|
+
functionType: "GET_PRIVATE_KEY",
|
|
375
|
+
offloadMPCComputationURL: ctx.offloadMPCComputationURL,
|
|
376
|
+
disableWorkers: ctx.disableWorkers,
|
|
377
|
+
sessionCookie,
|
|
378
|
+
useDKLS: ctx.useDKLS,
|
|
379
|
+
disableWebSockets: ctx.disableWebSockets,
|
|
380
|
+
wasmOverride: ctx.wasmOverride,
|
|
381
|
+
workId
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// src/ServerUtils.ts
|
|
387
|
+
var ServerUtils = class {
|
|
388
|
+
constructor() {
|
|
389
|
+
this.localStorage = new ServerLocalStorage();
|
|
390
|
+
this.sessionStorage = new ServerSessionStorage();
|
|
391
|
+
this.secureStorage = void 0;
|
|
392
|
+
this.isSyncStorage = true;
|
|
393
|
+
this.disableProviderModal = true;
|
|
394
|
+
}
|
|
395
|
+
getPrivateKey(ctx, userId, walletId, share, sessionCookie) {
|
|
396
|
+
return getPrivateKey(ctx, userId, walletId, share, sessionCookie);
|
|
397
|
+
}
|
|
398
|
+
keygen(ctx, userId, type, secretKey, sessionCookie, emailProps) {
|
|
399
|
+
return keygen(ctx, userId, type, secretKey, true, sessionCookie, emailProps);
|
|
400
|
+
}
|
|
401
|
+
refresh(_ctx, _sessionCookie, _userId, _walletId, _share, _oldPartnerId, _newPartnerId) {
|
|
402
|
+
throw new Error("not implemented");
|
|
403
|
+
}
|
|
404
|
+
preKeygen(ctx, partnerId, pregenIdentifier, pregenIdentifierType, type, secretKey, sessionCookie) {
|
|
405
|
+
return preKeygen(ctx, pregenIdentifier, pregenIdentifierType, type, secretKey, false, partnerId, sessionCookie);
|
|
406
|
+
}
|
|
407
|
+
signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS) {
|
|
408
|
+
return signMessage(ctx, userId, walletId, share, message, sessionCookie, isDKLS);
|
|
409
|
+
}
|
|
410
|
+
signTransaction(ctx, userId, walletId, share, message, chainId, sessionCookie, isDKLS) {
|
|
411
|
+
return signTransaction(ctx, userId, walletId, share, message, chainId, sessionCookie, isDKLS);
|
|
412
|
+
}
|
|
413
|
+
sendTransaction(ctx, userId, walletId, share, tx, chainId, sessionCookie, isDKLS) {
|
|
414
|
+
return sendTransaction(ctx, userId, walletId, share, tx, chainId, sessionCookie, isDKLS);
|
|
415
|
+
}
|
|
416
|
+
signHash(_address, _hash) {
|
|
417
|
+
throw new Error("not implemented");
|
|
418
|
+
}
|
|
419
|
+
ed25519Keygen(ctx, userId, sessionCookie, emailProps) {
|
|
420
|
+
return ed25519Keygen(ctx, userId, sessionCookie, emailProps);
|
|
421
|
+
}
|
|
422
|
+
ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType, sessionCookie) {
|
|
423
|
+
return ed25519PreKeygen(ctx, pregenIdentifier, pregenIdentifierType, sessionCookie);
|
|
424
|
+
}
|
|
425
|
+
ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie) {
|
|
426
|
+
return ed25519Sign(ctx, userId, walletId, share, base64Bytes, sessionCookie);
|
|
427
|
+
}
|
|
428
|
+
openPopup(_popupUrl) {
|
|
429
|
+
throw new Error("not implemented");
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
// src/ParaServer.ts
|
|
434
|
+
var Para = class extends ParaCore {
|
|
435
|
+
constructor(env, apiKey, opts) {
|
|
436
|
+
super(env, apiKey, opts);
|
|
437
|
+
if (env !== Environment.PROD && env !== Environment.DEV) {
|
|
438
|
+
Sentry.init({
|
|
439
|
+
environment: env.toLowerCase(),
|
|
440
|
+
dsn: "https://2a26842d951255c2721fde5c1dd2b252@o4504568036720640.ingest.us.sentry.io/4508850906791936"
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
getPlatformUtils() {
|
|
445
|
+
return new ServerUtils();
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
// src/index.ts
|
|
450
|
+
var src_default = Para;
|
|
451
|
+
export {
|
|
452
|
+
Para,
|
|
453
|
+
src_default as default
|
|
454
|
+
};
|
package/dist/esm/index.js.br
CHANGED
|
Binary file
|
package/dist/esm/index.js.gz
CHANGED
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
|
+
}) : x)(function(x) {
|
|
5
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
__require,
|
|
14
|
+
__commonJS
|
|
15
|
+
};
|
|
Binary file
|
|
Binary file
|