@learncard/didkit-plugin 1.10.11 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,17 +4,8 @@ export function getVersion(): string;
4
4
  export function completeIssuePresentation(presentation: string, preparation: string, signature: string): Promise<any>;
5
5
  export function verifyPresentation(vp: string, proof_options: string, context_map: string): Promise<any>;
6
6
  export function DIDAuth(holder: string, linked_data_proof_options: string, key: string, context_map: string): Promise<any>;
7
- export function verifyInvocation(invocation: string, delegation: string): Promise<any>;
8
- export function contextLoader(url: string): Promise<any>;
9
7
  export function JWKFromTezos(tz: string): Promise<any>;
10
- export function delegateCapability(capability: string, linked_data_proof_options: string, parents: string, key: string): Promise<any>;
11
- export function prepareDelegateCapability(capability: string, linked_data_proof_options: string, parents: string, public_key: string): Promise<any>;
12
- export function completeDelegateCapability(capability: string, preparation: string, signature: string): Promise<any>;
13
- export function verifyDelegation(delegation: string): Promise<any>;
14
- export function invokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, key: string): Promise<any>;
15
- export function prepareInvokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, public_key: string): Promise<any>;
16
- export function completeInvokeCapability(invocation: string, preparation: string, signature: string): Promise<any>;
17
- export function verifyInvocationSignature(invocation: string): Promise<any>;
8
+ export function contextLoader(url: string): Promise<any>;
18
9
  export function clearCache(): Promise<any>;
19
10
  export function didResolver(did: string, input_metadata: string): Promise<any>;
20
11
  export function resolveDID(did: string, input_metadata: string): Promise<any>;
@@ -40,13 +31,9 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
40
31
 
41
32
  export interface InitOutput {
42
33
  readonly memory: WebAssembly.Memory;
43
- readonly didkit_error_code: () => number;
44
- readonly didkit_error_message: () => number;
45
34
  readonly DIDAuth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
46
35
  readonly JWKFromTezos: (a: number, b: number) => number;
47
36
  readonly clearCache: () => number;
48
- readonly completeDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
49
- readonly completeInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
50
37
  readonly completeIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
51
38
  readonly completeIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
52
39
  readonly contextLoader: (a: number, b: number) => number;
@@ -54,7 +41,6 @@ export interface InitOutput {
54
41
  readonly createJwe: (a: number, b: number, c: number, d: number) => number;
55
42
  readonly decryptDagJwe: (a: number, b: number, c: number, d: number) => number;
56
43
  readonly decryptJwe: (a: number, b: number, c: number, d: number) => number;
57
- readonly delegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
58
44
  readonly didResolver: (a: number, b: number, c: number, d: number) => number;
59
45
  readonly didToVerificationMethod: (a: number, b: number) => number;
60
46
  readonly generateEd25519Key: (a: number) => void;
@@ -62,29 +48,25 @@ export interface InitOutput {
62
48
  readonly generateSecp256k1Key: (a: number) => void;
63
49
  readonly generateSecp256k1KeyFromBytes: (a: number, b: number, c: number) => void;
64
50
  readonly getVersion: (a: number) => void;
65
- readonly invokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
66
51
  readonly issueCredential: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
67
52
  readonly issuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
68
53
  readonly keyToDID: (a: number, b: number, c: number, d: number, e: number) => void;
69
54
  readonly keyToVerificationMethod: (a: number, b: number, c: number, d: number) => number;
70
- readonly prepareDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
71
- readonly prepareInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
72
55
  readonly prepareIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
73
56
  readonly prepareIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
74
57
  readonly resolveDID: (a: number, b: number, c: number, d: number) => number;
75
58
  readonly verifyCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
76
- readonly verifyDelegation: (a: number, b: number) => number;
77
- readonly verifyInvocation: (a: number, b: number, c: number, d: number) => number;
78
- readonly verifyInvocationSignature: (a: number, b: number) => number;
79
59
  readonly verifyPresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
60
+ readonly didkit_error_code: () => number;
61
+ readonly didkit_error_message: () => number;
80
62
  readonly __wbindgen_export_0: (a: number, b: number) => number;
81
63
  readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
82
64
  readonly __wbindgen_export_2: (a: number) => void;
83
65
  readonly __wbindgen_export_3: WebAssembly.Table;
84
66
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
85
67
  readonly __wbindgen_export_4: (a: number, b: number, c: number) => void;
86
- readonly __wbindgen_export_5: (a: number, b: number, c: number) => void;
87
- readonly __wbindgen_export_6: (a: number, b: number) => void;
68
+ readonly __wbindgen_export_5: (a: number, b: number) => void;
69
+ readonly __wbindgen_export_6: (a: number, b: number, c: number) => void;
88
70
  readonly __wbindgen_export_7: (a: number, b: number, c: number, d: number) => void;
89
71
  }
90
72
 
@@ -311,31 +311,6 @@ export function DIDAuth(holder, linked_data_proof_options, key, context_map) {
311
311
  return takeObject(ret);
312
312
  }
313
313
 
314
- /**
315
- * @param {string} invocation
316
- * @param {string} delegation
317
- * @returns {Promise<any>}
318
- */
319
- export function verifyInvocation(invocation, delegation) {
320
- const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
321
- const len0 = WASM_VECTOR_LEN;
322
- const ptr1 = passStringToWasm0(delegation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
323
- const len1 = WASM_VECTOR_LEN;
324
- const ret = wasm.verifyInvocation(ptr0, len0, ptr1, len1);
325
- return takeObject(ret);
326
- }
327
-
328
- /**
329
- * @param {string} url
330
- * @returns {Promise<any>}
331
- */
332
- export function contextLoader(url) {
333
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
334
- const len0 = WASM_VECTOR_LEN;
335
- const ret = wasm.contextLoader(ptr0, len0);
336
- return takeObject(ret);
337
- }
338
-
339
314
  /**
340
315
  * @param {string} tz
341
316
  * @returns {Promise<any>}
@@ -348,138 +323,13 @@ export function JWKFromTezos(tz) {
348
323
  }
349
324
 
350
325
  /**
351
- * @param {string} capability
352
- * @param {string} linked_data_proof_options
353
- * @param {string} parents
354
- * @param {string} key
355
- * @returns {Promise<any>}
356
- */
357
- export function delegateCapability(capability, linked_data_proof_options, parents, key) {
358
- const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
359
- const len0 = WASM_VECTOR_LEN;
360
- const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
361
- const len1 = WASM_VECTOR_LEN;
362
- const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
363
- const len2 = WASM_VECTOR_LEN;
364
- const ptr3 = passStringToWasm0(key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
365
- const len3 = WASM_VECTOR_LEN;
366
- const ret = wasm.delegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
367
- return takeObject(ret);
368
- }
369
-
370
- /**
371
- * @param {string} capability
372
- * @param {string} linked_data_proof_options
373
- * @param {string} parents
374
- * @param {string} public_key
375
- * @returns {Promise<any>}
376
- */
377
- export function prepareDelegateCapability(capability, linked_data_proof_options, parents, public_key) {
378
- const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
379
- const len0 = WASM_VECTOR_LEN;
380
- const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
381
- const len1 = WASM_VECTOR_LEN;
382
- const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
383
- const len2 = WASM_VECTOR_LEN;
384
- const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
385
- const len3 = WASM_VECTOR_LEN;
386
- const ret = wasm.prepareDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
387
- return takeObject(ret);
388
- }
389
-
390
- /**
391
- * @param {string} capability
392
- * @param {string} preparation
393
- * @param {string} signature
394
- * @returns {Promise<any>}
395
- */
396
- export function completeDelegateCapability(capability, preparation, signature) {
397
- const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
398
- const len0 = WASM_VECTOR_LEN;
399
- const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
400
- const len1 = WASM_VECTOR_LEN;
401
- const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
402
- const len2 = WASM_VECTOR_LEN;
403
- const ret = wasm.completeDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2);
404
- return takeObject(ret);
405
- }
406
-
407
- /**
408
- * @param {string} delegation
409
- * @returns {Promise<any>}
410
- */
411
- export function verifyDelegation(delegation) {
412
- const ptr0 = passStringToWasm0(delegation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
413
- const len0 = WASM_VECTOR_LEN;
414
- const ret = wasm.verifyDelegation(ptr0, len0);
415
- return takeObject(ret);
416
- }
417
-
418
- /**
419
- * @param {string} invocation
420
- * @param {string} target_id
421
- * @param {string} linked_data_proof_options
422
- * @param {string} key
423
- * @returns {Promise<any>}
424
- */
425
- export function invokeCapability(invocation, target_id, linked_data_proof_options, key) {
426
- const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
427
- const len0 = WASM_VECTOR_LEN;
428
- const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
429
- const len1 = WASM_VECTOR_LEN;
430
- const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
431
- const len2 = WASM_VECTOR_LEN;
432
- const ptr3 = passStringToWasm0(key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
433
- const len3 = WASM_VECTOR_LEN;
434
- const ret = wasm.invokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
435
- return takeObject(ret);
436
- }
437
-
438
- /**
439
- * @param {string} invocation
440
- * @param {string} target_id
441
- * @param {string} linked_data_proof_options
442
- * @param {string} public_key
443
- * @returns {Promise<any>}
444
- */
445
- export function prepareInvokeCapability(invocation, target_id, linked_data_proof_options, public_key) {
446
- const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
447
- const len0 = WASM_VECTOR_LEN;
448
- const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
449
- const len1 = WASM_VECTOR_LEN;
450
- const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
451
- const len2 = WASM_VECTOR_LEN;
452
- const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
453
- const len3 = WASM_VECTOR_LEN;
454
- const ret = wasm.prepareInvokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
455
- return takeObject(ret);
456
- }
457
-
458
- /**
459
- * @param {string} invocation
460
- * @param {string} preparation
461
- * @param {string} signature
462
- * @returns {Promise<any>}
463
- */
464
- export function completeInvokeCapability(invocation, preparation, signature) {
465
- const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
466
- const len0 = WASM_VECTOR_LEN;
467
- const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
468
- const len1 = WASM_VECTOR_LEN;
469
- const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
470
- const len2 = WASM_VECTOR_LEN;
471
- const ret = wasm.completeInvokeCapability(ptr0, len0, ptr1, len1, ptr2, len2);
472
- return takeObject(ret);
473
- }
474
-
475
- /**
476
- * @param {string} invocation
326
+ * @param {string} url
477
327
  * @returns {Promise<any>}
478
328
  */
479
- export function verifyInvocationSignature(invocation) {
480
- const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
329
+ export function contextLoader(url) {
330
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
481
331
  const len0 = WASM_VECTOR_LEN;
482
- const ret = wasm.verifyInvocationSignature(ptr0, len0);
332
+ const ret = wasm.contextLoader(ptr0, len0);
483
333
  return takeObject(ret);
484
334
  }
485
335
 
@@ -873,15 +723,15 @@ export function decryptDagJwe(jwe, jwks) {
873
723
  return takeObject(ret);
874
724
  }
875
725
 
876
- function __wbg_adapter_6(arg0, arg1, arg2) {
877
- wasm.__wbindgen_export_5(arg0, arg1, addHeapObject(arg2));
726
+ function __wbg_adapter_12(arg0, arg1) {
727
+ wasm.__wbindgen_export_5(arg0, arg1);
878
728
  }
879
729
 
880
- function __wbg_adapter_19(arg0, arg1) {
881
- wasm.__wbindgen_export_6(arg0, arg1);
730
+ function __wbg_adapter_17(arg0, arg1, arg2) {
731
+ wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
882
732
  }
883
733
 
884
- function __wbg_adapter_107(arg0, arg1, arg2, arg3) {
734
+ function __wbg_adapter_98(arg0, arg1, arg2, arg3) {
885
735
  wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
886
736
  }
887
737
 
@@ -1102,7 +952,7 @@ function __wbg_get_imports() {
1102
952
  const a = state0.a;
1103
953
  state0.a = 0;
1104
954
  try {
1105
- return __wbg_adapter_107(a, state0.b, arg0, arg1);
955
+ return __wbg_adapter_98(a, state0.b, arg0, arg1);
1106
956
  } finally {
1107
957
  state0.a = a;
1108
958
  }
@@ -1368,11 +1218,6 @@ function __wbg_get_imports() {
1368
1218
  imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
1369
1219
  throw new Error(getStringFromWasm0(arg0, arg1));
1370
1220
  };
1371
- imports.wbg.__wbindgen_cast_1eaafab1968e741d = function(arg0, arg1) {
1372
- // Cast intrinsic for `Closure(Closure { dtor_idx: 639, function: Function { arguments: [], shim_idx: 640, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1373
- const ret = makeMutClosure(arg0, arg1, 639, __wbg_adapter_19);
1374
- return addHeapObject(ret);
1375
- };
1376
1221
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1377
1222
  // Cast intrinsic for `Ref(String) -> Externref`.
1378
1223
  const ret = getStringFromWasm0(arg0, arg1);
@@ -1388,9 +1233,9 @@ function __wbg_get_imports() {
1388
1233
  const ret = BigInt.asUintN(64, arg0);
1389
1234
  return addHeapObject(ret);
1390
1235
  };
1391
- imports.wbg.__wbindgen_cast_67d14185bb436b4e = function(arg0, arg1) {
1392
- // Cast intrinsic for `Closure(Closure { dtor_idx: 726, function: Function { arguments: [Externref], shim_idx: 727, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1393
- const ret = makeMutClosure(arg0, arg1, 726, __wbg_adapter_6);
1236
+ imports.wbg.__wbindgen_cast_97b2994476861e36 = function(arg0, arg1) {
1237
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 580, function: Function { arguments: [Externref], shim_idx: 581, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1238
+ const ret = makeMutClosure(arg0, arg1, 580, __wbg_adapter_17);
1394
1239
  return addHeapObject(ret);
1395
1240
  };
1396
1241
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
@@ -1403,6 +1248,11 @@ function __wbg_get_imports() {
1403
1248
  const ret = getArrayU8FromWasm0(arg0, arg1);
1404
1249
  return addHeapObject(ret);
1405
1250
  };
1251
+ imports.wbg.__wbindgen_cast_cfb4a7783b62dc83 = function(arg0, arg1) {
1252
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 487, function: Function { arguments: [], shim_idx: 488, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1253
+ const ret = makeMutClosure(arg0, arg1, 487, __wbg_adapter_12);
1254
+ return addHeapObject(ret);
1255
+ };
1406
1256
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1407
1257
  // Cast intrinsic for `F64 -> Externref`.
1408
1258
  const ret = arg0;
Binary file
@@ -1,13 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const didkit_error_code: () => number;
5
- export const didkit_error_message: () => number;
6
4
  export const DIDAuth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
7
5
  export const JWKFromTezos: (a: number, b: number) => number;
8
6
  export const clearCache: () => number;
9
- export const completeDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
10
- export const completeInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
11
7
  export const completeIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
12
8
  export const completeIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
13
9
  export const contextLoader: (a: number, b: number) => number;
@@ -15,7 +11,6 @@ export const createDagJwe: (a: number, b: number, c: number) => number;
15
11
  export const createJwe: (a: number, b: number, c: number, d: number) => number;
16
12
  export const decryptDagJwe: (a: number, b: number, c: number, d: number) => number;
17
13
  export const decryptJwe: (a: number, b: number, c: number, d: number) => number;
18
- export const delegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
19
14
  export const didResolver: (a: number, b: number, c: number, d: number) => number;
20
15
  export const didToVerificationMethod: (a: number, b: number) => number;
21
16
  export const generateEd25519Key: (a: number) => void;
@@ -23,27 +18,23 @@ export const generateEd25519KeyFromBytes: (a: number, b: number, c: number) => v
23
18
  export const generateSecp256k1Key: (a: number) => void;
24
19
  export const generateSecp256k1KeyFromBytes: (a: number, b: number, c: number) => void;
25
20
  export const getVersion: (a: number) => void;
26
- export const invokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
27
21
  export const issueCredential: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
28
22
  export const issuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
29
23
  export const keyToDID: (a: number, b: number, c: number, d: number, e: number) => void;
30
24
  export const keyToVerificationMethod: (a: number, b: number, c: number, d: number) => number;
31
- export const prepareDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
32
- export const prepareInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
33
25
  export const prepareIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
34
26
  export const prepareIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
35
27
  export const resolveDID: (a: number, b: number, c: number, d: number) => number;
36
28
  export const verifyCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
37
- export const verifyDelegation: (a: number, b: number) => number;
38
- export const verifyInvocation: (a: number, b: number, c: number, d: number) => number;
39
- export const verifyInvocationSignature: (a: number, b: number) => number;
40
29
  export const verifyPresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
30
+ export const didkit_error_code: () => number;
31
+ export const didkit_error_message: () => number;
41
32
  export const __wbindgen_export_0: (a: number, b: number) => number;
42
33
  export const __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
43
34
  export const __wbindgen_export_2: (a: number) => void;
44
35
  export const __wbindgen_export_3: WebAssembly.Table;
45
36
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
46
37
  export const __wbindgen_export_4: (a: number, b: number, c: number) => void;
47
- export const __wbindgen_export_5: (a: number, b: number, c: number) => void;
48
- export const __wbindgen_export_6: (a: number, b: number) => void;
38
+ export const __wbindgen_export_5: (a: number, b: number) => void;
39
+ export const __wbindgen_export_6: (a: number, b: number, c: number) => void;
49
40
  export const __wbindgen_export_7: (a: number, b: number, c: number, d: number) => void;
package/dist/plugin.d.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  import { InitInput } from './didkit/index';
2
2
  import { DIDKitPlugin } from './types';
3
3
  /**
4
- j
4
+ * Starts (or joins) the single DIDKit WASM init without building a plugin. Hosts can call it
5
+ * early so the first wallet build finds DIDKit warm. A rejection is safe to ignore: the next
6
+ * `initDidKit` / `getDidKitPlugin` call retries.
7
+ *
8
+ * @group Plugins
9
+ */
10
+ export declare const initDidKit: (input?: InitInput | Promise<InitInput>) => Promise<void>;
11
+ /**
5
12
  * @group Plugins
6
13
  */
7
14
  export declare const getDidKitPlugin: (input?: InitInput | Promise<InitInput>, allowRemoteContexts?: boolean) => Promise<DIDKitPlugin>;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAa,EACT,SAAS,EAkBZ,MAAM,gBAAgB,CAAC;AAQxB,OAAO,EAAE,YAAY,EAAa,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,eAAe,GACxB,QAAQ,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,EACtC,6BAA2B,KAC5B,OAAO,CAAC,YAAY,CAqLtB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAa,EACT,SAAS,EAkBZ,MAAM,gBAAgB,CAAC;AAQxB,OAAO,EAAE,YAAY,EAAa,MAAM,SAAS,CAAC;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,QAAQ,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,KAAG,OAAO,CAAC,IAAI,CAAgB,CAAC;AAEjG;;GAEG;AACH,eAAO,MAAM,eAAe,GACxB,QAAQ,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,EACtC,6BAA2B,KAC5B,OAAO,CAAC,YAAY,CAqLtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@learncard/didkit-plugin",
3
- "version": "1.10.11",
3
+ "version": "1.11.0",
4
4
  "description": "DIDKit (WASM) plugin for signing and verifying credentials and resolving DIDs.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -56,8 +56,8 @@
56
56
  },
57
57
  "types": "./dist/index.d.ts",
58
58
  "dependencies": {
59
- "@learncard/core": "9.4.45",
60
- "@learncard/types": "6.1.0"
59
+ "@learncard/core": "10.0.0",
60
+ "@learncard/types": "6.2.0"
61
61
  },
62
62
  "sideEffects": false
63
63
  }
@@ -11,30 +11,23 @@ export * from './pkg/didkit_wasm';
11
11
  * how Prettier wraps the `init` signature. Do not inline it back into the parameter list.
12
12
  */
13
13
  export const DEFAULT_DIDKIT_WASM_URL =
14
- 'https://assets.learncard.ai/didkit/sha256-ba3e2ec2208f6da57d94e47c332b3226f048e11d7a23093d50b184d849b6bc0b/didkit_wasm_bg.wasm';
14
+ 'https://assets.learncard.ai/didkit/sha256-ded761c91910068261077c0e2e0c574b6c8c6ba638c8805ad9550a4b90e4138e/didkit_wasm_bg.wasm';
15
15
 
16
- let initialized = false;
17
- let generating = false; // Mutex flag to allow first init call to acquire a lock
16
+ // One shared WASM init. Concurrent and repeated callers await the same promise; a failed
17
+ // init clears it so the next caller can retry instead of inheriting a poisoned rejection.
18
+ let initPromise: Promise<void> | undefined;
18
19
 
19
- export const init = async (arg: InitInput | Promise<InitInput> = DEFAULT_DIDKIT_WASM_URL) => {
20
- // Do not return until we are done generating!
21
- while (generating) await new Promise(res => setTimeout(res, 250));
20
+ export const init = (arg: InitInput | Promise<InitInput> = DEFAULT_DIDKIT_WASM_URL) => {
21
+ initPromise ??= _init({ module_or_path: arg }).then(
22
+ () => undefined,
23
+ error => {
24
+ initPromise = undefined;
22
25
 
23
- // allow calling multiple times without reinitializing
24
- if (initialized) return;
26
+ throw error;
27
+ }
28
+ );
25
29
 
26
- try {
27
- generating = true;
28
-
29
- await _init({ module_or_path: arg });
30
-
31
- generating = false;
32
- initialized = true;
33
- } catch (error) {
34
- generating = false;
35
-
36
- throw error;
37
- }
30
+ return initPromise;
38
31
  };
39
32
 
40
33
  export default init;
@@ -4,17 +4,8 @@ export function getVersion(): string;
4
4
  export function completeIssuePresentation(presentation: string, preparation: string, signature: string): Promise<any>;
5
5
  export function verifyPresentation(vp: string, proof_options: string, context_map: string): Promise<any>;
6
6
  export function DIDAuth(holder: string, linked_data_proof_options: string, key: string, context_map: string): Promise<any>;
7
- export function verifyInvocation(invocation: string, delegation: string): Promise<any>;
8
- export function contextLoader(url: string): Promise<any>;
9
7
  export function JWKFromTezos(tz: string): Promise<any>;
10
- export function delegateCapability(capability: string, linked_data_proof_options: string, parents: string, key: string): Promise<any>;
11
- export function prepareDelegateCapability(capability: string, linked_data_proof_options: string, parents: string, public_key: string): Promise<any>;
12
- export function completeDelegateCapability(capability: string, preparation: string, signature: string): Promise<any>;
13
- export function verifyDelegation(delegation: string): Promise<any>;
14
- export function invokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, key: string): Promise<any>;
15
- export function prepareInvokeCapability(invocation: string, target_id: string, linked_data_proof_options: string, public_key: string): Promise<any>;
16
- export function completeInvokeCapability(invocation: string, preparation: string, signature: string): Promise<any>;
17
- export function verifyInvocationSignature(invocation: string): Promise<any>;
8
+ export function contextLoader(url: string): Promise<any>;
18
9
  export function clearCache(): Promise<any>;
19
10
  export function didResolver(did: string, input_metadata: string): Promise<any>;
20
11
  export function resolveDID(did: string, input_metadata: string): Promise<any>;
@@ -40,13 +31,9 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
40
31
 
41
32
  export interface InitOutput {
42
33
  readonly memory: WebAssembly.Memory;
43
- readonly didkit_error_code: () => number;
44
- readonly didkit_error_message: () => number;
45
34
  readonly DIDAuth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
46
35
  readonly JWKFromTezos: (a: number, b: number) => number;
47
36
  readonly clearCache: () => number;
48
- readonly completeDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
49
- readonly completeInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
50
37
  readonly completeIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
51
38
  readonly completeIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
52
39
  readonly contextLoader: (a: number, b: number) => number;
@@ -54,7 +41,6 @@ export interface InitOutput {
54
41
  readonly createJwe: (a: number, b: number, c: number, d: number) => number;
55
42
  readonly decryptDagJwe: (a: number, b: number, c: number, d: number) => number;
56
43
  readonly decryptJwe: (a: number, b: number, c: number, d: number) => number;
57
- readonly delegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
58
44
  readonly didResolver: (a: number, b: number, c: number, d: number) => number;
59
45
  readonly didToVerificationMethod: (a: number, b: number) => number;
60
46
  readonly generateEd25519Key: (a: number) => void;
@@ -62,29 +48,25 @@ export interface InitOutput {
62
48
  readonly generateSecp256k1Key: (a: number) => void;
63
49
  readonly generateSecp256k1KeyFromBytes: (a: number, b: number, c: number) => void;
64
50
  readonly getVersion: (a: number) => void;
65
- readonly invokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
66
51
  readonly issueCredential: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
67
52
  readonly issuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
68
53
  readonly keyToDID: (a: number, b: number, c: number, d: number, e: number) => void;
69
54
  readonly keyToVerificationMethod: (a: number, b: number, c: number, d: number) => number;
70
- readonly prepareDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
71
- readonly prepareInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
72
55
  readonly prepareIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
73
56
  readonly prepareIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
74
57
  readonly resolveDID: (a: number, b: number, c: number, d: number) => number;
75
58
  readonly verifyCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
76
- readonly verifyDelegation: (a: number, b: number) => number;
77
- readonly verifyInvocation: (a: number, b: number, c: number, d: number) => number;
78
- readonly verifyInvocationSignature: (a: number, b: number) => number;
79
59
  readonly verifyPresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
60
+ readonly didkit_error_code: () => number;
61
+ readonly didkit_error_message: () => number;
80
62
  readonly __wbindgen_export_0: (a: number, b: number) => number;
81
63
  readonly __wbindgen_export_1: (a: number, b: number, c: number, d: number) => number;
82
64
  readonly __wbindgen_export_2: (a: number) => void;
83
65
  readonly __wbindgen_export_3: WebAssembly.Table;
84
66
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
85
67
  readonly __wbindgen_export_4: (a: number, b: number, c: number) => void;
86
- readonly __wbindgen_export_5: (a: number, b: number, c: number) => void;
87
- readonly __wbindgen_export_6: (a: number, b: number) => void;
68
+ readonly __wbindgen_export_5: (a: number, b: number) => void;
69
+ readonly __wbindgen_export_6: (a: number, b: number, c: number) => void;
88
70
  readonly __wbindgen_export_7: (a: number, b: number, c: number, d: number) => void;
89
71
  }
90
72