@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.
@@ -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/src/plugin.ts CHANGED
@@ -28,7 +28,15 @@ import {
28
28
  import { DIDKitPlugin, DidMethod } from './types';
29
29
 
30
30
  /**
31
- j
31
+ * Starts (or joins) the single DIDKit WASM init without building a plugin. Hosts can call it
32
+ * early so the first wallet build finds DIDKit warm. A rejection is safe to ignore: the next
33
+ * `initDidKit` / `getDidKitPlugin` call retries.
34
+ *
35
+ * @group Plugins
36
+ */
37
+ export const initDidKit = (input?: InitInput | Promise<InitInput>): Promise<void> => init(input);
38
+
39
+ /**
32
40
  * @group Plugins
33
41
  */
34
42
  export const getDidKitPlugin = async (