@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
|
Binary file
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
4
|
+
export const DIDAuth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
5
|
+
export const JWKFromTezos: (a: number, b: number) => any;
|
|
5
6
|
export const clearCache: () => any;
|
|
7
|
+
export const completeDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
8
|
+
export const completeInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
9
|
+
export const completeIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
10
|
+
export const completeIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
11
|
+
export const contextLoader: (a: number, b: number) => any;
|
|
12
|
+
export const createDagJwe: (a: any, b: number, c: number) => any;
|
|
13
|
+
export const createJwe: (a: number, b: number, c: number, d: number) => any;
|
|
14
|
+
export const decryptDagJwe: (a: number, b: number, c: number, d: number) => any;
|
|
15
|
+
export const decryptJwe: (a: number, b: number, c: number, d: number) => any;
|
|
16
|
+
export const delegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
6
17
|
export const didResolver: (a: number, b: number, c: number, d: number) => any;
|
|
7
|
-
export const
|
|
18
|
+
export const didToVerificationMethod: (a: number, b: number) => any;
|
|
8
19
|
export const generateEd25519Key: () => [number, number, number, number];
|
|
9
20
|
export const generateEd25519KeyFromBytes: (a: number, b: number) => [number, number, number, number];
|
|
10
21
|
export const generateSecp256k1Key: () => [number, number, number, number];
|
|
11
22
|
export const generateSecp256k1KeyFromBytes: (a: number, b: number) => [number, number, number, number];
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
23
|
+
export const getVersion: () => [number, number];
|
|
24
|
+
export const invokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
25
|
+
export const issueCredential: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
26
|
+
export const issuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
16
27
|
export const keyToDID: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
17
28
|
export const keyToVerificationMethod: (a: number, b: number, c: number, d: number) => any;
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
29
|
+
export const prepareDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
30
|
+
export const prepareInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
20
31
|
export const prepareIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
21
|
-
export const completeIssueCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
22
|
-
export const verifyCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
23
|
-
export const issuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
24
32
|
export const prepareIssuePresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const DIDAuth: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
28
|
-
export const JWKFromTezos: (a: number, b: number) => any;
|
|
29
|
-
export const delegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
30
|
-
export const prepareDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
31
|
-
export const completeDelegateCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
33
|
+
export const resolveDID: (a: number, b: number, c: number, d: number) => any;
|
|
34
|
+
export const verifyCredential: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
32
35
|
export const verifyDelegation: (a: number, b: number) => any;
|
|
33
|
-
export const invokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
34
|
-
export const prepareInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;
|
|
35
|
-
export const completeInvokeCapability: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
36
|
-
export const verifyInvocationSignature: (a: number, b: number) => any;
|
|
37
36
|
export const verifyInvocation: (a: number, b: number, c: number, d: number) => any;
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
37
|
+
export const verifyInvocationSignature: (a: number, b: number) => any;
|
|
38
|
+
export const verifyPresentation: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
40
39
|
export const didkit_error_code: () => number;
|
|
40
|
+
export const didkit_error_message: () => number;
|
|
41
41
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
42
42
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
43
43
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
44
44
|
export const __externref_table_alloc: () => number;
|
|
45
45
|
export const __wbindgen_export_4: WebAssembly.Table;
|
|
46
46
|
export const __wbindgen_export_5: WebAssembly.Table;
|
|
47
|
-
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
48
47
|
export const __externref_table_dealloc: (a: number) => void;
|
|
49
|
-
export const
|
|
50
|
-
export const
|
|
48
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
49
|
+
export const closure4151_externref_shim: (a: number, b: number, c: any) => void;
|
|
50
|
+
export const closure4547_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
51
51
|
export const __wbindgen_start: () => void;
|
|
@@ -210,11 +210,25 @@ ${val.stack}`;
|
|
|
210
210
|
return className;
|
|
211
211
|
}
|
|
212
212
|
__name(debugString, "debugString");
|
|
213
|
-
function
|
|
214
|
-
const
|
|
213
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
214
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
215
|
+
for (let i = 0; i < array.length; i++) {
|
|
216
|
+
const add = addToExternrefTable0(array[i]);
|
|
217
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
218
|
+
}
|
|
219
|
+
WASM_VECTOR_LEN = array.length;
|
|
220
|
+
return ptr;
|
|
221
|
+
}
|
|
222
|
+
__name(passArrayJsValueToWasm0, "passArrayJsValueToWasm0");
|
|
223
|
+
function decryptDagJwe(jwe, jwks) {
|
|
224
|
+
const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
225
|
+
const len0 = WASM_VECTOR_LEN;
|
|
226
|
+
const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
|
|
227
|
+
const len1 = WASM_VECTOR_LEN;
|
|
228
|
+
const ret = wasm.decryptDagJwe(ptr0, len0, ptr1, len1);
|
|
215
229
|
return ret;
|
|
216
230
|
}
|
|
217
|
-
__name(
|
|
231
|
+
__name(decryptDagJwe, "decryptDagJwe");
|
|
218
232
|
function didResolver(did, input_metadata) {
|
|
219
233
|
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
220
234
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -224,21 +238,41 @@ function didResolver(did, input_metadata) {
|
|
|
224
238
|
return ret;
|
|
225
239
|
}
|
|
226
240
|
__name(didResolver, "didResolver");
|
|
227
|
-
function
|
|
228
|
-
const ptr0 = passStringToWasm0(
|
|
241
|
+
function issueCredential(credential, proof_options, key, context_map) {
|
|
242
|
+
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
229
243
|
const len0 = WASM_VECTOR_LEN;
|
|
230
|
-
const ptr1 = passStringToWasm0(
|
|
244
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
231
245
|
const len1 = WASM_VECTOR_LEN;
|
|
232
|
-
const
|
|
246
|
+
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
247
|
+
const len2 = WASM_VECTOR_LEN;
|
|
248
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
249
|
+
const len3 = WASM_VECTOR_LEN;
|
|
250
|
+
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
233
251
|
return ret;
|
|
234
252
|
}
|
|
235
|
-
__name(
|
|
236
|
-
function
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
253
|
+
__name(issueCredential, "issueCredential");
|
|
254
|
+
function issuePresentation(presentation, proof_options, key, context_map) {
|
|
255
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
257
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
+
const len1 = WASM_VECTOR_LEN;
|
|
259
|
+
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
260
|
+
const len2 = WASM_VECTOR_LEN;
|
|
261
|
+
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
262
|
+
const len3 = WASM_VECTOR_LEN;
|
|
263
|
+
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
264
|
+
return ret;
|
|
240
265
|
}
|
|
241
|
-
__name(
|
|
266
|
+
__name(issuePresentation, "issuePresentation");
|
|
267
|
+
function decryptJwe(jwe, jwks) {
|
|
268
|
+
const ptr0 = passStringToWasm0(jwe, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
269
|
+
const len0 = WASM_VECTOR_LEN;
|
|
270
|
+
const ptr1 = passArrayJsValueToWasm0(jwks, wasm.__wbindgen_malloc);
|
|
271
|
+
const len1 = WASM_VECTOR_LEN;
|
|
272
|
+
const ret = wasm.decryptJwe(ptr0, len0, ptr1, len1);
|
|
273
|
+
return ret;
|
|
274
|
+
}
|
|
275
|
+
__name(decryptJwe, "decryptJwe");
|
|
242
276
|
function passArray8ToWasm0(arg, malloc) {
|
|
243
277
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
244
278
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -246,28 +280,12 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
246
280
|
return ptr;
|
|
247
281
|
}
|
|
248
282
|
__name(passArray8ToWasm0, "passArray8ToWasm0");
|
|
249
|
-
function
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
254
|
-
const len0 = WASM_VECTOR_LEN;
|
|
255
|
-
const ret = wasm.generateEd25519KeyFromBytes(ptr0, len0);
|
|
256
|
-
var ptr2 = ret[0];
|
|
257
|
-
var len2 = ret[1];
|
|
258
|
-
if (ret[3]) {
|
|
259
|
-
ptr2 = 0;
|
|
260
|
-
len2 = 0;
|
|
261
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
262
|
-
}
|
|
263
|
-
deferred3_0 = ptr2;
|
|
264
|
-
deferred3_1 = len2;
|
|
265
|
-
return getStringFromWasm0(ptr2, len2);
|
|
266
|
-
} finally {
|
|
267
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
268
|
-
}
|
|
283
|
+
function takeFromExternrefTable0(idx) {
|
|
284
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
285
|
+
wasm.__externref_table_dealloc(idx);
|
|
286
|
+
return value;
|
|
269
287
|
}
|
|
270
|
-
__name(
|
|
288
|
+
__name(takeFromExternrefTable0, "takeFromExternrefTable0");
|
|
271
289
|
function generateSecp256k1KeyFromBytes(bytes) {
|
|
272
290
|
let deferred3_0;
|
|
273
291
|
let deferred3_1;
|
|
@@ -290,34 +308,28 @@ function generateSecp256k1KeyFromBytes(bytes) {
|
|
|
290
308
|
}
|
|
291
309
|
}
|
|
292
310
|
__name(generateSecp256k1KeyFromBytes, "generateSecp256k1KeyFromBytes");
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
for (let i = 0; i < array.length; i++) {
|
|
296
|
-
const add = addToExternrefTable0(array[i]);
|
|
297
|
-
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
298
|
-
}
|
|
299
|
-
WASM_VECTOR_LEN = array.length;
|
|
300
|
-
return ptr;
|
|
301
|
-
}
|
|
302
|
-
__name(passArrayJsValueToWasm0, "passArrayJsValueToWasm0");
|
|
303
|
-
function createJwe(cleartext, recipients) {
|
|
304
|
-
const ptr0 = passStringToWasm0(cleartext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
311
|
+
function verifyPresentation(vp, proof_options, context_map) {
|
|
312
|
+
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
305
313
|
const len0 = WASM_VECTOR_LEN;
|
|
306
|
-
const ptr1 =
|
|
314
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
307
315
|
const len1 = WASM_VECTOR_LEN;
|
|
308
|
-
const
|
|
316
|
+
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
317
|
+
const len2 = WASM_VECTOR_LEN;
|
|
318
|
+
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
309
319
|
return ret;
|
|
310
320
|
}
|
|
311
|
-
__name(
|
|
312
|
-
function
|
|
313
|
-
const ptr0 = passStringToWasm0(
|
|
321
|
+
__name(verifyPresentation, "verifyPresentation");
|
|
322
|
+
function verifyCredential(vc, proof_options, context_map) {
|
|
323
|
+
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
314
324
|
const len0 = WASM_VECTOR_LEN;
|
|
315
|
-
const ptr1 =
|
|
325
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
316
326
|
const len1 = WASM_VECTOR_LEN;
|
|
317
|
-
const
|
|
327
|
+
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
328
|
+
const len2 = WASM_VECTOR_LEN;
|
|
329
|
+
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
318
330
|
return ret;
|
|
319
331
|
}
|
|
320
|
-
__name(
|
|
332
|
+
__name(verifyCredential, "verifyCredential");
|
|
321
333
|
function createDagJwe(cleartext, recipients) {
|
|
322
334
|
const ptr0 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
|
|
323
335
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -325,15 +337,52 @@ function createDagJwe(cleartext, recipients) {
|
|
|
325
337
|
return ret;
|
|
326
338
|
}
|
|
327
339
|
__name(createDagJwe, "createDagJwe");
|
|
328
|
-
function
|
|
329
|
-
const ptr0 = passStringToWasm0(
|
|
340
|
+
function keyToVerificationMethod(method_pattern, jwk) {
|
|
341
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
330
342
|
const len0 = WASM_VECTOR_LEN;
|
|
331
|
-
const ptr1 =
|
|
343
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
332
344
|
const len1 = WASM_VECTOR_LEN;
|
|
333
|
-
const ret = wasm.
|
|
345
|
+
const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
|
|
334
346
|
return ret;
|
|
335
347
|
}
|
|
336
|
-
__name(
|
|
348
|
+
__name(keyToVerificationMethod, "keyToVerificationMethod");
|
|
349
|
+
function contextLoader(url) {
|
|
350
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
351
|
+
const len0 = WASM_VECTOR_LEN;
|
|
352
|
+
const ret = wasm.contextLoader(ptr0, len0);
|
|
353
|
+
return ret;
|
|
354
|
+
}
|
|
355
|
+
__name(contextLoader, "contextLoader");
|
|
356
|
+
function resolveDID(did, input_metadata) {
|
|
357
|
+
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
358
|
+
const len0 = WASM_VECTOR_LEN;
|
|
359
|
+
const ptr1 = passStringToWasm0(input_metadata, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
360
|
+
const len1 = WASM_VECTOR_LEN;
|
|
361
|
+
const ret = wasm.resolveDID(ptr0, len0, ptr1, len1);
|
|
362
|
+
return ret;
|
|
363
|
+
}
|
|
364
|
+
__name(resolveDID, "resolveDID");
|
|
365
|
+
function clearCache() {
|
|
366
|
+
const ret = wasm.clearCache();
|
|
367
|
+
return ret;
|
|
368
|
+
}
|
|
369
|
+
__name(clearCache, "clearCache");
|
|
370
|
+
function createJwe(cleartext, recipients) {
|
|
371
|
+
const ptr0 = passStringToWasm0(cleartext, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
372
|
+
const len0 = WASM_VECTOR_LEN;
|
|
373
|
+
const ptr1 = passArrayJsValueToWasm0(recipients, wasm.__wbindgen_malloc);
|
|
374
|
+
const len1 = WASM_VECTOR_LEN;
|
|
375
|
+
const ret = wasm.createJwe(ptr0, len0, ptr1, len1);
|
|
376
|
+
return ret;
|
|
377
|
+
}
|
|
378
|
+
__name(createJwe, "createJwe");
|
|
379
|
+
function didToVerificationMethod(did) {
|
|
380
|
+
const ptr0 = passStringToWasm0(did, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
381
|
+
const len0 = WASM_VECTOR_LEN;
|
|
382
|
+
const ret = wasm.didToVerificationMethod(ptr0, len0);
|
|
383
|
+
return ret;
|
|
384
|
+
}
|
|
385
|
+
__name(didToVerificationMethod, "didToVerificationMethod");
|
|
337
386
|
function keyToDID(method_pattern, jwk) {
|
|
338
387
|
let deferred4_0;
|
|
339
388
|
let deferred4_1;
|
|
@@ -358,85 +407,36 @@ function keyToDID(method_pattern, jwk) {
|
|
|
358
407
|
}
|
|
359
408
|
}
|
|
360
409
|
__name(keyToDID, "keyToDID");
|
|
361
|
-
function
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const len1 = WASM_VECTOR_LEN;
|
|
382
|
-
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
383
|
-
const len2 = WASM_VECTOR_LEN;
|
|
384
|
-
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
385
|
-
const len3 = WASM_VECTOR_LEN;
|
|
386
|
-
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
387
|
-
return ret;
|
|
388
|
-
}
|
|
389
|
-
__name(issueCredential, "issueCredential");
|
|
390
|
-
function verifyCredential(vc, proof_options, context_map) {
|
|
391
|
-
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
392
|
-
const len0 = WASM_VECTOR_LEN;
|
|
393
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
394
|
-
const len1 = WASM_VECTOR_LEN;
|
|
395
|
-
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
396
|
-
const len2 = WASM_VECTOR_LEN;
|
|
397
|
-
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
398
|
-
return ret;
|
|
399
|
-
}
|
|
400
|
-
__name(verifyCredential, "verifyCredential");
|
|
401
|
-
function issuePresentation(presentation, proof_options, key, context_map) {
|
|
402
|
-
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
403
|
-
const len0 = WASM_VECTOR_LEN;
|
|
404
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
405
|
-
const len1 = WASM_VECTOR_LEN;
|
|
406
|
-
const ptr2 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
407
|
-
const len2 = WASM_VECTOR_LEN;
|
|
408
|
-
const ptr3 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
409
|
-
const len3 = WASM_VECTOR_LEN;
|
|
410
|
-
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
411
|
-
return ret;
|
|
412
|
-
}
|
|
413
|
-
__name(issuePresentation, "issuePresentation");
|
|
414
|
-
function verifyPresentation(vp, proof_options, context_map) {
|
|
415
|
-
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
416
|
-
const len0 = WASM_VECTOR_LEN;
|
|
417
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
418
|
-
const len1 = WASM_VECTOR_LEN;
|
|
419
|
-
const ptr2 = passStringToWasm0(context_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
420
|
-
const len2 = WASM_VECTOR_LEN;
|
|
421
|
-
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
422
|
-
return ret;
|
|
423
|
-
}
|
|
424
|
-
__name(verifyPresentation, "verifyPresentation");
|
|
425
|
-
function contextLoader(url) {
|
|
426
|
-
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
427
|
-
const len0 = WASM_VECTOR_LEN;
|
|
428
|
-
const ret = wasm.contextLoader(ptr0, len0);
|
|
429
|
-
return ret;
|
|
410
|
+
function generateEd25519KeyFromBytes(bytes) {
|
|
411
|
+
let deferred3_0;
|
|
412
|
+
let deferred3_1;
|
|
413
|
+
try {
|
|
414
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
415
|
+
const len0 = WASM_VECTOR_LEN;
|
|
416
|
+
const ret = wasm.generateEd25519KeyFromBytes(ptr0, len0);
|
|
417
|
+
var ptr2 = ret[0];
|
|
418
|
+
var len2 = ret[1];
|
|
419
|
+
if (ret[3]) {
|
|
420
|
+
ptr2 = 0;
|
|
421
|
+
len2 = 0;
|
|
422
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
423
|
+
}
|
|
424
|
+
deferred3_0 = ptr2;
|
|
425
|
+
deferred3_1 = len2;
|
|
426
|
+
return getStringFromWasm0(ptr2, len2);
|
|
427
|
+
} finally {
|
|
428
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
429
|
+
}
|
|
430
430
|
}
|
|
431
|
-
__name(
|
|
431
|
+
__name(generateEd25519KeyFromBytes, "generateEd25519KeyFromBytes");
|
|
432
432
|
function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
433
|
-
wasm.
|
|
433
|
+
wasm.closure4151_externref_shim(arg0, arg1, arg2);
|
|
434
434
|
}
|
|
435
435
|
__name(__wbg_adapter_54, "__wbg_adapter_54");
|
|
436
|
-
function
|
|
437
|
-
wasm.
|
|
436
|
+
function __wbg_adapter_198(arg0, arg1, arg2, arg3) {
|
|
437
|
+
wasm.closure4547_externref_shim(arg0, arg1, arg2, arg3);
|
|
438
438
|
}
|
|
439
|
-
__name(
|
|
439
|
+
__name(__wbg_adapter_198, "__wbg_adapter_198");
|
|
440
440
|
var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
441
441
|
var __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
442
442
|
async function __wbg_load(module2, imports) {
|
|
@@ -662,7 +662,7 @@ function __wbg_get_imports() {
|
|
|
662
662
|
const a = state0.a;
|
|
663
663
|
state0.a = 0;
|
|
664
664
|
try {
|
|
665
|
-
return
|
|
665
|
+
return __wbg_adapter_198(a, state0.b, arg02, arg12);
|
|
666
666
|
} finally {
|
|
667
667
|
state0.a = a;
|
|
668
668
|
}
|
|
@@ -904,8 +904,8 @@ function __wbg_get_imports() {
|
|
|
904
904
|
const ret = false;
|
|
905
905
|
return ret;
|
|
906
906
|
};
|
|
907
|
-
imports.wbg.
|
|
908
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
907
|
+
imports.wbg.__wbindgen_closure_wrapper12163 = function(arg0, arg1, arg2) {
|
|
908
|
+
const ret = makeMutClosure(arg0, arg1, 4152, __wbg_adapter_54);
|
|
909
909
|
return ret;
|
|
910
910
|
};
|
|
911
911
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
@@ -1036,7 +1036,7 @@ var didkit_wasm_default = __wbg_init;
|
|
|
1036
1036
|
// src/didkit/index.ts
|
|
1037
1037
|
var initialized = false;
|
|
1038
1038
|
var generating = false;
|
|
1039
|
-
var init = /* @__PURE__ */ __name(async (arg = "https://cdn.filestackcontent.com/
|
|
1039
|
+
var init = /* @__PURE__ */ __name(async (arg = "https://cdn.filestackcontent.com/Z4wMCHTiKaOUGdUC6NQ3") => {
|
|
1040
1040
|
while (generating) await new Promise((res) => setTimeout(res, 250));
|
|
1041
1041
|
if (initialized) return;
|
|
1042
1042
|
try {
|