@worldcoin/idkit-core 4.0.1-dev.fe98789 → 4.0.1
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/README.md +0 -1
- package/dist/idkit_wasm_bg.wasm +0 -0
- package/dist/index.cjs +47 -59
- package/dist/index.d.cts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +47 -59
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/idkit_wasm_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.cjs
CHANGED
|
@@ -245,22 +245,6 @@ function _assertClass(instance, klass) {
|
|
|
245
245
|
throw new Error(`expected instance of ${klass.name}`);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
function createSession(app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
|
|
249
|
-
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
250
|
-
const len0 = WASM_VECTOR_LEN;
|
|
251
|
-
_assertClass(rp_context, RpContextWasm);
|
|
252
|
-
var ptr1 = rp_context.__destroy_into_raw();
|
|
253
|
-
var ptr2 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
254
|
-
var len2 = WASM_VECTOR_LEN;
|
|
255
|
-
var ptr3 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
256
|
-
var len3 = WASM_VECTOR_LEN;
|
|
257
|
-
var ptr4 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
258
|
-
var len4 = WASM_VECTOR_LEN;
|
|
259
|
-
var ptr5 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
260
|
-
var len5 = WASM_VECTOR_LEN;
|
|
261
|
-
const ret = wasm.createSession(ptr0, len0, ptr1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
262
|
-
return IDKitBuilder.__wrap(ret);
|
|
263
|
-
}
|
|
264
248
|
function request(app_id, action, rp_context, action_description, bridge_url, allow_legacy_proofs, override_connect_base_url, environment) {
|
|
265
249
|
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
266
250
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -279,6 +263,9 @@ function request(app_id, action, rp_context, action_description, bridge_url, all
|
|
|
279
263
|
const ret = wasm.idkitbuilder_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, allow_legacy_proofs, ptr5, len5, ptr6, len6);
|
|
280
264
|
return IDKitBuilder.__wrap(ret);
|
|
281
265
|
}
|
|
266
|
+
function init_wasm() {
|
|
267
|
+
wasm.init_wasm();
|
|
268
|
+
}
|
|
282
269
|
function base64Decode(data) {
|
|
283
270
|
try {
|
|
284
271
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -317,6 +304,22 @@ function proveSession(session_id, app_id, rp_context, action_description, bridge
|
|
|
317
304
|
const ret = wasm.idkitbuilder_forProveSession(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
318
305
|
return IDKitBuilder.__wrap(ret);
|
|
319
306
|
}
|
|
307
|
+
function createSession(app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
|
|
308
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
309
|
+
const len0 = WASM_VECTOR_LEN;
|
|
310
|
+
_assertClass(rp_context, RpContextWasm);
|
|
311
|
+
var ptr1 = rp_context.__destroy_into_raw();
|
|
312
|
+
var ptr2 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
313
|
+
var len2 = WASM_VECTOR_LEN;
|
|
314
|
+
var ptr3 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
315
|
+
var len3 = WASM_VECTOR_LEN;
|
|
316
|
+
var ptr4 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
317
|
+
var len4 = WASM_VECTOR_LEN;
|
|
318
|
+
var ptr5 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
319
|
+
var len5 = WASM_VECTOR_LEN;
|
|
320
|
+
const ret = wasm.createSession(ptr0, len0, ptr1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
321
|
+
return IDKitBuilder.__wrap(ret);
|
|
322
|
+
}
|
|
320
323
|
function passArray8ToWasm0(arg, malloc) {
|
|
321
324
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
322
325
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -341,28 +344,6 @@ function base64Encode(data) {
|
|
|
341
344
|
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
342
345
|
}
|
|
343
346
|
}
|
|
344
|
-
function init_wasm() {
|
|
345
|
-
wasm.init_wasm();
|
|
346
|
-
}
|
|
347
|
-
function signRequest(action, signing_key_hex, ttl_seconds) {
|
|
348
|
-
try {
|
|
349
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
350
|
-
const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
351
|
-
const len0 = WASM_VECTOR_LEN;
|
|
352
|
-
const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
353
|
-
const len1 = WASM_VECTOR_LEN;
|
|
354
|
-
wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
|
|
355
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
356
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
357
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
358
|
-
if (r2) {
|
|
359
|
-
throw takeObject(r1);
|
|
360
|
-
}
|
|
361
|
-
return RpSignature.__wrap(r0);
|
|
362
|
-
} finally {
|
|
363
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
347
|
function hashSignal(signal) {
|
|
367
348
|
let deferred2_0;
|
|
368
349
|
let deferred2_1;
|
|
@@ -388,14 +369,33 @@ function hashSignal(signal) {
|
|
|
388
369
|
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
389
370
|
}
|
|
390
371
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
372
|
+
function signRequest(action, signing_key_hex, ttl_seconds) {
|
|
373
|
+
try {
|
|
374
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
375
|
+
const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
376
|
+
const len0 = WASM_VECTOR_LEN;
|
|
377
|
+
const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
378
|
+
const len1 = WASM_VECTOR_LEN;
|
|
379
|
+
wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
|
|
380
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
381
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
382
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
383
|
+
if (r2) {
|
|
384
|
+
throw takeObject(r1);
|
|
385
|
+
}
|
|
386
|
+
return RpSignature.__wrap(r0);
|
|
387
|
+
} finally {
|
|
388
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
389
|
+
}
|
|
393
390
|
}
|
|
394
391
|
function __wasm_bindgen_func_elem_960(arg0, arg1, arg2) {
|
|
395
392
|
wasm.__wasm_bindgen_func_elem_960(arg0, arg1, addHeapObject(arg2));
|
|
396
393
|
}
|
|
397
|
-
function
|
|
398
|
-
wasm.
|
|
394
|
+
function __wasm_bindgen_func_elem_597(arg0, arg1) {
|
|
395
|
+
wasm.__wasm_bindgen_func_elem_597(arg0, arg1);
|
|
396
|
+
}
|
|
397
|
+
function __wasm_bindgen_func_elem_1343(arg0, arg1, arg2, arg3) {
|
|
398
|
+
wasm.__wasm_bindgen_func_elem_1343(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
399
399
|
}
|
|
400
400
|
var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
401
401
|
var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -1502,7 +1502,7 @@ function __wbg_get_imports() {
|
|
|
1502
1502
|
const a = state0.a;
|
|
1503
1503
|
state0.a = 0;
|
|
1504
1504
|
try {
|
|
1505
|
-
return
|
|
1505
|
+
return __wasm_bindgen_func_elem_1343(a, state0.b, arg02, arg12);
|
|
1506
1506
|
} finally {
|
|
1507
1507
|
state0.a = a;
|
|
1508
1508
|
}
|
|
@@ -1796,10 +1796,6 @@ var idkit_wasm_default = __wbg_init;
|
|
|
1796
1796
|
// src/lib/wasm.ts
|
|
1797
1797
|
var wasmInitialized = false;
|
|
1798
1798
|
var wasmInitPromise = null;
|
|
1799
|
-
async function importNodeModule(specifier) {
|
|
1800
|
-
const dynamicImport = Function("moduleName", "return import(moduleName)");
|
|
1801
|
-
return dynamicImport(specifier);
|
|
1802
|
-
}
|
|
1803
1799
|
async function initIDKit() {
|
|
1804
1800
|
if (wasmInitialized) {
|
|
1805
1801
|
return;
|
|
@@ -1827,18 +1823,10 @@ async function initIDKitServer() {
|
|
|
1827
1823
|
}
|
|
1828
1824
|
wasmInitPromise = (async () => {
|
|
1829
1825
|
try {
|
|
1830
|
-
const { readFile } = await
|
|
1831
|
-
|
|
1832
|
-
);
|
|
1833
|
-
const
|
|
1834
|
-
"node:url"
|
|
1835
|
-
);
|
|
1836
|
-
const { dirname, join } = await importNodeModule(
|
|
1837
|
-
"node:path"
|
|
1838
|
-
);
|
|
1839
|
-
const modulePath = fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
1840
|
-
const wasmPath = join(dirname(modulePath), "idkit_wasm_bg.wasm");
|
|
1841
|
-
const wasmBuffer = await readFile(wasmPath);
|
|
1826
|
+
const { readFile } = await import('fs/promises');
|
|
1827
|
+
const { fileURLToPath } = await import('url');
|
|
1828
|
+
const wasmUrl = new URL("idkit_wasm_bg.wasm", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
1829
|
+
const wasmBuffer = await readFile(fileURLToPath(wasmUrl));
|
|
1842
1830
|
await idkit_wasm_default({ module_or_path: wasmBuffer });
|
|
1843
1831
|
wasmInitialized = true;
|
|
1844
1832
|
} catch (error) {
|
package/dist/index.d.cts
CHANGED
|
@@ -80,22 +80,20 @@ type IDKitSessionConfig = {
|
|
|
80
80
|
environment?: "production" | "staging";
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
type: "OrbLegacy";
|
|
85
|
-
signal?: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
interface SecureDocumentLegacyPreset {
|
|
89
|
-
type: "SecureDocumentLegacy";
|
|
90
|
-
signal?: string;
|
|
91
|
-
}
|
|
83
|
+
type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
|
|
92
84
|
|
|
93
|
-
interface
|
|
94
|
-
type:
|
|
95
|
-
|
|
85
|
+
interface CredentialRequestType {
|
|
86
|
+
type: CredentialType;
|
|
87
|
+
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
88
|
+
signal?: string | Uint8Array;
|
|
89
|
+
genesis_issued_at_min?: number;
|
|
90
|
+
expires_at_min?: number;
|
|
96
91
|
}
|
|
97
92
|
|
|
98
|
-
type
|
|
93
|
+
type ConstraintNode =
|
|
94
|
+
| CredentialRequestType
|
|
95
|
+
| { any: ConstraintNode[] }
|
|
96
|
+
| { all: ConstraintNode[] };
|
|
99
97
|
|
|
100
98
|
|
|
101
99
|
|
|
@@ -225,20 +223,22 @@ type Status$1 =
|
|
|
225
223
|
|
|
226
224
|
|
|
227
225
|
|
|
228
|
-
|
|
226
|
+
interface OrbLegacyPreset {
|
|
227
|
+
type: "OrbLegacy";
|
|
228
|
+
signal?: string;
|
|
229
|
+
}
|
|
229
230
|
|
|
230
|
-
interface
|
|
231
|
-
type:
|
|
232
|
-
|
|
233
|
-
signal?: string | Uint8Array;
|
|
234
|
-
genesis_issued_at_min?: number;
|
|
235
|
-
expires_at_min?: number;
|
|
231
|
+
interface SecureDocumentLegacyPreset {
|
|
232
|
+
type: "SecureDocumentLegacy";
|
|
233
|
+
signal?: string;
|
|
236
234
|
}
|
|
237
235
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
interface DocumentLegacyPreset {
|
|
237
|
+
type: "DocumentLegacy";
|
|
238
|
+
signal?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset;
|
|
242
242
|
/**
|
|
243
243
|
* Unified builder for creating `IDKit` requests and sessions (WASM)
|
|
244
244
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -80,22 +80,20 @@ type IDKitSessionConfig = {
|
|
|
80
80
|
environment?: "production" | "staging";
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
type: "OrbLegacy";
|
|
85
|
-
signal?: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
interface SecureDocumentLegacyPreset {
|
|
89
|
-
type: "SecureDocumentLegacy";
|
|
90
|
-
signal?: string;
|
|
91
|
-
}
|
|
83
|
+
type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
|
|
92
84
|
|
|
93
|
-
interface
|
|
94
|
-
type:
|
|
95
|
-
|
|
85
|
+
interface CredentialRequestType {
|
|
86
|
+
type: CredentialType;
|
|
87
|
+
/** Signal can be a string or raw bytes (Uint8Array) */
|
|
88
|
+
signal?: string | Uint8Array;
|
|
89
|
+
genesis_issued_at_min?: number;
|
|
90
|
+
expires_at_min?: number;
|
|
96
91
|
}
|
|
97
92
|
|
|
98
|
-
type
|
|
93
|
+
type ConstraintNode =
|
|
94
|
+
| CredentialRequestType
|
|
95
|
+
| { any: ConstraintNode[] }
|
|
96
|
+
| { all: ConstraintNode[] };
|
|
99
97
|
|
|
100
98
|
|
|
101
99
|
|
|
@@ -225,20 +223,22 @@ type Status$1 =
|
|
|
225
223
|
|
|
226
224
|
|
|
227
225
|
|
|
228
|
-
|
|
226
|
+
interface OrbLegacyPreset {
|
|
227
|
+
type: "OrbLegacy";
|
|
228
|
+
signal?: string;
|
|
229
|
+
}
|
|
229
230
|
|
|
230
|
-
interface
|
|
231
|
-
type:
|
|
232
|
-
|
|
233
|
-
signal?: string | Uint8Array;
|
|
234
|
-
genesis_issued_at_min?: number;
|
|
235
|
-
expires_at_min?: number;
|
|
231
|
+
interface SecureDocumentLegacyPreset {
|
|
232
|
+
type: "SecureDocumentLegacy";
|
|
233
|
+
signal?: string;
|
|
236
234
|
}
|
|
237
235
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
interface DocumentLegacyPreset {
|
|
237
|
+
type: "DocumentLegacy";
|
|
238
|
+
signal?: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset;
|
|
242
242
|
/**
|
|
243
243
|
* Unified builder for creating `IDKit` requests and sessions (WASM)
|
|
244
244
|
*/
|
package/dist/index.js
CHANGED
|
@@ -242,22 +242,6 @@ function _assertClass(instance, klass) {
|
|
|
242
242
|
throw new Error(`expected instance of ${klass.name}`);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
function createSession(app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
|
|
246
|
-
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
247
|
-
const len0 = WASM_VECTOR_LEN;
|
|
248
|
-
_assertClass(rp_context, RpContextWasm);
|
|
249
|
-
var ptr1 = rp_context.__destroy_into_raw();
|
|
250
|
-
var ptr2 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
251
|
-
var len2 = WASM_VECTOR_LEN;
|
|
252
|
-
var ptr3 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
253
|
-
var len3 = WASM_VECTOR_LEN;
|
|
254
|
-
var ptr4 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
255
|
-
var len4 = WASM_VECTOR_LEN;
|
|
256
|
-
var ptr5 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
257
|
-
var len5 = WASM_VECTOR_LEN;
|
|
258
|
-
const ret = wasm.createSession(ptr0, len0, ptr1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
259
|
-
return IDKitBuilder.__wrap(ret);
|
|
260
|
-
}
|
|
261
245
|
function request(app_id, action, rp_context, action_description, bridge_url, allow_legacy_proofs, override_connect_base_url, environment) {
|
|
262
246
|
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
263
247
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -276,6 +260,9 @@ function request(app_id, action, rp_context, action_description, bridge_url, all
|
|
|
276
260
|
const ret = wasm.idkitbuilder_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, allow_legacy_proofs, ptr5, len5, ptr6, len6);
|
|
277
261
|
return IDKitBuilder.__wrap(ret);
|
|
278
262
|
}
|
|
263
|
+
function init_wasm() {
|
|
264
|
+
wasm.init_wasm();
|
|
265
|
+
}
|
|
279
266
|
function base64Decode(data) {
|
|
280
267
|
try {
|
|
281
268
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -314,6 +301,22 @@ function proveSession(session_id, app_id, rp_context, action_description, bridge
|
|
|
314
301
|
const ret = wasm.idkitbuilder_forProveSession(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
315
302
|
return IDKitBuilder.__wrap(ret);
|
|
316
303
|
}
|
|
304
|
+
function createSession(app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
|
|
305
|
+
const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
306
|
+
const len0 = WASM_VECTOR_LEN;
|
|
307
|
+
_assertClass(rp_context, RpContextWasm);
|
|
308
|
+
var ptr1 = rp_context.__destroy_into_raw();
|
|
309
|
+
var ptr2 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
310
|
+
var len2 = WASM_VECTOR_LEN;
|
|
311
|
+
var ptr3 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
312
|
+
var len3 = WASM_VECTOR_LEN;
|
|
313
|
+
var ptr4 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
314
|
+
var len4 = WASM_VECTOR_LEN;
|
|
315
|
+
var ptr5 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
316
|
+
var len5 = WASM_VECTOR_LEN;
|
|
317
|
+
const ret = wasm.createSession(ptr0, len0, ptr1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
318
|
+
return IDKitBuilder.__wrap(ret);
|
|
319
|
+
}
|
|
317
320
|
function passArray8ToWasm0(arg, malloc) {
|
|
318
321
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
319
322
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -338,28 +341,6 @@ function base64Encode(data) {
|
|
|
338
341
|
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
339
342
|
}
|
|
340
343
|
}
|
|
341
|
-
function init_wasm() {
|
|
342
|
-
wasm.init_wasm();
|
|
343
|
-
}
|
|
344
|
-
function signRequest(action, signing_key_hex, ttl_seconds) {
|
|
345
|
-
try {
|
|
346
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
347
|
-
const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
348
|
-
const len0 = WASM_VECTOR_LEN;
|
|
349
|
-
const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
350
|
-
const len1 = WASM_VECTOR_LEN;
|
|
351
|
-
wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
|
|
352
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
353
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
354
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
355
|
-
if (r2) {
|
|
356
|
-
throw takeObject(r1);
|
|
357
|
-
}
|
|
358
|
-
return RpSignature.__wrap(r0);
|
|
359
|
-
} finally {
|
|
360
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
344
|
function hashSignal(signal) {
|
|
364
345
|
let deferred2_0;
|
|
365
346
|
let deferred2_1;
|
|
@@ -385,14 +366,33 @@ function hashSignal(signal) {
|
|
|
385
366
|
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
386
367
|
}
|
|
387
368
|
}
|
|
388
|
-
function
|
|
389
|
-
|
|
369
|
+
function signRequest(action, signing_key_hex, ttl_seconds) {
|
|
370
|
+
try {
|
|
371
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
372
|
+
const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
373
|
+
const len0 = WASM_VECTOR_LEN;
|
|
374
|
+
const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
375
|
+
const len1 = WASM_VECTOR_LEN;
|
|
376
|
+
wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
|
|
377
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
378
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
379
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
380
|
+
if (r2) {
|
|
381
|
+
throw takeObject(r1);
|
|
382
|
+
}
|
|
383
|
+
return RpSignature.__wrap(r0);
|
|
384
|
+
} finally {
|
|
385
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
386
|
+
}
|
|
390
387
|
}
|
|
391
388
|
function __wasm_bindgen_func_elem_960(arg0, arg1, arg2) {
|
|
392
389
|
wasm.__wasm_bindgen_func_elem_960(arg0, arg1, addHeapObject(arg2));
|
|
393
390
|
}
|
|
394
|
-
function
|
|
395
|
-
wasm.
|
|
391
|
+
function __wasm_bindgen_func_elem_597(arg0, arg1) {
|
|
392
|
+
wasm.__wasm_bindgen_func_elem_597(arg0, arg1);
|
|
393
|
+
}
|
|
394
|
+
function __wasm_bindgen_func_elem_1343(arg0, arg1, arg2, arg3) {
|
|
395
|
+
wasm.__wasm_bindgen_func_elem_1343(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
396
396
|
}
|
|
397
397
|
var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
398
398
|
var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -1499,7 +1499,7 @@ function __wbg_get_imports() {
|
|
|
1499
1499
|
const a = state0.a;
|
|
1500
1500
|
state0.a = 0;
|
|
1501
1501
|
try {
|
|
1502
|
-
return
|
|
1502
|
+
return __wasm_bindgen_func_elem_1343(a, state0.b, arg02, arg12);
|
|
1503
1503
|
} finally {
|
|
1504
1504
|
state0.a = a;
|
|
1505
1505
|
}
|
|
@@ -1793,10 +1793,6 @@ var idkit_wasm_default = __wbg_init;
|
|
|
1793
1793
|
// src/lib/wasm.ts
|
|
1794
1794
|
var wasmInitialized = false;
|
|
1795
1795
|
var wasmInitPromise = null;
|
|
1796
|
-
async function importNodeModule(specifier) {
|
|
1797
|
-
const dynamicImport = Function("moduleName", "return import(moduleName)");
|
|
1798
|
-
return dynamicImport(specifier);
|
|
1799
|
-
}
|
|
1800
1796
|
async function initIDKit() {
|
|
1801
1797
|
if (wasmInitialized) {
|
|
1802
1798
|
return;
|
|
@@ -1824,18 +1820,10 @@ async function initIDKitServer() {
|
|
|
1824
1820
|
}
|
|
1825
1821
|
wasmInitPromise = (async () => {
|
|
1826
1822
|
try {
|
|
1827
|
-
const { readFile } = await
|
|
1828
|
-
|
|
1829
|
-
);
|
|
1830
|
-
const
|
|
1831
|
-
"node:url"
|
|
1832
|
-
);
|
|
1833
|
-
const { dirname, join } = await importNodeModule(
|
|
1834
|
-
"node:path"
|
|
1835
|
-
);
|
|
1836
|
-
const modulePath = fileURLToPath(import.meta.url);
|
|
1837
|
-
const wasmPath = join(dirname(modulePath), "idkit_wasm_bg.wasm");
|
|
1838
|
-
const wasmBuffer = await readFile(wasmPath);
|
|
1823
|
+
const { readFile } = await import('fs/promises');
|
|
1824
|
+
const { fileURLToPath } = await import('url');
|
|
1825
|
+
const wasmUrl = new URL("idkit_wasm_bg.wasm", import.meta.url);
|
|
1826
|
+
const wasmBuffer = await readFile(fileURLToPath(wasmUrl));
|
|
1839
1827
|
await idkit_wasm_default({ module_or_path: wasmBuffer });
|
|
1840
1828
|
wasmInitialized = true;
|
|
1841
1829
|
} catch (error) {
|