@worldcoin/idkit-core 4.0.11 → 4.0.13

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.
Binary file
package/dist/index.cjs CHANGED
@@ -249,44 +249,49 @@ function _assertClass(instance, klass) {
249
249
  throw new Error(`expected instance of ${klass.name}`);
250
250
  }
251
251
  }
252
- function base64Decode(data) {
252
+ function passArray8ToWasm0(arg, malloc) {
253
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
254
+ getUint8ArrayMemory0().set(arg, ptr / 1);
255
+ WASM_VECTOR_LEN = arg.length;
256
+ return ptr;
257
+ }
258
+ function base64Encode(data) {
259
+ let deferred2_0;
260
+ let deferred2_1;
253
261
  try {
254
262
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
255
- const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
263
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
256
264
  const len0 = WASM_VECTOR_LEN;
257
- wasm.base64Decode(retptr, ptr0, len0);
265
+ wasm.base64Encode(retptr, ptr0, len0);
266
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
267
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
268
+ deferred2_0 = r0;
269
+ deferred2_1 = r1;
270
+ return getStringFromWasm0(r0, r1);
271
+ } finally {
272
+ wasm.__wbindgen_add_to_stack_pointer(16);
273
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
274
+ }
275
+ }
276
+ function signRequest(action, signing_key_hex, ttl_seconds) {
277
+ try {
278
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
279
+ const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
280
+ const len0 = WASM_VECTOR_LEN;
281
+ const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
282
+ const len1 = WASM_VECTOR_LEN;
283
+ wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
258
284
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
259
285
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
260
286
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
261
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
262
- if (r3) {
263
- throw takeObject(r2);
287
+ if (r2) {
288
+ throw takeObject(r1);
264
289
  }
265
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
266
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
267
- return v2;
290
+ return RpSignature.__wrap(r0);
268
291
  } finally {
269
292
  wasm.__wbindgen_add_to_stack_pointer(16);
270
293
  }
271
294
  }
272
- function proveSession(session_id, app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
273
- const ptr0 = passStringToWasm0(session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
274
- const len0 = WASM_VECTOR_LEN;
275
- const ptr1 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
276
- const len1 = WASM_VECTOR_LEN;
277
- _assertClass(rp_context, RpContextWasm);
278
- var ptr2 = rp_context.__destroy_into_raw();
279
- var ptr3 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
280
- var len3 = WASM_VECTOR_LEN;
281
- var ptr4 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
282
- var len4 = WASM_VECTOR_LEN;
283
- var ptr5 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
284
- var len5 = WASM_VECTOR_LEN;
285
- var ptr6 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
286
- var len6 = WASM_VECTOR_LEN;
287
- const ret = wasm.idkitbuilder_forProveSession(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
288
- return IDKitBuilder.__wrap(ret);
289
- }
290
295
  function createSession(app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
291
296
  const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
292
297
  const len0 = WASM_VECTOR_LEN;
@@ -303,34 +308,10 @@ function createSession(app_id, rp_context, action_description, bridge_url, overr
303
308
  const ret = wasm.createSession(ptr0, len0, ptr1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
304
309
  return IDKitBuilder.__wrap(ret);
305
310
  }
306
- function passArray8ToWasm0(arg, malloc) {
307
- const ptr = malloc(arg.length * 1, 1) >>> 0;
308
- getUint8ArrayMemory0().set(arg, ptr / 1);
309
- WASM_VECTOR_LEN = arg.length;
310
- return ptr;
311
- }
312
- function base64Encode(data) {
313
- let deferred2_0;
314
- let deferred2_1;
315
- try {
316
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
317
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
318
- const len0 = WASM_VECTOR_LEN;
319
- wasm.base64Encode(retptr, ptr0, len0);
320
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
321
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
322
- deferred2_0 = r0;
323
- deferred2_1 = r1;
324
- return getStringFromWasm0(r0, r1);
325
- } finally {
326
- wasm.__wbindgen_add_to_stack_pointer(16);
327
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
328
- }
329
- }
330
- function request(app_id, action, rp_context, action_description, bridge_url, allow_legacy_proofs, override_connect_base_url, environment) {
331
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
311
+ function proveSession(session_id, app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
312
+ const ptr0 = passStringToWasm0(session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
332
313
  const len0 = WASM_VECTOR_LEN;
333
- const ptr1 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
314
+ const ptr1 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
334
315
  const len1 = WASM_VECTOR_LEN;
335
316
  _assertClass(rp_context, RpContextWasm);
336
317
  var ptr2 = rp_context.__destroy_into_raw();
@@ -342,7 +323,7 @@ function request(app_id, action, rp_context, action_description, bridge_url, all
342
323
  var len5 = WASM_VECTOR_LEN;
343
324
  var ptr6 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
344
325
  var len6 = WASM_VECTOR_LEN;
345
- const ret = wasm.idkitbuilder_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, allow_legacy_proofs, ptr5, len5, ptr6, len6);
326
+ const ret = wasm.idkitbuilder_forProveSession(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
346
327
  return IDKitBuilder.__wrap(ret);
347
328
  }
348
329
  function hashSignal(signal) {
@@ -370,36 +351,55 @@ function hashSignal(signal) {
370
351
  wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
371
352
  }
372
353
  }
373
- function init_wasm() {
374
- wasm.init_wasm();
375
- }
376
- function signRequest(action, signing_key_hex, ttl_seconds) {
354
+ function base64Decode(data) {
377
355
  try {
378
356
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
379
- const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
357
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
380
358
  const len0 = WASM_VECTOR_LEN;
381
- const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
382
- const len1 = WASM_VECTOR_LEN;
383
- wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
359
+ wasm.base64Decode(retptr, ptr0, len0);
384
360
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
385
361
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
386
362
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
387
- if (r2) {
388
- throw takeObject(r1);
363
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
364
+ if (r3) {
365
+ throw takeObject(r2);
389
366
  }
390
- return RpSignature.__wrap(r0);
367
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
368
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
369
+ return v2;
391
370
  } finally {
392
371
  wasm.__wbindgen_add_to_stack_pointer(16);
393
372
  }
394
373
  }
395
- function __wasm_bindgen_func_elem_619(arg0, arg1) {
396
- wasm.__wasm_bindgen_func_elem_619(arg0, arg1);
374
+ function init_wasm() {
375
+ wasm.init_wasm();
376
+ }
377
+ function request(app_id, action, rp_context, action_description, bridge_url, allow_legacy_proofs, override_connect_base_url, environment) {
378
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
379
+ const len0 = WASM_VECTOR_LEN;
380
+ const ptr1 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
381
+ const len1 = WASM_VECTOR_LEN;
382
+ _assertClass(rp_context, RpContextWasm);
383
+ var ptr2 = rp_context.__destroy_into_raw();
384
+ var ptr3 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
385
+ var len3 = WASM_VECTOR_LEN;
386
+ var ptr4 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
387
+ var len4 = WASM_VECTOR_LEN;
388
+ var ptr5 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
389
+ var len5 = WASM_VECTOR_LEN;
390
+ var ptr6 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
391
+ var len6 = WASM_VECTOR_LEN;
392
+ const ret = wasm.idkitbuilder_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, allow_legacy_proofs, ptr5, len5, ptr6, len6);
393
+ return IDKitBuilder.__wrap(ret);
394
+ }
395
+ function __wasm_bindgen_func_elem_611(arg0, arg1) {
396
+ wasm.__wasm_bindgen_func_elem_611(arg0, arg1);
397
397
  }
398
- function __wasm_bindgen_func_elem_982(arg0, arg1, arg2) {
399
- wasm.__wasm_bindgen_func_elem_982(arg0, arg1, addHeapObject(arg2));
398
+ function __wasm_bindgen_func_elem_927(arg0, arg1, arg2) {
399
+ wasm.__wasm_bindgen_func_elem_927(arg0, arg1, addHeapObject(arg2));
400
400
  }
401
- function __wasm_bindgen_func_elem_1367(arg0, arg1, arg2, arg3) {
402
- wasm.__wasm_bindgen_func_elem_1367(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
401
+ function __wasm_bindgen_func_elem_1352(arg0, arg1, arg2, arg3) {
402
+ wasm.__wasm_bindgen_func_elem_1352(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
403
403
  }
404
404
  var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
405
405
  var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -1591,7 +1591,7 @@ function __wbg_get_imports() {
1591
1591
  const a = state0.a;
1592
1592
  state0.a = 0;
1593
1593
  try {
1594
- return __wasm_bindgen_func_elem_1367(a, state0.b, arg02, arg12);
1594
+ return __wasm_bindgen_func_elem_1352(a, state0.b, arg02, arg12);
1595
1595
  } finally {
1596
1596
  state0.a = a;
1597
1597
  }
@@ -1800,22 +1800,22 @@ function __wbg_get_imports() {
1800
1800
  const ret = getObject(arg0).versions;
1801
1801
  return addHeapObject(ret);
1802
1802
  };
1803
- imports.wbg.__wbindgen_cast_0c688d3d5dd51bcb = function(arg0, arg1) {
1804
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_981, __wasm_bindgen_func_elem_982);
1803
+ imports.wbg.__wbindgen_cast_05d6e3863d59fd4a = function(arg0, arg1) {
1804
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_610, __wasm_bindgen_func_elem_611);
1805
1805
  return addHeapObject(ret);
1806
1806
  };
1807
1807
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1808
1808
  const ret = getStringFromWasm0(arg0, arg1);
1809
1809
  return addHeapObject(ret);
1810
1810
  };
1811
- imports.wbg.__wbindgen_cast_26df652e200d9104 = function(arg0, arg1) {
1812
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_618, __wasm_bindgen_func_elem_619);
1813
- return addHeapObject(ret);
1814
- };
1815
1811
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1816
1812
  const ret = BigInt.asUintN(64, arg0);
1817
1813
  return addHeapObject(ret);
1818
1814
  };
1815
+ imports.wbg.__wbindgen_cast_87cdb333eb97349f = function(arg0, arg1) {
1816
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_926, __wasm_bindgen_func_elem_927);
1817
+ return addHeapObject(ret);
1818
+ };
1819
1819
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
1820
1820
  const ret = arg0;
1821
1821
  return addHeapObject(ret);
package/dist/index.d.cts CHANGED
@@ -83,6 +83,59 @@ type IDKitSessionConfig = {
83
83
  environment?: "production" | "staging";
84
84
  };
85
85
 
86
+ interface OrbLegacyPreset {
87
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
88
+ type: "OrbLegacy";
89
+ signal?: string;
90
+ }
91
+
92
+ interface SecureDocumentLegacyPreset {
93
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
94
+ type: "SecureDocumentLegacy";
95
+ signal?: string;
96
+ }
97
+
98
+ interface DocumentLegacyPreset {
99
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
100
+ type: "DocumentLegacy";
101
+ signal?: string;
102
+ }
103
+
104
+ interface SelfieCheckLegacyPreset {
105
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
106
+ /** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
107
+ type: "SelfieCheckLegacy";
108
+ signal?: string;
109
+ }
110
+
111
+ interface DeviceLegacyPreset {
112
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
113
+ type: "DeviceLegacy";
114
+ signal?: string;
115
+ }
116
+
117
+ type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
118
+
119
+
120
+
121
+ type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
122
+
123
+ interface CredentialRequestType {
124
+ type: CredentialType;
125
+ /** Signal can be a string or raw bytes (Uint8Array) */
126
+ signal?: string | Uint8Array;
127
+ genesis_issued_at_min?: number;
128
+ expires_at_min?: number;
129
+ }
130
+
131
+ type ConstraintNode =
132
+ | CredentialRequestType
133
+ | { any: ConstraintNode[] }
134
+ | { all: ConstraintNode[] }
135
+ | { enumerate: ConstraintNode[] };
136
+
137
+
138
+
86
139
  /** V4 response item for World ID v4 uniqueness proofs */
87
140
  interface ResponseItemV4 {
88
141
  /** Credential identifier (e.g., "orb", "face", "document") */
@@ -207,59 +260,6 @@ type Status$1 =
207
260
  | { type: "confirmed"; result: IDKitResult }
208
261
  | { type: "failed"; error: IDKitErrorCode };
209
262
 
210
-
211
-
212
- type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
213
-
214
- interface CredentialRequestType {
215
- type: CredentialType;
216
- /** Signal can be a string or raw bytes (Uint8Array) */
217
- signal?: string | Uint8Array;
218
- genesis_issued_at_min?: number;
219
- expires_at_min?: number;
220
- }
221
-
222
- type ConstraintNode =
223
- | CredentialRequestType
224
- | { any: ConstraintNode[] }
225
- | { all: ConstraintNode[] }
226
- | { enumerate: ConstraintNode[] };
227
-
228
-
229
-
230
- interface OrbLegacyPreset {
231
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
232
- type: "OrbLegacy";
233
- signal?: string;
234
- }
235
-
236
- interface SecureDocumentLegacyPreset {
237
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
238
- type: "SecureDocumentLegacy";
239
- signal?: string;
240
- }
241
-
242
- interface DocumentLegacyPreset {
243
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
244
- type: "DocumentLegacy";
245
- signal?: string;
246
- }
247
-
248
- interface SelfieCheckLegacyPreset {
249
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
250
- /** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
251
- type: "SelfieCheckLegacy";
252
- signal?: string;
253
- }
254
-
255
- interface DeviceLegacyPreset {
256
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
257
- type: "DeviceLegacy";
258
- signal?: string;
259
- }
260
-
261
- type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
262
-
263
263
  /**
264
264
  * Result types - re-exported from WASM bindings
265
265
  *
package/dist/index.d.ts CHANGED
@@ -83,6 +83,59 @@ type IDKitSessionConfig = {
83
83
  environment?: "production" | "staging";
84
84
  };
85
85
 
86
+ interface OrbLegacyPreset {
87
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
88
+ type: "OrbLegacy";
89
+ signal?: string;
90
+ }
91
+
92
+ interface SecureDocumentLegacyPreset {
93
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
94
+ type: "SecureDocumentLegacy";
95
+ signal?: string;
96
+ }
97
+
98
+ interface DocumentLegacyPreset {
99
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
100
+ type: "DocumentLegacy";
101
+ signal?: string;
102
+ }
103
+
104
+ interface SelfieCheckLegacyPreset {
105
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
106
+ /** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
107
+ type: "SelfieCheckLegacy";
108
+ signal?: string;
109
+ }
110
+
111
+ interface DeviceLegacyPreset {
112
+ /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
113
+ type: "DeviceLegacy";
114
+ signal?: string;
115
+ }
116
+
117
+ type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
118
+
119
+
120
+
121
+ type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
122
+
123
+ interface CredentialRequestType {
124
+ type: CredentialType;
125
+ /** Signal can be a string or raw bytes (Uint8Array) */
126
+ signal?: string | Uint8Array;
127
+ genesis_issued_at_min?: number;
128
+ expires_at_min?: number;
129
+ }
130
+
131
+ type ConstraintNode =
132
+ | CredentialRequestType
133
+ | { any: ConstraintNode[] }
134
+ | { all: ConstraintNode[] }
135
+ | { enumerate: ConstraintNode[] };
136
+
137
+
138
+
86
139
  /** V4 response item for World ID v4 uniqueness proofs */
87
140
  interface ResponseItemV4 {
88
141
  /** Credential identifier (e.g., "orb", "face", "document") */
@@ -207,59 +260,6 @@ type Status$1 =
207
260
  | { type: "confirmed"; result: IDKitResult }
208
261
  | { type: "failed"; error: IDKitErrorCode };
209
262
 
210
-
211
-
212
- type CredentialType = "orb" | "face" | "secure_document" | "document" | "device";
213
-
214
- interface CredentialRequestType {
215
- type: CredentialType;
216
- /** Signal can be a string or raw bytes (Uint8Array) */
217
- signal?: string | Uint8Array;
218
- genesis_issued_at_min?: number;
219
- expires_at_min?: number;
220
- }
221
-
222
- type ConstraintNode =
223
- | CredentialRequestType
224
- | { any: ConstraintNode[] }
225
- | { all: ConstraintNode[] }
226
- | { enumerate: ConstraintNode[] };
227
-
228
-
229
-
230
- interface OrbLegacyPreset {
231
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
232
- type: "OrbLegacy";
233
- signal?: string;
234
- }
235
-
236
- interface SecureDocumentLegacyPreset {
237
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
238
- type: "SecureDocumentLegacy";
239
- signal?: string;
240
- }
241
-
242
- interface DocumentLegacyPreset {
243
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
244
- type: "DocumentLegacy";
245
- signal?: string;
246
- }
247
-
248
- interface SelfieCheckLegacyPreset {
249
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
250
- /** Preview: Selfie Check is currently in preview. Contact us if you need it enabled. */
251
- type: "SelfieCheckLegacy";
252
- signal?: string;
253
- }
254
-
255
- interface DeviceLegacyPreset {
256
- /** This preset only returns World ID 3.0 proofs. Use it for compatibility with older IDKit versions. */
257
- type: "DeviceLegacy";
258
- signal?: string;
259
- }
260
-
261
- type Preset = OrbLegacyPreset | SecureDocumentLegacyPreset | DocumentLegacyPreset | SelfieCheckLegacyPreset | DeviceLegacyPreset;
262
-
263
263
  /**
264
264
  * Result types - re-exported from WASM bindings
265
265
  *
package/dist/index.js CHANGED
@@ -246,44 +246,49 @@ function _assertClass(instance, klass) {
246
246
  throw new Error(`expected instance of ${klass.name}`);
247
247
  }
248
248
  }
249
- function base64Decode(data) {
249
+ function passArray8ToWasm0(arg, malloc) {
250
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
251
+ getUint8ArrayMemory0().set(arg, ptr / 1);
252
+ WASM_VECTOR_LEN = arg.length;
253
+ return ptr;
254
+ }
255
+ function base64Encode(data) {
256
+ let deferred2_0;
257
+ let deferred2_1;
250
258
  try {
251
259
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
252
- const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
260
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
253
261
  const len0 = WASM_VECTOR_LEN;
254
- wasm.base64Decode(retptr, ptr0, len0);
262
+ wasm.base64Encode(retptr, ptr0, len0);
263
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
264
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
265
+ deferred2_0 = r0;
266
+ deferred2_1 = r1;
267
+ return getStringFromWasm0(r0, r1);
268
+ } finally {
269
+ wasm.__wbindgen_add_to_stack_pointer(16);
270
+ wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
271
+ }
272
+ }
273
+ function signRequest(action, signing_key_hex, ttl_seconds) {
274
+ try {
275
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
276
+ const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
277
+ const len0 = WASM_VECTOR_LEN;
278
+ const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
279
+ const len1 = WASM_VECTOR_LEN;
280
+ wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
255
281
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
256
282
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
257
283
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
258
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
259
- if (r3) {
260
- throw takeObject(r2);
284
+ if (r2) {
285
+ throw takeObject(r1);
261
286
  }
262
- var v2 = getArrayU8FromWasm0(r0, r1).slice();
263
- wasm.__wbindgen_export4(r0, r1 * 1, 1);
264
- return v2;
287
+ return RpSignature.__wrap(r0);
265
288
  } finally {
266
289
  wasm.__wbindgen_add_to_stack_pointer(16);
267
290
  }
268
291
  }
269
- function proveSession(session_id, app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
270
- const ptr0 = passStringToWasm0(session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
271
- const len0 = WASM_VECTOR_LEN;
272
- const ptr1 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
273
- const len1 = WASM_VECTOR_LEN;
274
- _assertClass(rp_context, RpContextWasm);
275
- var ptr2 = rp_context.__destroy_into_raw();
276
- var ptr3 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
277
- var len3 = WASM_VECTOR_LEN;
278
- var ptr4 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
279
- var len4 = WASM_VECTOR_LEN;
280
- var ptr5 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
281
- var len5 = WASM_VECTOR_LEN;
282
- var ptr6 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
283
- var len6 = WASM_VECTOR_LEN;
284
- const ret = wasm.idkitbuilder_forProveSession(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
285
- return IDKitBuilder.__wrap(ret);
286
- }
287
292
  function createSession(app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
288
293
  const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
289
294
  const len0 = WASM_VECTOR_LEN;
@@ -300,34 +305,10 @@ function createSession(app_id, rp_context, action_description, bridge_url, overr
300
305
  const ret = wasm.createSession(ptr0, len0, ptr1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
301
306
  return IDKitBuilder.__wrap(ret);
302
307
  }
303
- function passArray8ToWasm0(arg, malloc) {
304
- const ptr = malloc(arg.length * 1, 1) >>> 0;
305
- getUint8ArrayMemory0().set(arg, ptr / 1);
306
- WASM_VECTOR_LEN = arg.length;
307
- return ptr;
308
- }
309
- function base64Encode(data) {
310
- let deferred2_0;
311
- let deferred2_1;
312
- try {
313
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
314
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export);
315
- const len0 = WASM_VECTOR_LEN;
316
- wasm.base64Encode(retptr, ptr0, len0);
317
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
318
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
319
- deferred2_0 = r0;
320
- deferred2_1 = r1;
321
- return getStringFromWasm0(r0, r1);
322
- } finally {
323
- wasm.__wbindgen_add_to_stack_pointer(16);
324
- wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
325
- }
326
- }
327
- function request(app_id, action, rp_context, action_description, bridge_url, allow_legacy_proofs, override_connect_base_url, environment) {
328
- const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
308
+ function proveSession(session_id, app_id, rp_context, action_description, bridge_url, override_connect_base_url, environment) {
309
+ const ptr0 = passStringToWasm0(session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
329
310
  const len0 = WASM_VECTOR_LEN;
330
- const ptr1 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
311
+ const ptr1 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
331
312
  const len1 = WASM_VECTOR_LEN;
332
313
  _assertClass(rp_context, RpContextWasm);
333
314
  var ptr2 = rp_context.__destroy_into_raw();
@@ -339,7 +320,7 @@ function request(app_id, action, rp_context, action_description, bridge_url, all
339
320
  var len5 = WASM_VECTOR_LEN;
340
321
  var ptr6 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
341
322
  var len6 = WASM_VECTOR_LEN;
342
- const ret = wasm.idkitbuilder_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, allow_legacy_proofs, ptr5, len5, ptr6, len6);
323
+ const ret = wasm.idkitbuilder_forProveSession(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
343
324
  return IDKitBuilder.__wrap(ret);
344
325
  }
345
326
  function hashSignal(signal) {
@@ -367,36 +348,55 @@ function hashSignal(signal) {
367
348
  wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
368
349
  }
369
350
  }
370
- function init_wasm() {
371
- wasm.init_wasm();
372
- }
373
- function signRequest(action, signing_key_hex, ttl_seconds) {
351
+ function base64Decode(data) {
374
352
  try {
375
353
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
376
- const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
354
+ const ptr0 = passStringToWasm0(data, wasm.__wbindgen_export, wasm.__wbindgen_export2);
377
355
  const len0 = WASM_VECTOR_LEN;
378
- const ptr1 = passStringToWasm0(signing_key_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
379
- const len1 = WASM_VECTOR_LEN;
380
- wasm.signRequest(retptr, ptr0, len0, ptr1, len1, !isLikeNone(ttl_seconds), isLikeNone(ttl_seconds) ? BigInt(0) : ttl_seconds);
356
+ wasm.base64Decode(retptr, ptr0, len0);
381
357
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
382
358
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
383
359
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
384
- if (r2) {
385
- throw takeObject(r1);
360
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
361
+ if (r3) {
362
+ throw takeObject(r2);
386
363
  }
387
- return RpSignature.__wrap(r0);
364
+ var v2 = getArrayU8FromWasm0(r0, r1).slice();
365
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
366
+ return v2;
388
367
  } finally {
389
368
  wasm.__wbindgen_add_to_stack_pointer(16);
390
369
  }
391
370
  }
392
- function __wasm_bindgen_func_elem_619(arg0, arg1) {
393
- wasm.__wasm_bindgen_func_elem_619(arg0, arg1);
371
+ function init_wasm() {
372
+ wasm.init_wasm();
373
+ }
374
+ function request(app_id, action, rp_context, action_description, bridge_url, allow_legacy_proofs, override_connect_base_url, environment) {
375
+ const ptr0 = passStringToWasm0(app_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
376
+ const len0 = WASM_VECTOR_LEN;
377
+ const ptr1 = passStringToWasm0(action, wasm.__wbindgen_export, wasm.__wbindgen_export2);
378
+ const len1 = WASM_VECTOR_LEN;
379
+ _assertClass(rp_context, RpContextWasm);
380
+ var ptr2 = rp_context.__destroy_into_raw();
381
+ var ptr3 = isLikeNone(action_description) ? 0 : passStringToWasm0(action_description, wasm.__wbindgen_export, wasm.__wbindgen_export2);
382
+ var len3 = WASM_VECTOR_LEN;
383
+ var ptr4 = isLikeNone(bridge_url) ? 0 : passStringToWasm0(bridge_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
384
+ var len4 = WASM_VECTOR_LEN;
385
+ var ptr5 = isLikeNone(override_connect_base_url) ? 0 : passStringToWasm0(override_connect_base_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
386
+ var len5 = WASM_VECTOR_LEN;
387
+ var ptr6 = isLikeNone(environment) ? 0 : passStringToWasm0(environment, wasm.__wbindgen_export, wasm.__wbindgen_export2);
388
+ var len6 = WASM_VECTOR_LEN;
389
+ const ret = wasm.idkitbuilder_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, allow_legacy_proofs, ptr5, len5, ptr6, len6);
390
+ return IDKitBuilder.__wrap(ret);
391
+ }
392
+ function __wasm_bindgen_func_elem_611(arg0, arg1) {
393
+ wasm.__wasm_bindgen_func_elem_611(arg0, arg1);
394
394
  }
395
- function __wasm_bindgen_func_elem_982(arg0, arg1, arg2) {
396
- wasm.__wasm_bindgen_func_elem_982(arg0, arg1, addHeapObject(arg2));
395
+ function __wasm_bindgen_func_elem_927(arg0, arg1, arg2) {
396
+ wasm.__wasm_bindgen_func_elem_927(arg0, arg1, addHeapObject(arg2));
397
397
  }
398
- function __wasm_bindgen_func_elem_1367(arg0, arg1, arg2, arg3) {
399
- wasm.__wasm_bindgen_func_elem_1367(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
398
+ function __wasm_bindgen_func_elem_1352(arg0, arg1, arg2, arg3) {
399
+ wasm.__wasm_bindgen_func_elem_1352(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
400
400
  }
401
401
  var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
402
402
  var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
@@ -1588,7 +1588,7 @@ function __wbg_get_imports() {
1588
1588
  const a = state0.a;
1589
1589
  state0.a = 0;
1590
1590
  try {
1591
- return __wasm_bindgen_func_elem_1367(a, state0.b, arg02, arg12);
1591
+ return __wasm_bindgen_func_elem_1352(a, state0.b, arg02, arg12);
1592
1592
  } finally {
1593
1593
  state0.a = a;
1594
1594
  }
@@ -1797,22 +1797,22 @@ function __wbg_get_imports() {
1797
1797
  const ret = getObject(arg0).versions;
1798
1798
  return addHeapObject(ret);
1799
1799
  };
1800
- imports.wbg.__wbindgen_cast_0c688d3d5dd51bcb = function(arg0, arg1) {
1801
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_981, __wasm_bindgen_func_elem_982);
1800
+ imports.wbg.__wbindgen_cast_05d6e3863d59fd4a = function(arg0, arg1) {
1801
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_610, __wasm_bindgen_func_elem_611);
1802
1802
  return addHeapObject(ret);
1803
1803
  };
1804
1804
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1805
1805
  const ret = getStringFromWasm0(arg0, arg1);
1806
1806
  return addHeapObject(ret);
1807
1807
  };
1808
- imports.wbg.__wbindgen_cast_26df652e200d9104 = function(arg0, arg1) {
1809
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_618, __wasm_bindgen_func_elem_619);
1810
- return addHeapObject(ret);
1811
- };
1812
1808
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1813
1809
  const ret = BigInt.asUintN(64, arg0);
1814
1810
  return addHeapObject(ret);
1815
1811
  };
1812
+ imports.wbg.__wbindgen_cast_87cdb333eb97349f = function(arg0, arg1) {
1813
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_926, __wasm_bindgen_func_elem_927);
1814
+ return addHeapObject(ret);
1815
+ };
1816
1816
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
1817
1817
  const ret = arg0;
1818
1818
  return addHeapObject(ret);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worldcoin/idkit-core",
3
- "version": "4.0.11",
3
+ "version": "4.0.13",
4
4
  "description": "Core IDKit SDK for World ID - Pure TypeScript, no dependencies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",