@learncard/didkit-plugin 1.8.4 → 1.8.7
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 +52 -52
- package/dist/didkit/didkit_wasm.js +326 -324
- package/dist/didkit/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit/didkit_wasm_bg.wasm.d.ts +27 -27
- package/dist/didkit-plugin.cjs.development.js +137 -137
- package/dist/didkit-plugin.cjs.development.js.map +2 -2
- package/dist/didkit-plugin.cjs.production.min.js +1 -1
- package/dist/didkit-plugin.cjs.production.min.js.map +3 -3
- package/dist/didkit-plugin.esm.js +137 -137
- package/dist/didkit-plugin.esm.js.map +2 -2
- package/dist/didkit_wasm.d.ts +52 -52
- package/dist/didkit_wasm.js +326 -324
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit_wasm_bg.wasm.d.ts +27 -27
- package/package.json +3 -3
|
@@ -202,27 +202,27 @@ 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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
try {
|
|
212
|
-
const ret = wasm.getVersion();
|
|
213
|
-
deferred1_0 = ret[0];
|
|
214
|
-
deferred1_1 = ret[1];
|
|
215
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
216
|
-
} finally {
|
|
217
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
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);
|
|
218
211
|
}
|
|
212
|
+
WASM_VECTOR_LEN = array.length;
|
|
213
|
+
return ptr;
|
|
219
214
|
}
|
|
220
|
-
|
|
221
215
|
/**
|
|
216
|
+
* @param {string} jwe
|
|
217
|
+
* @param {string[]} jwks
|
|
222
218
|
* @returns {Promise<any>}
|
|
223
219
|
*/
|
|
224
|
-
export function
|
|
225
|
-
const
|
|
220
|
+
export function decryptDagJwe(jwe, jwks) {
|
|
221
|
+
const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
222
|
+
const len0 = WASM_VECTOR_LEN;
|
|
223
|
+
const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
|
|
224
|
+
const len1 = WASM_VECTOR_LEN;
|
|
225
|
+
const ret = wasm.decryptDagJwe(ptr0, len0, ptr1, len1);
|
|
226
226
|
return ret;
|
|
227
227
|
}
|
|
228
228
|
|
|
@@ -241,170 +241,90 @@ export function didResolver(did, input_metadata) {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
|
-
* @param {string}
|
|
245
|
-
* @param {string}
|
|
244
|
+
* @param {string} credential
|
|
245
|
+
* @param {string} proof_options
|
|
246
|
+
* @param {string} key
|
|
247
|
+
* @param {string} context_map
|
|
246
248
|
* @returns {Promise<any>}
|
|
247
249
|
*/
|
|
248
|
-
export function
|
|
249
|
-
const ptr0 = passStringToWasm0(
|
|
250
|
+
export function issueCredential(credential, proof_options, key, context_map) {
|
|
251
|
+
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
250
252
|
const len0 = WASM_VECTOR_LEN;
|
|
251
|
-
const ptr1 = passStringToWasm0(
|
|
253
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
252
254
|
const len1 = WASM_VECTOR_LEN;
|
|
253
|
-
const
|
|
255
|
+
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
+
const len2 = WASM_VECTOR_LEN;
|
|
257
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
+
const len3 = WASM_VECTOR_LEN;
|
|
259
|
+
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
254
260
|
return ret;
|
|
255
261
|
}
|
|
256
262
|
|
|
257
|
-
function takeFromExternrefTable0(idx) {
|
|
258
|
-
const value = wasm.__wbindgen_export_4.get(idx);
|
|
259
|
-
wasm.__externref_table_dealloc(idx);
|
|
260
|
-
return value;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* @returns {string}
|
|
264
|
-
*/
|
|
265
|
-
export function generateEd25519Key() {
|
|
266
|
-
let deferred2_0;
|
|
267
|
-
let deferred2_1;
|
|
268
|
-
try {
|
|
269
|
-
const ret = wasm.generateEd25519Key();
|
|
270
|
-
var ptr1 = ret[0];
|
|
271
|
-
var len1 = ret[1];
|
|
272
|
-
if (ret[3]) {
|
|
273
|
-
ptr1 = 0; len1 = 0;
|
|
274
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
275
|
-
}
|
|
276
|
-
deferred2_0 = ptr1;
|
|
277
|
-
deferred2_1 = len1;
|
|
278
|
-
return getStringFromWasm0(ptr1, len1);
|
|
279
|
-
} finally {
|
|
280
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
285
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
286
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
287
|
-
WASM_VECTOR_LEN = arg.length;
|
|
288
|
-
return ptr;
|
|
289
|
-
}
|
|
290
263
|
/**
|
|
291
|
-
* @param {
|
|
292
|
-
* @
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
let deferred3_0;
|
|
296
|
-
let deferred3_1;
|
|
297
|
-
try {
|
|
298
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
299
|
-
const len0 = WASM_VECTOR_LEN;
|
|
300
|
-
const ret = wasm.generateEd25519KeyFromBytes(ptr0, len0);
|
|
301
|
-
var ptr2 = ret[0];
|
|
302
|
-
var len2 = ret[1];
|
|
303
|
-
if (ret[3]) {
|
|
304
|
-
ptr2 = 0; len2 = 0;
|
|
305
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
306
|
-
}
|
|
307
|
-
deferred3_0 = ptr2;
|
|
308
|
-
deferred3_1 = len2;
|
|
309
|
-
return getStringFromWasm0(ptr2, len2);
|
|
310
|
-
} finally {
|
|
311
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* @returns {string}
|
|
317
|
-
*/
|
|
318
|
-
export function generateSecp256k1Key() {
|
|
319
|
-
let deferred2_0;
|
|
320
|
-
let deferred2_1;
|
|
321
|
-
try {
|
|
322
|
-
const ret = wasm.generateSecp256k1Key();
|
|
323
|
-
var ptr1 = ret[0];
|
|
324
|
-
var len1 = ret[1];
|
|
325
|
-
if (ret[3]) {
|
|
326
|
-
ptr1 = 0; len1 = 0;
|
|
327
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
328
|
-
}
|
|
329
|
-
deferred2_0 = ptr1;
|
|
330
|
-
deferred2_1 = len1;
|
|
331
|
-
return getStringFromWasm0(ptr1, len1);
|
|
332
|
-
} finally {
|
|
333
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* @param {Uint8Array} bytes
|
|
339
|
-
* @returns {string}
|
|
264
|
+
* @param {string} presentation
|
|
265
|
+
* @param {string} linked_data_proof_options
|
|
266
|
+
* @param {string} public_key
|
|
267
|
+
* @returns {Promise<any>}
|
|
340
268
|
*/
|
|
341
|
-
export function
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (ret[3]) {
|
|
351
|
-
ptr2 = 0; len2 = 0;
|
|
352
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
353
|
-
}
|
|
354
|
-
deferred3_0 = ptr2;
|
|
355
|
-
deferred3_1 = len2;
|
|
356
|
-
return getStringFromWasm0(ptr2, len2);
|
|
357
|
-
} finally {
|
|
358
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
359
|
-
}
|
|
269
|
+
export function prepareIssuePresentation(presentation, linked_data_proof_options, public_key) {
|
|
270
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
272
|
+
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
273
|
+
const len1 = WASM_VECTOR_LEN;
|
|
274
|
+
const ptr2 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
275
|
+
const len2 = WASM_VECTOR_LEN;
|
|
276
|
+
const ret = wasm.prepareIssuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
277
|
+
return ret;
|
|
360
278
|
}
|
|
361
279
|
|
|
362
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
363
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
364
|
-
for (let i = 0; i < array.length; i++) {
|
|
365
|
-
const add = addToExternrefTable0(array[i]);
|
|
366
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
367
|
-
}
|
|
368
|
-
WASM_VECTOR_LEN = array.length;
|
|
369
|
-
return ptr;
|
|
370
|
-
}
|
|
371
280
|
/**
|
|
372
|
-
* @param {string}
|
|
373
|
-
* @param {string
|
|
281
|
+
* @param {string} credential
|
|
282
|
+
* @param {string} preparation
|
|
283
|
+
* @param {string} signature
|
|
374
284
|
* @returns {Promise<any>}
|
|
375
285
|
*/
|
|
376
|
-
export function
|
|
377
|
-
const ptr0 = passStringToWasm0(
|
|
286
|
+
export function completeIssueCredential(credential, preparation, signature) {
|
|
287
|
+
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
378
288
|
const len0 = WASM_VECTOR_LEN;
|
|
379
|
-
const ptr1 =
|
|
289
|
+
const ptr1 = passStringToWasm0(preparation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
380
290
|
const len1 = WASM_VECTOR_LEN;
|
|
381
|
-
const
|
|
291
|
+
const ptr2 = passStringToWasm0(signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
292
|
+
const len2 = WASM_VECTOR_LEN;
|
|
293
|
+
const ret = wasm.completeIssueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
382
294
|
return ret;
|
|
383
295
|
}
|
|
384
296
|
|
|
385
297
|
/**
|
|
386
|
-
* @param {string}
|
|
387
|
-
* @param {string
|
|
298
|
+
* @param {string} invocation
|
|
299
|
+
* @param {string} delegation
|
|
388
300
|
* @returns {Promise<any>}
|
|
389
301
|
*/
|
|
390
|
-
export function
|
|
391
|
-
const ptr0 = passStringToWasm0(
|
|
302
|
+
export function verifyInvocation(invocation, delegation) {
|
|
303
|
+
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
392
304
|
const len0 = WASM_VECTOR_LEN;
|
|
393
|
-
const ptr1 =
|
|
305
|
+
const ptr1 = passStringToWasm0(delegation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
394
306
|
const len1 = WASM_VECTOR_LEN;
|
|
395
|
-
const ret = wasm.
|
|
307
|
+
const ret = wasm.verifyInvocation(ptr0, len0, ptr1, len1);
|
|
396
308
|
return ret;
|
|
397
309
|
}
|
|
398
310
|
|
|
399
311
|
/**
|
|
400
|
-
* @param {
|
|
401
|
-
* @param {string
|
|
312
|
+
* @param {string} presentation
|
|
313
|
+
* @param {string} proof_options
|
|
314
|
+
* @param {string} key
|
|
315
|
+
* @param {string} context_map
|
|
402
316
|
* @returns {Promise<any>}
|
|
403
317
|
*/
|
|
404
|
-
export function
|
|
405
|
-
const ptr0 =
|
|
318
|
+
export function issuePresentation(presentation, proof_options, key, context_map) {
|
|
319
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
406
320
|
const len0 = WASM_VECTOR_LEN;
|
|
407
|
-
const
|
|
321
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
322
|
+
const len1 = WASM_VECTOR_LEN;
|
|
323
|
+
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
324
|
+
const len2 = WASM_VECTOR_LEN;
|
|
325
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
326
|
+
const len3 = WASM_VECTOR_LEN;
|
|
327
|
+
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
408
328
|
return ret;
|
|
409
329
|
}
|
|
410
330
|
|
|
@@ -413,119 +333,123 @@ export function createDagJwe(cleartext, recipients) {
|
|
|
413
333
|
* @param {string[]} jwks
|
|
414
334
|
* @returns {Promise<any>}
|
|
415
335
|
*/
|
|
416
|
-
export function
|
|
336
|
+
export function decryptJwe(jwe, jwks) {
|
|
417
337
|
const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
418
338
|
const len0 = WASM_VECTOR_LEN;
|
|
419
339
|
const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
|
|
420
340
|
const len1 = WASM_VECTOR_LEN;
|
|
421
|
-
const ret = wasm.
|
|
341
|
+
const ret = wasm.decryptJwe(ptr0, len0, ptr1, len1);
|
|
422
342
|
return ret;
|
|
423
343
|
}
|
|
424
344
|
|
|
345
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
346
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
347
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
348
|
+
WASM_VECTOR_LEN = arg.length;
|
|
349
|
+
return ptr;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function takeFromExternrefTable0(idx) {
|
|
353
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
354
|
+
wasm.__externref_table_dealloc(idx);
|
|
355
|
+
return value;
|
|
356
|
+
}
|
|
425
357
|
/**
|
|
426
|
-
* @param {
|
|
427
|
-
* @param {string} jwk
|
|
358
|
+
* @param {Uint8Array} bytes
|
|
428
359
|
* @returns {string}
|
|
429
360
|
*/
|
|
430
|
-
export function
|
|
431
|
-
let
|
|
432
|
-
let
|
|
361
|
+
export function generateSecp256k1KeyFromBytes(bytes) {
|
|
362
|
+
let deferred3_0;
|
|
363
|
+
let deferred3_1;
|
|
433
364
|
try {
|
|
434
|
-
const ptr0 =
|
|
365
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
435
366
|
const len0 = WASM_VECTOR_LEN;
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
var ptr3 = ret[0];
|
|
440
|
-
var len3 = ret[1];
|
|
367
|
+
const ret = wasm.generateSecp256k1KeyFromBytes(ptr0, len0);
|
|
368
|
+
var ptr2 = ret[0];
|
|
369
|
+
var len2 = ret[1];
|
|
441
370
|
if (ret[3]) {
|
|
442
|
-
|
|
371
|
+
ptr2 = 0; len2 = 0;
|
|
443
372
|
throw takeFromExternrefTable0(ret[2]);
|
|
444
373
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
return getStringFromWasm0(
|
|
374
|
+
deferred3_0 = ptr2;
|
|
375
|
+
deferred3_1 = len2;
|
|
376
|
+
return getStringFromWasm0(ptr2, len2);
|
|
448
377
|
} finally {
|
|
449
|
-
wasm.__wbindgen_free(
|
|
378
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
450
379
|
}
|
|
451
380
|
}
|
|
452
381
|
|
|
453
382
|
/**
|
|
454
|
-
* @param {string}
|
|
455
|
-
* @param {string}
|
|
383
|
+
* @param {string} invocation
|
|
384
|
+
* @param {string} target_id
|
|
385
|
+
* @param {string} linked_data_proof_options
|
|
386
|
+
* @param {string} key
|
|
456
387
|
* @returns {Promise<any>}
|
|
457
388
|
*/
|
|
458
|
-
export function
|
|
459
|
-
const ptr0 = passStringToWasm0(
|
|
389
|
+
export function invokeCapability(invocation, target_id, linked_data_proof_options, key) {
|
|
390
|
+
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
460
391
|
const len0 = WASM_VECTOR_LEN;
|
|
461
|
-
const ptr1 = passStringToWasm0(
|
|
392
|
+
const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
462
393
|
const len1 = WASM_VECTOR_LEN;
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
* @param {string} did
|
|
469
|
-
* @returns {Promise<any>}
|
|
470
|
-
*/
|
|
471
|
-
export function didToVerificationMethod(did) {
|
|
472
|
-
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
473
|
-
const len0 = WASM_VECTOR_LEN;
|
|
474
|
-
const ret = wasm.didToVerificationMethod(ptr0, len0);
|
|
394
|
+
const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
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);
|
|
475
399
|
return ret;
|
|
476
400
|
}
|
|
477
401
|
|
|
478
402
|
/**
|
|
479
403
|
* @param {string} credential
|
|
480
|
-
* @param {string}
|
|
481
|
-
* @param {string}
|
|
482
|
-
* @param {string} context_map
|
|
404
|
+
* @param {string} linked_data_proof_options
|
|
405
|
+
* @param {string} public_key
|
|
483
406
|
* @returns {Promise<any>}
|
|
484
407
|
*/
|
|
485
|
-
export function
|
|
408
|
+
export function prepareIssueCredential(credential, linked_data_proof_options, public_key) {
|
|
486
409
|
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
410
|
const len0 = WASM_VECTOR_LEN;
|
|
488
|
-
const ptr1 = passStringToWasm0(
|
|
411
|
+
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
489
412
|
const len1 = WASM_VECTOR_LEN;
|
|
490
|
-
const ptr2 = passStringToWasm0(
|
|
413
|
+
const ptr2 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
491
414
|
const len2 = WASM_VECTOR_LEN;
|
|
492
|
-
const
|
|
493
|
-
const len3 = WASM_VECTOR_LEN;
|
|
494
|
-
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
415
|
+
const ret = wasm.prepareIssueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
495
416
|
return ret;
|
|
496
417
|
}
|
|
497
418
|
|
|
498
419
|
/**
|
|
499
|
-
* @param {string}
|
|
420
|
+
* @param {string} holder
|
|
500
421
|
* @param {string} linked_data_proof_options
|
|
501
|
-
* @param {string}
|
|
422
|
+
* @param {string} key
|
|
423
|
+
* @param {string} context_map
|
|
502
424
|
* @returns {Promise<any>}
|
|
503
425
|
*/
|
|
504
|
-
export function
|
|
505
|
-
const ptr0 = passStringToWasm0(
|
|
426
|
+
export function DIDAuth(holder, linked_data_proof_options, key, context_map) {
|
|
427
|
+
const ptr0 = passStringToWasm0(holder, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
506
428
|
const len0 = WASM_VECTOR_LEN;
|
|
507
429
|
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
508
430
|
const len1 = WASM_VECTOR_LEN;
|
|
509
|
-
const ptr2 = passStringToWasm0(
|
|
431
|
+
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
510
432
|
const len2 = WASM_VECTOR_LEN;
|
|
511
|
-
const
|
|
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);
|
|
512
436
|
return ret;
|
|
513
437
|
}
|
|
514
438
|
|
|
515
439
|
/**
|
|
516
|
-
* @param {string}
|
|
517
|
-
* @param {string}
|
|
518
|
-
* @param {string}
|
|
440
|
+
* @param {string} vp
|
|
441
|
+
* @param {string} proof_options
|
|
442
|
+
* @param {string} context_map
|
|
519
443
|
* @returns {Promise<any>}
|
|
520
444
|
*/
|
|
521
|
-
export function
|
|
522
|
-
const ptr0 = passStringToWasm0(
|
|
445
|
+
export function verifyPresentation(vp, proof_options, context_map) {
|
|
446
|
+
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
523
447
|
const len0 = WASM_VECTOR_LEN;
|
|
524
|
-
const ptr1 = passStringToWasm0(
|
|
448
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
525
449
|
const len1 = WASM_VECTOR_LEN;
|
|
526
|
-
const ptr2 = passStringToWasm0(
|
|
450
|
+
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
527
451
|
const len2 = WASM_VECTOR_LEN;
|
|
528
|
-
const ret = wasm.
|
|
452
|
+
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
529
453
|
return ret;
|
|
530
454
|
}
|
|
531
455
|
|
|
@@ -547,39 +471,39 @@ export function verifyCredential(vc, proof_options, context_map) {
|
|
|
547
471
|
}
|
|
548
472
|
|
|
549
473
|
/**
|
|
550
|
-
* @param {string}
|
|
551
|
-
* @param {string} proof_options
|
|
552
|
-
* @param {string} key
|
|
553
|
-
* @param {string} context_map
|
|
474
|
+
* @param {string} invocation
|
|
554
475
|
* @returns {Promise<any>}
|
|
555
476
|
*/
|
|
556
|
-
export function
|
|
557
|
-
const ptr0 = passStringToWasm0(
|
|
477
|
+
export function verifyInvocationSignature(invocation) {
|
|
478
|
+
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
558
479
|
const len0 = WASM_VECTOR_LEN;
|
|
559
|
-
const
|
|
560
|
-
const len1 = WASM_VECTOR_LEN;
|
|
561
|
-
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
562
|
-
const len2 = WASM_VECTOR_LEN;
|
|
563
|
-
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
564
|
-
const len3 = WASM_VECTOR_LEN;
|
|
565
|
-
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
480
|
+
const ret = wasm.verifyInvocationSignature(ptr0, len0);
|
|
566
481
|
return ret;
|
|
567
482
|
}
|
|
568
483
|
|
|
569
484
|
/**
|
|
570
|
-
* @param {
|
|
571
|
-
* @param {string}
|
|
572
|
-
* @param {string} public_key
|
|
485
|
+
* @param {any} cleartext
|
|
486
|
+
* @param {string[]} recipients
|
|
573
487
|
* @returns {Promise<any>}
|
|
574
488
|
*/
|
|
575
|
-
export function
|
|
576
|
-
const ptr0 =
|
|
489
|
+
export function createDagJwe(cleartext, recipients) {
|
|
490
|
+
const ptr0 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
|
|
577
491
|
const len0 = WASM_VECTOR_LEN;
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
492
|
+
const ret = wasm.createDagJwe(cleartext, ptr0, len0);
|
|
493
|
+
return ret;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* @param {string} method_pattern
|
|
498
|
+
* @param {string} jwk
|
|
499
|
+
* @returns {Promise<any>}
|
|
500
|
+
*/
|
|
501
|
+
export function keyToVerificationMethod(method_pattern, jwk) {
|
|
502
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
503
|
+
const len0 = WASM_VECTOR_LEN;
|
|
504
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
505
|
+
const len1 = WASM_VECTOR_LEN;
|
|
506
|
+
const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
|
|
583
507
|
return ret;
|
|
584
508
|
}
|
|
585
509
|
|
|
@@ -601,39 +525,42 @@ export function completeIssuePresentation(presentation, preparation, signature)
|
|
|
601
525
|
}
|
|
602
526
|
|
|
603
527
|
/**
|
|
604
|
-
* @param {string}
|
|
605
|
-
* @param {string}
|
|
606
|
-
* @param {string}
|
|
528
|
+
* @param {string} capability
|
|
529
|
+
* @param {string} linked_data_proof_options
|
|
530
|
+
* @param {string} parents
|
|
531
|
+
* @param {string} key
|
|
607
532
|
* @returns {Promise<any>}
|
|
608
533
|
*/
|
|
609
|
-
export function
|
|
610
|
-
const ptr0 = passStringToWasm0(
|
|
534
|
+
export function delegateCapability(capability, linked_data_proof_options, parents, key) {
|
|
535
|
+
const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
611
536
|
const len0 = WASM_VECTOR_LEN;
|
|
612
|
-
const ptr1 = passStringToWasm0(
|
|
537
|
+
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
613
538
|
const len1 = WASM_VECTOR_LEN;
|
|
614
|
-
const ptr2 = passStringToWasm0(
|
|
539
|
+
const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
615
540
|
const len2 = WASM_VECTOR_LEN;
|
|
616
|
-
const
|
|
541
|
+
const ptr3 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
542
|
+
const len3 = WASM_VECTOR_LEN;
|
|
543
|
+
const ret = wasm.delegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
617
544
|
return ret;
|
|
618
545
|
}
|
|
619
546
|
|
|
620
547
|
/**
|
|
621
|
-
* @param {string}
|
|
548
|
+
* @param {string} capability
|
|
622
549
|
* @param {string} linked_data_proof_options
|
|
623
|
-
* @param {string}
|
|
624
|
-
* @param {string}
|
|
550
|
+
* @param {string} parents
|
|
551
|
+
* @param {string} public_key
|
|
625
552
|
* @returns {Promise<any>}
|
|
626
553
|
*/
|
|
627
|
-
export function
|
|
628
|
-
const ptr0 = passStringToWasm0(
|
|
554
|
+
export function prepareDelegateCapability(capability, linked_data_proof_options, parents, public_key) {
|
|
555
|
+
const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
629
556
|
const len0 = WASM_VECTOR_LEN;
|
|
630
557
|
const ptr1 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
558
|
const len1 = WASM_VECTOR_LEN;
|
|
632
|
-
const ptr2 = passStringToWasm0(
|
|
559
|
+
const ptr2 = passStringToWasm0(parents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
633
560
|
const len2 = WASM_VECTOR_LEN;
|
|
634
|
-
const ptr3 = passStringToWasm0(
|
|
561
|
+
const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
635
562
|
const len3 = WASM_VECTOR_LEN;
|
|
636
|
-
const ret = wasm.
|
|
563
|
+
const ret = wasm.prepareDelegateCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
637
564
|
return ret;
|
|
638
565
|
}
|
|
639
566
|
|
|
@@ -649,45 +576,69 @@ export function JWKFromTezos(tz) {
|
|
|
649
576
|
}
|
|
650
577
|
|
|
651
578
|
/**
|
|
652
|
-
* @
|
|
653
|
-
* @param {string} linked_data_proof_options
|
|
654
|
-
* @param {string} parents
|
|
655
|
-
* @param {string} key
|
|
656
|
-
* @returns {Promise<any>}
|
|
579
|
+
* @returns {string}
|
|
657
580
|
*/
|
|
658
|
-
export function
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
581
|
+
export function generateSecp256k1Key() {
|
|
582
|
+
let deferred2_0;
|
|
583
|
+
let deferred2_1;
|
|
584
|
+
try {
|
|
585
|
+
const ret = wasm.generateSecp256k1Key();
|
|
586
|
+
var ptr1 = ret[0];
|
|
587
|
+
var len1 = ret[1];
|
|
588
|
+
if (ret[3]) {
|
|
589
|
+
ptr1 = 0; len1 = 0;
|
|
590
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
591
|
+
}
|
|
592
|
+
deferred2_0 = ptr1;
|
|
593
|
+
deferred2_1 = len1;
|
|
594
|
+
return getStringFromWasm0(ptr1, len1);
|
|
595
|
+
} finally {
|
|
596
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
597
|
+
}
|
|
669
598
|
}
|
|
670
599
|
|
|
671
600
|
/**
|
|
672
|
-
* @param {string}
|
|
601
|
+
* @param {string} invocation
|
|
602
|
+
* @param {string} target_id
|
|
673
603
|
* @param {string} linked_data_proof_options
|
|
674
|
-
* @param {string} parents
|
|
675
604
|
* @param {string} public_key
|
|
676
605
|
* @returns {Promise<any>}
|
|
677
606
|
*/
|
|
678
|
-
export function
|
|
679
|
-
const ptr0 = passStringToWasm0(
|
|
607
|
+
export function prepareInvokeCapability(invocation, target_id, linked_data_proof_options, public_key) {
|
|
608
|
+
const ptr0 = passStringToWasm0(invocation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
680
609
|
const len0 = WASM_VECTOR_LEN;
|
|
681
|
-
const ptr1 = passStringToWasm0(
|
|
610
|
+
const ptr1 = passStringToWasm0(target_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
682
611
|
const len1 = WASM_VECTOR_LEN;
|
|
683
|
-
const ptr2 = passStringToWasm0(
|
|
612
|
+
const ptr2 = passStringToWasm0(linked_data_proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
684
613
|
const len2 = WASM_VECTOR_LEN;
|
|
685
614
|
const ptr3 = passStringToWasm0(public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
686
615
|
const len3 = WASM_VECTOR_LEN;
|
|
687
|
-
const ret = wasm.
|
|
616
|
+
const ret = wasm.prepareInvokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
688
617
|
return ret;
|
|
689
618
|
}
|
|
690
619
|
|
|
620
|
+
/**
|
|
621
|
+
* @returns {string}
|
|
622
|
+
*/
|
|
623
|
+
export function generateEd25519Key() {
|
|
624
|
+
let deferred2_0;
|
|
625
|
+
let deferred2_1;
|
|
626
|
+
try {
|
|
627
|
+
const ret = wasm.generateEd25519Key();
|
|
628
|
+
var ptr1 = ret[0];
|
|
629
|
+
var len1 = ret[1];
|
|
630
|
+
if (ret[3]) {
|
|
631
|
+
ptr1 = 0; len1 = 0;
|
|
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
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
691
642
|
/**
|
|
692
643
|
* @param {string} capability
|
|
693
644
|
* @param {string} preparation
|
|
@@ -706,53 +657,60 @@ export function completeDelegateCapability(capability, preparation, signature) {
|
|
|
706
657
|
}
|
|
707
658
|
|
|
708
659
|
/**
|
|
709
|
-
* @param {string}
|
|
660
|
+
* @param {string} url
|
|
710
661
|
* @returns {Promise<any>}
|
|
711
662
|
*/
|
|
712
|
-
export function
|
|
713
|
-
const ptr0 = passStringToWasm0(
|
|
663
|
+
export function contextLoader(url) {
|
|
664
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
714
665
|
const len0 = WASM_VECTOR_LEN;
|
|
715
|
-
const ret = wasm.
|
|
666
|
+
const ret = wasm.contextLoader(ptr0, len0);
|
|
716
667
|
return ret;
|
|
717
668
|
}
|
|
718
669
|
|
|
719
670
|
/**
|
|
720
|
-
* @param {string}
|
|
721
|
-
* @param {string}
|
|
722
|
-
* @param {string} linked_data_proof_options
|
|
723
|
-
* @param {string} key
|
|
671
|
+
* @param {string} did
|
|
672
|
+
* @param {string} input_metadata
|
|
724
673
|
* @returns {Promise<any>}
|
|
725
674
|
*/
|
|
726
|
-
export function
|
|
727
|
-
const ptr0 = passStringToWasm0(
|
|
675
|
+
export function resolveDID(did, input_metadata) {
|
|
676
|
+
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
728
677
|
const len0 = WASM_VECTOR_LEN;
|
|
729
|
-
const ptr1 = passStringToWasm0(
|
|
678
|
+
const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
730
679
|
const len1 = WASM_VECTOR_LEN;
|
|
731
|
-
const
|
|
732
|
-
const len2 = WASM_VECTOR_LEN;
|
|
733
|
-
const ptr3 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
734
|
-
const len3 = WASM_VECTOR_LEN;
|
|
735
|
-
const ret = wasm.invokeCapability(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
680
|
+
const ret = wasm.resolveDID(ptr0, len0, ptr1, len1);
|
|
736
681
|
return ret;
|
|
737
682
|
}
|
|
738
683
|
|
|
739
684
|
/**
|
|
740
|
-
* @param {string} invocation
|
|
741
|
-
* @param {string} target_id
|
|
742
|
-
* @param {string} linked_data_proof_options
|
|
743
|
-
* @param {string} public_key
|
|
744
685
|
* @returns {Promise<any>}
|
|
745
686
|
*/
|
|
746
|
-
export function
|
|
747
|
-
const
|
|
687
|
+
export function clearCache() {
|
|
688
|
+
const ret = wasm.clearCache();
|
|
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);
|
|
748
699
|
const len0 = WASM_VECTOR_LEN;
|
|
749
|
-
const ptr1 =
|
|
700
|
+
const ptr1 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
|
|
750
701
|
const len1 = WASM_VECTOR_LEN;
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
702
|
+
const ret = wasm.createJwe(ptr0, len0, ptr1, len1);
|
|
703
|
+
return ret;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/**
|
|
707
|
+
* @param {string} delegation
|
|
708
|
+
* @returns {Promise<any>}
|
|
709
|
+
*/
|
|
710
|
+
export function verifyDelegation(delegation) {
|
|
711
|
+
const ptr0 = passStringToWasm0(delegation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
712
|
+
const len0 = WASM_VECTOR_LEN;
|
|
713
|
+
const ret = wasm.verifyDelegation(ptr0, len0);
|
|
756
714
|
return ret;
|
|
757
715
|
}
|
|
758
716
|
|
|
@@ -774,47 +732,91 @@ export function completeInvokeCapability(invocation, preparation, signature) {
|
|
|
774
732
|
}
|
|
775
733
|
|
|
776
734
|
/**
|
|
777
|
-
* @param {string}
|
|
735
|
+
* @param {string} did
|
|
778
736
|
* @returns {Promise<any>}
|
|
779
737
|
*/
|
|
780
|
-
export function
|
|
781
|
-
const ptr0 = passStringToWasm0(
|
|
738
|
+
export function didToVerificationMethod(did) {
|
|
739
|
+
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
782
740
|
const len0 = WASM_VECTOR_LEN;
|
|
783
|
-
const ret = wasm.
|
|
741
|
+
const ret = wasm.didToVerificationMethod(ptr0, len0);
|
|
784
742
|
return ret;
|
|
785
743
|
}
|
|
786
744
|
|
|
787
745
|
/**
|
|
788
|
-
* @
|
|
789
|
-
* @param {string} delegation
|
|
790
|
-
* @returns {Promise<any>}
|
|
746
|
+
* @returns {string}
|
|
791
747
|
*/
|
|
792
|
-
export function
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
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
|
+
}
|
|
799
759
|
}
|
|
800
760
|
|
|
801
761
|
/**
|
|
802
|
-
* @param {string}
|
|
803
|
-
* @
|
|
762
|
+
* @param {string} method_pattern
|
|
763
|
+
* @param {string} jwk
|
|
764
|
+
* @returns {string}
|
|
804
765
|
*/
|
|
805
|
-
export function
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
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
|
+
}
|
|
810
812
|
}
|
|
811
813
|
|
|
812
814
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
813
|
-
wasm.
|
|
815
|
+
wasm.closure4151_externref_shim(arg0, arg1, arg2);
|
|
814
816
|
}
|
|
815
817
|
|
|
816
|
-
function
|
|
817
|
-
wasm.
|
|
818
|
+
function __wbg_adapter_198(arg0, arg1, arg2, arg3) {
|
|
819
|
+
wasm.closure4547_externref_shim(arg0, arg1, arg2, arg3);
|
|
818
820
|
}
|
|
819
821
|
|
|
820
822
|
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
@@ -1032,7 +1034,7 @@ function __wbg_get_imports() {
|
|
|
1032
1034
|
const a = state0.a;
|
|
1033
1035
|
state0.a = 0;
|
|
1034
1036
|
try {
|
|
1035
|
-
return
|
|
1037
|
+
return __wbg_adapter_198(a, state0.b, arg0, arg1);
|
|
1036
1038
|
} finally {
|
|
1037
1039
|
state0.a = a;
|
|
1038
1040
|
}
|
|
@@ -1258,8 +1260,8 @@ function __wbg_get_imports() {
|
|
|
1258
1260
|
const ret = false;
|
|
1259
1261
|
return ret;
|
|
1260
1262
|
};
|
|
1261
|
-
imports.wbg.
|
|
1262
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1263
|
+
imports.wbg.__wbindgen_closure_wrapper12163 = function(arg0, arg1, arg2) {
|
|
1264
|
+
const ret = makeMutClosure(arg0, arg1, 4152, __wbg_adapter_54);
|
|
1263
1265
|
return ret;
|
|
1264
1266
|
};
|
|
1265
1267
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|