@learncard/didkit-plugin 1.8.6 → 1.8.8

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.
@@ -183,29 +183,37 @@ ${val.stack}`;
183
183
  return className;
184
184
  }
185
185
  __name(debugString, "debugString");
186
- function clearCache() {
187
- const ret = wasm.clearCache();
186
+ function issueCredential(credential, proof_options, key, context_map) {
187
+ const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
188
+ const len0 = WASM_VECTOR_LEN;
189
+ const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
190
+ const len1 = WASM_VECTOR_LEN;
191
+ const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
192
+ const len2 = WASM_VECTOR_LEN;
193
+ const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
194
+ const len3 = WASM_VECTOR_LEN;
195
+ const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
188
196
  return ret;
189
197
  }
190
- __name(clearCache, "clearCache");
191
- function didResolver(did, input_metadata) {
192
- const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
198
+ __name(issueCredential, "issueCredential");
199
+ function verifyPresentation(vp, proof_options, context_map) {
200
+ const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
193
201
  const len0 = WASM_VECTOR_LEN;
194
- const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
202
+ const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
195
203
  const len1 = WASM_VECTOR_LEN;
196
- const ret = wasm.didResolver(ptr0, len0, ptr1, len1);
204
+ const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
205
+ const len2 = WASM_VECTOR_LEN;
206
+ const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
197
207
  return ret;
198
208
  }
199
- __name(didResolver, "didResolver");
200
- function resolveDID(did, input_metadata) {
201
- const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
209
+ __name(verifyPresentation, "verifyPresentation");
210
+ function contextLoader(url) {
211
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
202
212
  const len0 = WASM_VECTOR_LEN;
203
- const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
204
- const len1 = WASM_VECTOR_LEN;
205
- const ret = wasm.resolveDID(ptr0, len0, ptr1, len1);
213
+ const ret = wasm.contextLoader(ptr0, len0);
206
214
  return ret;
207
215
  }
208
- __name(resolveDID, "resolveDID");
216
+ __name(contextLoader, "contextLoader");
209
217
  function takeFromExternrefTable0(idx) {
210
218
  const value = wasm.__wbindgen_export_4.get(idx);
211
219
  wasm.__externref_table_dealloc(idx);
@@ -241,28 +249,6 @@ function generateEd25519KeyFromBytes(bytes) {
241
249
  }
242
250
  }
243
251
  __name(generateEd25519KeyFromBytes, "generateEd25519KeyFromBytes");
244
- function generateSecp256k1KeyFromBytes(bytes) {
245
- let deferred3_0;
246
- let deferred3_1;
247
- try {
248
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
249
- const len0 = WASM_VECTOR_LEN;
250
- const ret = wasm.generateSecp256k1KeyFromBytes(ptr0, len0);
251
- var ptr2 = ret[0];
252
- var len2 = ret[1];
253
- if (ret[3]) {
254
- ptr2 = 0;
255
- len2 = 0;
256
- throw takeFromExternrefTable0(ret[2]);
257
- }
258
- deferred3_0 = ptr2;
259
- deferred3_1 = len2;
260
- return getStringFromWasm0(ptr2, len2);
261
- } finally {
262
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
263
- }
264
- }
265
- __name(generateSecp256k1KeyFromBytes, "generateSecp256k1KeyFromBytes");
266
252
  function passArrayJsValueToWasm0(array, malloc) {
267
253
  const ptr = malloc(array.length * 4, 4) >>> 0;
268
254
  for (let i = 0; i < array.length; i++) {
@@ -282,22 +268,31 @@ function createJwe(cleartext, recipients) {
282
268
  return ret;
283
269
  }
284
270
  __name(createJwe, "createJwe");
285
- function decryptJwe(jwe, jwks) {
286
- const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
271
+ function didResolver(did, input_metadata) {
272
+ const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
287
273
  const len0 = WASM_VECTOR_LEN;
288
- const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
274
+ const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
289
275
  const len1 = WASM_VECTOR_LEN;
290
- const ret = wasm.decryptJwe(ptr0, len0, ptr1, len1);
276
+ const ret = wasm.didResolver(ptr0, len0, ptr1, len1);
291
277
  return ret;
292
278
  }
293
- __name(decryptJwe, "decryptJwe");
294
- function createDagJwe(cleartext, recipients) {
295
- const ptr0 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
279
+ __name(didResolver, "didResolver");
280
+ function keyToVerificationMethod(method_pattern, jwk) {
281
+ const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
296
282
  const len0 = WASM_VECTOR_LEN;
297
- const ret = wasm.createDagJwe(cleartext, ptr0, len0);
283
+ const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
284
+ const len1 = WASM_VECTOR_LEN;
285
+ const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
298
286
  return ret;
299
287
  }
300
- __name(createDagJwe, "createDagJwe");
288
+ __name(keyToVerificationMethod, "keyToVerificationMethod");
289
+ function didToVerificationMethod(did) {
290
+ const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
291
+ const len0 = WASM_VECTOR_LEN;
292
+ const ret = wasm.didToVerificationMethod(ptr0, len0);
293
+ return ret;
294
+ }
295
+ __name(didToVerificationMethod, "didToVerificationMethod");
301
296
  function decryptDagJwe(jwe, jwks) {
302
297
  const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
303
298
  const len0 = WASM_VECTOR_LEN;
@@ -331,24 +326,37 @@ function keyToDID(method_pattern, jwk) {
331
326
  }
332
327
  }
333
328
  __name(keyToDID, "keyToDID");
334
- function keyToVerificationMethod(method_pattern, jwk) {
335
- const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
329
+ function createDagJwe(cleartext, recipients) {
330
+ const ptr0 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
336
331
  const len0 = WASM_VECTOR_LEN;
337
- const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
338
- const len1 = WASM_VECTOR_LEN;
339
- const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
332
+ const ret = wasm.createDagJwe(cleartext, ptr0, len0);
340
333
  return ret;
341
334
  }
342
- __name(keyToVerificationMethod, "keyToVerificationMethod");
343
- function didToVerificationMethod(did) {
344
- const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
345
- const len0 = WASM_VECTOR_LEN;
346
- const ret = wasm.didToVerificationMethod(ptr0, len0);
347
- return ret;
335
+ __name(createDagJwe, "createDagJwe");
336
+ function generateSecp256k1KeyFromBytes(bytes) {
337
+ let deferred3_0;
338
+ let deferred3_1;
339
+ try {
340
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
341
+ const len0 = WASM_VECTOR_LEN;
342
+ const ret = wasm.generateSecp256k1KeyFromBytes(ptr0, len0);
343
+ var ptr2 = ret[0];
344
+ var len2 = ret[1];
345
+ if (ret[3]) {
346
+ ptr2 = 0;
347
+ len2 = 0;
348
+ throw takeFromExternrefTable0(ret[2]);
349
+ }
350
+ deferred3_0 = ptr2;
351
+ deferred3_1 = len2;
352
+ return getStringFromWasm0(ptr2, len2);
353
+ } finally {
354
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
355
+ }
348
356
  }
349
- __name(didToVerificationMethod, "didToVerificationMethod");
350
- function issueCredential(credential, proof_options, key, context_map) {
351
- const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
357
+ __name(generateSecp256k1KeyFromBytes, "generateSecp256k1KeyFromBytes");
358
+ function issuePresentation(presentation, proof_options, key, context_map) {
359
+ const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
352
360
  const len0 = WASM_VECTOR_LEN;
353
361
  const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
354
362
  const len1 = WASM_VECTOR_LEN;
@@ -356,60 +364,52 @@ function issueCredential(credential, proof_options, key, context_map) {
356
364
  const len2 = WASM_VECTOR_LEN;
357
365
  const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
358
366
  const len3 = WASM_VECTOR_LEN;
359
- const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
367
+ const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
360
368
  return ret;
361
369
  }
362
- __name(issueCredential, "issueCredential");
363
- function verifyCredential(vc, proof_options, context_map) {
364
- const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
370
+ __name(issuePresentation, "issuePresentation");
371
+ function resolveDID(did, input_metadata) {
372
+ const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
365
373
  const len0 = WASM_VECTOR_LEN;
366
- const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
374
+ const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
367
375
  const len1 = WASM_VECTOR_LEN;
368
- const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
369
- const len2 = WASM_VECTOR_LEN;
370
- const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
376
+ const ret = wasm.resolveDID(ptr0, len0, ptr1, len1);
371
377
  return ret;
372
378
  }
373
- __name(verifyCredential, "verifyCredential");
374
- function issuePresentation(presentation, proof_options, key, context_map) {
375
- const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
379
+ __name(resolveDID, "resolveDID");
380
+ function decryptJwe(jwe, jwks) {
381
+ const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
376
382
  const len0 = WASM_VECTOR_LEN;
377
- const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
383
+ const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
378
384
  const len1 = WASM_VECTOR_LEN;
379
- const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
380
- const len2 = WASM_VECTOR_LEN;
381
- const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
382
- const len3 = WASM_VECTOR_LEN;
383
- const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
385
+ const ret = wasm.decryptJwe(ptr0, len0, ptr1, len1);
384
386
  return ret;
385
387
  }
386
- __name(issuePresentation, "issuePresentation");
387
- function verifyPresentation(vp, proof_options, context_map) {
388
- const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
388
+ __name(decryptJwe, "decryptJwe");
389
+ function verifyCredential(vc, proof_options, context_map) {
390
+ const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
389
391
  const len0 = WASM_VECTOR_LEN;
390
392
  const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
391
393
  const len1 = WASM_VECTOR_LEN;
392
394
  const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
393
395
  const len2 = WASM_VECTOR_LEN;
394
- const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
396
+ const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
395
397
  return ret;
396
398
  }
397
- __name(verifyPresentation, "verifyPresentation");
398
- function contextLoader(url) {
399
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
400
- const len0 = WASM_VECTOR_LEN;
401
- const ret = wasm.contextLoader(ptr0, len0);
399
+ __name(verifyCredential, "verifyCredential");
400
+ function clearCache() {
401
+ const ret = wasm.clearCache();
402
402
  return ret;
403
403
  }
404
- __name(contextLoader, "contextLoader");
404
+ __name(clearCache, "clearCache");
405
405
  function __wbg_adapter_54(arg0, arg1, arg2) {
406
- wasm.closure4184_externref_shim(arg0, arg1, arg2);
406
+ wasm.closure4007_externref_shim(arg0, arg1, arg2);
407
407
  }
408
408
  __name(__wbg_adapter_54, "__wbg_adapter_54");
409
- function __wbg_adapter_222(arg0, arg1, arg2, arg3) {
410
- wasm.closure4586_externref_shim(arg0, arg1, arg2, arg3);
409
+ function __wbg_adapter_200(arg0, arg1, arg2, arg3) {
410
+ wasm.closure4398_externref_shim(arg0, arg1, arg2, arg3);
411
411
  }
412
- __name(__wbg_adapter_222, "__wbg_adapter_222");
412
+ __name(__wbg_adapter_200, "__wbg_adapter_200");
413
413
  var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
414
414
  var __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
415
415
  async function __wbg_load(module2, imports) {
@@ -481,7 +481,7 @@ function __wbg_get_imports() {
481
481
  const ret = arg0.crypto;
482
482
  return ret;
483
483
  };
484
- imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
484
+ imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
485
485
  const ret = arg0.crypto;
486
486
  return ret;
487
487
  };
@@ -508,16 +508,11 @@ function __wbg_get_imports() {
508
508
  imports.wbg.__wbg_getRandomValues_371e7ade8bd92088 = function(arg0, arg1) {
509
509
  arg0.getRandomValues(arg1);
510
510
  };
511
- imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() {
512
- return handleError(function(arg0, arg1) {
513
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
514
- }, arguments);
515
- };
516
511
  imports.wbg.__wbg_getRandomValues_7dfe5bd1b67c9ca1 = function(arg0) {
517
512
  const ret = arg0.getRandomValues;
518
513
  return ret;
519
514
  };
520
- imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() {
515
+ imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() {
521
516
  return handleError(function(arg0, arg1) {
522
517
  arg0.getRandomValues(arg1);
523
518
  }, arguments);
@@ -610,7 +605,7 @@ function __wbg_get_imports() {
610
605
  const ret = arg0.length;
611
606
  return ret;
612
607
  };
613
- imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
608
+ imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
614
609
  const ret = arg0.msCrypto;
615
610
  return ret;
616
611
  };
@@ -635,7 +630,7 @@ function __wbg_get_imports() {
635
630
  const a = state0.a;
636
631
  state0.a = 0;
637
632
  try {
638
- return __wbg_adapter_222(a, state0.b, arg02, arg12);
633
+ return __wbg_adapter_200(a, state0.b, arg02, arg12);
639
634
  } finally {
640
635
  state0.a = a;
641
636
  }
@@ -696,7 +691,7 @@ function __wbg_get_imports() {
696
691
  return ret;
697
692
  }, arguments);
698
693
  };
699
- imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
694
+ imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
700
695
  const ret = arg0.node;
701
696
  return ret;
702
697
  };
@@ -704,7 +699,7 @@ function __wbg_get_imports() {
704
699
  const ret = arg0.now();
705
700
  return ret;
706
701
  };
707
- imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
702
+ imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) {
708
703
  const ret = arg0.process;
709
704
  return ret;
710
705
  };
@@ -722,7 +717,7 @@ function __wbg_get_imports() {
722
717
  imports.wbg.__wbg_randomFillSync_994ac6d9ade7a695 = function(arg0, arg1, arg2) {
723
718
  arg0.randomFillSync(getArrayU8FromWasm0(arg1, arg2));
724
719
  };
725
- imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() {
720
+ imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() {
726
721
  return handleError(function(arg0, arg1) {
727
722
  arg0.randomFillSync(arg1);
728
723
  }, arguments);
@@ -731,7 +726,7 @@ function __wbg_get_imports() {
731
726
  const ret = arg0.require(getStringFromWasm0(arg1, arg2));
732
727
  return ret;
733
728
  };
734
- imports.wbg.__wbg_require_60cc747a6bc5215a = function() {
729
+ imports.wbg.__wbg_require_79b1e9274cde3c87 = function() {
735
730
  return handleError(function() {
736
731
  const ret = module.require;
737
732
  return ret;
@@ -841,7 +836,7 @@ function __wbg_get_imports() {
841
836
  const ret = arg0.value;
842
837
  return ret;
843
838
  };
844
- imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
839
+ imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
845
840
  const ret = arg0.versions;
846
841
  return ret;
847
842
  };
@@ -877,8 +872,8 @@ function __wbg_get_imports() {
877
872
  const ret = false;
878
873
  return ret;
879
874
  };
880
- imports.wbg.__wbindgen_closure_wrapper12250 = function(arg0, arg1, arg2) {
881
- const ret = makeMutClosure(arg0, arg1, 4185, __wbg_adapter_54);
875
+ imports.wbg.__wbindgen_closure_wrapper12039 = function(arg0, arg1, arg2) {
876
+ const ret = makeMutClosure(arg0, arg1, 4008, __wbg_adapter_54);
882
877
  return ret;
883
878
  };
884
879
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
@@ -1009,7 +1004,7 @@ var didkit_wasm_default = __wbg_init;
1009
1004
  // src/didkit/index.ts
1010
1005
  var initialized = false;
1011
1006
  var generating = false;
1012
- var init = /* @__PURE__ */ __name(async (arg = "https://cdn.filestackcontent.com/HReKwBTm2Wha4Wlo4uwe") => {
1007
+ var init = /* @__PURE__ */ __name(async (arg = "https://cdn.filestackcontent.com/Vhyjqv0NTnmViw4TLmlj") => {
1013
1008
  while (generating) await new Promise((res) => setTimeout(res, 250));
1014
1009
  if (initialized) return;
1015
1010
  try {