@stacks/clarinet-sdk-wasm-browser 3.8.1

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.
@@ -0,0 +1,1830 @@
1
+ let wasm;
2
+
3
+ let cachedUint8ArrayMemory0 = null;
4
+
5
+ function getUint8ArrayMemory0() {
6
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
7
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
8
+ }
9
+ return cachedUint8ArrayMemory0;
10
+ }
11
+
12
+ let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
13
+
14
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
15
+
16
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
17
+ let numBytesDecoded = 0;
18
+ function decodeText(ptr, len) {
19
+ numBytesDecoded += len;
20
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
21
+ cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
22
+ cachedTextDecoder.decode();
23
+ numBytesDecoded = len;
24
+ }
25
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
26
+ }
27
+
28
+ function getStringFromWasm0(ptr, len) {
29
+ ptr = ptr >>> 0;
30
+ return decodeText(ptr, len);
31
+ }
32
+
33
+ let WASM_VECTOR_LEN = 0;
34
+
35
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
36
+
37
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
38
+ ? function (arg, view) {
39
+ return cachedTextEncoder.encodeInto(arg, view);
40
+ }
41
+ : function (arg, view) {
42
+ const buf = cachedTextEncoder.encode(arg);
43
+ view.set(buf);
44
+ return {
45
+ read: arg.length,
46
+ written: buf.length
47
+ };
48
+ });
49
+
50
+ function passStringToWasm0(arg, malloc, realloc) {
51
+
52
+ if (realloc === undefined) {
53
+ const buf = cachedTextEncoder.encode(arg);
54
+ const ptr = malloc(buf.length, 1) >>> 0;
55
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
56
+ WASM_VECTOR_LEN = buf.length;
57
+ return ptr;
58
+ }
59
+
60
+ let len = arg.length;
61
+ let ptr = malloc(len, 1) >>> 0;
62
+
63
+ const mem = getUint8ArrayMemory0();
64
+
65
+ let offset = 0;
66
+
67
+ for (; offset < len; offset++) {
68
+ const code = arg.charCodeAt(offset);
69
+ if (code > 0x7F) break;
70
+ mem[ptr + offset] = code;
71
+ }
72
+
73
+ if (offset !== len) {
74
+ if (offset !== 0) {
75
+ arg = arg.slice(offset);
76
+ }
77
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
78
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
79
+ const ret = encodeString(arg, view);
80
+
81
+ offset += ret.written;
82
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
83
+ }
84
+
85
+ WASM_VECTOR_LEN = offset;
86
+ return ptr;
87
+ }
88
+
89
+ let cachedDataViewMemory0 = null;
90
+
91
+ function getDataViewMemory0() {
92
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
93
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
94
+ }
95
+ return cachedDataViewMemory0;
96
+ }
97
+
98
+ function addToExternrefTable0(obj) {
99
+ const idx = wasm.__externref_table_alloc();
100
+ wasm.__wbindgen_export_4.set(idx, obj);
101
+ return idx;
102
+ }
103
+
104
+ function handleError(f, args) {
105
+ try {
106
+ return f.apply(this, args);
107
+ } catch (e) {
108
+ const idx = addToExternrefTable0(e);
109
+ wasm.__wbindgen_exn_store(idx);
110
+ }
111
+ }
112
+
113
+ function getArrayU8FromWasm0(ptr, len) {
114
+ ptr = ptr >>> 0;
115
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
116
+ }
117
+
118
+ function isLikeNone(x) {
119
+ return x === undefined || x === null;
120
+ }
121
+
122
+ function debugString(val) {
123
+ // primitive types
124
+ const type = typeof val;
125
+ if (type == 'number' || type == 'boolean' || val == null) {
126
+ return `${val}`;
127
+ }
128
+ if (type == 'string') {
129
+ return `"${val}"`;
130
+ }
131
+ if (type == 'symbol') {
132
+ const description = val.description;
133
+ if (description == null) {
134
+ return 'Symbol';
135
+ } else {
136
+ return `Symbol(${description})`;
137
+ }
138
+ }
139
+ if (type == 'function') {
140
+ const name = val.name;
141
+ if (typeof name == 'string' && name.length > 0) {
142
+ return `Function(${name})`;
143
+ } else {
144
+ return 'Function';
145
+ }
146
+ }
147
+ // objects
148
+ if (Array.isArray(val)) {
149
+ const length = val.length;
150
+ let debug = '[';
151
+ if (length > 0) {
152
+ debug += debugString(val[0]);
153
+ }
154
+ for(let i = 1; i < length; i++) {
155
+ debug += ', ' + debugString(val[i]);
156
+ }
157
+ debug += ']';
158
+ return debug;
159
+ }
160
+ // Test for built-in
161
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
162
+ let className;
163
+ if (builtInMatches && builtInMatches.length > 1) {
164
+ className = builtInMatches[1];
165
+ } else {
166
+ // Failed to match the standard '[object ClassName]'
167
+ return toString.call(val);
168
+ }
169
+ if (className == 'Object') {
170
+ // we're a user defined class or Object
171
+ // JSON.stringify avoids problems with cycles, and is generally much
172
+ // easier than looping through ownProperties of `val`.
173
+ try {
174
+ return 'Object(' + JSON.stringify(val) + ')';
175
+ } catch (_) {
176
+ return 'Object';
177
+ }
178
+ }
179
+ // errors
180
+ if (val instanceof Error) {
181
+ return `${val.name}: ${val.message}\n${val.stack}`;
182
+ }
183
+ // TODO we could test for more things here, like `Set`s and `Map`s.
184
+ return className;
185
+ }
186
+
187
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
188
+ ? { register: () => {}, unregister: () => {} }
189
+ : new FinalizationRegistry(
190
+ state => {
191
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
192
+ }
193
+ );
194
+
195
+ function makeMutClosure(arg0, arg1, dtor, f) {
196
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
197
+ const real = (...args) => {
198
+
199
+ // First up with a closure we increment the internal reference
200
+ // count. This ensures that the Rust closure environment won't
201
+ // be deallocated while we're invoking it.
202
+ state.cnt++;
203
+ const a = state.a;
204
+ state.a = 0;
205
+ try {
206
+ return f(a, state.b, ...args);
207
+ } finally {
208
+ if (--state.cnt === 0) {
209
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
210
+ CLOSURE_DTORS.unregister(state);
211
+ } else {
212
+ state.a = a;
213
+ }
214
+ }
215
+ };
216
+ real.original = state;
217
+ CLOSURE_DTORS.register(real, state, state);
218
+ return real;
219
+ }
220
+
221
+ function passArrayJsValueToWasm0(array, malloc) {
222
+ const ptr = malloc(array.length * 4, 4) >>> 0;
223
+ for (let i = 0; i < array.length; i++) {
224
+ const add = addToExternrefTable0(array[i]);
225
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
226
+ }
227
+ WASM_VECTOR_LEN = array.length;
228
+ return ptr;
229
+ }
230
+
231
+ function _assertClass(instance, klass) {
232
+ if (!(instance instanceof klass)) {
233
+ throw new Error(`expected instance of ${klass.name}`);
234
+ }
235
+ }
236
+
237
+ function takeFromExternrefTable0(idx) {
238
+ const value = wasm.__wbindgen_export_4.get(idx);
239
+ wasm.__externref_table_dealloc(idx);
240
+ return value;
241
+ }
242
+
243
+ function passArray8ToWasm0(arg, malloc) {
244
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
245
+ getUint8ArrayMemory0().set(arg, ptr / 1);
246
+ WASM_VECTOR_LEN = arg.length;
247
+ return ptr;
248
+ }
249
+ function __wbg_adapter_8(arg0, arg1, arg2) {
250
+ wasm.closure607_externref_shim(arg0, arg1, arg2);
251
+ }
252
+
253
+ function __wbg_adapter_15(arg0, arg1) {
254
+ wasm.wasm_bindgen__convert__closures_____invoke__h663b0a1b4d0a0453(arg0, arg1);
255
+ }
256
+
257
+ function __wbg_adapter_233(arg0, arg1, arg2, arg3) {
258
+ wasm.closure3298_externref_shim(arg0, arg1, arg2, arg3);
259
+ }
260
+
261
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
262
+
263
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
264
+
265
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
266
+
267
+ const CallFnArgsFinalization = (typeof FinalizationRegistry === 'undefined')
268
+ ? { register: () => {}, unregister: () => {} }
269
+ : new FinalizationRegistry(ptr => wasm.__wbg_callfnargs_free(ptr >>> 0, 1));
270
+
271
+ export class CallFnArgs {
272
+
273
+ __destroy_into_raw() {
274
+ const ptr = this.__wbg_ptr;
275
+ this.__wbg_ptr = 0;
276
+ CallFnArgsFinalization.unregister(this);
277
+ return ptr;
278
+ }
279
+
280
+ free() {
281
+ const ptr = this.__destroy_into_raw();
282
+ wasm.__wbg_callfnargs_free(ptr, 0);
283
+ }
284
+ /**
285
+ * @param {string} contract
286
+ * @param {string} method
287
+ * @param {Uint8Array[]} args
288
+ * @param {string} sender
289
+ */
290
+ constructor(contract, method, args, sender) {
291
+ const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
292
+ const len0 = WASM_VECTOR_LEN;
293
+ const ptr1 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
294
+ const len1 = WASM_VECTOR_LEN;
295
+ const ptr2 = passArrayJsValueToWasm0(args, wasm.__wbindgen_malloc);
296
+ const len2 = WASM_VECTOR_LEN;
297
+ const ptr3 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
298
+ const len3 = WASM_VECTOR_LEN;
299
+ const ret = wasm.callfnargs_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
300
+ this.__wbg_ptr = ret >>> 0;
301
+ CallFnArgsFinalization.register(this, this.__wbg_ptr, this);
302
+ return this;
303
+ }
304
+ }
305
+
306
+ const ContractOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
307
+ ? { register: () => {}, unregister: () => {} }
308
+ : new FinalizationRegistry(ptr => wasm.__wbg_contractoptions_free(ptr >>> 0, 1));
309
+
310
+ export class ContractOptions {
311
+
312
+ __destroy_into_raw() {
313
+ const ptr = this.__wbg_ptr;
314
+ this.__wbg_ptr = 0;
315
+ ContractOptionsFinalization.unregister(this);
316
+ return ptr;
317
+ }
318
+
319
+ free() {
320
+ const ptr = this.__destroy_into_raw();
321
+ wasm.__wbg_contractoptions_free(ptr, 0);
322
+ }
323
+ /**
324
+ * @param {number | null} [clarity_version]
325
+ */
326
+ constructor(clarity_version) {
327
+ const ret = wasm.contractoptions_new(isLikeNone(clarity_version) ? 0x100000001 : (clarity_version) >>> 0);
328
+ this.__wbg_ptr = ret >>> 0;
329
+ ContractOptionsFinalization.register(this, this.__wbg_ptr, this);
330
+ return this;
331
+ }
332
+ }
333
+
334
+ const DeployContractArgsFinalization = (typeof FinalizationRegistry === 'undefined')
335
+ ? { register: () => {}, unregister: () => {} }
336
+ : new FinalizationRegistry(ptr => wasm.__wbg_deploycontractargs_free(ptr >>> 0, 1));
337
+
338
+ export class DeployContractArgs {
339
+
340
+ __destroy_into_raw() {
341
+ const ptr = this.__wbg_ptr;
342
+ this.__wbg_ptr = 0;
343
+ DeployContractArgsFinalization.unregister(this);
344
+ return ptr;
345
+ }
346
+
347
+ free() {
348
+ const ptr = this.__destroy_into_raw();
349
+ wasm.__wbg_deploycontractargs_free(ptr, 0);
350
+ }
351
+ /**
352
+ * @param {string} name
353
+ * @param {string} content
354
+ * @param {ContractOptions} options
355
+ * @param {string} sender
356
+ */
357
+ constructor(name, content, options, sender) {
358
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
+ const len0 = WASM_VECTOR_LEN;
360
+ const ptr1 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
361
+ const len1 = WASM_VECTOR_LEN;
362
+ _assertClass(options, ContractOptions);
363
+ var ptr2 = options.__destroy_into_raw();
364
+ const ptr3 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
365
+ const len3 = WASM_VECTOR_LEN;
366
+ const ret = wasm.deploycontractargs_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3);
367
+ this.__wbg_ptr = ret >>> 0;
368
+ DeployContractArgsFinalization.register(this, this.__wbg_ptr, this);
369
+ return this;
370
+ }
371
+ }
372
+
373
+ const SDKFinalization = (typeof FinalizationRegistry === 'undefined')
374
+ ? { register: () => {}, unregister: () => {} }
375
+ : new FinalizationRegistry(ptr => wasm.__wbg_sdk_free(ptr >>> 0, 1));
376
+
377
+ export class SDK {
378
+
379
+ __destroy_into_raw() {
380
+ const ptr = this.__wbg_ptr;
381
+ this.__wbg_ptr = 0;
382
+ SDKFinalization.unregister(this);
383
+ return ptr;
384
+ }
385
+
386
+ free() {
387
+ const ptr = this.__destroy_into_raw();
388
+ wasm.__wbg_sdk_free(ptr, 0);
389
+ }
390
+ /**
391
+ * @returns {string}
392
+ */
393
+ get deployer() {
394
+ let deferred1_0;
395
+ let deferred1_1;
396
+ try {
397
+ const ret = wasm.__wbg_get_sdk_deployer(this.__wbg_ptr);
398
+ deferred1_0 = ret[0];
399
+ deferred1_1 = ret[1];
400
+ return getStringFromWasm0(ret[0], ret[1]);
401
+ } finally {
402
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
403
+ }
404
+ }
405
+ /**
406
+ * @param {string} arg0
407
+ */
408
+ set deployer(arg0) {
409
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
410
+ const len0 = WASM_VECTOR_LEN;
411
+ wasm.__wbg_set_sdk_deployer(this.__wbg_ptr, ptr0, len0);
412
+ }
413
+ /**
414
+ * @param {Function} fs_request
415
+ * @param {SDKOptions | null} [options]
416
+ */
417
+ constructor(fs_request, options) {
418
+ let ptr0 = 0;
419
+ if (!isLikeNone(options)) {
420
+ _assertClass(options, SDKOptions);
421
+ ptr0 = options.__destroy_into_raw();
422
+ }
423
+ const ret = wasm.sdk_new(fs_request, ptr0);
424
+ this.__wbg_ptr = ret >>> 0;
425
+ SDKFinalization.register(this, this.__wbg_ptr, this);
426
+ return this;
427
+ }
428
+ /**
429
+ * @returns {EpochString}
430
+ */
431
+ static getDefaultEpoch() {
432
+ const ret = wasm.sdk_getDefaultEpoch();
433
+ return ret;
434
+ }
435
+ /**
436
+ * @returns {ClarityVersionString}
437
+ */
438
+ getDefaultClarityVersionForCurrentEpoch() {
439
+ const ret = wasm.sdk_getDefaultClarityVersionForCurrentEpoch(this.__wbg_ptr);
440
+ return ret;
441
+ }
442
+ /**
443
+ * @param {any} remote_data_settings
444
+ * @returns {Promise<void>}
445
+ */
446
+ initEmptySession(remote_data_settings) {
447
+ const ret = wasm.sdk_initEmptySession(this.__wbg_ptr, remote_data_settings);
448
+ return ret;
449
+ }
450
+ /**
451
+ * @param {string} cwd
452
+ * @param {string} manifest_path
453
+ * @returns {Promise<void>}
454
+ */
455
+ initSession(cwd, manifest_path) {
456
+ const ptr0 = passStringToWasm0(cwd, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
457
+ const len0 = WASM_VECTOR_LEN;
458
+ const ptr1 = passStringToWasm0(manifest_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
459
+ const len1 = WASM_VECTOR_LEN;
460
+ const ret = wasm.sdk_initSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
461
+ return ret;
462
+ }
463
+ clearCache() {
464
+ wasm.sdk_clearCache(this.__wbg_ptr);
465
+ }
466
+ /**
467
+ * @returns {number}
468
+ */
469
+ get blockHeight() {
470
+ const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
471
+ return ret >>> 0;
472
+ }
473
+ /**
474
+ * @returns {number}
475
+ */
476
+ get stacksBlockHeight() {
477
+ const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
478
+ return ret >>> 0;
479
+ }
480
+ /**
481
+ * @returns {number}
482
+ */
483
+ get burnBlockHeight() {
484
+ const ret = wasm.sdk_burnBlockHeight(this.__wbg_ptr);
485
+ return ret >>> 0;
486
+ }
487
+ /**
488
+ * @returns {string}
489
+ */
490
+ get currentEpoch() {
491
+ let deferred1_0;
492
+ let deferred1_1;
493
+ try {
494
+ const ret = wasm.sdk_currentEpoch(this.__wbg_ptr);
495
+ deferred1_0 = ret[0];
496
+ deferred1_1 = ret[1];
497
+ return getStringFromWasm0(ret[0], ret[1]);
498
+ } finally {
499
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
500
+ }
501
+ }
502
+ /**
503
+ * @param {EpochString} epoch
504
+ */
505
+ setEpoch(epoch) {
506
+ wasm.sdk_setEpoch(this.__wbg_ptr, epoch);
507
+ }
508
+ /**
509
+ * @returns {Map<string, IContractInterface>}
510
+ */
511
+ getContractsInterfaces() {
512
+ const ret = wasm.sdk_getContractsInterfaces(this.__wbg_ptr);
513
+ if (ret[2]) {
514
+ throw takeFromExternrefTable0(ret[1]);
515
+ }
516
+ return takeFromExternrefTable0(ret[0]);
517
+ }
518
+ /**
519
+ * @param {string} contract
520
+ * @returns {string | undefined}
521
+ */
522
+ getContractSource(contract) {
523
+ const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
524
+ const len0 = WASM_VECTOR_LEN;
525
+ const ret = wasm.sdk_getContractSource(this.__wbg_ptr, ptr0, len0);
526
+ let v2;
527
+ if (ret[0] !== 0) {
528
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
529
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
530
+ }
531
+ return v2;
532
+ }
533
+ /**
534
+ * @param {string} contract
535
+ * @returns {IContractAST}
536
+ */
537
+ getContractAST(contract) {
538
+ const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
539
+ const len0 = WASM_VECTOR_LEN;
540
+ const ret = wasm.sdk_getContractAST(this.__wbg_ptr, ptr0, len0);
541
+ if (ret[2]) {
542
+ throw takeFromExternrefTable0(ret[1]);
543
+ }
544
+ return takeFromExternrefTable0(ret[0]);
545
+ }
546
+ /**
547
+ * @returns {Map<string, Map<string, bigint>>}
548
+ */
549
+ getAssetsMap() {
550
+ const ret = wasm.sdk_getAssetsMap(this.__wbg_ptr);
551
+ if (ret[2]) {
552
+ throw takeFromExternrefTable0(ret[1]);
553
+ }
554
+ return takeFromExternrefTable0(ret[0]);
555
+ }
556
+ /**
557
+ * @returns {Map<string, string>}
558
+ */
559
+ getAccounts() {
560
+ const ret = wasm.sdk_getAccounts(this.__wbg_ptr);
561
+ if (ret[2]) {
562
+ throw takeFromExternrefTable0(ret[1]);
563
+ }
564
+ return takeFromExternrefTable0(ret[0]);
565
+ }
566
+ /**
567
+ * @param {string} contract
568
+ * @param {string} var_name
569
+ * @returns {string}
570
+ */
571
+ getDataVar(contract, var_name) {
572
+ let deferred4_0;
573
+ let deferred4_1;
574
+ try {
575
+ const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
576
+ const len0 = WASM_VECTOR_LEN;
577
+ const ptr1 = passStringToWasm0(var_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
578
+ const len1 = WASM_VECTOR_LEN;
579
+ const ret = wasm.sdk_getDataVar(this.__wbg_ptr, ptr0, len0, ptr1, len1);
580
+ var ptr3 = ret[0];
581
+ var len3 = ret[1];
582
+ if (ret[3]) {
583
+ ptr3 = 0; len3 = 0;
584
+ throw takeFromExternrefTable0(ret[2]);
585
+ }
586
+ deferred4_0 = ptr3;
587
+ deferred4_1 = len3;
588
+ return getStringFromWasm0(ptr3, len3);
589
+ } finally {
590
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
591
+ }
592
+ }
593
+ /**
594
+ * @returns {bigint}
595
+ */
596
+ getBlockTime() {
597
+ const ret = wasm.sdk_getBlockTime(this.__wbg_ptr);
598
+ return BigInt.asUintN(64, ret);
599
+ }
600
+ /**
601
+ * @param {string} contract
602
+ * @param {string} map_name
603
+ * @param {Uint8Array} map_key
604
+ * @returns {string}
605
+ */
606
+ getMapEntry(contract, map_name, map_key) {
607
+ let deferred5_0;
608
+ let deferred5_1;
609
+ try {
610
+ const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
611
+ const len0 = WASM_VECTOR_LEN;
612
+ const ptr1 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
613
+ const len1 = WASM_VECTOR_LEN;
614
+ const ptr2 = passArray8ToWasm0(map_key, wasm.__wbindgen_malloc);
615
+ const len2 = WASM_VECTOR_LEN;
616
+ const ret = wasm.sdk_getMapEntry(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
617
+ var ptr4 = ret[0];
618
+ var len4 = ret[1];
619
+ if (ret[3]) {
620
+ ptr4 = 0; len4 = 0;
621
+ throw takeFromExternrefTable0(ret[2]);
622
+ }
623
+ deferred5_0 = ptr4;
624
+ deferred5_1 = len4;
625
+ return getStringFromWasm0(ptr4, len4);
626
+ } finally {
627
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
628
+ }
629
+ }
630
+ /**
631
+ * @param {CallFnArgs} args
632
+ * @returns {TransactionRes}
633
+ */
634
+ callReadOnlyFn(args) {
635
+ _assertClass(args, CallFnArgs);
636
+ const ret = wasm.sdk_callReadOnlyFn(this.__wbg_ptr, args.__wbg_ptr);
637
+ if (ret[2]) {
638
+ throw takeFromExternrefTable0(ret[1]);
639
+ }
640
+ return TransactionRes.__wrap(ret[0]);
641
+ }
642
+ /**
643
+ * @param {DeployContractArgs} args
644
+ * @returns {TransactionRes}
645
+ */
646
+ deployContract(args) {
647
+ _assertClass(args, DeployContractArgs);
648
+ const ret = wasm.sdk_deployContract(this.__wbg_ptr, args.__wbg_ptr);
649
+ if (ret[2]) {
650
+ throw takeFromExternrefTable0(ret[1]);
651
+ }
652
+ return TransactionRes.__wrap(ret[0]);
653
+ }
654
+ /**
655
+ * @param {TransferSTXArgs} args
656
+ * @returns {TransactionRes}
657
+ */
658
+ transferSTX(args) {
659
+ _assertClass(args, TransferSTXArgs);
660
+ const ret = wasm.sdk_transferSTX(this.__wbg_ptr, args.__wbg_ptr);
661
+ if (ret[2]) {
662
+ throw takeFromExternrefTable0(ret[1]);
663
+ }
664
+ return TransactionRes.__wrap(ret[0]);
665
+ }
666
+ /**
667
+ * @param {CallFnArgs} args
668
+ * @returns {TransactionRes}
669
+ */
670
+ callPublicFn(args) {
671
+ _assertClass(args, CallFnArgs);
672
+ const ret = wasm.sdk_callPublicFn(this.__wbg_ptr, args.__wbg_ptr);
673
+ if (ret[2]) {
674
+ throw takeFromExternrefTable0(ret[1]);
675
+ }
676
+ return TransactionRes.__wrap(ret[0]);
677
+ }
678
+ /**
679
+ * @param {CallFnArgs} args
680
+ * @returns {TransactionRes}
681
+ */
682
+ callPrivateFn(args) {
683
+ _assertClass(args, CallFnArgs);
684
+ const ret = wasm.sdk_callPrivateFn(this.__wbg_ptr, args.__wbg_ptr);
685
+ if (ret[2]) {
686
+ throw takeFromExternrefTable0(ret[1]);
687
+ }
688
+ return TransactionRes.__wrap(ret[0]);
689
+ }
690
+ /**
691
+ * @param {Array<any>} js_txs
692
+ * @returns {any}
693
+ */
694
+ mineBlock(js_txs) {
695
+ const ret = wasm.sdk_mineBlock(this.__wbg_ptr, js_txs);
696
+ if (ret[2]) {
697
+ throw takeFromExternrefTable0(ret[1]);
698
+ }
699
+ return takeFromExternrefTable0(ret[0]);
700
+ }
701
+ /**
702
+ * @returns {number}
703
+ */
704
+ mineEmptyBlock() {
705
+ const ret = wasm.sdk_mineEmptyBlock(this.__wbg_ptr);
706
+ return ret >>> 0;
707
+ }
708
+ /**
709
+ * @param {number | null} [count]
710
+ * @returns {number}
711
+ */
712
+ mineEmptyBlocks(count) {
713
+ const ret = wasm.sdk_mineEmptyBlocks(this.__wbg_ptr, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
714
+ return ret >>> 0;
715
+ }
716
+ /**
717
+ * @returns {number}
718
+ */
719
+ mineEmptyStacksBlock() {
720
+ const ret = wasm.sdk_mineEmptyStacksBlock(this.__wbg_ptr);
721
+ if (ret[2]) {
722
+ throw takeFromExternrefTable0(ret[1]);
723
+ }
724
+ return ret[0] >>> 0;
725
+ }
726
+ /**
727
+ * @param {number | null} [count]
728
+ * @returns {number}
729
+ */
730
+ mineEmptyStacksBlocks(count) {
731
+ const ret = wasm.sdk_mineEmptyStacksBlocks(this.__wbg_ptr, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
732
+ if (ret[2]) {
733
+ throw takeFromExternrefTable0(ret[1]);
734
+ }
735
+ return ret[0] >>> 0;
736
+ }
737
+ /**
738
+ * @returns {number}
739
+ */
740
+ mineEmptyBurnBlock() {
741
+ const ret = wasm.sdk_mineEmptyBurnBlock(this.__wbg_ptr);
742
+ return ret >>> 0;
743
+ }
744
+ /**
745
+ * @param {number | null} [count]
746
+ * @returns {number}
747
+ */
748
+ mineEmptyBurnBlocks(count) {
749
+ const ret = wasm.sdk_mineEmptyBurnBlocks(this.__wbg_ptr, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
750
+ return ret >>> 0;
751
+ }
752
+ /**
753
+ * @param {string} snippet
754
+ * @returns {string}
755
+ */
756
+ runSnippet(snippet) {
757
+ let deferred2_0;
758
+ let deferred2_1;
759
+ try {
760
+ const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
761
+ const len0 = WASM_VECTOR_LEN;
762
+ const ret = wasm.sdk_runSnippet(this.__wbg_ptr, ptr0, len0);
763
+ deferred2_0 = ret[0];
764
+ deferred2_1 = ret[1];
765
+ return getStringFromWasm0(ret[0], ret[1]);
766
+ } finally {
767
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
768
+ }
769
+ }
770
+ /**
771
+ * @param {string} snippet
772
+ * @returns {TransactionRes}
773
+ */
774
+ execute(snippet) {
775
+ const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
776
+ const len0 = WASM_VECTOR_LEN;
777
+ const ret = wasm.sdk_execute(this.__wbg_ptr, ptr0, len0);
778
+ if (ret[2]) {
779
+ throw takeFromExternrefTable0(ret[1]);
780
+ }
781
+ return TransactionRes.__wrap(ret[0]);
782
+ }
783
+ /**
784
+ * @param {string} snippet
785
+ * @returns {string}
786
+ */
787
+ executeCommand(snippet) {
788
+ let deferred2_0;
789
+ let deferred2_1;
790
+ try {
791
+ const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
792
+ const len0 = WASM_VECTOR_LEN;
793
+ const ret = wasm.sdk_executeCommand(this.__wbg_ptr, ptr0, len0);
794
+ deferred2_0 = ret[0];
795
+ deferred2_1 = ret[1];
796
+ return getStringFromWasm0(ret[0], ret[1]);
797
+ } finally {
798
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
799
+ }
800
+ }
801
+ /**
802
+ * Returns the last contract call trace as a string, if available.
803
+ * @returns {string | undefined}
804
+ */
805
+ getLastContractCallTrace() {
806
+ const ret = wasm.sdk_getLastContractCallTrace(this.__wbg_ptr);
807
+ let v1;
808
+ if (ret[0] !== 0) {
809
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
810
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
811
+ }
812
+ return v1;
813
+ }
814
+ /**
815
+ * @param {string[]} addresses
816
+ */
817
+ setLocalAccounts(addresses) {
818
+ const ptr0 = passArrayJsValueToWasm0(addresses, wasm.__wbindgen_malloc);
819
+ const len0 = WASM_VECTOR_LEN;
820
+ wasm.sdk_setLocalAccounts(this.__wbg_ptr, ptr0, len0);
821
+ }
822
+ /**
823
+ * @param {string} recipient
824
+ * @param {bigint} amount
825
+ * @returns {string}
826
+ */
827
+ mintSTX(recipient, amount) {
828
+ let deferred3_0;
829
+ let deferred3_1;
830
+ try {
831
+ const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
832
+ const len0 = WASM_VECTOR_LEN;
833
+ const ret = wasm.sdk_mintSTX(this.__wbg_ptr, ptr0, len0, amount);
834
+ var ptr2 = ret[0];
835
+ var len2 = ret[1];
836
+ if (ret[3]) {
837
+ ptr2 = 0; len2 = 0;
838
+ throw takeFromExternrefTable0(ret[2]);
839
+ }
840
+ deferred3_0 = ptr2;
841
+ deferred3_1 = len2;
842
+ return getStringFromWasm0(ptr2, len2);
843
+ } finally {
844
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
845
+ }
846
+ }
847
+ /**
848
+ * @param {string} test_name
849
+ */
850
+ setCurrentTestName(test_name) {
851
+ const ptr0 = passStringToWasm0(test_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
852
+ const len0 = WASM_VECTOR_LEN;
853
+ wasm.sdk_setCurrentTestName(this.__wbg_ptr, ptr0, len0);
854
+ }
855
+ /**
856
+ * @param {boolean} include_boot_contracts
857
+ * @param {string} boot_contracts_path
858
+ * @returns {SessionReport}
859
+ */
860
+ collectReport(include_boot_contracts, boot_contracts_path) {
861
+ const ptr0 = passStringToWasm0(boot_contracts_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
862
+ const len0 = WASM_VECTOR_LEN;
863
+ const ret = wasm.sdk_collectReport(this.__wbg_ptr, include_boot_contracts, ptr0, len0);
864
+ if (ret[2]) {
865
+ throw takeFromExternrefTable0(ret[1]);
866
+ }
867
+ return SessionReport.__wrap(ret[0]);
868
+ }
869
+ /**
870
+ * @param {string} cost_field
871
+ */
872
+ enablePerformance(cost_field) {
873
+ const ptr0 = passStringToWasm0(cost_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
874
+ const len0 = WASM_VECTOR_LEN;
875
+ const ret = wasm.sdk_enablePerformance(this.__wbg_ptr, ptr0, len0);
876
+ if (ret[1]) {
877
+ throw takeFromExternrefTable0(ret[0]);
878
+ }
879
+ }
880
+ }
881
+
882
+ const SDKOptionsFinalization = (typeof FinalizationRegistry === 'undefined')
883
+ ? { register: () => {}, unregister: () => {} }
884
+ : new FinalizationRegistry(ptr => wasm.__wbg_sdkoptions_free(ptr >>> 0, 1));
885
+
886
+ export class SDKOptions {
887
+
888
+ __destroy_into_raw() {
889
+ const ptr = this.__wbg_ptr;
890
+ this.__wbg_ptr = 0;
891
+ SDKOptionsFinalization.unregister(this);
892
+ return ptr;
893
+ }
894
+
895
+ free() {
896
+ const ptr = this.__destroy_into_raw();
897
+ wasm.__wbg_sdkoptions_free(ptr, 0);
898
+ }
899
+ /**
900
+ * @returns {boolean}
901
+ */
902
+ get trackCosts() {
903
+ const ret = wasm.__wbg_get_sdkoptions_trackCosts(this.__wbg_ptr);
904
+ return ret !== 0;
905
+ }
906
+ /**
907
+ * @param {boolean} arg0
908
+ */
909
+ set trackCosts(arg0) {
910
+ wasm.__wbg_set_sdkoptions_trackCosts(this.__wbg_ptr, arg0);
911
+ }
912
+ /**
913
+ * @returns {boolean}
914
+ */
915
+ get trackCoverage() {
916
+ const ret = wasm.__wbg_get_sdkoptions_trackCoverage(this.__wbg_ptr);
917
+ return ret !== 0;
918
+ }
919
+ /**
920
+ * @param {boolean} arg0
921
+ */
922
+ set trackCoverage(arg0) {
923
+ wasm.__wbg_set_sdkoptions_trackCoverage(this.__wbg_ptr, arg0);
924
+ }
925
+ /**
926
+ * @returns {boolean}
927
+ */
928
+ get trackPerformance() {
929
+ const ret = wasm.__wbg_get_sdkoptions_trackPerformance(this.__wbg_ptr);
930
+ return ret !== 0;
931
+ }
932
+ /**
933
+ * @param {boolean} arg0
934
+ */
935
+ set trackPerformance(arg0) {
936
+ wasm.__wbg_set_sdkoptions_trackPerformance(this.__wbg_ptr, arg0);
937
+ }
938
+ /**
939
+ * @param {boolean} track_costs
940
+ * @param {boolean} track_coverage
941
+ * @param {boolean | null} [track_performance]
942
+ */
943
+ constructor(track_costs, track_coverage, track_performance) {
944
+ const ret = wasm.sdkoptions_new(track_costs, track_coverage, isLikeNone(track_performance) ? 0xFFFFFF : track_performance ? 1 : 0);
945
+ this.__wbg_ptr = ret >>> 0;
946
+ SDKOptionsFinalization.register(this, this.__wbg_ptr, this);
947
+ return this;
948
+ }
949
+ }
950
+
951
+ const SessionReportFinalization = (typeof FinalizationRegistry === 'undefined')
952
+ ? { register: () => {}, unregister: () => {} }
953
+ : new FinalizationRegistry(ptr => wasm.__wbg_sessionreport_free(ptr >>> 0, 1));
954
+
955
+ export class SessionReport {
956
+
957
+ static __wrap(ptr) {
958
+ ptr = ptr >>> 0;
959
+ const obj = Object.create(SessionReport.prototype);
960
+ obj.__wbg_ptr = ptr;
961
+ SessionReportFinalization.register(obj, obj.__wbg_ptr, obj);
962
+ return obj;
963
+ }
964
+
965
+ __destroy_into_raw() {
966
+ const ptr = this.__wbg_ptr;
967
+ this.__wbg_ptr = 0;
968
+ SessionReportFinalization.unregister(this);
969
+ return ptr;
970
+ }
971
+
972
+ free() {
973
+ const ptr = this.__destroy_into_raw();
974
+ wasm.__wbg_sessionreport_free(ptr, 0);
975
+ }
976
+ /**
977
+ * @returns {string}
978
+ */
979
+ get coverage() {
980
+ let deferred1_0;
981
+ let deferred1_1;
982
+ try {
983
+ const ret = wasm.__wbg_get_sessionreport_coverage(this.__wbg_ptr);
984
+ deferred1_0 = ret[0];
985
+ deferred1_1 = ret[1];
986
+ return getStringFromWasm0(ret[0], ret[1]);
987
+ } finally {
988
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
989
+ }
990
+ }
991
+ /**
992
+ * @param {string} arg0
993
+ */
994
+ set coverage(arg0) {
995
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
996
+ const len0 = WASM_VECTOR_LEN;
997
+ wasm.__wbg_set_sessionreport_coverage(this.__wbg_ptr, ptr0, len0);
998
+ }
999
+ /**
1000
+ * @returns {string}
1001
+ */
1002
+ get costs() {
1003
+ let deferred1_0;
1004
+ let deferred1_1;
1005
+ try {
1006
+ const ret = wasm.__wbg_get_sessionreport_costs(this.__wbg_ptr);
1007
+ deferred1_0 = ret[0];
1008
+ deferred1_1 = ret[1];
1009
+ return getStringFromWasm0(ret[0], ret[1]);
1010
+ } finally {
1011
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1012
+ }
1013
+ }
1014
+ /**
1015
+ * @param {string} arg0
1016
+ */
1017
+ set costs(arg0) {
1018
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1019
+ const len0 = WASM_VECTOR_LEN;
1020
+ wasm.__wbg_set_sessionreport_costs(this.__wbg_ptr, ptr0, len0);
1021
+ }
1022
+ }
1023
+
1024
+ const TransactionResFinalization = (typeof FinalizationRegistry === 'undefined')
1025
+ ? { register: () => {}, unregister: () => {} }
1026
+ : new FinalizationRegistry(ptr => wasm.__wbg_transactionres_free(ptr >>> 0, 1));
1027
+
1028
+ export class TransactionRes {
1029
+
1030
+ static __wrap(ptr) {
1031
+ ptr = ptr >>> 0;
1032
+ const obj = Object.create(TransactionRes.prototype);
1033
+ obj.__wbg_ptr = ptr;
1034
+ TransactionResFinalization.register(obj, obj.__wbg_ptr, obj);
1035
+ return obj;
1036
+ }
1037
+
1038
+ __destroy_into_raw() {
1039
+ const ptr = this.__wbg_ptr;
1040
+ this.__wbg_ptr = 0;
1041
+ TransactionResFinalization.unregister(this);
1042
+ return ptr;
1043
+ }
1044
+
1045
+ free() {
1046
+ const ptr = this.__destroy_into_raw();
1047
+ wasm.__wbg_transactionres_free(ptr, 0);
1048
+ }
1049
+ /**
1050
+ * @returns {string}
1051
+ */
1052
+ get result() {
1053
+ let deferred1_0;
1054
+ let deferred1_1;
1055
+ try {
1056
+ const ret = wasm.__wbg_get_transactionres_result(this.__wbg_ptr);
1057
+ deferred1_0 = ret[0];
1058
+ deferred1_1 = ret[1];
1059
+ return getStringFromWasm0(ret[0], ret[1]);
1060
+ } finally {
1061
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1062
+ }
1063
+ }
1064
+ /**
1065
+ * @param {string} arg0
1066
+ */
1067
+ set result(arg0) {
1068
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1069
+ const len0 = WASM_VECTOR_LEN;
1070
+ wasm.__wbg_set_sessionreport_coverage(this.__wbg_ptr, ptr0, len0);
1071
+ }
1072
+ /**
1073
+ * @returns {string}
1074
+ */
1075
+ get events() {
1076
+ let deferred1_0;
1077
+ let deferred1_1;
1078
+ try {
1079
+ const ret = wasm.__wbg_get_transactionres_events(this.__wbg_ptr);
1080
+ deferred1_0 = ret[0];
1081
+ deferred1_1 = ret[1];
1082
+ return getStringFromWasm0(ret[0], ret[1]);
1083
+ } finally {
1084
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1085
+ }
1086
+ }
1087
+ /**
1088
+ * @param {string} arg0
1089
+ */
1090
+ set events(arg0) {
1091
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1092
+ const len0 = WASM_VECTOR_LEN;
1093
+ wasm.__wbg_set_sessionreport_costs(this.__wbg_ptr, ptr0, len0);
1094
+ }
1095
+ /**
1096
+ * @returns {string}
1097
+ */
1098
+ get costs() {
1099
+ let deferred1_0;
1100
+ let deferred1_1;
1101
+ try {
1102
+ const ret = wasm.__wbg_get_transactionres_costs(this.__wbg_ptr);
1103
+ deferred1_0 = ret[0];
1104
+ deferred1_1 = ret[1];
1105
+ return getStringFromWasm0(ret[0], ret[1]);
1106
+ } finally {
1107
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1108
+ }
1109
+ }
1110
+ /**
1111
+ * @param {string} arg0
1112
+ */
1113
+ set costs(arg0) {
1114
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1115
+ const len0 = WASM_VECTOR_LEN;
1116
+ wasm.__wbg_set_transactionres_costs(this.__wbg_ptr, ptr0, len0);
1117
+ }
1118
+ /**
1119
+ * @returns {string | undefined}
1120
+ */
1121
+ get performance() {
1122
+ const ret = wasm.__wbg_get_transactionres_performance(this.__wbg_ptr);
1123
+ let v1;
1124
+ if (ret[0] !== 0) {
1125
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
1126
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1127
+ }
1128
+ return v1;
1129
+ }
1130
+ /**
1131
+ * @param {string | null} [arg0]
1132
+ */
1133
+ set performance(arg0) {
1134
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1135
+ var len0 = WASM_VECTOR_LEN;
1136
+ wasm.__wbg_set_transactionres_performance(this.__wbg_ptr, ptr0, len0);
1137
+ }
1138
+ }
1139
+
1140
+ const TransferSTXArgsFinalization = (typeof FinalizationRegistry === 'undefined')
1141
+ ? { register: () => {}, unregister: () => {} }
1142
+ : new FinalizationRegistry(ptr => wasm.__wbg_transferstxargs_free(ptr >>> 0, 1));
1143
+
1144
+ export class TransferSTXArgs {
1145
+
1146
+ __destroy_into_raw() {
1147
+ const ptr = this.__wbg_ptr;
1148
+ this.__wbg_ptr = 0;
1149
+ TransferSTXArgsFinalization.unregister(this);
1150
+ return ptr;
1151
+ }
1152
+
1153
+ free() {
1154
+ const ptr = this.__destroy_into_raw();
1155
+ wasm.__wbg_transferstxargs_free(ptr, 0);
1156
+ }
1157
+ /**
1158
+ * @param {bigint} amount
1159
+ * @param {string} recipient
1160
+ * @param {string} sender
1161
+ */
1162
+ constructor(amount, recipient, sender) {
1163
+ const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1164
+ const len0 = WASM_VECTOR_LEN;
1165
+ const ptr1 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1166
+ const len1 = WASM_VECTOR_LEN;
1167
+ const ret = wasm.transferstxargs_new(amount, ptr0, len0, ptr1, len1);
1168
+ this.__wbg_ptr = ret >>> 0;
1169
+ TransferSTXArgsFinalization.register(this, this.__wbg_ptr, this);
1170
+ return this;
1171
+ }
1172
+ }
1173
+
1174
+ const TxArgsFinalization = (typeof FinalizationRegistry === 'undefined')
1175
+ ? { register: () => {}, unregister: () => {} }
1176
+ : new FinalizationRegistry(ptr => wasm.__wbg_txargs_free(ptr >>> 0, 1));
1177
+
1178
+ export class TxArgs {
1179
+
1180
+ __destroy_into_raw() {
1181
+ const ptr = this.__wbg_ptr;
1182
+ this.__wbg_ptr = 0;
1183
+ TxArgsFinalization.unregister(this);
1184
+ return ptr;
1185
+ }
1186
+
1187
+ free() {
1188
+ const ptr = this.__destroy_into_raw();
1189
+ wasm.__wbg_txargs_free(ptr, 0);
1190
+ }
1191
+ }
1192
+
1193
+ const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
1194
+
1195
+ async function __wbg_load(module, imports) {
1196
+ if (typeof Response === 'function' && module instanceof Response) {
1197
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1198
+ try {
1199
+ return await WebAssembly.instantiateStreaming(module, imports);
1200
+
1201
+ } catch (e) {
1202
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
1203
+
1204
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1205
+ 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);
1206
+
1207
+ } else {
1208
+ throw e;
1209
+ }
1210
+ }
1211
+ }
1212
+
1213
+ const bytes = await module.arrayBuffer();
1214
+ return await WebAssembly.instantiate(bytes, imports);
1215
+
1216
+ } else {
1217
+ const instance = await WebAssembly.instantiate(module, imports);
1218
+
1219
+ if (instance instanceof WebAssembly.Instance) {
1220
+ return { instance, module };
1221
+
1222
+ } else {
1223
+ return instance;
1224
+ }
1225
+ }
1226
+ }
1227
+
1228
+ function __wbg_get_imports() {
1229
+ const imports = {};
1230
+ imports.wbg = {};
1231
+ imports.wbg.__wbg_Error_1f3748b298f99708 = function(arg0, arg1) {
1232
+ const ret = Error(getStringFromWasm0(arg0, arg1));
1233
+ return ret;
1234
+ };
1235
+ imports.wbg.__wbg_Number_577a493fc95ea223 = function(arg0) {
1236
+ const ret = Number(arg0);
1237
+ return ret;
1238
+ };
1239
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
1240
+ const ret = String(arg1);
1241
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1242
+ const len1 = WASM_VECTOR_LEN;
1243
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1244
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1245
+ };
1246
+ imports.wbg.__wbg_abort_6665281623826052 = function(arg0) {
1247
+ arg0.abort();
1248
+ };
1249
+ imports.wbg.__wbg_abort_c11a5d245a242912 = function(arg0, arg1) {
1250
+ arg0.abort(arg1);
1251
+ };
1252
+ imports.wbg.__wbg_append_3e86b0cd6215edd8 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1253
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1254
+ }, arguments) };
1255
+ imports.wbg.__wbg_arrayBuffer_55e4a430671abfd8 = function() { return handleError(function (arg0) {
1256
+ const ret = arg0.arrayBuffer();
1257
+ return ret;
1258
+ }, arguments) };
1259
+ imports.wbg.__wbg_call_2f8d426a20a307fe = function() { return handleError(function (arg0, arg1) {
1260
+ const ret = arg0.call(arg1);
1261
+ return ret;
1262
+ }, arguments) };
1263
+ imports.wbg.__wbg_call_d7c6e5dcdab87b72 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1264
+ const ret = arg0.call(arg1, arg2, arg3);
1265
+ return ret;
1266
+ }, arguments) };
1267
+ imports.wbg.__wbg_call_f53f0647ceb9c567 = function() { return handleError(function (arg0, arg1, arg2) {
1268
+ const ret = arg0.call(arg1, arg2);
1269
+ return ret;
1270
+ }, arguments) };
1271
+ imports.wbg.__wbg_clearTimeout_6222fede17abcb1a = function(arg0) {
1272
+ const ret = clearTimeout(arg0);
1273
+ return ret;
1274
+ };
1275
+ imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1276
+ const ret = arg0.crypto;
1277
+ return ret;
1278
+ };
1279
+ imports.wbg.__wbg_done_4a7743b6f942c9f3 = function(arg0) {
1280
+ const ret = arg0.done;
1281
+ return ret;
1282
+ };
1283
+ imports.wbg.__wbg_entries_17f7acbc2d691c0d = function(arg0) {
1284
+ const ret = Object.entries(arg0);
1285
+ return ret;
1286
+ };
1287
+ imports.wbg.__wbg_error_41f0589870426ea4 = function(arg0) {
1288
+ console.error(arg0);
1289
+ };
1290
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
1291
+ let deferred0_0;
1292
+ let deferred0_1;
1293
+ try {
1294
+ deferred0_0 = arg0;
1295
+ deferred0_1 = arg1;
1296
+ console.error(getStringFromWasm0(arg0, arg1));
1297
+ } finally {
1298
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1299
+ }
1300
+ };
1301
+ imports.wbg.__wbg_fetch_9885d2e26ad251bb = function(arg0, arg1) {
1302
+ const ret = arg0.fetch(arg1);
1303
+ return ret;
1304
+ };
1305
+ imports.wbg.__wbg_fetch_f156d10be9a5c88a = function(arg0) {
1306
+ const ret = fetch(arg0);
1307
+ return ret;
1308
+ };
1309
+ imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1310
+ arg0.getRandomValues(arg1);
1311
+ }, arguments) };
1312
+ imports.wbg.__wbg_getTime_5b1dd03bb6d4b784 = function(arg0) {
1313
+ const ret = arg0.getTime();
1314
+ return ret;
1315
+ };
1316
+ imports.wbg.__wbg_getTimezoneOffset_9b0741d5ee85cd60 = function(arg0) {
1317
+ const ret = arg0.getTimezoneOffset();
1318
+ return ret;
1319
+ };
1320
+ imports.wbg.__wbg_get_27b4bcbec57323ca = function() { return handleError(function (arg0, arg1) {
1321
+ const ret = Reflect.get(arg0, arg1);
1322
+ return ret;
1323
+ }, arguments) };
1324
+ imports.wbg.__wbg_get_59c6316d15f9f1d0 = function(arg0, arg1) {
1325
+ const ret = arg0[arg1 >>> 0];
1326
+ return ret;
1327
+ };
1328
+ imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
1329
+ const ret = arg0[arg1];
1330
+ return ret;
1331
+ };
1332
+ imports.wbg.__wbg_has_85abdd8aeb8edebf = function() { return handleError(function (arg0, arg1) {
1333
+ const ret = Reflect.has(arg0, arg1);
1334
+ return ret;
1335
+ }, arguments) };
1336
+ imports.wbg.__wbg_headers_177bc880a5823968 = function(arg0) {
1337
+ const ret = arg0.headers;
1338
+ return ret;
1339
+ };
1340
+ imports.wbg.__wbg_instanceof_ArrayBuffer_59339a3a6f0c10ea = function(arg0) {
1341
+ let result;
1342
+ try {
1343
+ result = arg0 instanceof ArrayBuffer;
1344
+ } catch (_) {
1345
+ result = false;
1346
+ }
1347
+ const ret = result;
1348
+ return ret;
1349
+ };
1350
+ imports.wbg.__wbg_instanceof_Response_0ab386c6818f788a = function(arg0) {
1351
+ let result;
1352
+ try {
1353
+ result = arg0 instanceof Response;
1354
+ } catch (_) {
1355
+ result = false;
1356
+ }
1357
+ const ret = result;
1358
+ return ret;
1359
+ };
1360
+ imports.wbg.__wbg_instanceof_Uint8Array_91f3c5adee7e6672 = function(arg0) {
1361
+ let result;
1362
+ try {
1363
+ result = arg0 instanceof Uint8Array;
1364
+ } catch (_) {
1365
+ result = false;
1366
+ }
1367
+ const ret = result;
1368
+ return ret;
1369
+ };
1370
+ imports.wbg.__wbg_isSafeInteger_6091d6e3ee1b65fd = function(arg0) {
1371
+ const ret = Number.isSafeInteger(arg0);
1372
+ return ret;
1373
+ };
1374
+ imports.wbg.__wbg_iterator_96378c3c9a17347c = function() {
1375
+ const ret = Symbol.iterator;
1376
+ return ret;
1377
+ };
1378
+ imports.wbg.__wbg_length_246fa1f85a0dea5b = function(arg0) {
1379
+ const ret = arg0.length;
1380
+ return ret;
1381
+ };
1382
+ imports.wbg.__wbg_length_904c0910ed998bf3 = function(arg0) {
1383
+ const ret = arg0.length;
1384
+ return ret;
1385
+ };
1386
+ imports.wbg.__wbg_log_f3c04200b995730f = function(arg0) {
1387
+ console.log(arg0);
1388
+ };
1389
+ imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1390
+ const ret = arg0.msCrypto;
1391
+ return ret;
1392
+ };
1393
+ imports.wbg.__wbg_new0_85cc856927102294 = function() {
1394
+ const ret = new Date();
1395
+ return ret;
1396
+ };
1397
+ imports.wbg.__wbg_new_0e42491da54e810c = function() { return handleError(function () {
1398
+ const ret = new XMLHttpRequest();
1399
+ return ret;
1400
+ }, arguments) };
1401
+ imports.wbg.__wbg_new_12588505388d0897 = function() { return handleError(function () {
1402
+ const ret = new Headers();
1403
+ return ret;
1404
+ }, arguments) };
1405
+ imports.wbg.__wbg_new_1930cbb8d9ffc31b = function() {
1406
+ const ret = new Object();
1407
+ return ret;
1408
+ };
1409
+ imports.wbg.__wbg_new_56407f99198feff7 = function() {
1410
+ const ret = new Map();
1411
+ return ret;
1412
+ };
1413
+ imports.wbg.__wbg_new_6a8b180049d9484e = function() { return handleError(function () {
1414
+ const ret = new AbortController();
1415
+ return ret;
1416
+ }, arguments) };
1417
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
1418
+ const ret = new Error();
1419
+ return ret;
1420
+ };
1421
+ imports.wbg.__wbg_new_9190433fb67ed635 = function(arg0) {
1422
+ const ret = new Uint8Array(arg0);
1423
+ return ret;
1424
+ };
1425
+ imports.wbg.__wbg_new_d5e3800b120e37e1 = function(arg0, arg1) {
1426
+ try {
1427
+ var state0 = {a: arg0, b: arg1};
1428
+ var cb0 = (arg0, arg1) => {
1429
+ const a = state0.a;
1430
+ state0.a = 0;
1431
+ try {
1432
+ return __wbg_adapter_233(a, state0.b, arg0, arg1);
1433
+ } finally {
1434
+ state0.a = a;
1435
+ }
1436
+ };
1437
+ const ret = new Promise(cb0);
1438
+ return ret;
1439
+ } finally {
1440
+ state0.a = state0.b = 0;
1441
+ }
1442
+ };
1443
+ imports.wbg.__wbg_new_e969dc3f68d25093 = function() {
1444
+ const ret = new Array();
1445
+ return ret;
1446
+ };
1447
+ imports.wbg.__wbg_new_eb6fa6c1e9ac9fb7 = function(arg0) {
1448
+ const ret = new Date(arg0);
1449
+ return ret;
1450
+ };
1451
+ imports.wbg.__wbg_newfromslice_d0d56929c6d9c842 = function(arg0, arg1) {
1452
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1453
+ return ret;
1454
+ };
1455
+ imports.wbg.__wbg_newnoargs_a81330f6e05d8aca = function(arg0, arg1) {
1456
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
1457
+ return ret;
1458
+ };
1459
+ imports.wbg.__wbg_newwithlength_ed0ee6c1edca86fc = function(arg0) {
1460
+ const ret = new Uint8Array(arg0 >>> 0);
1461
+ return ret;
1462
+ };
1463
+ imports.wbg.__wbg_newwithstrandinit_e8e22e9851f3c2fe = function() { return handleError(function (arg0, arg1, arg2) {
1464
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1465
+ return ret;
1466
+ }, arguments) };
1467
+ imports.wbg.__wbg_next_2e6b37020ac5fe58 = function() { return handleError(function (arg0) {
1468
+ const ret = arg0.next();
1469
+ return ret;
1470
+ }, arguments) };
1471
+ imports.wbg.__wbg_next_3de8f2669431a3ff = function(arg0) {
1472
+ const ret = arg0.next;
1473
+ return ret;
1474
+ };
1475
+ imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
1476
+ const ret = arg0.node;
1477
+ return ret;
1478
+ };
1479
+ imports.wbg.__wbg_open_f562b80a50e70cc2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
1480
+ arg0.open(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4), arg5 !== 0);
1481
+ }, arguments) };
1482
+ imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1483
+ const ret = arg0.process;
1484
+ return ret;
1485
+ };
1486
+ imports.wbg.__wbg_prototypesetcall_c5f74efd31aea86b = function(arg0, arg1, arg2) {
1487
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1488
+ };
1489
+ imports.wbg.__wbg_queueMicrotask_bcc6e26d899696db = function(arg0) {
1490
+ const ret = arg0.queueMicrotask;
1491
+ return ret;
1492
+ };
1493
+ imports.wbg.__wbg_queueMicrotask_f24a794d09c42640 = function(arg0) {
1494
+ queueMicrotask(arg0);
1495
+ };
1496
+ imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1497
+ arg0.randomFillSync(arg1);
1498
+ }, arguments) };
1499
+ imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1500
+ const ret = module.require;
1501
+ return ret;
1502
+ }, arguments) };
1503
+ imports.wbg.__wbg_resolve_5775c0ef9222f556 = function(arg0) {
1504
+ const ret = Promise.resolve(arg0);
1505
+ return ret;
1506
+ };
1507
+ imports.wbg.__wbg_responseText_28be5dba15ed5a28 = function() { return handleError(function (arg0, arg1) {
1508
+ const ret = arg1.responseText;
1509
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1510
+ var len1 = WASM_VECTOR_LEN;
1511
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1512
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1513
+ }, arguments) };
1514
+ imports.wbg.__wbg_send_7e67be94da3595b0 = function() { return handleError(function (arg0) {
1515
+ arg0.send();
1516
+ }, arguments) };
1517
+ imports.wbg.__wbg_setRequestHeader_f5bd6df2e7c11f16 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1518
+ arg0.setRequestHeader(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1519
+ }, arguments) };
1520
+ imports.wbg.__wbg_setTimeout_2b339866a2aa3789 = function(arg0, arg1) {
1521
+ const ret = setTimeout(arg0, arg1);
1522
+ return ret;
1523
+ };
1524
+ imports.wbg.__wbg_set_31197016f65a6a19 = function(arg0, arg1, arg2) {
1525
+ const ret = arg0.set(arg1, arg2);
1526
+ return ret;
1527
+ };
1528
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1529
+ arg0[arg1] = arg2;
1530
+ };
1531
+ imports.wbg.__wbg_set_b33e7a98099eed58 = function() { return handleError(function (arg0, arg1, arg2) {
1532
+ const ret = Reflect.set(arg0, arg1, arg2);
1533
+ return ret;
1534
+ }, arguments) };
1535
+ imports.wbg.__wbg_set_d636a0463acf1dbc = function(arg0, arg1, arg2) {
1536
+ arg0[arg1 >>> 0] = arg2;
1537
+ };
1538
+ imports.wbg.__wbg_setbody_e324371c31597f2a = function(arg0, arg1) {
1539
+ arg0.body = arg1;
1540
+ };
1541
+ imports.wbg.__wbg_setcache_7c95e3469a5bfb76 = function(arg0, arg1) {
1542
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
1543
+ };
1544
+ imports.wbg.__wbg_setcredentials_55a9317ed2777533 = function(arg0, arg1) {
1545
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1546
+ };
1547
+ imports.wbg.__wbg_setheaders_ac0b1e4890a949cd = function(arg0, arg1) {
1548
+ arg0.headers = arg1;
1549
+ };
1550
+ imports.wbg.__wbg_setmethod_9ce6e95af1ae0eaf = function(arg0, arg1, arg2) {
1551
+ arg0.method = getStringFromWasm0(arg1, arg2);
1552
+ };
1553
+ imports.wbg.__wbg_setmode_b89d1784e7e7f118 = function(arg0, arg1) {
1554
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1555
+ };
1556
+ imports.wbg.__wbg_setsignal_e663c6d962763cd5 = function(arg0, arg1) {
1557
+ arg0.signal = arg1;
1558
+ };
1559
+ imports.wbg.__wbg_signal_bdb003fe19e53a13 = function(arg0) {
1560
+ const ret = arg0.signal;
1561
+ return ret;
1562
+ };
1563
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
1564
+ const ret = arg1.stack;
1565
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1566
+ const len1 = WASM_VECTOR_LEN;
1567
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1568
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1569
+ };
1570
+ imports.wbg.__wbg_static_accessor_GLOBAL_1f13249cc3acc96d = function() {
1571
+ const ret = typeof global === 'undefined' ? null : global;
1572
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1573
+ };
1574
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_df7ae94b1e0ed6a3 = function() {
1575
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1576
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1577
+ };
1578
+ imports.wbg.__wbg_static_accessor_SELF_6265471db3b3c228 = function() {
1579
+ const ret = typeof self === 'undefined' ? null : self;
1580
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1581
+ };
1582
+ imports.wbg.__wbg_static_accessor_WINDOW_16fb482f8ec52863 = function() {
1583
+ const ret = typeof window === 'undefined' ? null : window;
1584
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1585
+ };
1586
+ imports.wbg.__wbg_status_1a1d0ab9224d19fc = function() { return handleError(function (arg0) {
1587
+ const ret = arg0.status;
1588
+ return ret;
1589
+ }, arguments) };
1590
+ imports.wbg.__wbg_status_31874648c8651949 = function(arg0) {
1591
+ const ret = arg0.status;
1592
+ return ret;
1593
+ };
1594
+ imports.wbg.__wbg_stringify_1f41b6198e0932e0 = function() { return handleError(function (arg0) {
1595
+ const ret = JSON.stringify(arg0);
1596
+ return ret;
1597
+ }, arguments) };
1598
+ imports.wbg.__wbg_subarray_a219824899e59712 = function(arg0, arg1, arg2) {
1599
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1600
+ return ret;
1601
+ };
1602
+ imports.wbg.__wbg_then_8d2fcccde5380a03 = function(arg0, arg1, arg2) {
1603
+ const ret = arg0.then(arg1, arg2);
1604
+ return ret;
1605
+ };
1606
+ imports.wbg.__wbg_then_9cc266be2bf537b6 = function(arg0, arg1) {
1607
+ const ret = arg0.then(arg1);
1608
+ return ret;
1609
+ };
1610
+ imports.wbg.__wbg_url_d5273b9e10503471 = function(arg0, arg1) {
1611
+ const ret = arg1.url;
1612
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1613
+ const len1 = WASM_VECTOR_LEN;
1614
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1615
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1616
+ };
1617
+ imports.wbg.__wbg_value_09d0b4eaab48b91d = function(arg0) {
1618
+ const ret = arg0.value;
1619
+ return ret;
1620
+ };
1621
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1622
+ const ret = arg0.versions;
1623
+ return ret;
1624
+ };
1625
+ imports.wbg.__wbg_vfs_3e4e963c5020aae9 = function(arg0, arg1, arg2) {
1626
+ let deferred0_0;
1627
+ let deferred0_1;
1628
+ try {
1629
+ deferred0_0 = arg0;
1630
+ deferred0_1 = arg1;
1631
+ const ret = window.vfs(getStringFromWasm0(arg0, arg1), arg2);
1632
+ return ret;
1633
+ } finally {
1634
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1635
+ }
1636
+ };
1637
+ imports.wbg.__wbg_wbindgenbooleanget_59f830b1a70d2530 = function(arg0) {
1638
+ const v = arg0;
1639
+ const ret = typeof(v) === 'boolean' ? v : undefined;
1640
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
1641
+ };
1642
+ imports.wbg.__wbg_wbindgencbdrop_a85ed476c6a370b9 = function(arg0) {
1643
+ const obj = arg0.original;
1644
+ if (obj.cnt-- == 1) {
1645
+ obj.a = 0;
1646
+ return true;
1647
+ }
1648
+ const ret = false;
1649
+ return ret;
1650
+ };
1651
+ imports.wbg.__wbg_wbindgendebugstring_bb652b1bc2061b6d = function(arg0, arg1) {
1652
+ const ret = debugString(arg1);
1653
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1654
+ const len1 = WASM_VECTOR_LEN;
1655
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1656
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1657
+ };
1658
+ imports.wbg.__wbg_wbindgenin_192b210aa1c401e9 = function(arg0, arg1) {
1659
+ const ret = arg0 in arg1;
1660
+ return ret;
1661
+ };
1662
+ imports.wbg.__wbg_wbindgenisfunction_ea72b9d66a0e1705 = function(arg0) {
1663
+ const ret = typeof(arg0) === 'function';
1664
+ return ret;
1665
+ };
1666
+ imports.wbg.__wbg_wbindgenisobject_dfe064a121d87553 = function(arg0) {
1667
+ const val = arg0;
1668
+ const ret = typeof(val) === 'object' && val !== null;
1669
+ return ret;
1670
+ };
1671
+ imports.wbg.__wbg_wbindgenisstring_4b74e4111ba029e6 = function(arg0) {
1672
+ const ret = typeof(arg0) === 'string';
1673
+ return ret;
1674
+ };
1675
+ imports.wbg.__wbg_wbindgenisundefined_71f08a6ade4354e7 = function(arg0) {
1676
+ const ret = arg0 === undefined;
1677
+ return ret;
1678
+ };
1679
+ imports.wbg.__wbg_wbindgenjsvallooseeq_9dd7bb4b95ac195c = function(arg0, arg1) {
1680
+ const ret = arg0 == arg1;
1681
+ return ret;
1682
+ };
1683
+ imports.wbg.__wbg_wbindgennumberget_d855f947247a3fbc = function(arg0, arg1) {
1684
+ const obj = arg1;
1685
+ const ret = typeof(obj) === 'number' ? obj : undefined;
1686
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
1687
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1688
+ };
1689
+ imports.wbg.__wbg_wbindgenstringget_43fe05afe34b0cb1 = function(arg0, arg1) {
1690
+ const obj = arg1;
1691
+ const ret = typeof(obj) === 'string' ? obj : undefined;
1692
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1693
+ var len1 = WASM_VECTOR_LEN;
1694
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1695
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1696
+ };
1697
+ imports.wbg.__wbg_wbindgenthrow_4c11a24fca429ccf = function(arg0, arg1) {
1698
+ throw new Error(getStringFromWasm0(arg0, arg1));
1699
+ };
1700
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1701
+ // Cast intrinsic for `Ref(String) -> Externref`.
1702
+ const ret = getStringFromWasm0(arg0, arg1);
1703
+ return ret;
1704
+ };
1705
+ imports.wbg.__wbindgen_cast_29d9d4936f0ef296 = function(arg0, arg1) {
1706
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 606, function: Function { arguments: [Externref], shim_idx: 607, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1707
+ const ret = makeMutClosure(arg0, arg1, 606, __wbg_adapter_8);
1708
+ return ret;
1709
+ };
1710
+ imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
1711
+ // Cast intrinsic for `I128 -> Externref`.
1712
+ const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
1713
+ return ret;
1714
+ };
1715
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1716
+ // Cast intrinsic for `U64 -> Externref`.
1717
+ const ret = BigInt.asUintN(64, arg0);
1718
+ return ret;
1719
+ };
1720
+ imports.wbg.__wbindgen_cast_50c13603d4e492d8 = function(arg0, arg1) {
1721
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 403, function: Function { arguments: [], shim_idx: 404, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1722
+ const ret = makeMutClosure(arg0, arg1, 403, __wbg_adapter_15);
1723
+ return ret;
1724
+ };
1725
+ imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
1726
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
1727
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
1728
+ // Cast intrinsic for `Vector(U8) -> Externref`.
1729
+ const ret = v0;
1730
+ return ret;
1731
+ };
1732
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1733
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1734
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1735
+ return ret;
1736
+ };
1737
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1738
+ // Cast intrinsic for `F64 -> Externref`.
1739
+ const ret = arg0;
1740
+ return ret;
1741
+ };
1742
+ imports.wbg.__wbindgen_cast_e7b45dd881f38ce3 = function(arg0, arg1) {
1743
+ // Cast intrinsic for `U128 -> Externref`.
1744
+ const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
1745
+ return ret;
1746
+ };
1747
+ imports.wbg.__wbindgen_init_externref_table = function() {
1748
+ const table = wasm.__wbindgen_export_4;
1749
+ const offset = table.grow(4);
1750
+ table.set(0, undefined);
1751
+ table.set(offset + 0, undefined);
1752
+ table.set(offset + 1, null);
1753
+ table.set(offset + 2, true);
1754
+ table.set(offset + 3, false);
1755
+ ;
1756
+ };
1757
+
1758
+ return imports;
1759
+ }
1760
+
1761
+ function __wbg_init_memory(imports, memory) {
1762
+
1763
+ }
1764
+
1765
+ function __wbg_finalize_init(instance, module) {
1766
+ wasm = instance.exports;
1767
+ __wbg_init.__wbindgen_wasm_module = module;
1768
+ cachedDataViewMemory0 = null;
1769
+ cachedUint8ArrayMemory0 = null;
1770
+
1771
+
1772
+ wasm.__wbindgen_start();
1773
+ return wasm;
1774
+ }
1775
+
1776
+ function initSync(module) {
1777
+ if (wasm !== undefined) return wasm;
1778
+
1779
+
1780
+ if (typeof module !== 'undefined') {
1781
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1782
+ ({module} = module)
1783
+ } else {
1784
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1785
+ }
1786
+ }
1787
+
1788
+ const imports = __wbg_get_imports();
1789
+
1790
+ __wbg_init_memory(imports);
1791
+
1792
+ if (!(module instanceof WebAssembly.Module)) {
1793
+ module = new WebAssembly.Module(module);
1794
+ }
1795
+
1796
+ const instance = new WebAssembly.Instance(module, imports);
1797
+
1798
+ return __wbg_finalize_init(instance, module);
1799
+ }
1800
+
1801
+ async function __wbg_init(module_or_path) {
1802
+ if (wasm !== undefined) return wasm;
1803
+
1804
+
1805
+ if (typeof module_or_path !== 'undefined') {
1806
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1807
+ ({module_or_path} = module_or_path)
1808
+ } else {
1809
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1810
+ }
1811
+ }
1812
+
1813
+ if (typeof module_or_path === 'undefined') {
1814
+ module_or_path = new URL('clarinet_sdk_bg.wasm', import.meta.url);
1815
+ }
1816
+ const imports = __wbg_get_imports();
1817
+
1818
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1819
+ module_or_path = fetch(module_or_path);
1820
+ }
1821
+
1822
+ __wbg_init_memory(imports);
1823
+
1824
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1825
+
1826
+ return __wbg_finalize_init(instance, module);
1827
+ }
1828
+
1829
+ export { initSync };
1830
+ export default __wbg_init;