@learncard/didkit-plugin 1.8.7 → 1.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/didkit/didkit_wasm.d.ts +29 -29
- package/dist/didkit/didkit_wasm.js +321 -326
- package/dist/didkit/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit/didkit_wasm_bg.wasm.d.ts +2 -2
- package/dist/didkit-plugin.cjs.development.js +119 -124
- package/dist/didkit-plugin.cjs.development.js.map +2 -2
- package/dist/didkit-plugin.cjs.production.min.js +2 -2
- package/dist/didkit-plugin.cjs.production.min.js.map +3 -3
- package/dist/didkit-plugin.esm.js +119 -124
- package/dist/didkit-plugin.esm.js.map +2 -2
- package/dist/didkit_wasm.d.ts +29 -29
- package/dist/didkit_wasm.js +321 -326
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit_wasm_bg.wasm.d.ts +2 -2
- package/package.json +3 -3
package/dist/didkit_wasm.js
CHANGED
|
@@ -202,41 +202,34 @@ function debugString(val) {
|
|
|
202
202
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
203
203
|
return className;
|
|
204
204
|
}
|
|
205
|
-
|
|
206
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
207
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
208
|
-
for (let i = 0; i < array.length; i++) {
|
|
209
|
-
const add = addToExternrefTable0(array[i]);
|
|
210
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
211
|
-
}
|
|
212
|
-
WASM_VECTOR_LEN = array.length;
|
|
213
|
-
return ptr;
|
|
214
|
-
}
|
|
215
205
|
/**
|
|
216
|
-
* @param {string}
|
|
217
|
-
* @param {string[]} jwks
|
|
206
|
+
* @param {string} delegation
|
|
218
207
|
* @returns {Promise<any>}
|
|
219
208
|
*/
|
|
220
|
-
export function
|
|
221
|
-
const ptr0 = passStringToWasm0(
|
|
209
|
+
export function verifyDelegation(delegation) {
|
|
210
|
+
const ptr0 = passStringToWasm0(delegation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
222
211
|
const len0 = WASM_VECTOR_LEN;
|
|
223
|
-
const
|
|
224
|
-
const len1 = WASM_VECTOR_LEN;
|
|
225
|
-
const ret = wasm.decryptDagJwe(ptr0, len0, ptr1, len1);
|
|
212
|
+
const ret = wasm.verifyDelegation(ptr0, len0);
|
|
226
213
|
return ret;
|
|
227
214
|
}
|
|
228
215
|
|
|
229
216
|
/**
|
|
230
|
-
* @param {string}
|
|
231
|
-
* @param {string}
|
|
217
|
+
* @param {string} holder
|
|
218
|
+
* @param {string} linked_data_proof_options
|
|
219
|
+
* @param {string} key
|
|
220
|
+
* @param {string} context_map
|
|
232
221
|
* @returns {Promise<any>}
|
|
233
222
|
*/
|
|
234
|
-
export function
|
|
235
|
-
const ptr0 = passStringToWasm0(
|
|
223
|
+
export function DIDAuth(holder, linked_data_proof_options, key, context_map) {
|
|
224
|
+
const ptr0 = passStringToWasm0(holder, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
236
225
|
const len0 = WASM_VECTOR_LEN;
|
|
237
|
-
const ptr1 = passStringToWasm0(
|
|
226
|
+
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
238
227
|
const len1 = WASM_VECTOR_LEN;
|
|
239
|
-
const
|
|
228
|
+
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
229
|
+
const len2 = WASM_VECTOR_LEN;
|
|
230
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
231
|
+
const len3 = WASM_VECTOR_LEN;
|
|
232
|
+
const ret = wasm.DIDAuth(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
240
233
|
return ret;
|
|
241
234
|
}
|
|
242
235
|
|
|
@@ -261,84 +254,139 @@ export function issueCredential(credential, proof_options, key, context_map) {
|
|
|
261
254
|
}
|
|
262
255
|
|
|
263
256
|
/**
|
|
264
|
-
* @param {string}
|
|
265
|
-
* @param {string}
|
|
266
|
-
* @param {string}
|
|
257
|
+
* @param {string} capability
|
|
258
|
+
* @param {string} preparation
|
|
259
|
+
* @param {string} signature
|
|
267
260
|
* @returns {Promise<any>}
|
|
268
261
|
*/
|
|
269
|
-
export function
|
|
270
|
-
const ptr0 = passStringToWasm0(
|
|
262
|
+
export function completeDelegateCapability(capability, preparation, signature) {
|
|
263
|
+
const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
271
264
|
const len0 = WASM_VECTOR_LEN;
|
|
272
|
-
const ptr1 = passStringToWasm0(
|
|
265
|
+
const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
273
266
|
const len1 = WASM_VECTOR_LEN;
|
|
274
|
-
const ptr2 = passStringToWasm0(
|
|
267
|
+
const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
275
268
|
const len2 = WASM_VECTOR_LEN;
|
|
276
|
-
const ret = wasm.
|
|
269
|
+
const ret = wasm.completeDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
277
270
|
return ret;
|
|
278
271
|
}
|
|
279
272
|
|
|
280
273
|
/**
|
|
281
|
-
* @param {string}
|
|
282
|
-
* @param {string}
|
|
283
|
-
* @param {string}
|
|
274
|
+
* @param {string} vp
|
|
275
|
+
* @param {string} proof_options
|
|
276
|
+
* @param {string} context_map
|
|
284
277
|
* @returns {Promise<any>}
|
|
285
278
|
*/
|
|
286
|
-
export function
|
|
287
|
-
const ptr0 = passStringToWasm0(
|
|
279
|
+
export function verifyPresentation(vp, proof_options, context_map) {
|
|
280
|
+
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
288
281
|
const len0 = WASM_VECTOR_LEN;
|
|
289
|
-
const ptr1 = passStringToWasm0(
|
|
282
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
290
283
|
const len1 = WASM_VECTOR_LEN;
|
|
291
|
-
const ptr2 = passStringToWasm0(
|
|
284
|
+
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
292
285
|
const len2 = WASM_VECTOR_LEN;
|
|
293
|
-
const ret = wasm.
|
|
286
|
+
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
294
287
|
return ret;
|
|
295
288
|
}
|
|
296
289
|
|
|
297
290
|
/**
|
|
298
291
|
* @param {string} invocation
|
|
299
|
-
* @param {string}
|
|
292
|
+
* @param {string} preparation
|
|
293
|
+
* @param {string} signature
|
|
300
294
|
* @returns {Promise<any>}
|
|
301
295
|
*/
|
|
302
|
-
export function
|
|
296
|
+
export function completeInvokeCapability(invocation, preparation, signature) {
|
|
303
297
|
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
304
298
|
const len0 = WASM_VECTOR_LEN;
|
|
305
|
-
const ptr1 = passStringToWasm0(
|
|
299
|
+
const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
306
300
|
const len1 = WASM_VECTOR_LEN;
|
|
307
|
-
const
|
|
301
|
+
const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
302
|
+
const len2 = WASM_VECTOR_LEN;
|
|
303
|
+
const ret = wasm.completeInvokeCapability(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
308
304
|
return ret;
|
|
309
305
|
}
|
|
310
306
|
|
|
311
307
|
/**
|
|
312
|
-
* @param {string}
|
|
313
|
-
* @param {string}
|
|
314
|
-
* @param {string}
|
|
315
|
-
* @param {string}
|
|
308
|
+
* @param {string} capability
|
|
309
|
+
* @param {string} linked_data_proof_options
|
|
310
|
+
* @param {string} parents
|
|
311
|
+
* @param {string} public_key
|
|
316
312
|
* @returns {Promise<any>}
|
|
317
313
|
*/
|
|
318
|
-
export function
|
|
319
|
-
const ptr0 = passStringToWasm0(
|
|
314
|
+
export function prepareDelegateCapability(capability, linked_data_proof_options, parents, public_key) {
|
|
315
|
+
const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
320
316
|
const len0 = WASM_VECTOR_LEN;
|
|
321
|
-
const ptr1 = passStringToWasm0(
|
|
317
|
+
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
322
318
|
const len1 = WASM_VECTOR_LEN;
|
|
323
|
-
const ptr2 = passStringToWasm0(
|
|
319
|
+
const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
324
320
|
const len2 = WASM_VECTOR_LEN;
|
|
325
|
-
const ptr3 = passStringToWasm0(
|
|
321
|
+
const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
326
322
|
const len3 = WASM_VECTOR_LEN;
|
|
327
|
-
const ret = wasm.
|
|
323
|
+
const ret = wasm.prepareDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
328
324
|
return ret;
|
|
329
325
|
}
|
|
330
326
|
|
|
331
327
|
/**
|
|
332
|
-
* @param {string}
|
|
333
|
-
* @param {string[]} jwks
|
|
328
|
+
* @param {string} url
|
|
334
329
|
* @returns {Promise<any>}
|
|
335
330
|
*/
|
|
336
|
-
export function
|
|
337
|
-
const ptr0 = passStringToWasm0(
|
|
331
|
+
export function contextLoader(url) {
|
|
332
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
338
333
|
const len0 = WASM_VECTOR_LEN;
|
|
339
|
-
const
|
|
334
|
+
const ret = wasm.contextLoader(ptr0, len0);
|
|
335
|
+
return ret;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function takeFromExternrefTable0(idx) {
|
|
339
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
340
|
+
wasm.__externref_table_dealloc(idx);
|
|
341
|
+
return value;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* @returns {string}
|
|
345
|
+
*/
|
|
346
|
+
export function generateSecp256k1Key() {
|
|
347
|
+
let deferred2_0;
|
|
348
|
+
let deferred2_1;
|
|
349
|
+
try {
|
|
350
|
+
const ret = wasm.generateSecp256k1Key();
|
|
351
|
+
var ptr1 = ret[0];
|
|
352
|
+
var len1 = ret[1];
|
|
353
|
+
if (ret[3]) {
|
|
354
|
+
ptr1 = 0; len1 = 0;
|
|
355
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
356
|
+
}
|
|
357
|
+
deferred2_0 = ptr1;
|
|
358
|
+
deferred2_1 = len1;
|
|
359
|
+
return getStringFromWasm0(ptr1, len1);
|
|
360
|
+
} finally {
|
|
361
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @param {string} invocation
|
|
367
|
+
* @returns {Promise<any>}
|
|
368
|
+
*/
|
|
369
|
+
export function verifyInvocationSignature(invocation) {
|
|
370
|
+
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
371
|
+
const len0 = WASM_VECTOR_LEN;
|
|
372
|
+
const ret = wasm.verifyInvocationSignature(ptr0, len0);
|
|
373
|
+
return ret;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* @param {string} presentation
|
|
378
|
+
* @param {string} preparation
|
|
379
|
+
* @param {string} signature
|
|
380
|
+
* @returns {Promise<any>}
|
|
381
|
+
*/
|
|
382
|
+
export function completeIssuePresentation(presentation, preparation, signature) {
|
|
383
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
384
|
+
const len0 = WASM_VECTOR_LEN;
|
|
385
|
+
const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
340
386
|
const len1 = WASM_VECTOR_LEN;
|
|
341
|
-
const
|
|
387
|
+
const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
388
|
+
const len2 = WASM_VECTOR_LEN;
|
|
389
|
+
const ret = wasm.completeIssuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
342
390
|
return ret;
|
|
343
391
|
}
|
|
344
392
|
|
|
@@ -348,23 +396,17 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
348
396
|
WASM_VECTOR_LEN = arg.length;
|
|
349
397
|
return ptr;
|
|
350
398
|
}
|
|
351
|
-
|
|
352
|
-
function takeFromExternrefTable0(idx) {
|
|
353
|
-
const value = wasm.__wbindgen_export_4.get(idx);
|
|
354
|
-
wasm.__externref_table_dealloc(idx);
|
|
355
|
-
return value;
|
|
356
|
-
}
|
|
357
399
|
/**
|
|
358
400
|
* @param {Uint8Array} bytes
|
|
359
401
|
* @returns {string}
|
|
360
402
|
*/
|
|
361
|
-
export function
|
|
403
|
+
export function generateEd25519KeyFromBytes(bytes) {
|
|
362
404
|
let deferred3_0;
|
|
363
405
|
let deferred3_1;
|
|
364
406
|
try {
|
|
365
407
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
366
408
|
const len0 = WASM_VECTOR_LEN;
|
|
367
|
-
const ret = wasm.
|
|
409
|
+
const ret = wasm.generateEd25519KeyFromBytes(ptr0, len0);
|
|
368
410
|
var ptr2 = ret[0];
|
|
369
411
|
var len2 = ret[1];
|
|
370
412
|
if (ret[3]) {
|
|
@@ -381,186 +423,210 @@ export function generateSecp256k1KeyFromBytes(bytes) {
|
|
|
381
423
|
|
|
382
424
|
/**
|
|
383
425
|
* @param {string} invocation
|
|
384
|
-
* @param {string}
|
|
385
|
-
* @param {string} linked_data_proof_options
|
|
386
|
-
* @param {string} key
|
|
426
|
+
* @param {string} delegation
|
|
387
427
|
* @returns {Promise<any>}
|
|
388
428
|
*/
|
|
389
|
-
export function
|
|
429
|
+
export function verifyInvocation(invocation, delegation) {
|
|
390
430
|
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
391
431
|
const len0 = WASM_VECTOR_LEN;
|
|
392
|
-
const ptr1 = passStringToWasm0(
|
|
432
|
+
const ptr1 = passStringToWasm0(delegation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
393
433
|
const len1 = WASM_VECTOR_LEN;
|
|
394
|
-
const
|
|
395
|
-
const len2 = WASM_VECTOR_LEN;
|
|
396
|
-
const ptr3 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
397
|
-
const len3 = WASM_VECTOR_LEN;
|
|
398
|
-
const ret = wasm.invokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
434
|
+
const ret = wasm.verifyInvocation(ptr0, len0, ptr1, len1);
|
|
399
435
|
return ret;
|
|
400
436
|
}
|
|
401
437
|
|
|
438
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
439
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
440
|
+
for (let i = 0; i < array.length; i++) {
|
|
441
|
+
const add = addToExternrefTable0(array[i]);
|
|
442
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
443
|
+
}
|
|
444
|
+
WASM_VECTOR_LEN = array.length;
|
|
445
|
+
return ptr;
|
|
446
|
+
}
|
|
402
447
|
/**
|
|
403
|
-
* @param {string}
|
|
404
|
-
* @param {string}
|
|
405
|
-
* @param {string} public_key
|
|
448
|
+
* @param {string} cleartext
|
|
449
|
+
* @param {string[]} recipients
|
|
406
450
|
* @returns {Promise<any>}
|
|
407
451
|
*/
|
|
408
|
-
export function
|
|
409
|
-
const ptr0 = passStringToWasm0(
|
|
452
|
+
export function createJwe(cleartext, recipients) {
|
|
453
|
+
const ptr0 = passStringToWasm0(cleartext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
410
454
|
const len0 = WASM_VECTOR_LEN;
|
|
411
|
-
const ptr1 =
|
|
455
|
+
const ptr1 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
|
|
412
456
|
const len1 = WASM_VECTOR_LEN;
|
|
413
|
-
const
|
|
414
|
-
const len2 = WASM_VECTOR_LEN;
|
|
415
|
-
const ret = wasm.prepareIssueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
457
|
+
const ret = wasm.createJwe(ptr0, len0, ptr1, len1);
|
|
416
458
|
return ret;
|
|
417
459
|
}
|
|
418
460
|
|
|
419
461
|
/**
|
|
420
|
-
* @param {string}
|
|
421
|
-
* @param {string}
|
|
422
|
-
* @param {string} key
|
|
423
|
-
* @param {string} context_map
|
|
462
|
+
* @param {string} did
|
|
463
|
+
* @param {string} input_metadata
|
|
424
464
|
* @returns {Promise<any>}
|
|
425
465
|
*/
|
|
426
|
-
export function
|
|
427
|
-
const ptr0 = passStringToWasm0(
|
|
466
|
+
export function didResolver(did, input_metadata) {
|
|
467
|
+
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
428
468
|
const len0 = WASM_VECTOR_LEN;
|
|
429
|
-
const ptr1 = passStringToWasm0(
|
|
469
|
+
const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
430
470
|
const len1 = WASM_VECTOR_LEN;
|
|
431
|
-
const
|
|
432
|
-
const len2 = WASM_VECTOR_LEN;
|
|
433
|
-
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
434
|
-
const len3 = WASM_VECTOR_LEN;
|
|
435
|
-
const ret = wasm.DIDAuth(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
471
|
+
const ret = wasm.didResolver(ptr0, len0, ptr1, len1);
|
|
436
472
|
return ret;
|
|
437
473
|
}
|
|
438
474
|
|
|
439
475
|
/**
|
|
440
|
-
* @
|
|
441
|
-
|
|
442
|
-
|
|
476
|
+
* @returns {string}
|
|
477
|
+
*/
|
|
478
|
+
export function generateEd25519Key() {
|
|
479
|
+
let deferred2_0;
|
|
480
|
+
let deferred2_1;
|
|
481
|
+
try {
|
|
482
|
+
const ret = wasm.generateEd25519Key();
|
|
483
|
+
var ptr1 = ret[0];
|
|
484
|
+
var len1 = ret[1];
|
|
485
|
+
if (ret[3]) {
|
|
486
|
+
ptr1 = 0; len1 = 0;
|
|
487
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
488
|
+
}
|
|
489
|
+
deferred2_0 = ptr1;
|
|
490
|
+
deferred2_1 = len1;
|
|
491
|
+
return getStringFromWasm0(ptr1, len1);
|
|
492
|
+
} finally {
|
|
493
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* @param {string} method_pattern
|
|
499
|
+
* @param {string} jwk
|
|
443
500
|
* @returns {Promise<any>}
|
|
444
501
|
*/
|
|
445
|
-
export function
|
|
446
|
-
const ptr0 = passStringToWasm0(
|
|
502
|
+
export function keyToVerificationMethod(method_pattern, jwk) {
|
|
503
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
447
504
|
const len0 = WASM_VECTOR_LEN;
|
|
448
|
-
const ptr1 = passStringToWasm0(
|
|
505
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
449
506
|
const len1 = WASM_VECTOR_LEN;
|
|
450
|
-
const
|
|
451
|
-
const len2 = WASM_VECTOR_LEN;
|
|
452
|
-
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
507
|
+
const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
|
|
453
508
|
return ret;
|
|
454
509
|
}
|
|
455
510
|
|
|
456
511
|
/**
|
|
457
|
-
* @param {string}
|
|
458
|
-
* @param {string} proof_options
|
|
459
|
-
* @param {string} context_map
|
|
512
|
+
* @param {string} did
|
|
460
513
|
* @returns {Promise<any>}
|
|
461
514
|
*/
|
|
462
|
-
export function
|
|
463
|
-
const ptr0 = passStringToWasm0(
|
|
515
|
+
export function didToVerificationMethod(did) {
|
|
516
|
+
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
464
517
|
const len0 = WASM_VECTOR_LEN;
|
|
465
|
-
const
|
|
466
|
-
const len1 = WASM_VECTOR_LEN;
|
|
467
|
-
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
468
|
-
const len2 = WASM_VECTOR_LEN;
|
|
469
|
-
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
518
|
+
const ret = wasm.didToVerificationMethod(ptr0, len0);
|
|
470
519
|
return ret;
|
|
471
520
|
}
|
|
472
521
|
|
|
473
522
|
/**
|
|
474
|
-
* @param {string}
|
|
523
|
+
* @param {string} jwe
|
|
524
|
+
* @param {string[]} jwks
|
|
475
525
|
* @returns {Promise<any>}
|
|
476
526
|
*/
|
|
477
|
-
export function
|
|
478
|
-
const ptr0 = passStringToWasm0(
|
|
527
|
+
export function decryptDagJwe(jwe, jwks) {
|
|
528
|
+
const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
479
529
|
const len0 = WASM_VECTOR_LEN;
|
|
480
|
-
const
|
|
530
|
+
const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
|
|
531
|
+
const len1 = WASM_VECTOR_LEN;
|
|
532
|
+
const ret = wasm.decryptDagJwe(ptr0, len0, ptr1, len1);
|
|
481
533
|
return ret;
|
|
482
534
|
}
|
|
483
535
|
|
|
484
536
|
/**
|
|
485
|
-
* @param {
|
|
486
|
-
* @param {string
|
|
537
|
+
* @param {string} capability
|
|
538
|
+
* @param {string} linked_data_proof_options
|
|
539
|
+
* @param {string} parents
|
|
540
|
+
* @param {string} key
|
|
487
541
|
* @returns {Promise<any>}
|
|
488
542
|
*/
|
|
489
|
-
export function
|
|
490
|
-
const ptr0 =
|
|
543
|
+
export function delegateCapability(capability, linked_data_proof_options, parents, key) {
|
|
544
|
+
const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
491
545
|
const len0 = WASM_VECTOR_LEN;
|
|
492
|
-
const
|
|
546
|
+
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
547
|
+
const len1 = WASM_VECTOR_LEN;
|
|
548
|
+
const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
549
|
+
const len2 = WASM_VECTOR_LEN;
|
|
550
|
+
const ptr3 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
551
|
+
const len3 = WASM_VECTOR_LEN;
|
|
552
|
+
const ret = wasm.delegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
493
553
|
return ret;
|
|
494
554
|
}
|
|
495
555
|
|
|
496
556
|
/**
|
|
497
557
|
* @param {string} method_pattern
|
|
498
558
|
* @param {string} jwk
|
|
499
|
-
* @returns {
|
|
559
|
+
* @returns {string}
|
|
500
560
|
*/
|
|
501
|
-
export function
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
561
|
+
export function keyToDID(method_pattern, jwk) {
|
|
562
|
+
let deferred4_0;
|
|
563
|
+
let deferred4_1;
|
|
564
|
+
try {
|
|
565
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
566
|
+
const len0 = WASM_VECTOR_LEN;
|
|
567
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
568
|
+
const len1 = WASM_VECTOR_LEN;
|
|
569
|
+
const ret = wasm.keyToDID(ptr0, len0, ptr1, len1);
|
|
570
|
+
var ptr3 = ret[0];
|
|
571
|
+
var len3 = ret[1];
|
|
572
|
+
if (ret[3]) {
|
|
573
|
+
ptr3 = 0; len3 = 0;
|
|
574
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
575
|
+
}
|
|
576
|
+
deferred4_0 = ptr3;
|
|
577
|
+
deferred4_1 = len3;
|
|
578
|
+
return getStringFromWasm0(ptr3, len3);
|
|
579
|
+
} finally {
|
|
580
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
581
|
+
}
|
|
508
582
|
}
|
|
509
583
|
|
|
510
584
|
/**
|
|
511
|
-
* @param {
|
|
512
|
-
* @param {string}
|
|
513
|
-
* @param {string} signature
|
|
585
|
+
* @param {any} cleartext
|
|
586
|
+
* @param {string[]} recipients
|
|
514
587
|
* @returns {Promise<any>}
|
|
515
588
|
*/
|
|
516
|
-
export function
|
|
517
|
-
const ptr0 =
|
|
589
|
+
export function createDagJwe(cleartext, recipients) {
|
|
590
|
+
const ptr0 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
|
|
518
591
|
const len0 = WASM_VECTOR_LEN;
|
|
519
|
-
const
|
|
520
|
-
const len1 = WASM_VECTOR_LEN;
|
|
521
|
-
const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
522
|
-
const len2 = WASM_VECTOR_LEN;
|
|
523
|
-
const ret = wasm.completeIssuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
592
|
+
const ret = wasm.createDagJwe(cleartext, ptr0, len0);
|
|
524
593
|
return ret;
|
|
525
594
|
}
|
|
526
595
|
|
|
527
596
|
/**
|
|
528
|
-
* @param {string}
|
|
597
|
+
* @param {string} invocation
|
|
598
|
+
* @param {string} target_id
|
|
529
599
|
* @param {string} linked_data_proof_options
|
|
530
|
-
* @param {string} parents
|
|
531
600
|
* @param {string} key
|
|
532
601
|
* @returns {Promise<any>}
|
|
533
602
|
*/
|
|
534
|
-
export function
|
|
535
|
-
const ptr0 = passStringToWasm0(
|
|
603
|
+
export function invokeCapability(invocation, target_id, linked_data_proof_options, key) {
|
|
604
|
+
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
536
605
|
const len0 = WASM_VECTOR_LEN;
|
|
537
|
-
const ptr1 = passStringToWasm0(
|
|
606
|
+
const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
538
607
|
const len1 = WASM_VECTOR_LEN;
|
|
539
|
-
const ptr2 = passStringToWasm0(
|
|
608
|
+
const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
540
609
|
const len2 = WASM_VECTOR_LEN;
|
|
541
610
|
const ptr3 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
542
611
|
const len3 = WASM_VECTOR_LEN;
|
|
543
|
-
const ret = wasm.
|
|
612
|
+
const ret = wasm.invokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
544
613
|
return ret;
|
|
545
614
|
}
|
|
546
615
|
|
|
547
616
|
/**
|
|
548
|
-
* @param {string}
|
|
617
|
+
* @param {string} credential
|
|
549
618
|
* @param {string} linked_data_proof_options
|
|
550
|
-
* @param {string} parents
|
|
551
619
|
* @param {string} public_key
|
|
552
620
|
* @returns {Promise<any>}
|
|
553
621
|
*/
|
|
554
|
-
export function
|
|
555
|
-
const ptr0 = passStringToWasm0(
|
|
622
|
+
export function prepareIssueCredential(credential, linked_data_proof_options, public_key) {
|
|
623
|
+
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
556
624
|
const len0 = WASM_VECTOR_LEN;
|
|
557
625
|
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
558
626
|
const len1 = WASM_VECTOR_LEN;
|
|
559
|
-
const ptr2 = passStringToWasm0(
|
|
627
|
+
const ptr2 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
628
|
const len2 = WASM_VECTOR_LEN;
|
|
561
|
-
const
|
|
562
|
-
const len3 = WASM_VECTOR_LEN;
|
|
563
|
-
const ret = wasm.prepareDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
629
|
+
const ret = wasm.prepareIssueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
564
630
|
return ret;
|
|
565
631
|
}
|
|
566
632
|
|
|
@@ -576,95 +642,98 @@ export function JWKFromTezos(tz) {
|
|
|
576
642
|
}
|
|
577
643
|
|
|
578
644
|
/**
|
|
645
|
+
* @param {Uint8Array} bytes
|
|
579
646
|
* @returns {string}
|
|
580
647
|
*/
|
|
581
|
-
export function
|
|
582
|
-
let
|
|
583
|
-
let
|
|
648
|
+
export function generateSecp256k1KeyFromBytes(bytes) {
|
|
649
|
+
let deferred3_0;
|
|
650
|
+
let deferred3_1;
|
|
584
651
|
try {
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
|
|
652
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
653
|
+
const len0 = WASM_VECTOR_LEN;
|
|
654
|
+
const ret = wasm.generateSecp256k1KeyFromBytes(ptr0, len0);
|
|
655
|
+
var ptr2 = ret[0];
|
|
656
|
+
var len2 = ret[1];
|
|
588
657
|
if (ret[3]) {
|
|
589
|
-
|
|
658
|
+
ptr2 = 0; len2 = 0;
|
|
590
659
|
throw takeFromExternrefTable0(ret[2]);
|
|
591
660
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
return getStringFromWasm0(
|
|
661
|
+
deferred3_0 = ptr2;
|
|
662
|
+
deferred3_1 = len2;
|
|
663
|
+
return getStringFromWasm0(ptr2, len2);
|
|
595
664
|
} finally {
|
|
596
|
-
wasm.__wbindgen_free(
|
|
665
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
597
666
|
}
|
|
598
667
|
}
|
|
599
668
|
|
|
600
669
|
/**
|
|
601
|
-
* @param {string}
|
|
602
|
-
* @param {string}
|
|
603
|
-
* @param {string}
|
|
604
|
-
* @param {string}
|
|
670
|
+
* @param {string} presentation
|
|
671
|
+
* @param {string} proof_options
|
|
672
|
+
* @param {string} key
|
|
673
|
+
* @param {string} context_map
|
|
605
674
|
* @returns {Promise<any>}
|
|
606
675
|
*/
|
|
607
|
-
export function
|
|
608
|
-
const ptr0 = passStringToWasm0(
|
|
676
|
+
export function issuePresentation(presentation, proof_options, key, context_map) {
|
|
677
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
609
678
|
const len0 = WASM_VECTOR_LEN;
|
|
610
|
-
const ptr1 = passStringToWasm0(
|
|
679
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
611
680
|
const len1 = WASM_VECTOR_LEN;
|
|
612
|
-
const ptr2 = passStringToWasm0(
|
|
681
|
+
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
613
682
|
const len2 = WASM_VECTOR_LEN;
|
|
614
|
-
const ptr3 = passStringToWasm0(
|
|
683
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
615
684
|
const len3 = WASM_VECTOR_LEN;
|
|
616
|
-
const ret = wasm.
|
|
685
|
+
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
617
686
|
return ret;
|
|
618
687
|
}
|
|
619
688
|
|
|
620
689
|
/**
|
|
621
|
-
* @
|
|
690
|
+
* @param {string} presentation
|
|
691
|
+
* @param {string} linked_data_proof_options
|
|
692
|
+
* @param {string} public_key
|
|
693
|
+
* @returns {Promise<any>}
|
|
622
694
|
*/
|
|
623
|
-
export function
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
633
|
-
}
|
|
634
|
-
deferred2_0 = ptr1;
|
|
635
|
-
deferred2_1 = len1;
|
|
636
|
-
return getStringFromWasm0(ptr1, len1);
|
|
637
|
-
} finally {
|
|
638
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
639
|
-
}
|
|
695
|
+
export function prepareIssuePresentation(presentation, linked_data_proof_options, public_key) {
|
|
696
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
697
|
+
const len0 = WASM_VECTOR_LEN;
|
|
698
|
+
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
699
|
+
const len1 = WASM_VECTOR_LEN;
|
|
700
|
+
const ptr2 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
701
|
+
const len2 = WASM_VECTOR_LEN;
|
|
702
|
+
const ret = wasm.prepareIssuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
703
|
+
return ret;
|
|
640
704
|
}
|
|
641
705
|
|
|
642
706
|
/**
|
|
643
|
-
* @param {string}
|
|
707
|
+
* @param {string} credential
|
|
644
708
|
* @param {string} preparation
|
|
645
709
|
* @param {string} signature
|
|
646
710
|
* @returns {Promise<any>}
|
|
647
711
|
*/
|
|
648
|
-
export function
|
|
649
|
-
const ptr0 = passStringToWasm0(
|
|
712
|
+
export function completeIssueCredential(credential, preparation, signature) {
|
|
713
|
+
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
650
714
|
const len0 = WASM_VECTOR_LEN;
|
|
651
715
|
const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
652
716
|
const len1 = WASM_VECTOR_LEN;
|
|
653
717
|
const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
654
718
|
const len2 = WASM_VECTOR_LEN;
|
|
655
|
-
const ret = wasm.
|
|
719
|
+
const ret = wasm.completeIssueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
656
720
|
return ret;
|
|
657
721
|
}
|
|
658
722
|
|
|
659
723
|
/**
|
|
660
|
-
* @
|
|
661
|
-
* @returns {Promise<any>}
|
|
724
|
+
* @returns {string}
|
|
662
725
|
*/
|
|
663
|
-
export function
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
726
|
+
export function getVersion() {
|
|
727
|
+
let deferred1_0;
|
|
728
|
+
let deferred1_1;
|
|
729
|
+
try {
|
|
730
|
+
const ret = wasm.getVersion();
|
|
731
|
+
deferred1_0 = ret[0];
|
|
732
|
+
deferred1_1 = ret[1];
|
|
733
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
734
|
+
} finally {
|
|
735
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
736
|
+
}
|
|
668
737
|
}
|
|
669
738
|
|
|
670
739
|
/**
|
|
@@ -682,141 +751,70 @@ export function resolveDID(did, input_metadata) {
|
|
|
682
751
|
}
|
|
683
752
|
|
|
684
753
|
/**
|
|
754
|
+
* @param {string} invocation
|
|
755
|
+
* @param {string} target_id
|
|
756
|
+
* @param {string} linked_data_proof_options
|
|
757
|
+
* @param {string} public_key
|
|
685
758
|
* @returns {Promise<any>}
|
|
686
759
|
*/
|
|
687
|
-
export function
|
|
688
|
-
const
|
|
689
|
-
return ret;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* @param {string} cleartext
|
|
694
|
-
* @param {string[]} recipients
|
|
695
|
-
* @returns {Promise<any>}
|
|
696
|
-
*/
|
|
697
|
-
export function createJwe(cleartext, recipients) {
|
|
698
|
-
const ptr0 = passStringToWasm0(cleartext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
760
|
+
export function prepareInvokeCapability(invocation, target_id, linked_data_proof_options, public_key) {
|
|
761
|
+
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
699
762
|
const len0 = WASM_VECTOR_LEN;
|
|
700
|
-
const ptr1 =
|
|
763
|
+
const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
701
764
|
const len1 = WASM_VECTOR_LEN;
|
|
702
|
-
const
|
|
765
|
+
const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
766
|
+
const len2 = WASM_VECTOR_LEN;
|
|
767
|
+
const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
768
|
+
const len3 = WASM_VECTOR_LEN;
|
|
769
|
+
const ret = wasm.prepareInvokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
703
770
|
return ret;
|
|
704
771
|
}
|
|
705
772
|
|
|
706
773
|
/**
|
|
707
|
-
* @param {string}
|
|
774
|
+
* @param {string} jwe
|
|
775
|
+
* @param {string[]} jwks
|
|
708
776
|
* @returns {Promise<any>}
|
|
709
777
|
*/
|
|
710
|
-
export function
|
|
711
|
-
const ptr0 = passStringToWasm0(
|
|
778
|
+
export function decryptJwe(jwe, jwks) {
|
|
779
|
+
const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
712
780
|
const len0 = WASM_VECTOR_LEN;
|
|
713
|
-
const
|
|
781
|
+
const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
|
|
782
|
+
const len1 = WASM_VECTOR_LEN;
|
|
783
|
+
const ret = wasm.decryptJwe(ptr0, len0, ptr1, len1);
|
|
714
784
|
return ret;
|
|
715
785
|
}
|
|
716
786
|
|
|
717
787
|
/**
|
|
718
|
-
* @param {string}
|
|
719
|
-
* @param {string}
|
|
720
|
-
* @param {string}
|
|
788
|
+
* @param {string} vc
|
|
789
|
+
* @param {string} proof_options
|
|
790
|
+
* @param {string} context_map
|
|
721
791
|
* @returns {Promise<any>}
|
|
722
792
|
*/
|
|
723
|
-
export function
|
|
724
|
-
const ptr0 = passStringToWasm0(
|
|
793
|
+
export function verifyCredential(vc, proof_options, context_map) {
|
|
794
|
+
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
725
795
|
const len0 = WASM_VECTOR_LEN;
|
|
726
|
-
const ptr1 = passStringToWasm0(
|
|
796
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
727
797
|
const len1 = WASM_VECTOR_LEN;
|
|
728
|
-
const ptr2 = passStringToWasm0(
|
|
798
|
+
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
729
799
|
const len2 = WASM_VECTOR_LEN;
|
|
730
|
-
const ret = wasm.
|
|
800
|
+
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
731
801
|
return ret;
|
|
732
802
|
}
|
|
733
803
|
|
|
734
804
|
/**
|
|
735
|
-
* @param {string} did
|
|
736
805
|
* @returns {Promise<any>}
|
|
737
806
|
*/
|
|
738
|
-
export function
|
|
739
|
-
const
|
|
740
|
-
const len0 = WASM_VECTOR_LEN;
|
|
741
|
-
const ret = wasm.didToVerificationMethod(ptr0, len0);
|
|
807
|
+
export function clearCache() {
|
|
808
|
+
const ret = wasm.clearCache();
|
|
742
809
|
return ret;
|
|
743
810
|
}
|
|
744
811
|
|
|
745
|
-
/**
|
|
746
|
-
* @returns {string}
|
|
747
|
-
*/
|
|
748
|
-
export function getVersion() {
|
|
749
|
-
let deferred1_0;
|
|
750
|
-
let deferred1_1;
|
|
751
|
-
try {
|
|
752
|
-
const ret = wasm.getVersion();
|
|
753
|
-
deferred1_0 = ret[0];
|
|
754
|
-
deferred1_1 = ret[1];
|
|
755
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
756
|
-
} finally {
|
|
757
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* @param {string} method_pattern
|
|
763
|
-
* @param {string} jwk
|
|
764
|
-
* @returns {string}
|
|
765
|
-
*/
|
|
766
|
-
export function keyToDID(method_pattern, jwk) {
|
|
767
|
-
let deferred4_0;
|
|
768
|
-
let deferred4_1;
|
|
769
|
-
try {
|
|
770
|
-
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
771
|
-
const len0 = WASM_VECTOR_LEN;
|
|
772
|
-
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
773
|
-
const len1 = WASM_VECTOR_LEN;
|
|
774
|
-
const ret = wasm.keyToDID(ptr0, len0, ptr1, len1);
|
|
775
|
-
var ptr3 = ret[0];
|
|
776
|
-
var len3 = ret[1];
|
|
777
|
-
if (ret[3]) {
|
|
778
|
-
ptr3 = 0; len3 = 0;
|
|
779
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
780
|
-
}
|
|
781
|
-
deferred4_0 = ptr3;
|
|
782
|
-
deferred4_1 = len3;
|
|
783
|
-
return getStringFromWasm0(ptr3, len3);
|
|
784
|
-
} finally {
|
|
785
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
/**
|
|
790
|
-
* @param {Uint8Array} bytes
|
|
791
|
-
* @returns {string}
|
|
792
|
-
*/
|
|
793
|
-
export function generateEd25519KeyFromBytes(bytes) {
|
|
794
|
-
let deferred3_0;
|
|
795
|
-
let deferred3_1;
|
|
796
|
-
try {
|
|
797
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
798
|
-
const len0 = WASM_VECTOR_LEN;
|
|
799
|
-
const ret = wasm.generateEd25519KeyFromBytes(ptr0, len0);
|
|
800
|
-
var ptr2 = ret[0];
|
|
801
|
-
var len2 = ret[1];
|
|
802
|
-
if (ret[3]) {
|
|
803
|
-
ptr2 = 0; len2 = 0;
|
|
804
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
805
|
-
}
|
|
806
|
-
deferred3_0 = ptr2;
|
|
807
|
-
deferred3_1 = len2;
|
|
808
|
-
return getStringFromWasm0(ptr2, len2);
|
|
809
|
-
} finally {
|
|
810
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
|
|
814
812
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
815
|
-
wasm.
|
|
813
|
+
wasm.closure4007_externref_shim(arg0, arg1, arg2);
|
|
816
814
|
}
|
|
817
815
|
|
|
818
|
-
function
|
|
819
|
-
wasm.
|
|
816
|
+
function __wbg_adapter_200(arg0, arg1, arg2, arg3) {
|
|
817
|
+
wasm.closure4398_externref_shim(arg0, arg1, arg2, arg3);
|
|
820
818
|
}
|
|
821
819
|
|
|
822
820
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -890,7 +888,7 @@ function __wbg_get_imports() {
|
|
|
890
888
|
const ret = arg0.crypto;
|
|
891
889
|
return ret;
|
|
892
890
|
};
|
|
893
|
-
imports.wbg.
|
|
891
|
+
imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
|
|
894
892
|
const ret = arg0.crypto;
|
|
895
893
|
return ret;
|
|
896
894
|
};
|
|
@@ -917,14 +915,11 @@ function __wbg_get_imports() {
|
|
|
917
915
|
imports.wbg.__wbg_getRandomValues_371e7ade8bd92088 = function(arg0, arg1) {
|
|
918
916
|
arg0.getRandomValues(arg1);
|
|
919
917
|
};
|
|
920
|
-
imports.wbg.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
|
|
921
|
-
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
922
|
-
}, arguments) };
|
|
923
918
|
imports.wbg.__wbg_getRandomValues_7dfe5bd1b67c9ca1 = function(arg0) {
|
|
924
919
|
const ret = arg0.getRandomValues;
|
|
925
920
|
return ret;
|
|
926
921
|
};
|
|
927
|
-
imports.wbg.
|
|
922
|
+
imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
|
|
928
923
|
arg0.getRandomValues(arg1);
|
|
929
924
|
}, arguments) };
|
|
930
925
|
imports.wbg.__wbg_getTime_46267b1c24877e30 = function(arg0) {
|
|
@@ -1011,7 +1006,7 @@ function __wbg_get_imports() {
|
|
|
1011
1006
|
const ret = arg0.length;
|
|
1012
1007
|
return ret;
|
|
1013
1008
|
};
|
|
1014
|
-
imports.wbg.
|
|
1009
|
+
imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
1015
1010
|
const ret = arg0.msCrypto;
|
|
1016
1011
|
return ret;
|
|
1017
1012
|
};
|
|
@@ -1034,7 +1029,7 @@ function __wbg_get_imports() {
|
|
|
1034
1029
|
const a = state0.a;
|
|
1035
1030
|
state0.a = 0;
|
|
1036
1031
|
try {
|
|
1037
|
-
return
|
|
1032
|
+
return __wbg_adapter_200(a, state0.b, arg0, arg1);
|
|
1038
1033
|
} finally {
|
|
1039
1034
|
state0.a = a;
|
|
1040
1035
|
}
|
|
@@ -1089,7 +1084,7 @@ function __wbg_get_imports() {
|
|
|
1089
1084
|
const ret = arg0.next();
|
|
1090
1085
|
return ret;
|
|
1091
1086
|
}, arguments) };
|
|
1092
|
-
imports.wbg.
|
|
1087
|
+
imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
|
|
1093
1088
|
const ret = arg0.node;
|
|
1094
1089
|
return ret;
|
|
1095
1090
|
};
|
|
@@ -1097,7 +1092,7 @@ function __wbg_get_imports() {
|
|
|
1097
1092
|
const ret = arg0.now();
|
|
1098
1093
|
return ret;
|
|
1099
1094
|
};
|
|
1100
|
-
imports.wbg.
|
|
1095
|
+
imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) {
|
|
1101
1096
|
const ret = arg0.process;
|
|
1102
1097
|
return ret;
|
|
1103
1098
|
};
|
|
@@ -1115,14 +1110,14 @@ function __wbg_get_imports() {
|
|
|
1115
1110
|
imports.wbg.__wbg_randomFillSync_994ac6d9ade7a695 = function(arg0, arg1, arg2) {
|
|
1116
1111
|
arg0.randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
1117
1112
|
};
|
|
1118
|
-
imports.wbg.
|
|
1113
|
+
imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
|
|
1119
1114
|
arg0.randomFillSync(arg1);
|
|
1120
1115
|
}, arguments) };
|
|
1121
1116
|
imports.wbg.__wbg_require_0d6aeaec3c042c88 = function(arg0, arg1, arg2) {
|
|
1122
1117
|
const ret = arg0.require(getStringFromWasm0(arg1, arg2));
|
|
1123
1118
|
return ret;
|
|
1124
1119
|
};
|
|
1125
|
-
imports.wbg.
|
|
1120
|
+
imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
|
|
1126
1121
|
const ret = module.require;
|
|
1127
1122
|
return ret;
|
|
1128
1123
|
}, arguments) };
|
|
@@ -1224,7 +1219,7 @@ function __wbg_get_imports() {
|
|
|
1224
1219
|
const ret = arg0.value;
|
|
1225
1220
|
return ret;
|
|
1226
1221
|
};
|
|
1227
|
-
imports.wbg.
|
|
1222
|
+
imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
|
|
1228
1223
|
const ret = arg0.versions;
|
|
1229
1224
|
return ret;
|
|
1230
1225
|
};
|
|
@@ -1260,8 +1255,8 @@ function __wbg_get_imports() {
|
|
|
1260
1255
|
const ret = false;
|
|
1261
1256
|
return ret;
|
|
1262
1257
|
};
|
|
1263
|
-
imports.wbg.
|
|
1264
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1258
|
+
imports.wbg.__wbindgen_closure_wrapper12039 = function(arg0, arg1, arg2) {
|
|
1259
|
+
const ret = makeMutClosure(arg0, arg1, 4008, __wbg_adapter_54);
|
|
1265
1260
|
return ret;
|
|
1266
1261
|
};
|
|
1267
1262
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|