@midnightntwrk/onchain-runtime-v4 4.0.0-rc.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.
- package/midnight_onchain_runtime_wasm.js +5 -0
- package/midnight_onchain_runtime_wasm_bg.js +3034 -0
- package/midnight_onchain_runtime_wasm_bg.wasm +0 -0
- package/midnight_onchain_runtime_wasm_fs.js +22 -0
- package/onchain-runtime-v4.d.ts +1149 -0
- package/package-lock.json +12 -0
- package/package.json +34 -0
|
@@ -0,0 +1,3034 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
export function __wbg_set_wasm(val) {
|
|
3
|
+
wasm = val;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function addToExternrefTable0(obj) {
|
|
8
|
+
const idx = wasm.__externref_table_alloc();
|
|
9
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
10
|
+
return idx;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function handleError(f, args) {
|
|
14
|
+
try {
|
|
15
|
+
return f.apply(this, args);
|
|
16
|
+
} catch (e) {
|
|
17
|
+
const idx = addToExternrefTable0(e);
|
|
18
|
+
wasm.__wbindgen_exn_store(idx);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
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
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
32
|
+
|
|
33
|
+
cachedTextDecoder.decode();
|
|
34
|
+
|
|
35
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
36
|
+
let numBytesDecoded = 0;
|
|
37
|
+
function decodeText(ptr, len) {
|
|
38
|
+
numBytesDecoded += len;
|
|
39
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
40
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
41
|
+
cachedTextDecoder.decode();
|
|
42
|
+
numBytesDecoded = len;
|
|
43
|
+
}
|
|
44
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getStringFromWasm0(ptr, len) {
|
|
48
|
+
ptr = ptr >>> 0;
|
|
49
|
+
return decodeText(ptr, len);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let WASM_VECTOR_LEN = 0;
|
|
53
|
+
|
|
54
|
+
const cachedTextEncoder = new TextEncoder();
|
|
55
|
+
|
|
56
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
57
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
58
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
59
|
+
view.set(buf);
|
|
60
|
+
return {
|
|
61
|
+
read: arg.length,
|
|
62
|
+
written: buf.length
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
68
|
+
|
|
69
|
+
if (realloc === undefined) {
|
|
70
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
71
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
72
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
73
|
+
WASM_VECTOR_LEN = buf.length;
|
|
74
|
+
return ptr;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let len = arg.length;
|
|
78
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
79
|
+
|
|
80
|
+
const mem = getUint8ArrayMemory0();
|
|
81
|
+
|
|
82
|
+
let offset = 0;
|
|
83
|
+
|
|
84
|
+
for (; offset < len; offset++) {
|
|
85
|
+
const code = arg.charCodeAt(offset);
|
|
86
|
+
if (code > 0x7F) break;
|
|
87
|
+
mem[ptr + offset] = code;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (offset !== len) {
|
|
91
|
+
if (offset !== 0) {
|
|
92
|
+
arg = arg.slice(offset);
|
|
93
|
+
}
|
|
94
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
95
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
96
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
97
|
+
|
|
98
|
+
offset += ret.written;
|
|
99
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
WASM_VECTOR_LEN = offset;
|
|
103
|
+
return ptr;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let cachedDataViewMemory0 = null;
|
|
107
|
+
|
|
108
|
+
function getDataViewMemory0() {
|
|
109
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
110
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
111
|
+
}
|
|
112
|
+
return cachedDataViewMemory0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function isLikeNone(x) {
|
|
116
|
+
return x === undefined || x === null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
120
|
+
ptr = ptr >>> 0;
|
|
121
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function debugString(val) {
|
|
125
|
+
// primitive types
|
|
126
|
+
const type = typeof val;
|
|
127
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
128
|
+
return `${val}`;
|
|
129
|
+
}
|
|
130
|
+
if (type == 'string') {
|
|
131
|
+
return `"${val}"`;
|
|
132
|
+
}
|
|
133
|
+
if (type == 'symbol') {
|
|
134
|
+
const description = val.description;
|
|
135
|
+
if (description == null) {
|
|
136
|
+
return 'Symbol';
|
|
137
|
+
} else {
|
|
138
|
+
return `Symbol(${description})`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (type == 'function') {
|
|
142
|
+
const name = val.name;
|
|
143
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
144
|
+
return `Function(${name})`;
|
|
145
|
+
} else {
|
|
146
|
+
return 'Function';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// objects
|
|
150
|
+
if (Array.isArray(val)) {
|
|
151
|
+
const length = val.length;
|
|
152
|
+
let debug = '[';
|
|
153
|
+
if (length > 0) {
|
|
154
|
+
debug += debugString(val[0]);
|
|
155
|
+
}
|
|
156
|
+
for(let i = 1; i < length; i++) {
|
|
157
|
+
debug += ', ' + debugString(val[i]);
|
|
158
|
+
}
|
|
159
|
+
debug += ']';
|
|
160
|
+
return debug;
|
|
161
|
+
}
|
|
162
|
+
// Test for built-in
|
|
163
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
164
|
+
let className;
|
|
165
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
166
|
+
className = builtInMatches[1];
|
|
167
|
+
} else {
|
|
168
|
+
// Failed to match the standard '[object ClassName]'
|
|
169
|
+
return toString.call(val);
|
|
170
|
+
}
|
|
171
|
+
if (className == 'Object') {
|
|
172
|
+
// we're a user defined class or Object
|
|
173
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
174
|
+
// easier than looping through ownProperties of `val`.
|
|
175
|
+
try {
|
|
176
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
177
|
+
} catch (_) {
|
|
178
|
+
return 'Object';
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// errors
|
|
182
|
+
if (val instanceof Error) {
|
|
183
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
184
|
+
}
|
|
185
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
186
|
+
return className;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
190
|
+
? { register: () => {}, unregister: () => {} }
|
|
191
|
+
: new FinalizationRegistry(
|
|
192
|
+
state => {
|
|
193
|
+
wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b);
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
198
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
199
|
+
const real = (...args) => {
|
|
200
|
+
|
|
201
|
+
// First up with a closure we increment the internal reference
|
|
202
|
+
// count. This ensures that the Rust closure environment won't
|
|
203
|
+
// be deallocated while we're invoking it.
|
|
204
|
+
state.cnt++;
|
|
205
|
+
const a = state.a;
|
|
206
|
+
state.a = 0;
|
|
207
|
+
try {
|
|
208
|
+
return f(a, state.b, ...args);
|
|
209
|
+
} finally {
|
|
210
|
+
if (--state.cnt === 0) {
|
|
211
|
+
wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
|
|
212
|
+
CLOSURE_DTORS.unregister(state);
|
|
213
|
+
} else {
|
|
214
|
+
state.a = a;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
real.original = state;
|
|
219
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
220
|
+
return real;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function takeFromExternrefTable0(idx) {
|
|
224
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
225
|
+
wasm.__externref_table_dealloc(idx);
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @param {any} coin
|
|
230
|
+
* @param {any} recipient
|
|
231
|
+
* @returns {any}
|
|
232
|
+
*/
|
|
233
|
+
export function runtimeCoinCommitment(coin, recipient) {
|
|
234
|
+
const ret = wasm.runtimeCoinCommitment(coin, recipient);
|
|
235
|
+
if (ret[2]) {
|
|
236
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
237
|
+
}
|
|
238
|
+
return takeFromExternrefTable0(ret[0]);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @param {any} key
|
|
243
|
+
* @param {Uint8Array} data
|
|
244
|
+
* @returns {any}
|
|
245
|
+
*/
|
|
246
|
+
export function signData(key, data) {
|
|
247
|
+
const ret = wasm.signData(key, data);
|
|
248
|
+
if (ret[2]) {
|
|
249
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
250
|
+
}
|
|
251
|
+
return takeFromExternrefTable0(ret[0]);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Sample a random JubJub scalar, returned as a native field element.
|
|
256
|
+
* @returns {any}
|
|
257
|
+
*/
|
|
258
|
+
export function jubjubSampleScalar() {
|
|
259
|
+
const ret = wasm.jubjubSampleScalar();
|
|
260
|
+
if (ret[2]) {
|
|
261
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
262
|
+
}
|
|
263
|
+
return takeFromExternrefTable0(ret[0]);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @param {bigint} x
|
|
268
|
+
* @returns {bigint}
|
|
269
|
+
*/
|
|
270
|
+
export function bigIntModFr(x) {
|
|
271
|
+
const ret = wasm.bigIntModFr(x);
|
|
272
|
+
if (ret[2]) {
|
|
273
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
274
|
+
}
|
|
275
|
+
return takeFromExternrefTable0(ret[0]);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @param {any} a
|
|
280
|
+
* @param {any} b
|
|
281
|
+
* @returns {any}
|
|
282
|
+
*/
|
|
283
|
+
export function ecMul(a, b) {
|
|
284
|
+
const ret = wasm.ecMul(a, b);
|
|
285
|
+
if (ret[2]) {
|
|
286
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
287
|
+
}
|
|
288
|
+
return takeFromExternrefTable0(ret[0]);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @param {any} align
|
|
293
|
+
* @param {any} val
|
|
294
|
+
* @param {any} opening
|
|
295
|
+
* @returns {any}
|
|
296
|
+
*/
|
|
297
|
+
export function transientCommit(align, val, opening) {
|
|
298
|
+
const ret = wasm.transientCommit(align, val, opening);
|
|
299
|
+
if (ret[2]) {
|
|
300
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
301
|
+
}
|
|
302
|
+
return takeFromExternrefTable0(ret[0]);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @param {any} value
|
|
307
|
+
* @returns {any}
|
|
308
|
+
*/
|
|
309
|
+
export function leafHash(value) {
|
|
310
|
+
const ret = wasm.leafHash(value);
|
|
311
|
+
if (ret[2]) {
|
|
312
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
313
|
+
}
|
|
314
|
+
return takeFromExternrefTable0(ret[0]);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* @param {any} x
|
|
319
|
+
* @returns {bigint}
|
|
320
|
+
*/
|
|
321
|
+
export function valueToBigInt(x) {
|
|
322
|
+
const ret = wasm.valueToBigInt(x);
|
|
323
|
+
if (ret[2]) {
|
|
324
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
325
|
+
}
|
|
326
|
+
return takeFromExternrefTable0(ret[0]);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @param {any} align
|
|
331
|
+
* @param {any} val
|
|
332
|
+
* @returns {any}
|
|
333
|
+
*/
|
|
334
|
+
export function hashToCurve(align, val) {
|
|
335
|
+
const ret = wasm.hashToCurve(align, val);
|
|
336
|
+
if (ret[2]) {
|
|
337
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
338
|
+
}
|
|
339
|
+
return takeFromExternrefTable0(ret[0]);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* @param {any} input
|
|
344
|
+
* @param {any} output
|
|
345
|
+
* @param {string} rand
|
|
346
|
+
* @returns {string}
|
|
347
|
+
*/
|
|
348
|
+
export function communicationCommitment(input, output, rand) {
|
|
349
|
+
let deferred3_0;
|
|
350
|
+
let deferred3_1;
|
|
351
|
+
try {
|
|
352
|
+
const ptr0 = passStringToWasm0(rand, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
353
|
+
const len0 = WASM_VECTOR_LEN;
|
|
354
|
+
const ret = wasm.communicationCommitment(input, output, ptr0, len0);
|
|
355
|
+
var ptr2 = ret[0];
|
|
356
|
+
var len2 = ret[1];
|
|
357
|
+
if (ret[3]) {
|
|
358
|
+
ptr2 = 0; len2 = 0;
|
|
359
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
360
|
+
}
|
|
361
|
+
deferred3_0 = ptr2;
|
|
362
|
+
deferred3_1 = len2;
|
|
363
|
+
return getStringFromWasm0(ptr2, len2);
|
|
364
|
+
} finally {
|
|
365
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* @param {Uint8Array} bytes
|
|
371
|
+
* @returns {any}
|
|
372
|
+
*/
|
|
373
|
+
export function signingKeyFromBip340(bytes) {
|
|
374
|
+
const ret = wasm.signingKeyFromBip340(bytes);
|
|
375
|
+
if (ret[2]) {
|
|
376
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
377
|
+
}
|
|
378
|
+
return takeFromExternrefTable0(ret[0]);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* @param {any} alignment
|
|
383
|
+
* @returns {bigint}
|
|
384
|
+
*/
|
|
385
|
+
export function maxAlignedSize(alignment) {
|
|
386
|
+
const ret = wasm.maxAlignedSize(alignment);
|
|
387
|
+
if (ret[2]) {
|
|
388
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
389
|
+
}
|
|
390
|
+
return BigInt.asUintN(64, ret[0]);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Returns the largest representable JubJub scalar (i.e. the JubJub scalar field modulus minus one).
|
|
395
|
+
* @returns {bigint}
|
|
396
|
+
*/
|
|
397
|
+
export function maxJubjubScalar() {
|
|
398
|
+
const ret = wasm.maxJubjubScalar();
|
|
399
|
+
if (ret[2]) {
|
|
400
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
401
|
+
}
|
|
402
|
+
return takeFromExternrefTable0(ret[0]);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* @returns {string}
|
|
407
|
+
*/
|
|
408
|
+
export function communicationCommitmentRandomness() {
|
|
409
|
+
let deferred2_0;
|
|
410
|
+
let deferred2_1;
|
|
411
|
+
try {
|
|
412
|
+
const ret = wasm.communicationCommitmentRandomness();
|
|
413
|
+
var ptr1 = ret[0];
|
|
414
|
+
var len1 = ret[1];
|
|
415
|
+
if (ret[3]) {
|
|
416
|
+
ptr1 = 0; len1 = 0;
|
|
417
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
418
|
+
}
|
|
419
|
+
deferred2_0 = ptr1;
|
|
420
|
+
deferred2_1 = len1;
|
|
421
|
+
return getStringFromWasm0(ptr1, len1);
|
|
422
|
+
} finally {
|
|
423
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @param {any} align
|
|
429
|
+
* @param {any} val
|
|
430
|
+
* @param {any} opening
|
|
431
|
+
* @returns {any}
|
|
432
|
+
*/
|
|
433
|
+
export function persistentCommit(align, val, opening) {
|
|
434
|
+
const ret = wasm.persistentCommit(align, val, opening);
|
|
435
|
+
if (ret[2]) {
|
|
436
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
437
|
+
}
|
|
438
|
+
return takeFromExternrefTable0(ret[0]);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* @returns {string}
|
|
443
|
+
*/
|
|
444
|
+
export function sampleRawTokenType() {
|
|
445
|
+
let deferred2_0;
|
|
446
|
+
let deferred2_1;
|
|
447
|
+
try {
|
|
448
|
+
const ret = wasm.sampleRawTokenType();
|
|
449
|
+
var ptr1 = ret[0];
|
|
450
|
+
var len1 = ret[1];
|
|
451
|
+
if (ret[3]) {
|
|
452
|
+
ptr1 = 0; len1 = 0;
|
|
453
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
454
|
+
}
|
|
455
|
+
deferred2_0 = ptr1;
|
|
456
|
+
deferred2_1 = len1;
|
|
457
|
+
return getStringFromWasm0(ptr1, len1);
|
|
458
|
+
} finally {
|
|
459
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @param {any} transient
|
|
465
|
+
* @returns {any}
|
|
466
|
+
*/
|
|
467
|
+
export function upgradeFromTransient(transient) {
|
|
468
|
+
const ret = wasm.upgradeFromTransient(transient);
|
|
469
|
+
if (ret[2]) {
|
|
470
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
471
|
+
}
|
|
472
|
+
return takeFromExternrefTable0(ret[0]);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* @param {any} val
|
|
477
|
+
* @returns {any}
|
|
478
|
+
*/
|
|
479
|
+
export function ecMulGenerator(val) {
|
|
480
|
+
const ret = wasm.ecMulGenerator(val);
|
|
481
|
+
if (ret[2]) {
|
|
482
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
483
|
+
}
|
|
484
|
+
return takeFromExternrefTable0(ret[0]);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* @param {any} align
|
|
489
|
+
* @param {any} val
|
|
490
|
+
* @returns {any}
|
|
491
|
+
*/
|
|
492
|
+
export function persistentHash(align, val) {
|
|
493
|
+
const ret = wasm.persistentHash(align, val);
|
|
494
|
+
if (ret[2]) {
|
|
495
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
496
|
+
}
|
|
497
|
+
return takeFromExternrefTable0(ret[0]);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* @param {bigint} x
|
|
502
|
+
* @returns {any}
|
|
503
|
+
*/
|
|
504
|
+
export function bigIntToValue(x) {
|
|
505
|
+
const ret = wasm.bigIntToValue(x);
|
|
506
|
+
if (ret[2]) {
|
|
507
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
508
|
+
}
|
|
509
|
+
return takeFromExternrefTable0(ret[0]);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @param {any} input
|
|
514
|
+
* @param {any} output
|
|
515
|
+
* @param {any} public_transcript
|
|
516
|
+
* @param {any} private_transcript_outputs
|
|
517
|
+
* @param {string | null} [key_location]
|
|
518
|
+
* @returns {Uint8Array}
|
|
519
|
+
*/
|
|
520
|
+
export function proofDataIntoSerializedPreimage(input, output, public_transcript, private_transcript_outputs, key_location) {
|
|
521
|
+
var ptr0 = isLikeNone(key_location) ? 0 : passStringToWasm0(key_location, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
522
|
+
var len0 = WASM_VECTOR_LEN;
|
|
523
|
+
const ret = wasm.proofDataIntoSerializedPreimage(input, output, public_transcript, private_transcript_outputs, ptr0, len0);
|
|
524
|
+
if (ret[2]) {
|
|
525
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
526
|
+
}
|
|
527
|
+
return takeFromExternrefTable0(ret[0]);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* @param {any} a
|
|
532
|
+
* @param {any} b
|
|
533
|
+
* @returns {any}
|
|
534
|
+
*/
|
|
535
|
+
export function ecAdd(a, b) {
|
|
536
|
+
const ret = wasm.ecAdd(a, b);
|
|
537
|
+
if (ret[2]) {
|
|
538
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
539
|
+
}
|
|
540
|
+
return takeFromExternrefTable0(ret[0]);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* @param {any} align
|
|
545
|
+
* @param {any} val
|
|
546
|
+
* @returns {any}
|
|
547
|
+
*/
|
|
548
|
+
export function transientHash(align, val) {
|
|
549
|
+
const ret = wasm.transientHash(align, val);
|
|
550
|
+
if (ret[2]) {
|
|
551
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
552
|
+
}
|
|
553
|
+
return takeFromExternrefTable0(ret[0]);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* @returns {string}
|
|
558
|
+
*/
|
|
559
|
+
export function sampleContractAddress() {
|
|
560
|
+
let deferred2_0;
|
|
561
|
+
let deferred2_1;
|
|
562
|
+
try {
|
|
563
|
+
const ret = wasm.sampleContractAddress();
|
|
564
|
+
var ptr1 = ret[0];
|
|
565
|
+
var len1 = ret[1];
|
|
566
|
+
if (ret[3]) {
|
|
567
|
+
ptr1 = 0; len1 = 0;
|
|
568
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
569
|
+
}
|
|
570
|
+
deferred2_0 = ptr1;
|
|
571
|
+
deferred2_1 = len1;
|
|
572
|
+
return getStringFromWasm0(ptr1, len1);
|
|
573
|
+
} finally {
|
|
574
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* @param {any} sk
|
|
580
|
+
* @returns {any}
|
|
581
|
+
*/
|
|
582
|
+
export function signatureVerifyingKey(sk) {
|
|
583
|
+
const ret = wasm.signatureVerifyingKey(sk);
|
|
584
|
+
if (ret[2]) {
|
|
585
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
586
|
+
}
|
|
587
|
+
return takeFromExternrefTable0(ret[0]);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* Converts a native field element (BLS12-381 scalar) to a JubJub scalar field element,
|
|
592
|
+
* reducing modulo the JubJub scalar field modulus.
|
|
593
|
+
* @param {any} native
|
|
594
|
+
* @returns {any}
|
|
595
|
+
*/
|
|
596
|
+
export function jubjubScalarFromNative(native) {
|
|
597
|
+
const ret = wasm.jubjubScalarFromNative(native);
|
|
598
|
+
if (ret[2]) {
|
|
599
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
600
|
+
}
|
|
601
|
+
return takeFromExternrefTable0(ret[0]);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* @returns {string}
|
|
606
|
+
*/
|
|
607
|
+
export function dummyContractAddress() {
|
|
608
|
+
let deferred2_0;
|
|
609
|
+
let deferred2_1;
|
|
610
|
+
try {
|
|
611
|
+
const ret = wasm.dummyContractAddress();
|
|
612
|
+
var ptr1 = ret[0];
|
|
613
|
+
var len1 = ret[1];
|
|
614
|
+
if (ret[3]) {
|
|
615
|
+
ptr1 = 0; len1 = 0;
|
|
616
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
617
|
+
}
|
|
618
|
+
deferred2_0 = ptr1;
|
|
619
|
+
deferred2_1 = len1;
|
|
620
|
+
return getStringFromWasm0(ptr1, len1);
|
|
621
|
+
} finally {
|
|
622
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* @returns {string}
|
|
628
|
+
*/
|
|
629
|
+
export function sampleUserAddress() {
|
|
630
|
+
let deferred2_0;
|
|
631
|
+
let deferred2_1;
|
|
632
|
+
try {
|
|
633
|
+
const ret = wasm.sampleUserAddress();
|
|
634
|
+
var ptr1 = ret[0];
|
|
635
|
+
var len1 = ret[1];
|
|
636
|
+
if (ret[3]) {
|
|
637
|
+
ptr1 = 0; len1 = 0;
|
|
638
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
639
|
+
}
|
|
640
|
+
deferred2_0 = ptr1;
|
|
641
|
+
deferred2_1 = len1;
|
|
642
|
+
return getStringFromWasm0(ptr1, len1);
|
|
643
|
+
} finally {
|
|
644
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* @param {Uint8Array} domain_sep
|
|
650
|
+
* @param {string} contract
|
|
651
|
+
* @returns {string}
|
|
652
|
+
*/
|
|
653
|
+
export function rawTokenType(domain_sep, contract) {
|
|
654
|
+
let deferred3_0;
|
|
655
|
+
let deferred3_1;
|
|
656
|
+
try {
|
|
657
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
658
|
+
const len0 = WASM_VECTOR_LEN;
|
|
659
|
+
const ret = wasm.rawTokenType(domain_sep, ptr0, len0);
|
|
660
|
+
var ptr2 = ret[0];
|
|
661
|
+
var len2 = ret[1];
|
|
662
|
+
if (ret[3]) {
|
|
663
|
+
ptr2 = 0; len2 = 0;
|
|
664
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
665
|
+
}
|
|
666
|
+
deferred3_0 = ptr2;
|
|
667
|
+
deferred3_1 = len2;
|
|
668
|
+
return getStringFromWasm0(ptr2, len2);
|
|
669
|
+
} finally {
|
|
670
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* @returns {string}
|
|
676
|
+
*/
|
|
677
|
+
export function dummyUserAddress() {
|
|
678
|
+
let deferred2_0;
|
|
679
|
+
let deferred2_1;
|
|
680
|
+
try {
|
|
681
|
+
const ret = wasm.dummyUserAddress();
|
|
682
|
+
var ptr1 = ret[0];
|
|
683
|
+
var len1 = ret[1];
|
|
684
|
+
if (ret[3]) {
|
|
685
|
+
ptr1 = 0; len1 = 0;
|
|
686
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
687
|
+
}
|
|
688
|
+
deferred2_0 = ptr1;
|
|
689
|
+
deferred2_1 = len1;
|
|
690
|
+
return getStringFromWasm0(ptr1, len1);
|
|
691
|
+
} finally {
|
|
692
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* @param {any} entry_point
|
|
698
|
+
* @returns {string}
|
|
699
|
+
*/
|
|
700
|
+
export function entryPointHash(entry_point) {
|
|
701
|
+
let deferred2_0;
|
|
702
|
+
let deferred2_1;
|
|
703
|
+
try {
|
|
704
|
+
const ret = wasm.entryPointHash(entry_point);
|
|
705
|
+
var ptr1 = ret[0];
|
|
706
|
+
var len1 = ret[1];
|
|
707
|
+
if (ret[3]) {
|
|
708
|
+
ptr1 = 0; len1 = 0;
|
|
709
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
710
|
+
}
|
|
711
|
+
deferred2_0 = ptr1;
|
|
712
|
+
deferred2_1 = len1;
|
|
713
|
+
return getStringFromWasm0(ptr1, len1);
|
|
714
|
+
} finally {
|
|
715
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* @param {any} coin
|
|
721
|
+
* @param {any} sender_evidence
|
|
722
|
+
* @returns {any}
|
|
723
|
+
*/
|
|
724
|
+
export function runtimeCoinNullifier(coin, sender_evidence) {
|
|
725
|
+
const ret = wasm.runtimeCoinNullifier(coin, sender_evidence);
|
|
726
|
+
if (ret[2]) {
|
|
727
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
728
|
+
}
|
|
729
|
+
return takeFromExternrefTable0(ret[0]);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Converts a JubJub scalar field element to a native field element (BLS12-381 scalar).
|
|
734
|
+
* @param {any} jubjub
|
|
735
|
+
* @returns {any}
|
|
736
|
+
*/
|
|
737
|
+
export function nativeFromJubjubScalar(jubjub) {
|
|
738
|
+
const ret = wasm.nativeFromJubjubScalar(jubjub);
|
|
739
|
+
if (ret[2]) {
|
|
740
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
741
|
+
}
|
|
742
|
+
return takeFromExternrefTable0(ret[0]);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* @returns {bigint}
|
|
747
|
+
*/
|
|
748
|
+
export function maxField() {
|
|
749
|
+
const ret = wasm.maxField();
|
|
750
|
+
if (ret[2]) {
|
|
751
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
752
|
+
}
|
|
753
|
+
return takeFromExternrefTable0(ret[0]);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* @param {any} persistent
|
|
758
|
+
* @returns {any}
|
|
759
|
+
*/
|
|
760
|
+
export function degradeToTransient(persistent) {
|
|
761
|
+
const ret = wasm.degradeToTransient(persistent);
|
|
762
|
+
if (ret[2]) {
|
|
763
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
764
|
+
}
|
|
765
|
+
return takeFromExternrefTable0(ret[0]);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* @param {any} key
|
|
770
|
+
* @param {Uint8Array} data
|
|
771
|
+
* @param {any} signature
|
|
772
|
+
* @returns {boolean}
|
|
773
|
+
*/
|
|
774
|
+
export function verifySignature(key, data, signature) {
|
|
775
|
+
const ret = wasm.verifySignature(key, data, signature);
|
|
776
|
+
if (ret[2]) {
|
|
777
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
778
|
+
}
|
|
779
|
+
return ret[0] !== 0;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* @param {string | null} [kind]
|
|
784
|
+
* @returns {any}
|
|
785
|
+
*/
|
|
786
|
+
export function sampleSigningKey(kind) {
|
|
787
|
+
var ptr0 = isLikeNone(kind) ? 0 : passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
788
|
+
var len0 = WASM_VECTOR_LEN;
|
|
789
|
+
const ret = wasm.sampleSigningKey(ptr0, len0);
|
|
790
|
+
if (ret[2]) {
|
|
791
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
792
|
+
}
|
|
793
|
+
return takeFromExternrefTable0(ret[0]);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* @param {any} coin
|
|
798
|
+
* @returns {any}
|
|
799
|
+
*/
|
|
800
|
+
export function decodeShieldedCoinInfo(coin) {
|
|
801
|
+
const ret = wasm.decodeShieldedCoinInfo(coin);
|
|
802
|
+
if (ret[2]) {
|
|
803
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
804
|
+
}
|
|
805
|
+
return takeFromExternrefTable0(ret[0]);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* @param {Uint8Array} addr
|
|
810
|
+
* @returns {string}
|
|
811
|
+
*/
|
|
812
|
+
export function decodeUserAddress(addr) {
|
|
813
|
+
let deferred2_0;
|
|
814
|
+
let deferred2_1;
|
|
815
|
+
try {
|
|
816
|
+
const ret = wasm.decodeUserAddress(addr);
|
|
817
|
+
var ptr1 = ret[0];
|
|
818
|
+
var len1 = ret[1];
|
|
819
|
+
if (ret[3]) {
|
|
820
|
+
ptr1 = 0; len1 = 0;
|
|
821
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
822
|
+
}
|
|
823
|
+
deferred2_0 = ptr1;
|
|
824
|
+
deferred2_1 = len1;
|
|
825
|
+
return getStringFromWasm0(ptr1, len1);
|
|
826
|
+
} finally {
|
|
827
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* @param {Uint8Array} pk
|
|
833
|
+
* @returns {string}
|
|
834
|
+
*/
|
|
835
|
+
export function decodeCoinPublicKey(pk) {
|
|
836
|
+
let deferred2_0;
|
|
837
|
+
let deferred2_1;
|
|
838
|
+
try {
|
|
839
|
+
const ret = wasm.decodeCoinPublicKey(pk);
|
|
840
|
+
var ptr1 = ret[0];
|
|
841
|
+
var len1 = ret[1];
|
|
842
|
+
if (ret[3]) {
|
|
843
|
+
ptr1 = 0; len1 = 0;
|
|
844
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
845
|
+
}
|
|
846
|
+
deferred2_0 = ptr1;
|
|
847
|
+
deferred2_1 = len1;
|
|
848
|
+
return getStringFromWasm0(ptr1, len1);
|
|
849
|
+
} finally {
|
|
850
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* @param {string} addr
|
|
856
|
+
* @returns {Uint8Array}
|
|
857
|
+
*/
|
|
858
|
+
export function encodeContractAddress(addr) {
|
|
859
|
+
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
860
|
+
const len0 = WASM_VECTOR_LEN;
|
|
861
|
+
const ret = wasm.encodeContractAddress(ptr0, len0);
|
|
862
|
+
if (ret[2]) {
|
|
863
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
864
|
+
}
|
|
865
|
+
return takeFromExternrefTable0(ret[0]);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* @param {string} tt
|
|
870
|
+
* @returns {Uint8Array}
|
|
871
|
+
*/
|
|
872
|
+
export function encodeRawTokenType(tt) {
|
|
873
|
+
const ptr0 = passStringToWasm0(tt, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
874
|
+
const len0 = WASM_VECTOR_LEN;
|
|
875
|
+
const ret = wasm.encodeRawTokenType(ptr0, len0);
|
|
876
|
+
if (ret[2]) {
|
|
877
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
878
|
+
}
|
|
879
|
+
return takeFromExternrefTable0(ret[0]);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* @param {Uint8Array} addr
|
|
884
|
+
* @returns {string}
|
|
885
|
+
*/
|
|
886
|
+
export function decodeContractAddress(addr) {
|
|
887
|
+
let deferred2_0;
|
|
888
|
+
let deferred2_1;
|
|
889
|
+
try {
|
|
890
|
+
const ret = wasm.decodeContractAddress(addr);
|
|
891
|
+
var ptr1 = ret[0];
|
|
892
|
+
var len1 = ret[1];
|
|
893
|
+
if (ret[3]) {
|
|
894
|
+
ptr1 = 0; len1 = 0;
|
|
895
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
896
|
+
}
|
|
897
|
+
deferred2_0 = ptr1;
|
|
898
|
+
deferred2_1 = len1;
|
|
899
|
+
return getStringFromWasm0(ptr1, len1);
|
|
900
|
+
} finally {
|
|
901
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* @param {string} addr
|
|
907
|
+
* @returns {Uint8Array}
|
|
908
|
+
*/
|
|
909
|
+
export function encodeUserAddress(addr) {
|
|
910
|
+
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
911
|
+
const len0 = WASM_VECTOR_LEN;
|
|
912
|
+
const ret = wasm.encodeUserAddress(ptr0, len0);
|
|
913
|
+
if (ret[2]) {
|
|
914
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
915
|
+
}
|
|
916
|
+
return takeFromExternrefTable0(ret[0]);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* @param {string} pk
|
|
921
|
+
* @returns {Uint8Array}
|
|
922
|
+
*/
|
|
923
|
+
export function encodeCoinPublicKey(pk) {
|
|
924
|
+
const ptr0 = passStringToWasm0(pk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
925
|
+
const len0 = WASM_VECTOR_LEN;
|
|
926
|
+
const ret = wasm.encodeCoinPublicKey(ptr0, len0);
|
|
927
|
+
if (ret[2]) {
|
|
928
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
929
|
+
}
|
|
930
|
+
return takeFromExternrefTable0(ret[0]);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* @param {any} coin
|
|
935
|
+
* @returns {any}
|
|
936
|
+
*/
|
|
937
|
+
export function encodeShieldedCoinInfo(coin) {
|
|
938
|
+
const ret = wasm.encodeShieldedCoinInfo(coin);
|
|
939
|
+
if (ret[2]) {
|
|
940
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
941
|
+
}
|
|
942
|
+
return takeFromExternrefTable0(ret[0]);
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* @param {any} coin
|
|
947
|
+
* @returns {any}
|
|
948
|
+
*/
|
|
949
|
+
export function decodeQualifiedShieldedCoinInfo(coin) {
|
|
950
|
+
const ret = wasm.decodeQualifiedShieldedCoinInfo(coin);
|
|
951
|
+
if (ret[2]) {
|
|
952
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
953
|
+
}
|
|
954
|
+
return takeFromExternrefTable0(ret[0]);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* @param {Uint8Array} tt
|
|
959
|
+
* @returns {string}
|
|
960
|
+
*/
|
|
961
|
+
export function decodeRawTokenType(tt) {
|
|
962
|
+
let deferred2_0;
|
|
963
|
+
let deferred2_1;
|
|
964
|
+
try {
|
|
965
|
+
const ret = wasm.decodeRawTokenType(tt);
|
|
966
|
+
var ptr1 = ret[0];
|
|
967
|
+
var len1 = ret[1];
|
|
968
|
+
if (ret[3]) {
|
|
969
|
+
ptr1 = 0; len1 = 0;
|
|
970
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
971
|
+
}
|
|
972
|
+
deferred2_0 = ptr1;
|
|
973
|
+
deferred2_1 = len1;
|
|
974
|
+
return getStringFromWasm0(ptr1, len1);
|
|
975
|
+
} finally {
|
|
976
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* @param {any} coin
|
|
982
|
+
* @returns {any}
|
|
983
|
+
*/
|
|
984
|
+
export function encodeQualifiedShieldedCoinInfo(coin) {
|
|
985
|
+
const ret = wasm.encodeQualifiedShieldedCoinInfo(coin);
|
|
986
|
+
if (ret[2]) {
|
|
987
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
988
|
+
}
|
|
989
|
+
return takeFromExternrefTable0(ret[0]);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function _assertClass(instance, klass) {
|
|
993
|
+
if (!(instance instanceof klass)) {
|
|
994
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* @param {VmStack} initial
|
|
999
|
+
* @param {any} ops
|
|
1000
|
+
* @param {CostModel} cost_model
|
|
1001
|
+
* @param {any} gas_limit
|
|
1002
|
+
* @returns {VmResults}
|
|
1003
|
+
*/
|
|
1004
|
+
export function runProgram(initial, ops, cost_model, gas_limit) {
|
|
1005
|
+
_assertClass(initial, VmStack);
|
|
1006
|
+
_assertClass(cost_model, CostModel);
|
|
1007
|
+
const ret = wasm.runProgram(initial.__wbg_ptr, ops, cost_model.__wbg_ptr, gas_limit);
|
|
1008
|
+
if (ret[2]) {
|
|
1009
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1010
|
+
}
|
|
1011
|
+
return VmResults.__wrap(ret[0]);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
1015
|
+
ptr = ptr >>> 0;
|
|
1016
|
+
const mem = getDataViewMemory0();
|
|
1017
|
+
const result = [];
|
|
1018
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
1019
|
+
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
|
|
1020
|
+
}
|
|
1021
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
1022
|
+
return result;
|
|
1023
|
+
}
|
|
1024
|
+
function __wbg_adapter_10(arg0, arg1, arg2) {
|
|
1025
|
+
wasm.closure720_externref_shim(arg0, arg1, arg2);
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
function __wbg_adapter_292(arg0, arg1, arg2, arg3) {
|
|
1029
|
+
wasm.closure760_externref_shim(arg0, arg1, arg2, arg3);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
1033
|
+
|
|
1034
|
+
const ChargedStateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1035
|
+
? { register: () => {}, unregister: () => {} }
|
|
1036
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_chargedstate_free(ptr >>> 0, 1));
|
|
1037
|
+
|
|
1038
|
+
export class ChargedState {
|
|
1039
|
+
|
|
1040
|
+
static __wrap(ptr) {
|
|
1041
|
+
ptr = ptr >>> 0;
|
|
1042
|
+
const obj = Object.create(ChargedState.prototype);
|
|
1043
|
+
obj.__wbg_ptr = ptr;
|
|
1044
|
+
ChargedStateFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1045
|
+
return obj;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
__destroy_into_raw() {
|
|
1049
|
+
const ptr = this.__wbg_ptr;
|
|
1050
|
+
this.__wbg_ptr = 0;
|
|
1051
|
+
ChargedStateFinalization.unregister(this);
|
|
1052
|
+
return ptr;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
free() {
|
|
1056
|
+
const ptr = this.__destroy_into_raw();
|
|
1057
|
+
wasm.__wbg_chargedstate_free(ptr, 0);
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* @param {StateValue} state
|
|
1061
|
+
*/
|
|
1062
|
+
constructor(state) {
|
|
1063
|
+
_assertClass(state, StateValue);
|
|
1064
|
+
const ret = wasm.chargedstate_new(state.__wbg_ptr);
|
|
1065
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1066
|
+
ChargedStateFinalization.register(this, this.__wbg_ptr, this);
|
|
1067
|
+
return this;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* @returns {StateValue}
|
|
1071
|
+
*/
|
|
1072
|
+
get state() {
|
|
1073
|
+
const ret = wasm.chargedstate_state(this.__wbg_ptr);
|
|
1074
|
+
return StateValue.__wrap(ret);
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* @param {boolean | null} [compact]
|
|
1078
|
+
* @returns {string}
|
|
1079
|
+
*/
|
|
1080
|
+
toString(compact) {
|
|
1081
|
+
let deferred1_0;
|
|
1082
|
+
let deferred1_1;
|
|
1083
|
+
try {
|
|
1084
|
+
const ret = wasm.chargedstate_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
1085
|
+
deferred1_0 = ret[0];
|
|
1086
|
+
deferred1_1 = ret[1];
|
|
1087
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1088
|
+
} finally {
|
|
1089
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
if (Symbol.dispose) ChargedState.prototype[Symbol.dispose] = ChargedState.prototype.free;
|
|
1094
|
+
|
|
1095
|
+
const ContractMaintenanceAuthorityFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1096
|
+
? { register: () => {}, unregister: () => {} }
|
|
1097
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractmaintenanceauthority_free(ptr >>> 0, 1));
|
|
1098
|
+
|
|
1099
|
+
export class ContractMaintenanceAuthority {
|
|
1100
|
+
|
|
1101
|
+
static __wrap(ptr) {
|
|
1102
|
+
ptr = ptr >>> 0;
|
|
1103
|
+
const obj = Object.create(ContractMaintenanceAuthority.prototype);
|
|
1104
|
+
obj.__wbg_ptr = ptr;
|
|
1105
|
+
ContractMaintenanceAuthorityFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1106
|
+
return obj;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
__destroy_into_raw() {
|
|
1110
|
+
const ptr = this.__wbg_ptr;
|
|
1111
|
+
this.__wbg_ptr = 0;
|
|
1112
|
+
ContractMaintenanceAuthorityFinalization.unregister(this);
|
|
1113
|
+
return ptr;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
free() {
|
|
1117
|
+
const ptr = this.__destroy_into_raw();
|
|
1118
|
+
wasm.__wbg_contractmaintenanceauthority_free(ptr, 0);
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* @param {Uint8Array} raw
|
|
1122
|
+
* @returns {ContractMaintenanceAuthority}
|
|
1123
|
+
*/
|
|
1124
|
+
static deserialize(raw) {
|
|
1125
|
+
const ret = wasm.contractmaintenanceauthority_deserialize(raw);
|
|
1126
|
+
if (ret[2]) {
|
|
1127
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1128
|
+
}
|
|
1129
|
+
return ContractMaintenanceAuthority.__wrap(ret[0]);
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* @param {Array<any>} committee
|
|
1133
|
+
* @param {number} threshold
|
|
1134
|
+
* @param {bigint | null} [counter]
|
|
1135
|
+
*/
|
|
1136
|
+
constructor(committee, threshold, counter) {
|
|
1137
|
+
const ret = wasm.contractmaintenanceauthority_new(committee, threshold, isLikeNone(counter) ? 0 : addToExternrefTable0(counter));
|
|
1138
|
+
if (ret[2]) {
|
|
1139
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1140
|
+
}
|
|
1141
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
1142
|
+
ContractMaintenanceAuthorityFinalization.register(this, this.__wbg_ptr, this);
|
|
1143
|
+
return this;
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* @returns {bigint}
|
|
1147
|
+
*/
|
|
1148
|
+
get counter() {
|
|
1149
|
+
const ret = wasm.contractmaintenanceauthority_counter(this.__wbg_ptr);
|
|
1150
|
+
return ret;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* @returns {Array<any>}
|
|
1154
|
+
*/
|
|
1155
|
+
get committee() {
|
|
1156
|
+
const ret = wasm.contractmaintenanceauthority_committee(this.__wbg_ptr);
|
|
1157
|
+
if (ret[2]) {
|
|
1158
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1159
|
+
}
|
|
1160
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* @returns {any}
|
|
1164
|
+
*/
|
|
1165
|
+
serialize() {
|
|
1166
|
+
const ret = wasm.contractmaintenanceauthority_serialize(this.__wbg_ptr);
|
|
1167
|
+
if (ret[2]) {
|
|
1168
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1169
|
+
}
|
|
1170
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* @returns {number}
|
|
1174
|
+
*/
|
|
1175
|
+
get threshold() {
|
|
1176
|
+
const ret = wasm.contractmaintenanceauthority_threshold(this.__wbg_ptr);
|
|
1177
|
+
return ret >>> 0;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* @param {boolean | null} [compact]
|
|
1181
|
+
* @returns {string}
|
|
1182
|
+
*/
|
|
1183
|
+
toString(compact) {
|
|
1184
|
+
let deferred1_0;
|
|
1185
|
+
let deferred1_1;
|
|
1186
|
+
try {
|
|
1187
|
+
const ret = wasm.contractmaintenanceauthority_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
1188
|
+
deferred1_0 = ret[0];
|
|
1189
|
+
deferred1_1 = ret[1];
|
|
1190
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1191
|
+
} finally {
|
|
1192
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
if (Symbol.dispose) ContractMaintenanceAuthority.prototype[Symbol.dispose] = ContractMaintenanceAuthority.prototype.free;
|
|
1197
|
+
|
|
1198
|
+
const ContractOperationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1199
|
+
? { register: () => {}, unregister: () => {} }
|
|
1200
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractoperation_free(ptr >>> 0, 1));
|
|
1201
|
+
|
|
1202
|
+
export class ContractOperation {
|
|
1203
|
+
|
|
1204
|
+
static __wrap(ptr) {
|
|
1205
|
+
ptr = ptr >>> 0;
|
|
1206
|
+
const obj = Object.create(ContractOperation.prototype);
|
|
1207
|
+
obj.__wbg_ptr = ptr;
|
|
1208
|
+
ContractOperationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1209
|
+
return obj;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
__destroy_into_raw() {
|
|
1213
|
+
const ptr = this.__wbg_ptr;
|
|
1214
|
+
this.__wbg_ptr = 0;
|
|
1215
|
+
ContractOperationFinalization.unregister(this);
|
|
1216
|
+
return ptr;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
free() {
|
|
1220
|
+
const ptr = this.__destroy_into_raw();
|
|
1221
|
+
wasm.__wbg_contractoperation_free(ptr, 0);
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* @param {Uint8Array} raw
|
|
1225
|
+
* @returns {ContractOperation}
|
|
1226
|
+
*/
|
|
1227
|
+
static deserialize(raw) {
|
|
1228
|
+
const ret = wasm.contractoperation_deserialize(raw);
|
|
1229
|
+
if (ret[2]) {
|
|
1230
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1231
|
+
}
|
|
1232
|
+
return ContractOperation.__wrap(ret[0]);
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* @returns {any}
|
|
1236
|
+
*/
|
|
1237
|
+
get verifierKey() {
|
|
1238
|
+
const ret = wasm.contractoperation_verifier_key(this.__wbg_ptr);
|
|
1239
|
+
if (ret[2]) {
|
|
1240
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1241
|
+
}
|
|
1242
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* @param {Uint8Array} key
|
|
1246
|
+
*/
|
|
1247
|
+
set verifierKey(key) {
|
|
1248
|
+
const ret = wasm.contractoperation_set_verifier_key(this.__wbg_ptr, key);
|
|
1249
|
+
if (ret[1]) {
|
|
1250
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
constructor() {
|
|
1254
|
+
const ret = wasm.contractoperation_new();
|
|
1255
|
+
if (ret[2]) {
|
|
1256
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1257
|
+
}
|
|
1258
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
1259
|
+
ContractOperationFinalization.register(this, this.__wbg_ptr, this);
|
|
1260
|
+
return this;
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* @returns {any}
|
|
1264
|
+
*/
|
|
1265
|
+
serialize() {
|
|
1266
|
+
const ret = wasm.contractoperation_serialize(this.__wbg_ptr);
|
|
1267
|
+
if (ret[2]) {
|
|
1268
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1269
|
+
}
|
|
1270
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
1273
|
+
* @param {boolean | null} [compact]
|
|
1274
|
+
* @returns {string}
|
|
1275
|
+
*/
|
|
1276
|
+
toString(compact) {
|
|
1277
|
+
let deferred1_0;
|
|
1278
|
+
let deferred1_1;
|
|
1279
|
+
try {
|
|
1280
|
+
const ret = wasm.contractoperation_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
1281
|
+
deferred1_0 = ret[0];
|
|
1282
|
+
deferred1_1 = ret[1];
|
|
1283
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1284
|
+
} finally {
|
|
1285
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
if (Symbol.dispose) ContractOperation.prototype[Symbol.dispose] = ContractOperation.prototype.free;
|
|
1290
|
+
|
|
1291
|
+
const ContractStateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1292
|
+
? { register: () => {}, unregister: () => {} }
|
|
1293
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractstate_free(ptr >>> 0, 1));
|
|
1294
|
+
|
|
1295
|
+
export class ContractState {
|
|
1296
|
+
|
|
1297
|
+
static __wrap(ptr) {
|
|
1298
|
+
ptr = ptr >>> 0;
|
|
1299
|
+
const obj = Object.create(ContractState.prototype);
|
|
1300
|
+
obj.__wbg_ptr = ptr;
|
|
1301
|
+
ContractStateFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1302
|
+
return obj;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
__destroy_into_raw() {
|
|
1306
|
+
const ptr = this.__wbg_ptr;
|
|
1307
|
+
this.__wbg_ptr = 0;
|
|
1308
|
+
ContractStateFinalization.unregister(this);
|
|
1309
|
+
return ptr;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
free() {
|
|
1313
|
+
const ptr = this.__destroy_into_raw();
|
|
1314
|
+
wasm.__wbg_contractstate_free(ptr, 0);
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* @returns {any[]}
|
|
1318
|
+
*/
|
|
1319
|
+
operations() {
|
|
1320
|
+
const ret = wasm.contractstate_operations(this.__wbg_ptr);
|
|
1321
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1322
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1323
|
+
return v1;
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* @param {Uint8Array} raw
|
|
1327
|
+
* @returns {ContractState}
|
|
1328
|
+
*/
|
|
1329
|
+
static deserialize(raw) {
|
|
1330
|
+
const ret = wasm.contractstate_deserialize(raw);
|
|
1331
|
+
if (ret[2]) {
|
|
1332
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1333
|
+
}
|
|
1334
|
+
return ContractState.__wrap(ret[0]);
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* @param {Map<any, any>} value_map
|
|
1338
|
+
*/
|
|
1339
|
+
set balance(value_map) {
|
|
1340
|
+
const ret = wasm.contractstate_set_balance(this.__wbg_ptr, value_map);
|
|
1341
|
+
if (ret[1]) {
|
|
1342
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* @param {any} operation
|
|
1347
|
+
* @param {ContractOperation} value
|
|
1348
|
+
*/
|
|
1349
|
+
setOperation(operation, value) {
|
|
1350
|
+
_assertClass(value, ContractOperation);
|
|
1351
|
+
const ret = wasm.contractstate_setOperation(this.__wbg_ptr, operation, value.__wbg_ptr);
|
|
1352
|
+
if (ret[1]) {
|
|
1353
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* @returns {ContractMaintenanceAuthority}
|
|
1358
|
+
*/
|
|
1359
|
+
get maintenanceAuthority() {
|
|
1360
|
+
const ret = wasm.contractstate_maintenance_authority(this.__wbg_ptr);
|
|
1361
|
+
return ContractMaintenanceAuthority.__wrap(ret);
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* @param {ContractMaintenanceAuthority} authority
|
|
1365
|
+
*/
|
|
1366
|
+
set maintenanceAuthority(authority) {
|
|
1367
|
+
_assertClass(authority, ContractMaintenanceAuthority);
|
|
1368
|
+
wasm.contractstate_set_maintenance_authority(this.__wbg_ptr, authority.__wbg_ptr);
|
|
1369
|
+
}
|
|
1370
|
+
constructor() {
|
|
1371
|
+
const ret = wasm.contractstate_new();
|
|
1372
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1373
|
+
ContractStateFinalization.register(this, this.__wbg_ptr, this);
|
|
1374
|
+
return this;
|
|
1375
|
+
}
|
|
1376
|
+
/**
|
|
1377
|
+
* @returns {ChargedState}
|
|
1378
|
+
*/
|
|
1379
|
+
get data() {
|
|
1380
|
+
const ret = wasm.contractstate_data(this.__wbg_ptr);
|
|
1381
|
+
return ChargedState.__wrap(ret);
|
|
1382
|
+
}
|
|
1383
|
+
/**
|
|
1384
|
+
* @param {any} query
|
|
1385
|
+
* @param {CostModel} cost_model
|
|
1386
|
+
* @returns {any}
|
|
1387
|
+
*/
|
|
1388
|
+
query(query, cost_model) {
|
|
1389
|
+
_assertClass(cost_model, CostModel);
|
|
1390
|
+
const ret = wasm.contractstate_query(this.__wbg_ptr, query, cost_model.__wbg_ptr);
|
|
1391
|
+
if (ret[2]) {
|
|
1392
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1393
|
+
}
|
|
1394
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* @returns {Map<any, any>}
|
|
1398
|
+
*/
|
|
1399
|
+
get balance() {
|
|
1400
|
+
const ret = wasm.contractstate_balance(this.__wbg_ptr);
|
|
1401
|
+
if (ret[2]) {
|
|
1402
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1403
|
+
}
|
|
1404
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* @param {ChargedState} data
|
|
1408
|
+
*/
|
|
1409
|
+
set data(data) {
|
|
1410
|
+
_assertClass(data, ChargedState);
|
|
1411
|
+
wasm.contractstate_set_data(this.__wbg_ptr, data.__wbg_ptr);
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* @param {any} operation
|
|
1415
|
+
* @returns {ContractOperation | undefined}
|
|
1416
|
+
*/
|
|
1417
|
+
operation(operation) {
|
|
1418
|
+
const ret = wasm.contractstate_operation(this.__wbg_ptr, operation);
|
|
1419
|
+
if (ret[2]) {
|
|
1420
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1421
|
+
}
|
|
1422
|
+
return ret[0] === 0 ? undefined : ContractOperation.__wrap(ret[0]);
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* @returns {any}
|
|
1426
|
+
*/
|
|
1427
|
+
serialize() {
|
|
1428
|
+
const ret = wasm.contractstate_serialize(this.__wbg_ptr);
|
|
1429
|
+
if (ret[2]) {
|
|
1430
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1431
|
+
}
|
|
1432
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* @param {boolean | null} [compact]
|
|
1436
|
+
* @returns {string}
|
|
1437
|
+
*/
|
|
1438
|
+
toString(compact) {
|
|
1439
|
+
let deferred1_0;
|
|
1440
|
+
let deferred1_1;
|
|
1441
|
+
try {
|
|
1442
|
+
const ret = wasm.contractstate_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
1443
|
+
deferred1_0 = ret[0];
|
|
1444
|
+
deferred1_1 = ret[1];
|
|
1445
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1446
|
+
} finally {
|
|
1447
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
if (Symbol.dispose) ContractState.prototype[Symbol.dispose] = ContractState.prototype.free;
|
|
1452
|
+
|
|
1453
|
+
const CostModelFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1454
|
+
? { register: () => {}, unregister: () => {} }
|
|
1455
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_costmodel_free(ptr >>> 0, 1));
|
|
1456
|
+
|
|
1457
|
+
export class CostModel {
|
|
1458
|
+
|
|
1459
|
+
static __wrap(ptr) {
|
|
1460
|
+
ptr = ptr >>> 0;
|
|
1461
|
+
const obj = Object.create(CostModel.prototype);
|
|
1462
|
+
obj.__wbg_ptr = ptr;
|
|
1463
|
+
CostModelFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1464
|
+
return obj;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
__destroy_into_raw() {
|
|
1468
|
+
const ptr = this.__wbg_ptr;
|
|
1469
|
+
this.__wbg_ptr = 0;
|
|
1470
|
+
CostModelFinalization.unregister(this);
|
|
1471
|
+
return ptr;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
free() {
|
|
1475
|
+
const ptr = this.__destroy_into_raw();
|
|
1476
|
+
wasm.__wbg_costmodel_free(ptr, 0);
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* @returns {CostModel}
|
|
1480
|
+
*/
|
|
1481
|
+
static initialCostModel() {
|
|
1482
|
+
const ret = wasm.costmodel_initialCostModel();
|
|
1483
|
+
return CostModel.__wrap(ret);
|
|
1484
|
+
}
|
|
1485
|
+
constructor() {
|
|
1486
|
+
const ret = wasm.costmodel_new();
|
|
1487
|
+
if (ret[2]) {
|
|
1488
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1489
|
+
}
|
|
1490
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
1491
|
+
CostModelFinalization.register(this, this.__wbg_ptr, this);
|
|
1492
|
+
return this;
|
|
1493
|
+
}
|
|
1494
|
+
/**
|
|
1495
|
+
* @param {boolean | null} [compact]
|
|
1496
|
+
* @returns {string}
|
|
1497
|
+
*/
|
|
1498
|
+
toString(compact) {
|
|
1499
|
+
let deferred1_0;
|
|
1500
|
+
let deferred1_1;
|
|
1501
|
+
try {
|
|
1502
|
+
const ret = wasm.costmodel_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
1503
|
+
deferred1_0 = ret[0];
|
|
1504
|
+
deferred1_1 = ret[1];
|
|
1505
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1506
|
+
} finally {
|
|
1507
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
if (Symbol.dispose) CostModel.prototype[Symbol.dispose] = CostModel.prototype.free;
|
|
1512
|
+
|
|
1513
|
+
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1514
|
+
? { register: () => {}, unregister: () => {} }
|
|
1515
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
|
|
1516
|
+
|
|
1517
|
+
export class IntoUnderlyingByteSource {
|
|
1518
|
+
|
|
1519
|
+
__destroy_into_raw() {
|
|
1520
|
+
const ptr = this.__wbg_ptr;
|
|
1521
|
+
this.__wbg_ptr = 0;
|
|
1522
|
+
IntoUnderlyingByteSourceFinalization.unregister(this);
|
|
1523
|
+
return ptr;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
free() {
|
|
1527
|
+
const ptr = this.__destroy_into_raw();
|
|
1528
|
+
wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* @returns {number}
|
|
1532
|
+
*/
|
|
1533
|
+
get autoAllocateChunkSize() {
|
|
1534
|
+
const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
|
|
1535
|
+
return ret >>> 0;
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* @param {ReadableByteStreamController} controller
|
|
1539
|
+
* @returns {Promise<any>}
|
|
1540
|
+
*/
|
|
1541
|
+
pull(controller) {
|
|
1542
|
+
const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
|
|
1543
|
+
return ret;
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* @param {ReadableByteStreamController} controller
|
|
1547
|
+
*/
|
|
1548
|
+
start(controller) {
|
|
1549
|
+
wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* @returns {ReadableStreamType}
|
|
1553
|
+
*/
|
|
1554
|
+
get type() {
|
|
1555
|
+
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
1556
|
+
return __wbindgen_enum_ReadableStreamType[ret];
|
|
1557
|
+
}
|
|
1558
|
+
cancel() {
|
|
1559
|
+
const ptr = this.__destroy_into_raw();
|
|
1560
|
+
wasm.intounderlyingbytesource_cancel(ptr);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1564
|
+
|
|
1565
|
+
const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1566
|
+
? { register: () => {}, unregister: () => {} }
|
|
1567
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
|
|
1568
|
+
|
|
1569
|
+
export class IntoUnderlyingSink {
|
|
1570
|
+
|
|
1571
|
+
__destroy_into_raw() {
|
|
1572
|
+
const ptr = this.__wbg_ptr;
|
|
1573
|
+
this.__wbg_ptr = 0;
|
|
1574
|
+
IntoUnderlyingSinkFinalization.unregister(this);
|
|
1575
|
+
return ptr;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
free() {
|
|
1579
|
+
const ptr = this.__destroy_into_raw();
|
|
1580
|
+
wasm.__wbg_intounderlyingsink_free(ptr, 0);
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* @param {any} reason
|
|
1584
|
+
* @returns {Promise<any>}
|
|
1585
|
+
*/
|
|
1586
|
+
abort(reason) {
|
|
1587
|
+
const ptr = this.__destroy_into_raw();
|
|
1588
|
+
const ret = wasm.intounderlyingsink_abort(ptr, reason);
|
|
1589
|
+
return ret;
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* @returns {Promise<any>}
|
|
1593
|
+
*/
|
|
1594
|
+
close() {
|
|
1595
|
+
const ptr = this.__destroy_into_raw();
|
|
1596
|
+
const ret = wasm.intounderlyingsink_close(ptr);
|
|
1597
|
+
return ret;
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* @param {any} chunk
|
|
1601
|
+
* @returns {Promise<any>}
|
|
1602
|
+
*/
|
|
1603
|
+
write(chunk) {
|
|
1604
|
+
const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
|
|
1605
|
+
return ret;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1609
|
+
|
|
1610
|
+
const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1611
|
+
? { register: () => {}, unregister: () => {} }
|
|
1612
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
|
|
1613
|
+
|
|
1614
|
+
export class IntoUnderlyingSource {
|
|
1615
|
+
|
|
1616
|
+
__destroy_into_raw() {
|
|
1617
|
+
const ptr = this.__wbg_ptr;
|
|
1618
|
+
this.__wbg_ptr = 0;
|
|
1619
|
+
IntoUnderlyingSourceFinalization.unregister(this);
|
|
1620
|
+
return ptr;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
free() {
|
|
1624
|
+
const ptr = this.__destroy_into_raw();
|
|
1625
|
+
wasm.__wbg_intounderlyingsource_free(ptr, 0);
|
|
1626
|
+
}
|
|
1627
|
+
/**
|
|
1628
|
+
* @param {ReadableStreamDefaultController} controller
|
|
1629
|
+
* @returns {Promise<any>}
|
|
1630
|
+
*/
|
|
1631
|
+
pull(controller) {
|
|
1632
|
+
const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
|
|
1633
|
+
return ret;
|
|
1634
|
+
}
|
|
1635
|
+
cancel() {
|
|
1636
|
+
const ptr = this.__destroy_into_raw();
|
|
1637
|
+
wasm.intounderlyingsource_cancel(ptr);
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1641
|
+
|
|
1642
|
+
const QueryContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1643
|
+
? { register: () => {}, unregister: () => {} }
|
|
1644
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_querycontext_free(ptr >>> 0, 1));
|
|
1645
|
+
|
|
1646
|
+
export class QueryContext {
|
|
1647
|
+
|
|
1648
|
+
static __wrap(ptr) {
|
|
1649
|
+
ptr = ptr >>> 0;
|
|
1650
|
+
const obj = Object.create(QueryContext.prototype);
|
|
1651
|
+
obj.__wbg_ptr = ptr;
|
|
1652
|
+
QueryContextFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1653
|
+
return obj;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
__destroy_into_raw() {
|
|
1657
|
+
const ptr = this.__wbg_ptr;
|
|
1658
|
+
this.__wbg_ptr = 0;
|
|
1659
|
+
QueryContextFinalization.unregister(this);
|
|
1660
|
+
return ptr;
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
free() {
|
|
1664
|
+
const ptr = this.__destroy_into_raw();
|
|
1665
|
+
wasm.__wbg_querycontext_free(ptr, 0);
|
|
1666
|
+
}
|
|
1667
|
+
/**
|
|
1668
|
+
* @returns {any}
|
|
1669
|
+
*/
|
|
1670
|
+
get comIndices() {
|
|
1671
|
+
const ret = wasm.querycontext_com_indices(this.__wbg_ptr);
|
|
1672
|
+
if (ret[2]) {
|
|
1673
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1674
|
+
}
|
|
1675
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* @param {any} effects
|
|
1679
|
+
*/
|
|
1680
|
+
set effects(effects) {
|
|
1681
|
+
const ret = wasm.querycontext_set_effects(this.__wbg_ptr, effects);
|
|
1682
|
+
if (ret[1]) {
|
|
1683
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
/**
|
|
1687
|
+
* @returns {VmStack}
|
|
1688
|
+
*/
|
|
1689
|
+
toVmStack() {
|
|
1690
|
+
const ret = wasm.querycontext_toVmStack(this.__wbg_ptr);
|
|
1691
|
+
return VmStack.__wrap(ret);
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* @param {any} transcript
|
|
1695
|
+
* @param {CostModel} cost_model
|
|
1696
|
+
* @returns {QueryContext}
|
|
1697
|
+
*/
|
|
1698
|
+
runTranscript(transcript, cost_model) {
|
|
1699
|
+
_assertClass(cost_model, CostModel);
|
|
1700
|
+
const ret = wasm.querycontext_runTranscript(this.__wbg_ptr, transcript, cost_model.__wbg_ptr);
|
|
1701
|
+
if (ret[2]) {
|
|
1702
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1703
|
+
}
|
|
1704
|
+
return QueryContext.__wrap(ret[0]);
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* @param {string} comm
|
|
1708
|
+
* @param {bigint} index
|
|
1709
|
+
* @returns {QueryContext}
|
|
1710
|
+
*/
|
|
1711
|
+
insertCommitment(comm, index) {
|
|
1712
|
+
const ptr0 = passStringToWasm0(comm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1713
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1714
|
+
const ret = wasm.querycontext_insertCommitment(this.__wbg_ptr, ptr0, len0, index);
|
|
1715
|
+
if (ret[2]) {
|
|
1716
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1717
|
+
}
|
|
1718
|
+
return QueryContext.__wrap(ret[0]);
|
|
1719
|
+
}
|
|
1720
|
+
/**
|
|
1721
|
+
* @param {ChargedState} state
|
|
1722
|
+
* @param {string} address
|
|
1723
|
+
*/
|
|
1724
|
+
constructor(state, address) {
|
|
1725
|
+
_assertClass(state, ChargedState);
|
|
1726
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1727
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1728
|
+
const ret = wasm.querycontext_new(state.__wbg_ptr, ptr0, len0);
|
|
1729
|
+
if (ret[2]) {
|
|
1730
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1731
|
+
}
|
|
1732
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
1733
|
+
QueryContextFinalization.register(this, this.__wbg_ptr, this);
|
|
1734
|
+
return this;
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* @returns {any}
|
|
1738
|
+
*/
|
|
1739
|
+
get block() {
|
|
1740
|
+
const ret = wasm.querycontext_block(this.__wbg_ptr);
|
|
1741
|
+
if (ret[2]) {
|
|
1742
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1743
|
+
}
|
|
1744
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* @param {any} ops
|
|
1748
|
+
* @param {CostModel} cost_model
|
|
1749
|
+
* @param {any} gas_limit
|
|
1750
|
+
* @returns {QueryResults}
|
|
1751
|
+
*/
|
|
1752
|
+
query(ops, cost_model, gas_limit) {
|
|
1753
|
+
_assertClass(cost_model, CostModel);
|
|
1754
|
+
const ret = wasm.querycontext_query(this.__wbg_ptr, ops, cost_model.__wbg_ptr, gas_limit);
|
|
1755
|
+
if (ret[2]) {
|
|
1756
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1757
|
+
}
|
|
1758
|
+
return QueryResults.__wrap(ret[0]);
|
|
1759
|
+
}
|
|
1760
|
+
/**
|
|
1761
|
+
* @returns {ChargedState}
|
|
1762
|
+
*/
|
|
1763
|
+
get state() {
|
|
1764
|
+
const ret = wasm.querycontext_state(this.__wbg_ptr);
|
|
1765
|
+
return ChargedState.__wrap(ret);
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* @returns {string}
|
|
1769
|
+
*/
|
|
1770
|
+
get address() {
|
|
1771
|
+
let deferred2_0;
|
|
1772
|
+
let deferred2_1;
|
|
1773
|
+
try {
|
|
1774
|
+
const ret = wasm.querycontext_address(this.__wbg_ptr);
|
|
1775
|
+
var ptr1 = ret[0];
|
|
1776
|
+
var len1 = ret[1];
|
|
1777
|
+
if (ret[3]) {
|
|
1778
|
+
ptr1 = 0; len1 = 0;
|
|
1779
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1780
|
+
}
|
|
1781
|
+
deferred2_0 = ptr1;
|
|
1782
|
+
deferred2_1 = len1;
|
|
1783
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1784
|
+
} finally {
|
|
1785
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* @returns {any}
|
|
1790
|
+
*/
|
|
1791
|
+
get effects() {
|
|
1792
|
+
const ret = wasm.querycontext_effects(this.__wbg_ptr);
|
|
1793
|
+
if (ret[2]) {
|
|
1794
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1795
|
+
}
|
|
1796
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* @param {any} coin
|
|
1800
|
+
* @returns {any}
|
|
1801
|
+
*/
|
|
1802
|
+
qualify(coin) {
|
|
1803
|
+
const ret = wasm.querycontext_qualify(this.__wbg_ptr, coin);
|
|
1804
|
+
if (ret[2]) {
|
|
1805
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1806
|
+
}
|
|
1807
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1808
|
+
}
|
|
1809
|
+
/**
|
|
1810
|
+
* @param {any} block
|
|
1811
|
+
*/
|
|
1812
|
+
set block(block) {
|
|
1813
|
+
const ret = wasm.querycontext_set_block(this.__wbg_ptr, block);
|
|
1814
|
+
if (ret[1]) {
|
|
1815
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* @param {boolean | null} [compact]
|
|
1820
|
+
* @returns {string}
|
|
1821
|
+
*/
|
|
1822
|
+
toString(compact) {
|
|
1823
|
+
let deferred1_0;
|
|
1824
|
+
let deferred1_1;
|
|
1825
|
+
try {
|
|
1826
|
+
const ret = wasm.querycontext_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
1827
|
+
deferred1_0 = ret[0];
|
|
1828
|
+
deferred1_1 = ret[1];
|
|
1829
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1830
|
+
} finally {
|
|
1831
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
if (Symbol.dispose) QueryContext.prototype[Symbol.dispose] = QueryContext.prototype.free;
|
|
1836
|
+
|
|
1837
|
+
const QueryResultsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1838
|
+
? { register: () => {}, unregister: () => {} }
|
|
1839
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_queryresults_free(ptr >>> 0, 1));
|
|
1840
|
+
|
|
1841
|
+
export class QueryResults {
|
|
1842
|
+
|
|
1843
|
+
static __wrap(ptr) {
|
|
1844
|
+
ptr = ptr >>> 0;
|
|
1845
|
+
const obj = Object.create(QueryResults.prototype);
|
|
1846
|
+
obj.__wbg_ptr = ptr;
|
|
1847
|
+
QueryResultsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1848
|
+
return obj;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
__destroy_into_raw() {
|
|
1852
|
+
const ptr = this.__wbg_ptr;
|
|
1853
|
+
this.__wbg_ptr = 0;
|
|
1854
|
+
QueryResultsFinalization.unregister(this);
|
|
1855
|
+
return ptr;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
free() {
|
|
1859
|
+
const ptr = this.__destroy_into_raw();
|
|
1860
|
+
wasm.__wbg_queryresults_free(ptr, 0);
|
|
1861
|
+
}
|
|
1862
|
+
constructor() {
|
|
1863
|
+
const ret = wasm.queryresults_new();
|
|
1864
|
+
if (ret[2]) {
|
|
1865
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1866
|
+
}
|
|
1867
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
1868
|
+
QueryResultsFinalization.register(this, this.__wbg_ptr, this);
|
|
1869
|
+
return this;
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* @returns {any}
|
|
1873
|
+
*/
|
|
1874
|
+
get events() {
|
|
1875
|
+
const ret = wasm.queryresults_events(this.__wbg_ptr);
|
|
1876
|
+
if (ret[2]) {
|
|
1877
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1878
|
+
}
|
|
1879
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* @returns {QueryContext}
|
|
1883
|
+
*/
|
|
1884
|
+
get context() {
|
|
1885
|
+
const ret = wasm.queryresults_context(this.__wbg_ptr);
|
|
1886
|
+
return QueryContext.__wrap(ret);
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* @returns {any}
|
|
1890
|
+
*/
|
|
1891
|
+
get gasCost() {
|
|
1892
|
+
const ret = wasm.queryresults_gas_cost(this.__wbg_ptr);
|
|
1893
|
+
if (ret[2]) {
|
|
1894
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1895
|
+
}
|
|
1896
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1897
|
+
}
|
|
1898
|
+
/**
|
|
1899
|
+
* @param {boolean | null} [compact]
|
|
1900
|
+
* @returns {string}
|
|
1901
|
+
*/
|
|
1902
|
+
toString(compact) {
|
|
1903
|
+
let deferred1_0;
|
|
1904
|
+
let deferred1_1;
|
|
1905
|
+
try {
|
|
1906
|
+
const ret = wasm.queryresults_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
1907
|
+
deferred1_0 = ret[0];
|
|
1908
|
+
deferred1_1 = ret[1];
|
|
1909
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1910
|
+
} finally {
|
|
1911
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
if (Symbol.dispose) QueryResults.prototype[Symbol.dispose] = QueryResults.prototype.free;
|
|
1916
|
+
|
|
1917
|
+
const StateBoundedMerkleTreeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1918
|
+
? { register: () => {}, unregister: () => {} }
|
|
1919
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_stateboundedmerkletree_free(ptr >>> 0, 1));
|
|
1920
|
+
|
|
1921
|
+
export class StateBoundedMerkleTree {
|
|
1922
|
+
|
|
1923
|
+
static __wrap(ptr) {
|
|
1924
|
+
ptr = ptr >>> 0;
|
|
1925
|
+
const obj = Object.create(StateBoundedMerkleTree.prototype);
|
|
1926
|
+
obj.__wbg_ptr = ptr;
|
|
1927
|
+
StateBoundedMerkleTreeFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1928
|
+
return obj;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
__destroy_into_raw() {
|
|
1932
|
+
const ptr = this.__wbg_ptr;
|
|
1933
|
+
this.__wbg_ptr = 0;
|
|
1934
|
+
StateBoundedMerkleTreeFinalization.unregister(this);
|
|
1935
|
+
return ptr;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
free() {
|
|
1939
|
+
const ptr = this.__destroy_into_raw();
|
|
1940
|
+
wasm.__wbg_stateboundedmerkletree_free(ptr, 0);
|
|
1941
|
+
}
|
|
1942
|
+
/**
|
|
1943
|
+
* @param {bigint} index
|
|
1944
|
+
* @param {any} leaf
|
|
1945
|
+
* @returns {any}
|
|
1946
|
+
*/
|
|
1947
|
+
pathForLeaf(index, leaf) {
|
|
1948
|
+
const ret = wasm.stateboundedmerkletree_pathForLeaf(this.__wbg_ptr, index, leaf);
|
|
1949
|
+
if (ret[2]) {
|
|
1950
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1951
|
+
}
|
|
1952
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1953
|
+
}
|
|
1954
|
+
/**
|
|
1955
|
+
* @param {any} leaf
|
|
1956
|
+
* @param {bigint | null} [index_start]
|
|
1957
|
+
* @param {bigint | null} [index_end]
|
|
1958
|
+
* @param {boolean | null} [already_hashed]
|
|
1959
|
+
* @returns {any}
|
|
1960
|
+
*/
|
|
1961
|
+
findPathForLeaf(leaf, index_start, index_end, already_hashed) {
|
|
1962
|
+
const ret = wasm.stateboundedmerkletree_findPathForLeaf(this.__wbg_ptr, leaf, !isLikeNone(index_start), isLikeNone(index_start) ? BigInt(0) : index_start, !isLikeNone(index_end), isLikeNone(index_end) ? BigInt(0) : index_end, isLikeNone(already_hashed) ? 0xFFFFFF : already_hashed ? 1 : 0);
|
|
1963
|
+
if (ret[2]) {
|
|
1964
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1965
|
+
}
|
|
1966
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1967
|
+
}
|
|
1968
|
+
/**
|
|
1969
|
+
* @returns {any}
|
|
1970
|
+
*/
|
|
1971
|
+
root() {
|
|
1972
|
+
const ret = wasm.stateboundedmerkletree_root(this.__wbg_ptr);
|
|
1973
|
+
if (ret[2]) {
|
|
1974
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1975
|
+
}
|
|
1976
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1977
|
+
}
|
|
1978
|
+
/**
|
|
1979
|
+
* @param {number} height
|
|
1980
|
+
*/
|
|
1981
|
+
constructor(height) {
|
|
1982
|
+
const ret = wasm.stateboundedmerkletree_blank(height);
|
|
1983
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1984
|
+
StateBoundedMerkleTreeFinalization.register(this, this.__wbg_ptr, this);
|
|
1985
|
+
return this;
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1988
|
+
* @returns {number}
|
|
1989
|
+
*/
|
|
1990
|
+
get height() {
|
|
1991
|
+
const ret = wasm.stateboundedmerkletree_height(this.__wbg_ptr);
|
|
1992
|
+
return ret;
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* @returns {StateBoundedMerkleTree}
|
|
1996
|
+
*/
|
|
1997
|
+
rehash() {
|
|
1998
|
+
const ret = wasm.stateboundedmerkletree_rehash(this.__wbg_ptr);
|
|
1999
|
+
return StateBoundedMerkleTree.__wrap(ret);
|
|
2000
|
+
}
|
|
2001
|
+
/**
|
|
2002
|
+
* @param {bigint} index
|
|
2003
|
+
* @param {any} leaf
|
|
2004
|
+
* @returns {StateBoundedMerkleTree}
|
|
2005
|
+
*/
|
|
2006
|
+
update(index, leaf) {
|
|
2007
|
+
const ret = wasm.stateboundedmerkletree_update(this.__wbg_ptr, index, leaf);
|
|
2008
|
+
if (ret[2]) {
|
|
2009
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2010
|
+
}
|
|
2011
|
+
return StateBoundedMerkleTree.__wrap(ret[0]);
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* @param {bigint} start
|
|
2015
|
+
* @param {bigint} end
|
|
2016
|
+
* @returns {StateBoundedMerkleTree}
|
|
2017
|
+
*/
|
|
2018
|
+
collapse(start, end) {
|
|
2019
|
+
const ret = wasm.stateboundedmerkletree_collapse(this.__wbg_ptr, start, end);
|
|
2020
|
+
return StateBoundedMerkleTree.__wrap(ret);
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* @param {boolean | null} [compact]
|
|
2024
|
+
* @returns {string}
|
|
2025
|
+
*/
|
|
2026
|
+
toString(compact) {
|
|
2027
|
+
let deferred1_0;
|
|
2028
|
+
let deferred1_1;
|
|
2029
|
+
try {
|
|
2030
|
+
const ret = wasm.stateboundedmerkletree_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
2031
|
+
deferred1_0 = ret[0];
|
|
2032
|
+
deferred1_1 = ret[1];
|
|
2033
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2034
|
+
} finally {
|
|
2035
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
if (Symbol.dispose) StateBoundedMerkleTree.prototype[Symbol.dispose] = StateBoundedMerkleTree.prototype.free;
|
|
2040
|
+
|
|
2041
|
+
const StateMapFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2042
|
+
? { register: () => {}, unregister: () => {} }
|
|
2043
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_statemap_free(ptr >>> 0, 1));
|
|
2044
|
+
|
|
2045
|
+
export class StateMap {
|
|
2046
|
+
|
|
2047
|
+
static __wrap(ptr) {
|
|
2048
|
+
ptr = ptr >>> 0;
|
|
2049
|
+
const obj = Object.create(StateMap.prototype);
|
|
2050
|
+
obj.__wbg_ptr = ptr;
|
|
2051
|
+
StateMapFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2052
|
+
return obj;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
__destroy_into_raw() {
|
|
2056
|
+
const ptr = this.__wbg_ptr;
|
|
2057
|
+
this.__wbg_ptr = 0;
|
|
2058
|
+
StateMapFinalization.unregister(this);
|
|
2059
|
+
return ptr;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
free() {
|
|
2063
|
+
const ptr = this.__destroy_into_raw();
|
|
2064
|
+
wasm.__wbg_statemap_free(ptr, 0);
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* @param {any} key
|
|
2068
|
+
* @returns {StateValue | undefined}
|
|
2069
|
+
*/
|
|
2070
|
+
get(key) {
|
|
2071
|
+
const ret = wasm.statemap_get(this.__wbg_ptr, key);
|
|
2072
|
+
if (ret[2]) {
|
|
2073
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2074
|
+
}
|
|
2075
|
+
return ret[0] === 0 ? undefined : StateValue.__wrap(ret[0]);
|
|
2076
|
+
}
|
|
2077
|
+
constructor() {
|
|
2078
|
+
const ret = wasm.statemap_new();
|
|
2079
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2080
|
+
StateMapFinalization.register(this, this.__wbg_ptr, this);
|
|
2081
|
+
return this;
|
|
2082
|
+
}
|
|
2083
|
+
/**
|
|
2084
|
+
* @returns {any[]}
|
|
2085
|
+
*/
|
|
2086
|
+
keys() {
|
|
2087
|
+
const ret = wasm.statemap_keys(this.__wbg_ptr);
|
|
2088
|
+
if (ret[3]) {
|
|
2089
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2090
|
+
}
|
|
2091
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
2092
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
2093
|
+
return v1;
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* @param {any} key
|
|
2097
|
+
* @param {StateValue} value
|
|
2098
|
+
* @returns {StateMap}
|
|
2099
|
+
*/
|
|
2100
|
+
insert(key, value) {
|
|
2101
|
+
_assertClass(value, StateValue);
|
|
2102
|
+
const ret = wasm.statemap_insert(this.__wbg_ptr, key, value.__wbg_ptr);
|
|
2103
|
+
if (ret[2]) {
|
|
2104
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2105
|
+
}
|
|
2106
|
+
return StateMap.__wrap(ret[0]);
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* @param {any} key
|
|
2110
|
+
* @returns {StateMap}
|
|
2111
|
+
*/
|
|
2112
|
+
remove(key) {
|
|
2113
|
+
const ret = wasm.statemap_remove(this.__wbg_ptr, key);
|
|
2114
|
+
if (ret[2]) {
|
|
2115
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2116
|
+
}
|
|
2117
|
+
return StateMap.__wrap(ret[0]);
|
|
2118
|
+
}
|
|
2119
|
+
/**
|
|
2120
|
+
* @param {boolean | null} [compact]
|
|
2121
|
+
* @returns {string}
|
|
2122
|
+
*/
|
|
2123
|
+
toString(compact) {
|
|
2124
|
+
let deferred1_0;
|
|
2125
|
+
let deferred1_1;
|
|
2126
|
+
try {
|
|
2127
|
+
const ret = wasm.statemap_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
2128
|
+
deferred1_0 = ret[0];
|
|
2129
|
+
deferred1_1 = ret[1];
|
|
2130
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2131
|
+
} finally {
|
|
2132
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
if (Symbol.dispose) StateMap.prototype[Symbol.dispose] = StateMap.prototype.free;
|
|
2137
|
+
|
|
2138
|
+
const StateValueFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2139
|
+
? { register: () => {}, unregister: () => {} }
|
|
2140
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_statevalue_free(ptr >>> 0, 1));
|
|
2141
|
+
|
|
2142
|
+
export class StateValue {
|
|
2143
|
+
|
|
2144
|
+
static __wrap(ptr) {
|
|
2145
|
+
ptr = ptr >>> 0;
|
|
2146
|
+
const obj = Object.create(StateValue.prototype);
|
|
2147
|
+
obj.__wbg_ptr = ptr;
|
|
2148
|
+
StateValueFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2149
|
+
return obj;
|
|
2150
|
+
}
|
|
2151
|
+
|
|
2152
|
+
__destroy_into_raw() {
|
|
2153
|
+
const ptr = this.__wbg_ptr;
|
|
2154
|
+
this.__wbg_ptr = 0;
|
|
2155
|
+
StateValueFinalization.unregister(this);
|
|
2156
|
+
return ptr;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
free() {
|
|
2160
|
+
const ptr = this.__destroy_into_raw();
|
|
2161
|
+
wasm.__wbg_statevalue_free(ptr, 0);
|
|
2162
|
+
}
|
|
2163
|
+
/**
|
|
2164
|
+
* @param {StateValue} value
|
|
2165
|
+
* @returns {StateValue}
|
|
2166
|
+
*/
|
|
2167
|
+
arrayPush(value) {
|
|
2168
|
+
_assertClass(value, StateValue);
|
|
2169
|
+
const ret = wasm.statevalue_arrayPush(this.__wbg_ptr, value.__wbg_ptr);
|
|
2170
|
+
if (ret[2]) {
|
|
2171
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2172
|
+
}
|
|
2173
|
+
return StateValue.__wrap(ret[0]);
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* @returns {StateBoundedMerkleTree | undefined}
|
|
2177
|
+
*/
|
|
2178
|
+
asBoundedMerkleTree() {
|
|
2179
|
+
const ret = wasm.statevalue_asBoundedMerkleTree(this.__wbg_ptr);
|
|
2180
|
+
if (ret[2]) {
|
|
2181
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2182
|
+
}
|
|
2183
|
+
return ret[0] === 0 ? undefined : StateBoundedMerkleTree.__wrap(ret[0]);
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* @param {StateBoundedMerkleTree} tree
|
|
2187
|
+
* @returns {StateValue}
|
|
2188
|
+
*/
|
|
2189
|
+
static newBoundedMerkleTree(tree) {
|
|
2190
|
+
_assertClass(tree, StateBoundedMerkleTree);
|
|
2191
|
+
const ret = wasm.statevalue_newBoundedMerkleTree(tree.__wbg_ptr);
|
|
2192
|
+
return StateValue.__wrap(ret);
|
|
2193
|
+
}
|
|
2194
|
+
constructor() {
|
|
2195
|
+
const ret = wasm.statevalue_new();
|
|
2196
|
+
if (ret[2]) {
|
|
2197
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2198
|
+
}
|
|
2199
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
2200
|
+
StateValueFinalization.register(this, this.__wbg_ptr, this);
|
|
2201
|
+
return this;
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* @returns {string}
|
|
2205
|
+
*/
|
|
2206
|
+
type() {
|
|
2207
|
+
let deferred1_0;
|
|
2208
|
+
let deferred1_1;
|
|
2209
|
+
try {
|
|
2210
|
+
const ret = wasm.statevalue_type(this.__wbg_ptr);
|
|
2211
|
+
deferred1_0 = ret[0];
|
|
2212
|
+
deferred1_1 = ret[1];
|
|
2213
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2214
|
+
} finally {
|
|
2215
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* @returns {StateMap | undefined}
|
|
2220
|
+
*/
|
|
2221
|
+
asMap() {
|
|
2222
|
+
const ret = wasm.statevalue_asMap(this.__wbg_ptr);
|
|
2223
|
+
if (ret[2]) {
|
|
2224
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2225
|
+
}
|
|
2226
|
+
return ret[0] === 0 ? undefined : StateMap.__wrap(ret[0]);
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* @param {any} value
|
|
2230
|
+
* @returns {StateValue}
|
|
2231
|
+
*/
|
|
2232
|
+
static decode(value) {
|
|
2233
|
+
const ret = wasm.statevalue_decode(value);
|
|
2234
|
+
if (ret[2]) {
|
|
2235
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2236
|
+
}
|
|
2237
|
+
return StateValue.__wrap(ret[0]);
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* @returns {any}
|
|
2241
|
+
*/
|
|
2242
|
+
encode() {
|
|
2243
|
+
const ret = wasm.statevalue_encode(this.__wbg_ptr);
|
|
2244
|
+
if (ret[2]) {
|
|
2245
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2246
|
+
}
|
|
2247
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2248
|
+
}
|
|
2249
|
+
/**
|
|
2250
|
+
* @returns {any}
|
|
2251
|
+
*/
|
|
2252
|
+
asCell() {
|
|
2253
|
+
const ret = wasm.statevalue_asCell(this.__wbg_ptr);
|
|
2254
|
+
if (ret[2]) {
|
|
2255
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2256
|
+
}
|
|
2257
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* @param {StateMap} map
|
|
2261
|
+
* @returns {StateValue}
|
|
2262
|
+
*/
|
|
2263
|
+
static newMap(map) {
|
|
2264
|
+
_assertClass(map, StateMap);
|
|
2265
|
+
const ret = wasm.statevalue_newMap(map.__wbg_ptr);
|
|
2266
|
+
return StateValue.__wrap(ret);
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* @returns {any[] | undefined}
|
|
2270
|
+
*/
|
|
2271
|
+
asArray() {
|
|
2272
|
+
const ret = wasm.statevalue_asArray(this.__wbg_ptr);
|
|
2273
|
+
if (ret[3]) {
|
|
2274
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2275
|
+
}
|
|
2276
|
+
let v1;
|
|
2277
|
+
if (ret[0] !== 0) {
|
|
2278
|
+
v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
2279
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
2280
|
+
}
|
|
2281
|
+
return v1;
|
|
2282
|
+
}
|
|
2283
|
+
/**
|
|
2284
|
+
* @returns {number}
|
|
2285
|
+
*/
|
|
2286
|
+
logSize() {
|
|
2287
|
+
const ret = wasm.statevalue_logSize(this.__wbg_ptr);
|
|
2288
|
+
return ret >>> 0;
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* @param {any} value
|
|
2292
|
+
* @returns {StateValue}
|
|
2293
|
+
*/
|
|
2294
|
+
static newCell(value) {
|
|
2295
|
+
const ret = wasm.statevalue_newCell(value);
|
|
2296
|
+
if (ret[2]) {
|
|
2297
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2298
|
+
}
|
|
2299
|
+
return StateValue.__wrap(ret[0]);
|
|
2300
|
+
}
|
|
2301
|
+
/**
|
|
2302
|
+
* @returns {StateValue}
|
|
2303
|
+
*/
|
|
2304
|
+
static newNull() {
|
|
2305
|
+
const ret = wasm.statevalue_newNull();
|
|
2306
|
+
return StateValue.__wrap(ret);
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* @returns {StateValue}
|
|
2310
|
+
*/
|
|
2311
|
+
static newArray() {
|
|
2312
|
+
const ret = wasm.statevalue_newArray();
|
|
2313
|
+
return StateValue.__wrap(ret);
|
|
2314
|
+
}
|
|
2315
|
+
/**
|
|
2316
|
+
* @param {boolean | null} [compact]
|
|
2317
|
+
* @returns {string}
|
|
2318
|
+
*/
|
|
2319
|
+
toString(compact) {
|
|
2320
|
+
let deferred1_0;
|
|
2321
|
+
let deferred1_1;
|
|
2322
|
+
try {
|
|
2323
|
+
const ret = wasm.statevalue_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
2324
|
+
deferred1_0 = ret[0];
|
|
2325
|
+
deferred1_1 = ret[1];
|
|
2326
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2327
|
+
} finally {
|
|
2328
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
if (Symbol.dispose) StateValue.prototype[Symbol.dispose] = StateValue.prototype.free;
|
|
2333
|
+
|
|
2334
|
+
const VmResultsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2335
|
+
? { register: () => {}, unregister: () => {} }
|
|
2336
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_vmresults_free(ptr >>> 0, 1));
|
|
2337
|
+
|
|
2338
|
+
export class VmResults {
|
|
2339
|
+
|
|
2340
|
+
static __wrap(ptr) {
|
|
2341
|
+
ptr = ptr >>> 0;
|
|
2342
|
+
const obj = Object.create(VmResults.prototype);
|
|
2343
|
+
obj.__wbg_ptr = ptr;
|
|
2344
|
+
VmResultsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2345
|
+
return obj;
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
__destroy_into_raw() {
|
|
2349
|
+
const ptr = this.__wbg_ptr;
|
|
2350
|
+
this.__wbg_ptr = 0;
|
|
2351
|
+
VmResultsFinalization.unregister(this);
|
|
2352
|
+
return ptr;
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
free() {
|
|
2356
|
+
const ptr = this.__destroy_into_raw();
|
|
2357
|
+
wasm.__wbg_vmresults_free(ptr, 0);
|
|
2358
|
+
}
|
|
2359
|
+
constructor() {
|
|
2360
|
+
const ret = wasm.vmresults_new();
|
|
2361
|
+
if (ret[2]) {
|
|
2362
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2363
|
+
}
|
|
2364
|
+
return StateValue.__wrap(ret[0]);
|
|
2365
|
+
}
|
|
2366
|
+
/**
|
|
2367
|
+
* @returns {VmStack}
|
|
2368
|
+
*/
|
|
2369
|
+
get stack() {
|
|
2370
|
+
const ret = wasm.vmresults_stack(this.__wbg_ptr);
|
|
2371
|
+
return VmStack.__wrap(ret);
|
|
2372
|
+
}
|
|
2373
|
+
/**
|
|
2374
|
+
* @returns {any}
|
|
2375
|
+
*/
|
|
2376
|
+
get events() {
|
|
2377
|
+
const ret = wasm.vmresults_events(this.__wbg_ptr);
|
|
2378
|
+
if (ret[2]) {
|
|
2379
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2380
|
+
}
|
|
2381
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* @returns {any}
|
|
2385
|
+
*/
|
|
2386
|
+
get gasCost() {
|
|
2387
|
+
const ret = wasm.vmresults_gas_cost(this.__wbg_ptr);
|
|
2388
|
+
if (ret[2]) {
|
|
2389
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2390
|
+
}
|
|
2391
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* @param {boolean | null} [compact]
|
|
2395
|
+
* @returns {string}
|
|
2396
|
+
*/
|
|
2397
|
+
toString(compact) {
|
|
2398
|
+
let deferred1_0;
|
|
2399
|
+
let deferred1_1;
|
|
2400
|
+
try {
|
|
2401
|
+
const ret = wasm.vmresults_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
2402
|
+
deferred1_0 = ret[0];
|
|
2403
|
+
deferred1_1 = ret[1];
|
|
2404
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2405
|
+
} finally {
|
|
2406
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
if (Symbol.dispose) VmResults.prototype[Symbol.dispose] = VmResults.prototype.free;
|
|
2411
|
+
|
|
2412
|
+
const VmStackFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2413
|
+
? { register: () => {}, unregister: () => {} }
|
|
2414
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_vmstack_free(ptr >>> 0, 1));
|
|
2415
|
+
|
|
2416
|
+
export class VmStack {
|
|
2417
|
+
|
|
2418
|
+
static __wrap(ptr) {
|
|
2419
|
+
ptr = ptr >>> 0;
|
|
2420
|
+
const obj = Object.create(VmStack.prototype);
|
|
2421
|
+
obj.__wbg_ptr = ptr;
|
|
2422
|
+
VmStackFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2423
|
+
return obj;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
__destroy_into_raw() {
|
|
2427
|
+
const ptr = this.__wbg_ptr;
|
|
2428
|
+
this.__wbg_ptr = 0;
|
|
2429
|
+
VmStackFinalization.unregister(this);
|
|
2430
|
+
return ptr;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
free() {
|
|
2434
|
+
const ptr = this.__destroy_into_raw();
|
|
2435
|
+
wasm.__wbg_vmstack_free(ptr, 0);
|
|
2436
|
+
}
|
|
2437
|
+
removeLast() {
|
|
2438
|
+
wasm.vmstack_removeLast(this.__wbg_ptr);
|
|
2439
|
+
}
|
|
2440
|
+
/**
|
|
2441
|
+
* @param {number} idx
|
|
2442
|
+
* @returns {StateValue | undefined}
|
|
2443
|
+
*/
|
|
2444
|
+
get(idx) {
|
|
2445
|
+
const ret = wasm.vmstack_get(this.__wbg_ptr, idx);
|
|
2446
|
+
return ret === 0 ? undefined : StateValue.__wrap(ret);
|
|
2447
|
+
}
|
|
2448
|
+
constructor() {
|
|
2449
|
+
const ret = wasm.vmstack_new();
|
|
2450
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2451
|
+
VmStackFinalization.register(this, this.__wbg_ptr, this);
|
|
2452
|
+
return this;
|
|
2453
|
+
}
|
|
2454
|
+
/**
|
|
2455
|
+
* @param {StateValue} value
|
|
2456
|
+
* @param {boolean} is_strong
|
|
2457
|
+
*/
|
|
2458
|
+
push(value, is_strong) {
|
|
2459
|
+
_assertClass(value, StateValue);
|
|
2460
|
+
wasm.vmstack_push(this.__wbg_ptr, value.__wbg_ptr, is_strong);
|
|
2461
|
+
}
|
|
2462
|
+
/**
|
|
2463
|
+
* @returns {number}
|
|
2464
|
+
*/
|
|
2465
|
+
length() {
|
|
2466
|
+
const ret = wasm.vmstack_length(this.__wbg_ptr);
|
|
2467
|
+
return ret >>> 0;
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* @param {number} idx
|
|
2471
|
+
* @returns {boolean | undefined}
|
|
2472
|
+
*/
|
|
2473
|
+
isStrong(idx) {
|
|
2474
|
+
const ret = wasm.vmstack_isStrong(this.__wbg_ptr, idx);
|
|
2475
|
+
return ret === 0xFFFFFF ? undefined : ret !== 0;
|
|
2476
|
+
}
|
|
2477
|
+
/**
|
|
2478
|
+
* @param {boolean | null} [compact]
|
|
2479
|
+
* @returns {string}
|
|
2480
|
+
*/
|
|
2481
|
+
toString(compact) {
|
|
2482
|
+
let deferred1_0;
|
|
2483
|
+
let deferred1_1;
|
|
2484
|
+
try {
|
|
2485
|
+
const ret = wasm.vmstack_toString(this.__wbg_ptr, isLikeNone(compact) ? 0xFFFFFF : compact ? 1 : 0);
|
|
2486
|
+
deferred1_0 = ret[0];
|
|
2487
|
+
deferred1_1 = ret[1];
|
|
2488
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2489
|
+
} finally {
|
|
2490
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
if (Symbol.dispose) VmStack.prototype[Symbol.dispose] = VmStack.prototype.free;
|
|
2495
|
+
|
|
2496
|
+
export function __wbg_BigInt_40a77d45cca49470() { return handleError(function (arg0) {
|
|
2497
|
+
const ret = BigInt(arg0);
|
|
2498
|
+
return ret;
|
|
2499
|
+
}, arguments) };
|
|
2500
|
+
|
|
2501
|
+
export function __wbg_BigInt_6adbfd8eb0f7ec07(arg0) {
|
|
2502
|
+
const ret = BigInt(arg0);
|
|
2503
|
+
return ret;
|
|
2504
|
+
};
|
|
2505
|
+
|
|
2506
|
+
export function __wbg_Error_e17e777aac105295(arg0, arg1) {
|
|
2507
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
2508
|
+
return ret;
|
|
2509
|
+
};
|
|
2510
|
+
|
|
2511
|
+
export function __wbg_Number_998bea33bd87c3e0(arg0) {
|
|
2512
|
+
const ret = Number(arg0);
|
|
2513
|
+
return ret;
|
|
2514
|
+
};
|
|
2515
|
+
|
|
2516
|
+
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
2517
|
+
const ret = String(arg1);
|
|
2518
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2519
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2520
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2521
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2522
|
+
};
|
|
2523
|
+
|
|
2524
|
+
export function __wbg_buffer_8d40b1d762fb3c66(arg0) {
|
|
2525
|
+
const ret = arg0.buffer;
|
|
2526
|
+
return ret;
|
|
2527
|
+
};
|
|
2528
|
+
|
|
2529
|
+
export function __wbg_byobRequest_2c036bceca1e6037(arg0) {
|
|
2530
|
+
const ret = arg0.byobRequest;
|
|
2531
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2532
|
+
};
|
|
2533
|
+
|
|
2534
|
+
export function __wbg_byteLength_331a6b5545834024(arg0) {
|
|
2535
|
+
const ret = arg0.byteLength;
|
|
2536
|
+
return ret;
|
|
2537
|
+
};
|
|
2538
|
+
|
|
2539
|
+
export function __wbg_byteOffset_49a5b5608000358b(arg0) {
|
|
2540
|
+
const ret = arg0.byteOffset;
|
|
2541
|
+
return ret;
|
|
2542
|
+
};
|
|
2543
|
+
|
|
2544
|
+
export function __wbg_call_13410aac570ffff7() { return handleError(function (arg0, arg1) {
|
|
2545
|
+
const ret = arg0.call(arg1);
|
|
2546
|
+
return ret;
|
|
2547
|
+
}, arguments) };
|
|
2548
|
+
|
|
2549
|
+
export function __wbg_call_a5400b25a865cfd8() { return handleError(function (arg0, arg1, arg2) {
|
|
2550
|
+
const ret = arg0.call(arg1, arg2);
|
|
2551
|
+
return ret;
|
|
2552
|
+
}, arguments) };
|
|
2553
|
+
|
|
2554
|
+
export function __wbg_close_cccada6053ee3a65() { return handleError(function (arg0) {
|
|
2555
|
+
arg0.close();
|
|
2556
|
+
}, arguments) };
|
|
2557
|
+
|
|
2558
|
+
export function __wbg_close_d71a78219dc23e91() { return handleError(function (arg0) {
|
|
2559
|
+
arg0.close();
|
|
2560
|
+
}, arguments) };
|
|
2561
|
+
|
|
2562
|
+
export function __wbg_contractstate_new(arg0) {
|
|
2563
|
+
const ret = ContractState.__wrap(arg0);
|
|
2564
|
+
return ret;
|
|
2565
|
+
};
|
|
2566
|
+
|
|
2567
|
+
export function __wbg_crypto_86f2631e91b51511(arg0) {
|
|
2568
|
+
const ret = arg0.crypto;
|
|
2569
|
+
return ret;
|
|
2570
|
+
};
|
|
2571
|
+
|
|
2572
|
+
export function __wbg_done_75ed0ee6dd243d9d(arg0) {
|
|
2573
|
+
const ret = arg0.done;
|
|
2574
|
+
return ret;
|
|
2575
|
+
};
|
|
2576
|
+
|
|
2577
|
+
export function __wbg_enqueue_452bc2343d1c2ff9() { return handleError(function (arg0, arg1) {
|
|
2578
|
+
arg0.enqueue(arg1);
|
|
2579
|
+
}, arguments) };
|
|
2580
|
+
|
|
2581
|
+
export function __wbg_entries_2be2f15bd5554996(arg0) {
|
|
2582
|
+
const ret = Object.entries(arg0);
|
|
2583
|
+
return ret;
|
|
2584
|
+
};
|
|
2585
|
+
|
|
2586
|
+
export function __wbg_from_88bc52ce20ba6318(arg0) {
|
|
2587
|
+
const ret = Array.from(arg0);
|
|
2588
|
+
return ret;
|
|
2589
|
+
};
|
|
2590
|
+
|
|
2591
|
+
export function __wbg_getRandomValues_b3f15fcbfabb0f8b() { return handleError(function (arg0, arg1) {
|
|
2592
|
+
arg0.getRandomValues(arg1);
|
|
2593
|
+
}, arguments) };
|
|
2594
|
+
|
|
2595
|
+
export function __wbg_get_0da715ceaecea5c8(arg0, arg1) {
|
|
2596
|
+
const ret = arg0[arg1 >>> 0];
|
|
2597
|
+
return ret;
|
|
2598
|
+
};
|
|
2599
|
+
|
|
2600
|
+
export function __wbg_get_458e874b43b18b25() { return handleError(function (arg0, arg1) {
|
|
2601
|
+
const ret = Reflect.get(arg0, arg1);
|
|
2602
|
+
return ret;
|
|
2603
|
+
}, arguments) };
|
|
2604
|
+
|
|
2605
|
+
export function __wbg_get_5ee3191755594360(arg0, arg1) {
|
|
2606
|
+
const ret = arg0.get(arg1);
|
|
2607
|
+
return ret;
|
|
2608
|
+
};
|
|
2609
|
+
|
|
2610
|
+
export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
|
|
2611
|
+
const ret = arg0[arg1];
|
|
2612
|
+
return ret;
|
|
2613
|
+
};
|
|
2614
|
+
|
|
2615
|
+
export function __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd(arg0) {
|
|
2616
|
+
let result;
|
|
2617
|
+
try {
|
|
2618
|
+
result = arg0 instanceof ArrayBuffer;
|
|
2619
|
+
} catch (_) {
|
|
2620
|
+
result = false;
|
|
2621
|
+
}
|
|
2622
|
+
const ret = result;
|
|
2623
|
+
return ret;
|
|
2624
|
+
};
|
|
2625
|
+
|
|
2626
|
+
export function __wbg_instanceof_Map_ebb01a5b6b5ffd0b(arg0) {
|
|
2627
|
+
let result;
|
|
2628
|
+
try {
|
|
2629
|
+
result = arg0 instanceof Map;
|
|
2630
|
+
} catch (_) {
|
|
2631
|
+
result = false;
|
|
2632
|
+
}
|
|
2633
|
+
const ret = result;
|
|
2634
|
+
return ret;
|
|
2635
|
+
};
|
|
2636
|
+
|
|
2637
|
+
export function __wbg_instanceof_Uint8Array_9a8378d955933db7(arg0) {
|
|
2638
|
+
let result;
|
|
2639
|
+
try {
|
|
2640
|
+
result = arg0 instanceof Uint8Array;
|
|
2641
|
+
} catch (_) {
|
|
2642
|
+
result = false;
|
|
2643
|
+
}
|
|
2644
|
+
const ret = result;
|
|
2645
|
+
return ret;
|
|
2646
|
+
};
|
|
2647
|
+
|
|
2648
|
+
export function __wbg_isArray_030cce220591fb41(arg0) {
|
|
2649
|
+
const ret = Array.isArray(arg0);
|
|
2650
|
+
return ret;
|
|
2651
|
+
};
|
|
2652
|
+
|
|
2653
|
+
export function __wbg_isSafeInteger_1c0d1af5542e102a(arg0) {
|
|
2654
|
+
const ret = Number.isSafeInteger(arg0);
|
|
2655
|
+
return ret;
|
|
2656
|
+
};
|
|
2657
|
+
|
|
2658
|
+
export function __wbg_iterator_f370b34483c71a1c() {
|
|
2659
|
+
const ret = Symbol.iterator;
|
|
2660
|
+
return ret;
|
|
2661
|
+
};
|
|
2662
|
+
|
|
2663
|
+
export function __wbg_keys_822161a7faf55538(arg0) {
|
|
2664
|
+
const ret = arg0.keys();
|
|
2665
|
+
return ret;
|
|
2666
|
+
};
|
|
2667
|
+
|
|
2668
|
+
export function __wbg_length_186546c51cd61acd(arg0) {
|
|
2669
|
+
const ret = arg0.length;
|
|
2670
|
+
return ret;
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2673
|
+
export function __wbg_length_6bb7e81f9d7713e4(arg0) {
|
|
2674
|
+
const ret = arg0.length;
|
|
2675
|
+
return ret;
|
|
2676
|
+
};
|
|
2677
|
+
|
|
2678
|
+
export function __wbg_msCrypto_d562bbe83e0d4b91(arg0) {
|
|
2679
|
+
const ret = arg0.msCrypto;
|
|
2680
|
+
return ret;
|
|
2681
|
+
};
|
|
2682
|
+
|
|
2683
|
+
export function __wbg_new_19c25a3f2fa63a02() {
|
|
2684
|
+
const ret = new Object();
|
|
2685
|
+
return ret;
|
|
2686
|
+
};
|
|
2687
|
+
|
|
2688
|
+
export function __wbg_new_1f3a344cf3123716() {
|
|
2689
|
+
const ret = new Array();
|
|
2690
|
+
return ret;
|
|
2691
|
+
};
|
|
2692
|
+
|
|
2693
|
+
export function __wbg_new_2e3c58a15f39f5f9(arg0, arg1) {
|
|
2694
|
+
try {
|
|
2695
|
+
var state0 = {a: arg0, b: arg1};
|
|
2696
|
+
var cb0 = (arg0, arg1) => {
|
|
2697
|
+
const a = state0.a;
|
|
2698
|
+
state0.a = 0;
|
|
2699
|
+
try {
|
|
2700
|
+
return __wbg_adapter_292(a, state0.b, arg0, arg1);
|
|
2701
|
+
} finally {
|
|
2702
|
+
state0.a = a;
|
|
2703
|
+
}
|
|
2704
|
+
};
|
|
2705
|
+
const ret = new Promise(cb0);
|
|
2706
|
+
return ret;
|
|
2707
|
+
} finally {
|
|
2708
|
+
state0.a = state0.b = 0;
|
|
2709
|
+
}
|
|
2710
|
+
};
|
|
2711
|
+
|
|
2712
|
+
export function __wbg_new_2ff1f68f3676ea53() {
|
|
2713
|
+
const ret = new Map();
|
|
2714
|
+
return ret;
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2717
|
+
export function __wbg_new_638ebfaedbf32a5e(arg0) {
|
|
2718
|
+
const ret = new Uint8Array(arg0);
|
|
2719
|
+
return ret;
|
|
2720
|
+
};
|
|
2721
|
+
|
|
2722
|
+
export function __wbg_new_da9dc54c5db29dfa(arg0, arg1) {
|
|
2723
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2724
|
+
return ret;
|
|
2725
|
+
};
|
|
2726
|
+
|
|
2727
|
+
export function __wbg_newfromslice_074c56947bd43469(arg0, arg1) {
|
|
2728
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
2729
|
+
return ret;
|
|
2730
|
+
};
|
|
2731
|
+
|
|
2732
|
+
export function __wbg_newnoargs_254190557c45b4ec(arg0, arg1) {
|
|
2733
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
2734
|
+
return ret;
|
|
2735
|
+
};
|
|
2736
|
+
|
|
2737
|
+
export function __wbg_newwithbyteoffsetandlength_e8f53910b4d42b45(arg0, arg1, arg2) {
|
|
2738
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
2739
|
+
return ret;
|
|
2740
|
+
};
|
|
2741
|
+
|
|
2742
|
+
export function __wbg_newwithlength_a167dcc7aaa3ba77(arg0) {
|
|
2743
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
2744
|
+
return ret;
|
|
2745
|
+
};
|
|
2746
|
+
|
|
2747
|
+
export function __wbg_next_5b3530e612fde77d(arg0) {
|
|
2748
|
+
const ret = arg0.next;
|
|
2749
|
+
return ret;
|
|
2750
|
+
};
|
|
2751
|
+
|
|
2752
|
+
export function __wbg_next_692e82279131b03c() { return handleError(function (arg0) {
|
|
2753
|
+
const ret = arg0.next();
|
|
2754
|
+
return ret;
|
|
2755
|
+
}, arguments) };
|
|
2756
|
+
|
|
2757
|
+
export function __wbg_node_e1f24f89a7336c2e(arg0) {
|
|
2758
|
+
const ret = arg0.node;
|
|
2759
|
+
return ret;
|
|
2760
|
+
};
|
|
2761
|
+
|
|
2762
|
+
export function __wbg_process_3975fd6c72f520aa(arg0) {
|
|
2763
|
+
const ret = arg0.process;
|
|
2764
|
+
return ret;
|
|
2765
|
+
};
|
|
2766
|
+
|
|
2767
|
+
export function __wbg_prototypesetcall_3d4a26c1ed734349(arg0, arg1, arg2) {
|
|
2768
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
2769
|
+
};
|
|
2770
|
+
|
|
2771
|
+
export function __wbg_push_330b2eb93e4e1212(arg0, arg1) {
|
|
2772
|
+
const ret = arg0.push(arg1);
|
|
2773
|
+
return ret;
|
|
2774
|
+
};
|
|
2775
|
+
|
|
2776
|
+
export function __wbg_queueMicrotask_25d0739ac89e8c88(arg0) {
|
|
2777
|
+
queueMicrotask(arg0);
|
|
2778
|
+
};
|
|
2779
|
+
|
|
2780
|
+
export function __wbg_queueMicrotask_4488407636f5bf24(arg0) {
|
|
2781
|
+
const ret = arg0.queueMicrotask;
|
|
2782
|
+
return ret;
|
|
2783
|
+
};
|
|
2784
|
+
|
|
2785
|
+
export function __wbg_randomFillSync_f8c153b79f285817() { return handleError(function (arg0, arg1) {
|
|
2786
|
+
arg0.randomFillSync(arg1);
|
|
2787
|
+
}, arguments) };
|
|
2788
|
+
|
|
2789
|
+
export function __wbg_require_b74f47fc2d022fd6() { return handleError(function () {
|
|
2790
|
+
const ret = module.require;
|
|
2791
|
+
return ret;
|
|
2792
|
+
}, arguments) };
|
|
2793
|
+
|
|
2794
|
+
export function __wbg_resolve_4055c623acdd6a1b(arg0) {
|
|
2795
|
+
const ret = Promise.resolve(arg0);
|
|
2796
|
+
return ret;
|
|
2797
|
+
};
|
|
2798
|
+
|
|
2799
|
+
export function __wbg_respond_6c2c4e20ef85138e() { return handleError(function (arg0, arg1) {
|
|
2800
|
+
arg0.respond(arg1 >>> 0);
|
|
2801
|
+
}, arguments) };
|
|
2802
|
+
|
|
2803
|
+
export function __wbg_set_1353b2a5e96bc48c(arg0, arg1, arg2) {
|
|
2804
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
2805
|
+
};
|
|
2806
|
+
|
|
2807
|
+
export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
2808
|
+
arg0[arg1] = arg2;
|
|
2809
|
+
};
|
|
2810
|
+
|
|
2811
|
+
export function __wbg_set_90f6c0f7bd8c0415(arg0, arg1, arg2) {
|
|
2812
|
+
arg0[arg1 >>> 0] = arg2;
|
|
2813
|
+
};
|
|
2814
|
+
|
|
2815
|
+
export function __wbg_set_b7f1cf4fae26fe2a(arg0, arg1, arg2) {
|
|
2816
|
+
const ret = arg0.set(arg1, arg2);
|
|
2817
|
+
return ret;
|
|
2818
|
+
};
|
|
2819
|
+
|
|
2820
|
+
export function __wbg_statevalue_new(arg0) {
|
|
2821
|
+
const ret = StateValue.__wrap(arg0);
|
|
2822
|
+
return ret;
|
|
2823
|
+
};
|
|
2824
|
+
|
|
2825
|
+
export function __wbg_static_accessor_GLOBAL_8921f820c2ce3f12() {
|
|
2826
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
2827
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2828
|
+
};
|
|
2829
|
+
|
|
2830
|
+
export function __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184() {
|
|
2831
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
2832
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2833
|
+
};
|
|
2834
|
+
|
|
2835
|
+
export function __wbg_static_accessor_SELF_995b214ae681ff99() {
|
|
2836
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
2837
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2838
|
+
};
|
|
2839
|
+
|
|
2840
|
+
export function __wbg_static_accessor_WINDOW_cde3890479c675ea() {
|
|
2841
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
2842
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2843
|
+
};
|
|
2844
|
+
|
|
2845
|
+
export function __wbg_subarray_70fd07feefe14294(arg0, arg1, arg2) {
|
|
2846
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2847
|
+
return ret;
|
|
2848
|
+
};
|
|
2849
|
+
|
|
2850
|
+
export function __wbg_then_e22500defe16819f(arg0, arg1) {
|
|
2851
|
+
const ret = arg0.then(arg1);
|
|
2852
|
+
return ret;
|
|
2853
|
+
};
|
|
2854
|
+
|
|
2855
|
+
export function __wbg_toString_7268338f40012a03() { return handleError(function (arg0, arg1) {
|
|
2856
|
+
const ret = arg0.toString(arg1);
|
|
2857
|
+
return ret;
|
|
2858
|
+
}, arguments) };
|
|
2859
|
+
|
|
2860
|
+
export function __wbg_toString_d8f537919ef401d6(arg0) {
|
|
2861
|
+
const ret = arg0.toString();
|
|
2862
|
+
return ret;
|
|
2863
|
+
};
|
|
2864
|
+
|
|
2865
|
+
export function __wbg_value_dd9372230531eade(arg0) {
|
|
2866
|
+
const ret = arg0.value;
|
|
2867
|
+
return ret;
|
|
2868
|
+
};
|
|
2869
|
+
|
|
2870
|
+
export function __wbg_versions_4e31226f5e8dc909(arg0) {
|
|
2871
|
+
const ret = arg0.versions;
|
|
2872
|
+
return ret;
|
|
2873
|
+
};
|
|
2874
|
+
|
|
2875
|
+
export function __wbg_view_91cc97d57ab30530(arg0) {
|
|
2876
|
+
const ret = arg0.view;
|
|
2877
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2878
|
+
};
|
|
2879
|
+
|
|
2880
|
+
export function __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1(arg0, arg1) {
|
|
2881
|
+
const v = arg1;
|
|
2882
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
2883
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
2884
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2885
|
+
};
|
|
2886
|
+
|
|
2887
|
+
export function __wbg_wbindgenbooleanget_3fe6f642c7d97746(arg0) {
|
|
2888
|
+
const v = arg0;
|
|
2889
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
2890
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
2891
|
+
};
|
|
2892
|
+
|
|
2893
|
+
export function __wbg_wbindgencbdrop_eb10308566512b88(arg0) {
|
|
2894
|
+
const obj = arg0.original;
|
|
2895
|
+
if (obj.cnt-- == 1) {
|
|
2896
|
+
obj.a = 0;
|
|
2897
|
+
return true;
|
|
2898
|
+
}
|
|
2899
|
+
const ret = false;
|
|
2900
|
+
return ret;
|
|
2901
|
+
};
|
|
2902
|
+
|
|
2903
|
+
export function __wbg_wbindgendebugstring_99ef257a3ddda34d(arg0, arg1) {
|
|
2904
|
+
const ret = debugString(arg1);
|
|
2905
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2906
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2907
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2908
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2909
|
+
};
|
|
2910
|
+
|
|
2911
|
+
export function __wbg_wbindgenin_d7a1ee10933d2d55(arg0, arg1) {
|
|
2912
|
+
const ret = arg0 in arg1;
|
|
2913
|
+
return ret;
|
|
2914
|
+
};
|
|
2915
|
+
|
|
2916
|
+
export function __wbg_wbindgenisbigint_ecb90cc08a5a9154(arg0) {
|
|
2917
|
+
const ret = typeof(arg0) === 'bigint';
|
|
2918
|
+
return ret;
|
|
2919
|
+
};
|
|
2920
|
+
|
|
2921
|
+
export function __wbg_wbindgenisfunction_8cee7dce3725ae74(arg0) {
|
|
2922
|
+
const ret = typeof(arg0) === 'function';
|
|
2923
|
+
return ret;
|
|
2924
|
+
};
|
|
2925
|
+
|
|
2926
|
+
export function __wbg_wbindgenisnull_f3037694abe4d97a(arg0) {
|
|
2927
|
+
const ret = arg0 === null;
|
|
2928
|
+
return ret;
|
|
2929
|
+
};
|
|
2930
|
+
|
|
2931
|
+
export function __wbg_wbindgenisobject_307a53c6bd97fbf8(arg0) {
|
|
2932
|
+
const val = arg0;
|
|
2933
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
2934
|
+
return ret;
|
|
2935
|
+
};
|
|
2936
|
+
|
|
2937
|
+
export function __wbg_wbindgenisstring_d4fa939789f003b0(arg0) {
|
|
2938
|
+
const ret = typeof(arg0) === 'string';
|
|
2939
|
+
return ret;
|
|
2940
|
+
};
|
|
2941
|
+
|
|
2942
|
+
export function __wbg_wbindgenisundefined_c4b71d073b92f3c5(arg0) {
|
|
2943
|
+
const ret = arg0 === undefined;
|
|
2944
|
+
return ret;
|
|
2945
|
+
};
|
|
2946
|
+
|
|
2947
|
+
export function __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58(arg0, arg1) {
|
|
2948
|
+
const ret = arg0 === arg1;
|
|
2949
|
+
return ret;
|
|
2950
|
+
};
|
|
2951
|
+
|
|
2952
|
+
export function __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1(arg0, arg1) {
|
|
2953
|
+
const ret = arg0 == arg1;
|
|
2954
|
+
return ret;
|
|
2955
|
+
};
|
|
2956
|
+
|
|
2957
|
+
export function __wbg_wbindgennumberget_f74b4c7525ac05cb(arg0, arg1) {
|
|
2958
|
+
const obj = arg1;
|
|
2959
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
2960
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
2961
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2962
|
+
};
|
|
2963
|
+
|
|
2964
|
+
export function __wbg_wbindgenshr_7d2aae6044c0dab1(arg0, arg1) {
|
|
2965
|
+
const ret = arg0 >> arg1;
|
|
2966
|
+
return ret;
|
|
2967
|
+
};
|
|
2968
|
+
|
|
2969
|
+
export function __wbg_wbindgenstringget_0f16a6ddddef376f(arg0, arg1) {
|
|
2970
|
+
const obj = arg1;
|
|
2971
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
2972
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2973
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2974
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2975
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2976
|
+
};
|
|
2977
|
+
|
|
2978
|
+
export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
|
|
2979
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2980
|
+
};
|
|
2981
|
+
|
|
2982
|
+
export function __wbindgen_cast_0d2631eef1e73a41(arg0, arg1) {
|
|
2983
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 719, function: Function { arguments: [Externref], shim_idx: 720, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2984
|
+
const ret = makeMutClosure(arg0, arg1, 719, __wbg_adapter_10);
|
|
2985
|
+
return ret;
|
|
2986
|
+
};
|
|
2987
|
+
|
|
2988
|
+
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
2989
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2990
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
2991
|
+
return ret;
|
|
2992
|
+
};
|
|
2993
|
+
|
|
2994
|
+
export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
2995
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
2996
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
2997
|
+
return ret;
|
|
2998
|
+
};
|
|
2999
|
+
|
|
3000
|
+
export function __wbindgen_cast_9ae0607507abb057(arg0) {
|
|
3001
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
3002
|
+
const ret = arg0;
|
|
3003
|
+
return ret;
|
|
3004
|
+
};
|
|
3005
|
+
|
|
3006
|
+
export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
|
|
3007
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
3008
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
3009
|
+
return ret;
|
|
3010
|
+
};
|
|
3011
|
+
|
|
3012
|
+
export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
|
|
3013
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
3014
|
+
const ret = arg0;
|
|
3015
|
+
return ret;
|
|
3016
|
+
};
|
|
3017
|
+
|
|
3018
|
+
export function __wbindgen_cast_e7b45dd881f38ce3(arg0, arg1) {
|
|
3019
|
+
// Cast intrinsic for `U128 -> Externref`.
|
|
3020
|
+
const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
|
|
3021
|
+
return ret;
|
|
3022
|
+
};
|
|
3023
|
+
|
|
3024
|
+
export function __wbindgen_init_externref_table() {
|
|
3025
|
+
const table = wasm.__wbindgen_export_2;
|
|
3026
|
+
const offset = table.grow(4);
|
|
3027
|
+
table.set(0, undefined);
|
|
3028
|
+
table.set(offset + 0, undefined);
|
|
3029
|
+
table.set(offset + 1, null);
|
|
3030
|
+
table.set(offset + 2, true);
|
|
3031
|
+
table.set(offset + 3, false);
|
|
3032
|
+
;
|
|
3033
|
+
};
|
|
3034
|
+
|