pshenmic-dpp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.editorconfig +10 -0
  2. package/.gitattributes +4 -0
  3. package/.github/workflows/build.yml +46 -0
  4. package/.github/workflows/publish.yml +42 -0
  5. package/Cargo.lock +2241 -0
  6. package/Cargo.toml +18 -0
  7. package/README.md +74 -0
  8. package/dist/wasm/pshenmic_dpp.js +1130 -0
  9. package/package.json +25 -0
  10. package/packages/cbor-conversation/Cargo.toml +17 -0
  11. package/packages/cbor-conversation/src/lib.rs +26 -0
  12. package/packages/document/Cargo.toml +15 -0
  13. package/packages/document/src/lib.rs +58 -0
  14. package/packages/document/src/methods/js.rs +204 -0
  15. package/packages/document/src/methods/mod.rs +2 -0
  16. package/packages/document/src/methods/rust.rs +92 -0
  17. package/packages/document_batch/Cargo.toml +20 -0
  18. package/packages/document_batch/src/generators.rs +63 -0
  19. package/packages/document_batch/src/lib.rs +326 -0
  20. package/packages/enums/Cargo.toml +13 -0
  21. package/packages/enums/src/batch/batch_enum.rs +19 -0
  22. package/packages/enums/src/batch/mod.rs +1 -0
  23. package/packages/enums/src/keys/key_type.rs +36 -0
  24. package/packages/enums/src/keys/mod.rs +3 -0
  25. package/packages/enums/src/keys/purpose.rs +41 -0
  26. package/packages/enums/src/keys/security_level.rs +32 -0
  27. package/packages/enums/src/lib.rs +2 -0
  28. package/packages/mock_bls/Cargo.toml +12 -0
  29. package/packages/mock_bls/src/lib.rs +26 -0
  30. package/packages/private_key/Cargo.toml +13 -0
  31. package/packages/private_key/src/lib.rs +35 -0
  32. package/packages/public_key/Cargo.toml +15 -0
  33. package/packages/public_key/src/lib.rs +125 -0
  34. package/packages/utils/Cargo.toml +20 -0
  35. package/packages/utils/src/buffer.rs +29 -0
  36. package/packages/utils/src/lib.rs +351 -0
  37. package/scripts/build-js.sh +38 -0
  38. package/scripts/build.sh +35 -0
  39. package/src/lib.rs +2 -0
  40. package/tsconfig.json +18 -0
@@ -0,0 +1,1130 @@
1
+ let wasm;
2
+
3
+ function addToExternrefTable0(obj) {
4
+ const idx = wasm.__externref_table_alloc();
5
+ wasm.__wbindgen_export_2.set(idx, obj);
6
+ return idx;
7
+ }
8
+
9
+ function handleError(f, args) {
10
+ try {
11
+ return f.apply(this, args);
12
+ } catch (e) {
13
+ const idx = addToExternrefTable0(e);
14
+ wasm.__wbindgen_exn_store(idx);
15
+ }
16
+ }
17
+
18
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
19
+
20
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
21
+
22
+ let cachedUint8ArrayMemory0 = null;
23
+
24
+ function getUint8ArrayMemory0() {
25
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
26
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
27
+ }
28
+ return cachedUint8ArrayMemory0;
29
+ }
30
+
31
+ function getStringFromWasm0(ptr, len) {
32
+ ptr = ptr >>> 0;
33
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
34
+ }
35
+
36
+ function isLikeNone(x) {
37
+ return x === undefined || x === null;
38
+ }
39
+
40
+ function debugString(val) {
41
+ // primitive types
42
+ const type = typeof val;
43
+ if (type == 'number' || type == 'boolean' || val == null) {
44
+ return `${val}`;
45
+ }
46
+ if (type == 'string') {
47
+ return `"${val}"`;
48
+ }
49
+ if (type == 'symbol') {
50
+ const description = val.description;
51
+ if (description == null) {
52
+ return 'Symbol';
53
+ } else {
54
+ return `Symbol(${description})`;
55
+ }
56
+ }
57
+ if (type == 'function') {
58
+ const name = val.name;
59
+ if (typeof name == 'string' && name.length > 0) {
60
+ return `Function(${name})`;
61
+ } else {
62
+ return 'Function';
63
+ }
64
+ }
65
+ // objects
66
+ if (Array.isArray(val)) {
67
+ const length = val.length;
68
+ let debug = '[';
69
+ if (length > 0) {
70
+ debug += debugString(val[0]);
71
+ }
72
+ for(let i = 1; i < length; i++) {
73
+ debug += ', ' + debugString(val[i]);
74
+ }
75
+ debug += ']';
76
+ return debug;
77
+ }
78
+ // Test for built-in
79
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
80
+ let className;
81
+ if (builtInMatches && builtInMatches.length > 1) {
82
+ className = builtInMatches[1];
83
+ } else {
84
+ // Failed to match the standard '[object ClassName]'
85
+ return toString.call(val);
86
+ }
87
+ if (className == 'Object') {
88
+ // we're a user defined class or Object
89
+ // JSON.stringify avoids problems with cycles, and is generally much
90
+ // easier than looping through ownProperties of `val`.
91
+ try {
92
+ return 'Object(' + JSON.stringify(val) + ')';
93
+ } catch (_) {
94
+ return 'Object';
95
+ }
96
+ }
97
+ // errors
98
+ if (val instanceof Error) {
99
+ return `${val.name}: ${val.message}\n${val.stack}`;
100
+ }
101
+ // TODO we could test for more things here, like `Set`s and `Map`s.
102
+ return className;
103
+ }
104
+
105
+ let WASM_VECTOR_LEN = 0;
106
+
107
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
108
+
109
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
110
+ ? function (arg, view) {
111
+ return cachedTextEncoder.encodeInto(arg, view);
112
+ }
113
+ : function (arg, view) {
114
+ const buf = cachedTextEncoder.encode(arg);
115
+ view.set(buf);
116
+ return {
117
+ read: arg.length,
118
+ written: buf.length
119
+ };
120
+ });
121
+
122
+ function passStringToWasm0(arg, malloc, realloc) {
123
+
124
+ if (realloc === undefined) {
125
+ const buf = cachedTextEncoder.encode(arg);
126
+ const ptr = malloc(buf.length, 1) >>> 0;
127
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
128
+ WASM_VECTOR_LEN = buf.length;
129
+ return ptr;
130
+ }
131
+
132
+ let len = arg.length;
133
+ let ptr = malloc(len, 1) >>> 0;
134
+
135
+ const mem = getUint8ArrayMemory0();
136
+
137
+ let offset = 0;
138
+
139
+ for (; offset < len; offset++) {
140
+ const code = arg.charCodeAt(offset);
141
+ if (code > 0x7F) break;
142
+ mem[ptr + offset] = code;
143
+ }
144
+
145
+ if (offset !== len) {
146
+ if (offset !== 0) {
147
+ arg = arg.slice(offset);
148
+ }
149
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
150
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
151
+ const ret = encodeString(arg, view);
152
+
153
+ offset += ret.written;
154
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
155
+ }
156
+
157
+ WASM_VECTOR_LEN = offset;
158
+ return ptr;
159
+ }
160
+
161
+ let cachedDataViewMemory0 = null;
162
+
163
+ function getDataViewMemory0() {
164
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
165
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
166
+ }
167
+ return cachedDataViewMemory0;
168
+ }
169
+
170
+ function getArrayU8FromWasm0(ptr, len) {
171
+ ptr = ptr >>> 0;
172
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
173
+ }
174
+
175
+ function _assertClass(instance, klass) {
176
+ if (!(instance instanceof klass)) {
177
+ throw new Error(`expected instance of ${klass.name}`);
178
+ }
179
+ }
180
+
181
+ function takeFromExternrefTable0(idx) {
182
+ const value = wasm.__wbindgen_export_2.get(idx);
183
+ wasm.__externref_table_dealloc(idx);
184
+ return value;
185
+ }
186
+
187
+ function passArray8ToWasm0(arg, malloc) {
188
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
189
+ getUint8ArrayMemory0().set(arg, ptr / 1);
190
+ WASM_VECTOR_LEN = arg.length;
191
+ return ptr;
192
+ }
193
+ /**
194
+ * @param {any} object
195
+ * @returns {string}
196
+ */
197
+ export function objectToCbor(object) {
198
+ let deferred1_0;
199
+ let deferred1_1;
200
+ try {
201
+ const ret = wasm.objectToCbor(object);
202
+ deferred1_0 = ret[0];
203
+ deferred1_1 = ret[1];
204
+ return getStringFromWasm0(ret[0], ret[1]);
205
+ } finally {
206
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
207
+ }
208
+ }
209
+
210
+ /**
211
+ * @param {string} cbor
212
+ * @returns {any}
213
+ */
214
+ export function cborToObject(cbor) {
215
+ const ptr0 = passStringToWasm0(cbor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
216
+ const len0 = WASM_VECTOR_LEN;
217
+ const ret = wasm.cborToObject(ptr0, len0);
218
+ return ret;
219
+ }
220
+
221
+ /**
222
+ * @enum {0 | 1 | 2}
223
+ */
224
+ export const BatchType = Object.freeze({
225
+ CREATE: 0, "0": "CREATE",
226
+ REPLACE: 1, "1": "REPLACE",
227
+ DELETE: 2, "2": "DELETE",
228
+ });
229
+ /**
230
+ * @enum {0 | 1 | 2 | 3 | 4}
231
+ */
232
+ export const KeyType = Object.freeze({
233
+ ECDSA_SECP256K1: 0, "0": "ECDSA_SECP256K1",
234
+ BLS12_381: 1, "1": "BLS12_381",
235
+ ECDSA_HASH160: 2, "2": "ECDSA_HASH160",
236
+ BIP13_SCRIPT_HASH: 3, "3": "BIP13_SCRIPT_HASH",
237
+ EDDSA_25519_HASH160: 4, "4": "EDDSA_25519_HASH160",
238
+ });
239
+ /**
240
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
241
+ */
242
+ export const Purpose = Object.freeze({
243
+ AUTHENTICATION: 0, "0": "AUTHENTICATION",
244
+ ENCRYPTION: 1, "1": "ENCRYPTION",
245
+ DECRYPTION: 2, "2": "DECRYPTION",
246
+ TRANSFER: 3, "3": "TRANSFER",
247
+ SYSTEM: 4, "4": "SYSTEM",
248
+ VOTING: 5, "5": "VOTING",
249
+ OWNER: 6, "6": "OWNER",
250
+ });
251
+ /**
252
+ * @enum {0 | 1 | 2 | 3}
253
+ */
254
+ export const SecurityLevel = Object.freeze({
255
+ MASTER: 0, "0": "MASTER",
256
+ CRITICAL: 1, "1": "CRITICAL",
257
+ HIGH: 2, "2": "HIGH",
258
+ MEDIUM: 3, "3": "MEDIUM",
259
+ });
260
+
261
+ const DocumentBatchWASMFinalization = (typeof FinalizationRegistry === 'undefined')
262
+ ? { register: () => {}, unregister: () => {} }
263
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentbatchwasm_free(ptr >>> 0, 1));
264
+
265
+ export class DocumentBatchWASM {
266
+
267
+ static __wrap(ptr) {
268
+ ptr = ptr >>> 0;
269
+ const obj = Object.create(DocumentBatchWASM.prototype);
270
+ obj.__wbg_ptr = ptr;
271
+ DocumentBatchWASMFinalization.register(obj, obj.__wbg_ptr, obj);
272
+ return obj;
273
+ }
274
+
275
+ __destroy_into_raw() {
276
+ const ptr = this.__wbg_ptr;
277
+ this.__wbg_ptr = 0;
278
+ DocumentBatchWASMFinalization.unregister(this);
279
+ return ptr;
280
+ }
281
+
282
+ free() {
283
+ const ptr = this.__destroy_into_raw();
284
+ wasm.__wbg_documentbatchwasm_free(ptr, 0);
285
+ }
286
+ /**
287
+ * @param {BatchType} batch_type
288
+ * @param {DocumentWASM} document
289
+ * @param {bigint} identity_contract_nonce
290
+ * @returns {DocumentBatchWASM}
291
+ */
292
+ static new(batch_type, document, identity_contract_nonce) {
293
+ _assertClass(document, DocumentWASM);
294
+ var ptr0 = document.__destroy_into_raw();
295
+ const ret = wasm.documentbatchwasm_new(batch_type, ptr0, identity_contract_nonce);
296
+ if (ret[2]) {
297
+ throw takeFromExternrefTable0(ret[1]);
298
+ }
299
+ return DocumentBatchWASM.__wrap(ret[0]);
300
+ }
301
+ /**
302
+ * @param {PrivateKeyWASM} private_key
303
+ * @param {IdentityPublicKeyWASM} public_key
304
+ * @returns {any}
305
+ */
306
+ sign(private_key, public_key) {
307
+ _assertClass(private_key, PrivateKeyWASM);
308
+ var ptr0 = private_key.__destroy_into_raw();
309
+ _assertClass(public_key, IdentityPublicKeyWASM);
310
+ var ptr1 = public_key.__destroy_into_raw();
311
+ const ret = wasm.documentbatchwasm_sign(this.__wbg_ptr, ptr0, ptr1);
312
+ if (ret[2]) {
313
+ throw takeFromExternrefTable0(ret[1]);
314
+ }
315
+ return takeFromExternrefTable0(ret[0]);
316
+ }
317
+ /**
318
+ * @param {PrivateKeyWASM} private_key
319
+ * @param {KeyType} key_type
320
+ * @returns {any}
321
+ */
322
+ signByPrivateKey(private_key, key_type) {
323
+ _assertClass(private_key, PrivateKeyWASM);
324
+ var ptr0 = private_key.__destroy_into_raw();
325
+ const ret = wasm.documentbatchwasm_signByPrivateKey(this.__wbg_ptr, ptr0, key_type);
326
+ return ret;
327
+ }
328
+ /**
329
+ * @returns {any}
330
+ */
331
+ toBuffer() {
332
+ const ret = wasm.documentbatchwasm_toBuffer(this.__wbg_ptr);
333
+ if (ret[2]) {
334
+ throw takeFromExternrefTable0(ret[1]);
335
+ }
336
+ return takeFromExternrefTable0(ret[0]);
337
+ }
338
+ /**
339
+ * @param {Uint8Array} bytes
340
+ * @returns {DocumentBatchWASM}
341
+ */
342
+ static fromBuffer(bytes) {
343
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
344
+ const len0 = WASM_VECTOR_LEN;
345
+ const ret = wasm.documentbatchwasm_fromBuffer(ptr0, len0);
346
+ if (ret[2]) {
347
+ throw takeFromExternrefTable0(ret[1]);
348
+ }
349
+ return DocumentBatchWASM.__wrap(ret[0]);
350
+ }
351
+ /**
352
+ * @returns {DocumentWASM}
353
+ */
354
+ getDocument() {
355
+ const ret = wasm.documentbatchwasm_getDocument(this.__wbg_ptr);
356
+ return DocumentWASM.__wrap(ret);
357
+ }
358
+ /**
359
+ * @returns {Uint8Array}
360
+ */
361
+ getSignature() {
362
+ const ret = wasm.documentbatchwasm_getSignature(this.__wbg_ptr);
363
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
364
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
365
+ return v1;
366
+ }
367
+ }
368
+
369
+ const DocumentWASMFinalization = (typeof FinalizationRegistry === 'undefined')
370
+ ? { register: () => {}, unregister: () => {} }
371
+ : new FinalizationRegistry(ptr => wasm.__wbg_documentwasm_free(ptr >>> 0, 1));
372
+
373
+ export class DocumentWASM {
374
+
375
+ static __wrap(ptr) {
376
+ ptr = ptr >>> 0;
377
+ const obj = Object.create(DocumentWASM.prototype);
378
+ obj.__wbg_ptr = ptr;
379
+ DocumentWASMFinalization.register(obj, obj.__wbg_ptr, obj);
380
+ return obj;
381
+ }
382
+
383
+ __destroy_into_raw() {
384
+ const ptr = this.__wbg_ptr;
385
+ this.__wbg_ptr = 0;
386
+ DocumentWASMFinalization.unregister(this);
387
+ return ptr;
388
+ }
389
+
390
+ free() {
391
+ const ptr = this.__destroy_into_raw();
392
+ wasm.__wbg_documentwasm_free(ptr, 0);
393
+ }
394
+ /**
395
+ * @param {any} js_raw_document
396
+ * @param {string} js_document_type_name
397
+ * @param {bigint} js_revision
398
+ * @param {string} js_data_contract_id
399
+ * @param {string} js_owner_id
400
+ * @returns {DocumentWASM}
401
+ */
402
+ static new(js_raw_document, js_document_type_name, js_revision, js_data_contract_id, js_owner_id) {
403
+ const ptr0 = passStringToWasm0(js_document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
404
+ const len0 = WASM_VECTOR_LEN;
405
+ const ptr1 = passStringToWasm0(js_data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
406
+ const len1 = WASM_VECTOR_LEN;
407
+ const ptr2 = passStringToWasm0(js_owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
408
+ const len2 = WASM_VECTOR_LEN;
409
+ const ret = wasm.documentwasm_new(js_raw_document, ptr0, len0, js_revision, ptr1, len1, ptr2, len2);
410
+ return DocumentWASM.__wrap(ret);
411
+ }
412
+ /**
413
+ * @returns {any}
414
+ */
415
+ getId() {
416
+ const ret = wasm.documentwasm_getId(this.__wbg_ptr);
417
+ return ret;
418
+ }
419
+ /**
420
+ * @returns {any}
421
+ */
422
+ getEntropy() {
423
+ const ret = wasm.documentwasm_getEntropy(this.__wbg_ptr);
424
+ return ret;
425
+ }
426
+ /**
427
+ * @returns {any}
428
+ */
429
+ getOwnerId() {
430
+ const ret = wasm.documentwasm_getOwnerId(this.__wbg_ptr);
431
+ return ret;
432
+ }
433
+ /**
434
+ * @returns {any}
435
+ */
436
+ getProperties() {
437
+ const ret = wasm.documentwasm_getProperties(this.__wbg_ptr);
438
+ return ret;
439
+ }
440
+ /**
441
+ * @returns {bigint | undefined}
442
+ */
443
+ getRevision() {
444
+ const ret = wasm.documentwasm_getRevision(this.__wbg_ptr);
445
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
446
+ }
447
+ /**
448
+ * @returns {bigint | undefined}
449
+ */
450
+ getCreatedAt() {
451
+ const ret = wasm.documentwasm_getCreatedAt(this.__wbg_ptr);
452
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
453
+ }
454
+ /**
455
+ * @returns {bigint | undefined}
456
+ */
457
+ getUpdatedAt() {
458
+ const ret = wasm.documentwasm_getUpdatedAt(this.__wbg_ptr);
459
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
460
+ }
461
+ /**
462
+ * @returns {bigint | undefined}
463
+ */
464
+ getTransferredAt() {
465
+ const ret = wasm.documentwasm_getTransferredAt(this.__wbg_ptr);
466
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
467
+ }
468
+ /**
469
+ * @returns {bigint | undefined}
470
+ */
471
+ getCreatedAtBlockHeight() {
472
+ const ret = wasm.documentwasm_getCreatedAtBlockHeight(this.__wbg_ptr);
473
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
474
+ }
475
+ /**
476
+ * @returns {bigint | undefined}
477
+ */
478
+ getUpdatedAtBlockHeight() {
479
+ const ret = wasm.documentwasm_getUpdatedAtBlockHeight(this.__wbg_ptr);
480
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
481
+ }
482
+ /**
483
+ * @returns {bigint | undefined}
484
+ */
485
+ getTransferredAtBlockHeight() {
486
+ const ret = wasm.documentwasm_getTransferredAtBlockHeight(this.__wbg_ptr);
487
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
488
+ }
489
+ /**
490
+ * @returns {number | undefined}
491
+ */
492
+ getCreatedAtCoreBlockHeight() {
493
+ const ret = wasm.documentwasm_getCreatedAtCoreBlockHeight(this.__wbg_ptr);
494
+ return ret === 0x100000001 ? undefined : ret;
495
+ }
496
+ /**
497
+ * @returns {number | undefined}
498
+ */
499
+ getUpdatedAtCoreBlockHeight() {
500
+ const ret = wasm.documentwasm_getUpdatedAtCoreBlockHeight(this.__wbg_ptr);
501
+ return ret === 0x100000001 ? undefined : ret;
502
+ }
503
+ /**
504
+ * @returns {number | undefined}
505
+ */
506
+ getTransferredAtCoreBlockHeight() {
507
+ const ret = wasm.documentwasm_getTransferredAtCoreBlockHeight(this.__wbg_ptr);
508
+ return ret === 0x100000001 ? undefined : ret;
509
+ }
510
+ /**
511
+ * @returns {string}
512
+ */
513
+ getDocumentTypeName() {
514
+ let deferred1_0;
515
+ let deferred1_1;
516
+ try {
517
+ const ret = wasm.documentwasm_getDocumentTypeName(this.__wbg_ptr);
518
+ deferred1_0 = ret[0];
519
+ deferred1_1 = ret[1];
520
+ return getStringFromWasm0(ret[0], ret[1]);
521
+ } finally {
522
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
523
+ }
524
+ }
525
+ /**
526
+ * @param {any} id
527
+ */
528
+ setId(id) {
529
+ wasm.documentwasm_setId(this.__wbg_ptr, id);
530
+ }
531
+ /**
532
+ * @param {any} entropy
533
+ */
534
+ setEntropy(entropy) {
535
+ wasm.documentwasm_setEntropy(this.__wbg_ptr, entropy);
536
+ }
537
+ /**
538
+ * @param {any} id
539
+ */
540
+ setOwnerId(id) {
541
+ wasm.documentwasm_setOwnerId(this.__wbg_ptr, id);
542
+ }
543
+ /**
544
+ * @param {any} properties
545
+ */
546
+ setProperties(properties) {
547
+ wasm.documentwasm_setProperties(this.__wbg_ptr, properties);
548
+ }
549
+ /**
550
+ * @param {bigint | null} [revision]
551
+ */
552
+ setRevision(revision) {
553
+ wasm.documentwasm_setRevision(this.__wbg_ptr, !isLikeNone(revision), isLikeNone(revision) ? BigInt(0) : revision);
554
+ }
555
+ /**
556
+ * @param {bigint | null} [created_at]
557
+ */
558
+ setCreatedAt(created_at) {
559
+ wasm.documentwasm_setCreatedAt(this.__wbg_ptr, !isLikeNone(created_at), isLikeNone(created_at) ? BigInt(0) : created_at);
560
+ }
561
+ /**
562
+ * @param {bigint | null} [updated_at]
563
+ */
564
+ setUpdatedAt(updated_at) {
565
+ wasm.documentwasm_setUpdatedAt(this.__wbg_ptr, !isLikeNone(updated_at), isLikeNone(updated_at) ? BigInt(0) : updated_at);
566
+ }
567
+ /**
568
+ * @param {bigint | null} [transferred_at]
569
+ */
570
+ setTransferredAt(transferred_at) {
571
+ wasm.documentwasm_setTransferredAt(this.__wbg_ptr, !isLikeNone(transferred_at), isLikeNone(transferred_at) ? BigInt(0) : transferred_at);
572
+ }
573
+ /**
574
+ * @param {bigint | null} [created_at_block_height]
575
+ */
576
+ setCreatedAtBlockHeight(created_at_block_height) {
577
+ wasm.documentwasm_setCreatedAtBlockHeight(this.__wbg_ptr, !isLikeNone(created_at_block_height), isLikeNone(created_at_block_height) ? BigInt(0) : created_at_block_height);
578
+ }
579
+ /**
580
+ * @param {bigint | null} [updated_at_block_height]
581
+ */
582
+ setUpdatedAtBlockHeight(updated_at_block_height) {
583
+ wasm.documentwasm_setUpdatedAtBlockHeight(this.__wbg_ptr, !isLikeNone(updated_at_block_height), isLikeNone(updated_at_block_height) ? BigInt(0) : updated_at_block_height);
584
+ }
585
+ /**
586
+ * @param {bigint | null} [transferred_at_block_height]
587
+ */
588
+ setTransferredAtBlockHeight(transferred_at_block_height) {
589
+ wasm.documentwasm_setTransferredAtBlockHeight(this.__wbg_ptr, !isLikeNone(transferred_at_block_height), isLikeNone(transferred_at_block_height) ? BigInt(0) : transferred_at_block_height);
590
+ }
591
+ /**
592
+ * @param {number | null} [created_at_core_block_height]
593
+ */
594
+ setCreatedAtCoreBlockHeight(created_at_core_block_height) {
595
+ wasm.documentwasm_setCreatedAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(created_at_core_block_height) ? 0x100000001 : (created_at_core_block_height) >>> 0);
596
+ }
597
+ /**
598
+ * @param {number | null} [updated_at_core_block_height]
599
+ */
600
+ setUpdatedAtCoreBlockHeight(updated_at_core_block_height) {
601
+ wasm.documentwasm_setUpdatedAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(updated_at_core_block_height) ? 0x100000001 : (updated_at_core_block_height) >>> 0);
602
+ }
603
+ /**
604
+ * @param {number | null} [transferred_at_core_block_height]
605
+ */
606
+ setTransferredAtCoreBlockHeight(transferred_at_core_block_height) {
607
+ wasm.documentwasm_setTransferredAtCoreBlockHeight(this.__wbg_ptr, isLikeNone(transferred_at_core_block_height) ? 0x100000001 : (transferred_at_core_block_height) >>> 0);
608
+ }
609
+ /**
610
+ * @param {string} document_type_name
611
+ */
612
+ setDocumentTypeName(document_type_name) {
613
+ const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
614
+ const len0 = WASM_VECTOR_LEN;
615
+ wasm.documentwasm_setDocumentTypeName(this.__wbg_ptr, ptr0, len0);
616
+ }
617
+ }
618
+
619
+ const IdentityPublicKeyWASMFinalization = (typeof FinalizationRegistry === 'undefined')
620
+ ? { register: () => {}, unregister: () => {} }
621
+ : new FinalizationRegistry(ptr => wasm.__wbg_identitypublickeywasm_free(ptr >>> 0, 1));
622
+
623
+ export class IdentityPublicKeyWASM {
624
+
625
+ static __wrap(ptr) {
626
+ ptr = ptr >>> 0;
627
+ const obj = Object.create(IdentityPublicKeyWASM.prototype);
628
+ obj.__wbg_ptr = ptr;
629
+ IdentityPublicKeyWASMFinalization.register(obj, obj.__wbg_ptr, obj);
630
+ return obj;
631
+ }
632
+
633
+ __destroy_into_raw() {
634
+ const ptr = this.__wbg_ptr;
635
+ this.__wbg_ptr = 0;
636
+ IdentityPublicKeyWASMFinalization.unregister(this);
637
+ return ptr;
638
+ }
639
+
640
+ free() {
641
+ const ptr = this.__destroy_into_raw();
642
+ wasm.__wbg_identitypublickeywasm_free(ptr, 0);
643
+ }
644
+ /**
645
+ * @param {number} id
646
+ * @param {Purpose} purpose
647
+ * @param {SecurityLevel} security_level
648
+ * @param {KeyType} key_type
649
+ * @param {boolean} read_only
650
+ * @param {string} binary_data
651
+ * @param {bigint | null} [disabled_at]
652
+ * @returns {IdentityPublicKeyWASM}
653
+ */
654
+ static new(id, purpose, security_level, key_type, read_only, binary_data, disabled_at) {
655
+ const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
656
+ const len0 = WASM_VECTOR_LEN;
657
+ const ret = wasm.identitypublickeywasm_new(id, purpose, security_level, key_type, read_only, ptr0, len0, !isLikeNone(disabled_at), isLikeNone(disabled_at) ? BigInt(0) : disabled_at);
658
+ return IdentityPublicKeyWASM.__wrap(ret);
659
+ }
660
+ /**
661
+ * @returns {number}
662
+ */
663
+ getKeyId() {
664
+ const ret = wasm.identitypublickeywasm_getKeyId(this.__wbg_ptr);
665
+ return ret >>> 0;
666
+ }
667
+ /**
668
+ * @returns {Purpose}
669
+ */
670
+ getPurpose() {
671
+ const ret = wasm.identitypublickeywasm_getPurpose(this.__wbg_ptr);
672
+ return ret;
673
+ }
674
+ /**
675
+ * @returns {SecurityLevel}
676
+ */
677
+ getSecurityLevel() {
678
+ const ret = wasm.identitypublickeywasm_getSecurityLevel(this.__wbg_ptr);
679
+ return ret;
680
+ }
681
+ /**
682
+ * @returns {KeyType}
683
+ */
684
+ getKeyType() {
685
+ const ret = wasm.identitypublickeywasm_getKeyType(this.__wbg_ptr);
686
+ return ret;
687
+ }
688
+ /**
689
+ * @returns {boolean}
690
+ */
691
+ getReadOnly() {
692
+ const ret = wasm.identitypublickeywasm_getReadOnly(this.__wbg_ptr);
693
+ return ret !== 0;
694
+ }
695
+ /**
696
+ * @returns {string}
697
+ */
698
+ getData() {
699
+ let deferred1_0;
700
+ let deferred1_1;
701
+ try {
702
+ const ret = wasm.identitypublickeywasm_getData(this.__wbg_ptr);
703
+ deferred1_0 = ret[0];
704
+ deferred1_1 = ret[1];
705
+ return getStringFromWasm0(ret[0], ret[1]);
706
+ } finally {
707
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
708
+ }
709
+ }
710
+ /**
711
+ * @returns {bigint | undefined}
712
+ */
713
+ getDisabledAt() {
714
+ const ret = wasm.identitypublickeywasm_getDisabledAt(this.__wbg_ptr);
715
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
716
+ }
717
+ /**
718
+ * @param {number} key_id
719
+ */
720
+ setKeyId(key_id) {
721
+ wasm.identitypublickeywasm_setKeyId(this.__wbg_ptr, key_id);
722
+ }
723
+ /**
724
+ * @param {Purpose} purpose
725
+ */
726
+ setPurpose(purpose) {
727
+ wasm.identitypublickeywasm_setPurpose(this.__wbg_ptr, purpose);
728
+ }
729
+ /**
730
+ * @param {SecurityLevel} security_level
731
+ */
732
+ setSecurityLevel(security_level) {
733
+ wasm.identitypublickeywasm_setSecurityLevel(this.__wbg_ptr, security_level);
734
+ }
735
+ /**
736
+ * @param {KeyType} key_type
737
+ */
738
+ setKeyType(key_type) {
739
+ wasm.identitypublickeywasm_setKeyType(this.__wbg_ptr, key_type);
740
+ }
741
+ /**
742
+ * @param {boolean} read_only
743
+ */
744
+ setReadOnly(read_only) {
745
+ wasm.identitypublickeywasm_setReadOnly(this.__wbg_ptr, read_only);
746
+ }
747
+ /**
748
+ * @param {string} binary_data
749
+ */
750
+ setData(binary_data) {
751
+ const ptr0 = passStringToWasm0(binary_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
752
+ const len0 = WASM_VECTOR_LEN;
753
+ wasm.identitypublickeywasm_setData(this.__wbg_ptr, ptr0, len0);
754
+ }
755
+ /**
756
+ * @param {bigint} disabled_at
757
+ */
758
+ setDisabledAt(disabled_at) {
759
+ wasm.identitypublickeywasm_setDisabledAt(this.__wbg_ptr, disabled_at);
760
+ }
761
+ }
762
+
763
+ const PrivateKeyWASMFinalization = (typeof FinalizationRegistry === 'undefined')
764
+ ? { register: () => {}, unregister: () => {} }
765
+ : new FinalizationRegistry(ptr => wasm.__wbg_privatekeywasm_free(ptr >>> 0, 1));
766
+
767
+ export class PrivateKeyWASM {
768
+
769
+ static __wrap(ptr) {
770
+ ptr = ptr >>> 0;
771
+ const obj = Object.create(PrivateKeyWASM.prototype);
772
+ obj.__wbg_ptr = ptr;
773
+ PrivateKeyWASMFinalization.register(obj, obj.__wbg_ptr, obj);
774
+ return obj;
775
+ }
776
+
777
+ __destroy_into_raw() {
778
+ const ptr = this.__wbg_ptr;
779
+ this.__wbg_ptr = 0;
780
+ PrivateKeyWASMFinalization.unregister(this);
781
+ return ptr;
782
+ }
783
+
784
+ free() {
785
+ const ptr = this.__destroy_into_raw();
786
+ wasm.__wbg_privatekeywasm_free(ptr, 0);
787
+ }
788
+ /**
789
+ * @param {string} wif
790
+ * @returns {PrivateKeyWASM}
791
+ */
792
+ static new(wif) {
793
+ const ptr0 = passStringToWasm0(wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
794
+ const len0 = WASM_VECTOR_LEN;
795
+ const ret = wasm.privatekeywasm_new(ptr0, len0);
796
+ return PrivateKeyWASM.__wrap(ret);
797
+ }
798
+ /**
799
+ * @returns {string}
800
+ */
801
+ getKeyWIF() {
802
+ let deferred1_0;
803
+ let deferred1_1;
804
+ try {
805
+ const ret = wasm.privatekeywasm_getKeyWIF(this.__wbg_ptr);
806
+ deferred1_0 = ret[0];
807
+ deferred1_1 = ret[1];
808
+ return getStringFromWasm0(ret[0], ret[1]);
809
+ } finally {
810
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
811
+ }
812
+ }
813
+ }
814
+
815
+ async function __wbg_load(module, imports) {
816
+ if (typeof Response === 'function' && module instanceof Response) {
817
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
818
+ try {
819
+ return await WebAssembly.instantiateStreaming(module, imports);
820
+
821
+ } catch (e) {
822
+ if (module.headers.get('Content-Type') != 'application/wasm') {
823
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
824
+
825
+ } else {
826
+ throw e;
827
+ }
828
+ }
829
+ }
830
+
831
+ const bytes = await module.arrayBuffer();
832
+ return await WebAssembly.instantiate(bytes, imports);
833
+
834
+ } else {
835
+ const instance = await WebAssembly.instantiate(module, imports);
836
+
837
+ if (instance instanceof WebAssembly.Instance) {
838
+ return { instance, module };
839
+
840
+ } else {
841
+ return instance;
842
+ }
843
+ }
844
+ }
845
+
846
+ function __wbg_get_imports() {
847
+ const imports = {};
848
+ imports.wbg = {};
849
+ imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
850
+ const ret = arg0.buffer;
851
+ return ret;
852
+ };
853
+ imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
854
+ const ret = arg0.call(arg1);
855
+ return ret;
856
+ }, arguments) };
857
+ imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
858
+ const ret = arg0.call(arg1, arg2);
859
+ return ret;
860
+ }, arguments) };
861
+ imports.wbg.__wbg_crypto_ed58b8e10a292839 = function(arg0) {
862
+ const ret = arg0.crypto;
863
+ return ret;
864
+ };
865
+ imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
866
+ const ret = Array.from(arg0);
867
+ return ret;
868
+ };
869
+ imports.wbg.__wbg_getRandomValues_bcb4912f16000dc4 = function() { return handleError(function (arg0, arg1) {
870
+ arg0.getRandomValues(arg1);
871
+ }, arguments) };
872
+ imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
873
+ const ret = arg0.msCrypto;
874
+ return ret;
875
+ };
876
+ imports.wbg.__wbg_new_405e22f390576ce2 = function() {
877
+ const ret = new Object();
878
+ return ret;
879
+ };
880
+ imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
881
+ const ret = new Map();
882
+ return ret;
883
+ };
884
+ imports.wbg.__wbg_new_78feb108b6472713 = function() {
885
+ const ret = new Array();
886
+ return ret;
887
+ };
888
+ imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
889
+ const ret = new Uint8Array(arg0);
890
+ return ret;
891
+ };
892
+ imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
893
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
894
+ return ret;
895
+ };
896
+ imports.wbg.__wbg_newwithargs_ab6ffe8cd6c19c04 = function(arg0, arg1, arg2, arg3) {
897
+ const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
898
+ return ret;
899
+ };
900
+ imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
901
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
902
+ return ret;
903
+ };
904
+ imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
905
+ const ret = new Uint8Array(arg0 >>> 0);
906
+ return ret;
907
+ };
908
+ imports.wbg.__wbg_node_02999533c4ea02e3 = function(arg0) {
909
+ const ret = arg0.node;
910
+ return ret;
911
+ };
912
+ imports.wbg.__wbg_process_5c1d670bc53614b8 = function(arg0) {
913
+ const ret = arg0.process;
914
+ return ret;
915
+ };
916
+ imports.wbg.__wbg_randomFillSync_ab2cfe79ebbf2740 = function() { return handleError(function (arg0, arg1) {
917
+ arg0.randomFillSync(arg1);
918
+ }, arguments) };
919
+ imports.wbg.__wbg_require_79b1e9274cde3c87 = function() { return handleError(function () {
920
+ const ret = module.require;
921
+ return ret;
922
+ }, arguments) };
923
+ imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
924
+ arg0[arg1 >>> 0] = arg2;
925
+ };
926
+ imports.wbg.__wbg_set_3807d5f0bfc24aa7 = function(arg0, arg1, arg2) {
927
+ arg0[arg1] = arg2;
928
+ };
929
+ imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
930
+ arg0.set(arg1, arg2 >>> 0);
931
+ };
932
+ imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
933
+ const ret = arg0.set(arg1, arg2);
934
+ return ret;
935
+ };
936
+ imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
937
+ const ret = typeof global === 'undefined' ? null : global;
938
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
939
+ };
940
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
941
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
942
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
943
+ };
944
+ imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
945
+ const ret = typeof self === 'undefined' ? null : self;
946
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
947
+ };
948
+ imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
949
+ const ret = typeof window === 'undefined' ? null : window;
950
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
951
+ };
952
+ imports.wbg.__wbg_stringify_b1b3844ae02664a1 = function() { return handleError(function (arg0, arg1) {
953
+ const ret = JSON.stringify(arg0, arg1);
954
+ return ret;
955
+ }, arguments) };
956
+ imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
957
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
958
+ return ret;
959
+ };
960
+ imports.wbg.__wbg_versions_c71aa1626a93e0a1 = function(arg0) {
961
+ const ret = arg0.versions;
962
+ return ret;
963
+ };
964
+ imports.wbg.__wbindgen_bigint_from_i128 = function(arg0, arg1) {
965
+ const ret = arg0 << BigInt(64) | BigInt.asUintN(64, arg1);
966
+ return ret;
967
+ };
968
+ imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
969
+ const ret = arg0;
970
+ return ret;
971
+ };
972
+ imports.wbg.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
973
+ const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
974
+ return ret;
975
+ };
976
+ imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
977
+ const ret = BigInt.asUintN(64, arg0);
978
+ return ret;
979
+ };
980
+ imports.wbg.__wbindgen_boolean_get = function(arg0) {
981
+ const v = arg0;
982
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
983
+ return ret;
984
+ };
985
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
986
+ const ret = debugString(arg1);
987
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
988
+ const len1 = WASM_VECTOR_LEN;
989
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
990
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
991
+ };
992
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
993
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
994
+ return ret;
995
+ };
996
+ imports.wbg.__wbindgen_init_externref_table = function() {
997
+ const table = wasm.__wbindgen_export_2;
998
+ const offset = table.grow(4);
999
+ table.set(0, undefined);
1000
+ table.set(offset + 0, undefined);
1001
+ table.set(offset + 1, null);
1002
+ table.set(offset + 2, true);
1003
+ table.set(offset + 3, false);
1004
+ ;
1005
+ };
1006
+ imports.wbg.__wbindgen_is_function = function(arg0) {
1007
+ const ret = typeof(arg0) === 'function';
1008
+ return ret;
1009
+ };
1010
+ imports.wbg.__wbindgen_is_null = function(arg0) {
1011
+ const ret = arg0 === null;
1012
+ return ret;
1013
+ };
1014
+ imports.wbg.__wbindgen_is_object = function(arg0) {
1015
+ const val = arg0;
1016
+ const ret = typeof(val) === 'object' && val !== null;
1017
+ return ret;
1018
+ };
1019
+ imports.wbg.__wbindgen_is_string = function(arg0) {
1020
+ const ret = typeof(arg0) === 'string';
1021
+ return ret;
1022
+ };
1023
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
1024
+ const ret = arg0 === undefined;
1025
+ return ret;
1026
+ };
1027
+ imports.wbg.__wbindgen_memory = function() {
1028
+ const ret = wasm.memory;
1029
+ return ret;
1030
+ };
1031
+ imports.wbg.__wbindgen_number_new = function(arg0) {
1032
+ const ret = arg0;
1033
+ return ret;
1034
+ };
1035
+ imports.wbg.__wbindgen_rethrow = function(arg0) {
1036
+ throw arg0;
1037
+ };
1038
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
1039
+ const obj = arg1;
1040
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1041
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1042
+ var len1 = WASM_VECTOR_LEN;
1043
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1044
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1045
+ };
1046
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
1047
+ const ret = getStringFromWasm0(arg0, arg1);
1048
+ return ret;
1049
+ };
1050
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
1051
+ throw new Error(getStringFromWasm0(arg0, arg1));
1052
+ };
1053
+ imports.wbg.__wbindgen_uint8_array_new = function(arg0, arg1) {
1054
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
1055
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
1056
+ const ret = v0;
1057
+ return ret;
1058
+ };
1059
+
1060
+ return imports;
1061
+ }
1062
+
1063
+ function __wbg_init_memory(imports, memory) {
1064
+
1065
+ }
1066
+
1067
+ function __wbg_finalize_init(instance, module) {
1068
+ wasm = instance.exports;
1069
+ __wbg_init.__wbindgen_wasm_module = module;
1070
+ cachedDataViewMemory0 = null;
1071
+ cachedUint8ArrayMemory0 = null;
1072
+
1073
+
1074
+ wasm.__wbindgen_start();
1075
+ return wasm;
1076
+ }
1077
+
1078
+ function initSync(module) {
1079
+ if (wasm !== undefined) return wasm;
1080
+
1081
+
1082
+ if (typeof module !== 'undefined') {
1083
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1084
+ ({module} = module)
1085
+ } else {
1086
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1087
+ }
1088
+ }
1089
+
1090
+ const imports = __wbg_get_imports();
1091
+
1092
+ __wbg_init_memory(imports);
1093
+
1094
+ if (!(module instanceof WebAssembly.Module)) {
1095
+ module = new WebAssembly.Module(module);
1096
+ }
1097
+
1098
+ const instance = new WebAssembly.Instance(module, imports);
1099
+
1100
+ return __wbg_finalize_init(instance, module);
1101
+ }
1102
+
1103
+ async function __wbg_init(module_or_path) {
1104
+ if (wasm !== undefined) return wasm;
1105
+
1106
+
1107
+ if (typeof module_or_path !== 'undefined') {
1108
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1109
+ ({module_or_path} = module_or_path)
1110
+ } else {
1111
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1112
+ }
1113
+ }
1114
+
1115
+
1116
+ const imports = __wbg_get_imports();
1117
+
1118
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1119
+ module_or_path = fetch(module_or_path);
1120
+ }
1121
+
1122
+ __wbg_init_memory(imports);
1123
+
1124
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1125
+
1126
+ return __wbg_finalize_init(instance, module);
1127
+ }
1128
+
1129
+ export { initSync };
1130
+ export default __wbg_init;