@totemsdk/proofgraph 0.1.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canonical.d.ts +4 -4
- package/dist/canonical.js +11 -26
- package/dist/index.js +1 -1
- package/dist/io.d.ts +8 -5
- package/dist/io.js +132 -8
- package/package.json +21 -24
- package/rust/pkg/package.json +27 -0
- package/rust/pkg/proofgraph_wasm.d.ts +30 -0
- package/rust/pkg/proofgraph_wasm.js +9 -0
- package/rust/pkg/proofgraph_wasm_bg.js +690 -0
- package/rust/pkg/proofgraph_wasm_bg.wasm +0 -0
- package/rust/pkg/proofgraph_wasm_bg.wasm.d.ts +25 -0
- package/rust/pkg-node/package.json +21 -0
- package/rust/pkg-node/proofgraph_wasm.d.ts +30 -0
- package/rust/pkg-node/proofgraph_wasm.js +709 -0
- package/rust/pkg-node/proofgraph_wasm_bg.wasm +0 -0
- package/rust/pkg-node/proofgraph_wasm_bg.wasm.d.ts +25 -0
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
/* @ts-self-types="./proofgraph_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {any} graph_js
|
|
5
|
+
* @param {any} edge_js
|
|
6
|
+
* @returns {any}
|
|
7
|
+
*/
|
|
8
|
+
function add_edge_wasm(graph_js, edge_js) {
|
|
9
|
+
const ret = wasm.add_edge_wasm(graph_js, edge_js);
|
|
10
|
+
if (ret[2]) {
|
|
11
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12
|
+
}
|
|
13
|
+
return takeFromExternrefTable0(ret[0]);
|
|
14
|
+
}
|
|
15
|
+
exports.add_edge_wasm = add_edge_wasm;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @param {any} graph_js
|
|
19
|
+
* @param {string} node_type
|
|
20
|
+
* @param {string} ref_id
|
|
21
|
+
* @param {any | null | undefined} data_js
|
|
22
|
+
* @param {bigint} created_at
|
|
23
|
+
* @returns {any}
|
|
24
|
+
*/
|
|
25
|
+
function add_node_wasm(graph_js, node_type, ref_id, data_js, created_at) {
|
|
26
|
+
const ptr0 = passStringToWasm0(node_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
27
|
+
const len0 = WASM_VECTOR_LEN;
|
|
28
|
+
const ptr1 = passStringToWasm0(ref_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
29
|
+
const len1 = WASM_VECTOR_LEN;
|
|
30
|
+
const ret = wasm.add_node_wasm(graph_js, ptr0, len0, ptr1, len1, isLikeNone(data_js) ? 0 : addToExternrefTable0(data_js), created_at);
|
|
31
|
+
if (ret[2]) {
|
|
32
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
33
|
+
}
|
|
34
|
+
return takeFromExternrefTable0(ret[0]);
|
|
35
|
+
}
|
|
36
|
+
exports.add_node_wasm = add_node_wasm;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {any} value_js
|
|
40
|
+
* @returns {string}
|
|
41
|
+
*/
|
|
42
|
+
function canonical_json_wasm(value_js) {
|
|
43
|
+
let deferred2_0;
|
|
44
|
+
let deferred2_1;
|
|
45
|
+
try {
|
|
46
|
+
const ret = wasm.canonical_json_wasm(value_js);
|
|
47
|
+
var ptr1 = ret[0];
|
|
48
|
+
var len1 = ret[1];
|
|
49
|
+
if (ret[3]) {
|
|
50
|
+
ptr1 = 0; len1 = 0;
|
|
51
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
52
|
+
}
|
|
53
|
+
deferred2_0 = ptr1;
|
|
54
|
+
deferred2_1 = len1;
|
|
55
|
+
return getStringFromWasm0(ptr1, len1);
|
|
56
|
+
} finally {
|
|
57
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.canonical_json_wasm = canonical_json_wasm;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param {string} edge_type
|
|
64
|
+
* @param {string} from
|
|
65
|
+
* @param {string} to
|
|
66
|
+
* @param {string | null} [proof_id]
|
|
67
|
+
* @param {any | null} [data_js]
|
|
68
|
+
* @returns {string}
|
|
69
|
+
*/
|
|
70
|
+
function compute_edge_id_wasm(edge_type, from, to, proof_id, data_js) {
|
|
71
|
+
let deferred6_0;
|
|
72
|
+
let deferred6_1;
|
|
73
|
+
try {
|
|
74
|
+
const ptr0 = passStringToWasm0(edge_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
75
|
+
const len0 = WASM_VECTOR_LEN;
|
|
76
|
+
const ptr1 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
77
|
+
const len1 = WASM_VECTOR_LEN;
|
|
78
|
+
const ptr2 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
79
|
+
const len2 = WASM_VECTOR_LEN;
|
|
80
|
+
var ptr3 = isLikeNone(proof_id) ? 0 : passStringToWasm0(proof_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
81
|
+
var len3 = WASM_VECTOR_LEN;
|
|
82
|
+
const ret = wasm.compute_edge_id_wasm(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(data_js) ? 0 : addToExternrefTable0(data_js));
|
|
83
|
+
var ptr5 = ret[0];
|
|
84
|
+
var len5 = ret[1];
|
|
85
|
+
if (ret[3]) {
|
|
86
|
+
ptr5 = 0; len5 = 0;
|
|
87
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
88
|
+
}
|
|
89
|
+
deferred6_0 = ptr5;
|
|
90
|
+
deferred6_1 = len5;
|
|
91
|
+
return getStringFromWasm0(ptr5, len5);
|
|
92
|
+
} finally {
|
|
93
|
+
wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.compute_edge_id_wasm = compute_edge_id_wasm;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @param {string} node_type
|
|
100
|
+
* @param {string} ref_id
|
|
101
|
+
* @returns {string}
|
|
102
|
+
*/
|
|
103
|
+
function compute_node_id_wasm(node_type, ref_id) {
|
|
104
|
+
let deferred3_0;
|
|
105
|
+
let deferred3_1;
|
|
106
|
+
try {
|
|
107
|
+
const ptr0 = passStringToWasm0(node_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
108
|
+
const len0 = WASM_VECTOR_LEN;
|
|
109
|
+
const ptr1 = passStringToWasm0(ref_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
110
|
+
const len1 = WASM_VECTOR_LEN;
|
|
111
|
+
const ret = wasm.compute_node_id_wasm(ptr0, len0, ptr1, len1);
|
|
112
|
+
deferred3_0 = ret[0];
|
|
113
|
+
deferred3_1 = ret[1];
|
|
114
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
115
|
+
} finally {
|
|
116
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.compute_node_id_wasm = compute_node_id_wasm;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @param {any} nodes_js
|
|
123
|
+
* @param {any} edges_js
|
|
124
|
+
* @returns {string}
|
|
125
|
+
*/
|
|
126
|
+
function compute_proof_graph_id_wasm(nodes_js, edges_js) {
|
|
127
|
+
let deferred2_0;
|
|
128
|
+
let deferred2_1;
|
|
129
|
+
try {
|
|
130
|
+
const ret = wasm.compute_proof_graph_id_wasm(nodes_js, edges_js);
|
|
131
|
+
var ptr1 = ret[0];
|
|
132
|
+
var len1 = ret[1];
|
|
133
|
+
if (ret[3]) {
|
|
134
|
+
ptr1 = 0; len1 = 0;
|
|
135
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
136
|
+
}
|
|
137
|
+
deferred2_0 = ptr1;
|
|
138
|
+
deferred2_1 = len1;
|
|
139
|
+
return getStringFromWasm0(ptr1, len1);
|
|
140
|
+
} finally {
|
|
141
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.compute_proof_graph_id_wasm = compute_proof_graph_id_wasm;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @param {any | null | undefined} metadata_js
|
|
148
|
+
* @param {bigint} created_at
|
|
149
|
+
* @returns {any}
|
|
150
|
+
*/
|
|
151
|
+
function create_proof_graph_wasm(metadata_js, created_at) {
|
|
152
|
+
const ret = wasm.create_proof_graph_wasm(isLikeNone(metadata_js) ? 0 : addToExternrefTable0(metadata_js), created_at);
|
|
153
|
+
if (ret[2]) {
|
|
154
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
155
|
+
}
|
|
156
|
+
return takeFromExternrefTable0(ret[0]);
|
|
157
|
+
}
|
|
158
|
+
exports.create_proof_graph_wasm = create_proof_graph_wasm;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @param {any} graph_js
|
|
162
|
+
* @param {string} id
|
|
163
|
+
* @returns {any}
|
|
164
|
+
*/
|
|
165
|
+
function find_node_wasm(graph_js, id) {
|
|
166
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
167
|
+
const len0 = WASM_VECTOR_LEN;
|
|
168
|
+
const ret = wasm.find_node_wasm(graph_js, ptr0, len0);
|
|
169
|
+
if (ret[2]) {
|
|
170
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
171
|
+
}
|
|
172
|
+
return takeFromExternrefTable0(ret[0]);
|
|
173
|
+
}
|
|
174
|
+
exports.find_node_wasm = find_node_wasm;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @param {any} graph_js
|
|
178
|
+
* @param {string} subject_id
|
|
179
|
+
* @returns {any}
|
|
180
|
+
*/
|
|
181
|
+
function find_proofs_by_subject_wasm(graph_js, subject_id) {
|
|
182
|
+
const ptr0 = passStringToWasm0(subject_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
183
|
+
const len0 = WASM_VECTOR_LEN;
|
|
184
|
+
const ret = wasm.find_proofs_by_subject_wasm(graph_js, ptr0, len0);
|
|
185
|
+
if (ret[2]) {
|
|
186
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
187
|
+
}
|
|
188
|
+
return takeFromExternrefTable0(ret[0]);
|
|
189
|
+
}
|
|
190
|
+
exports.find_proofs_by_subject_wasm = find_proofs_by_subject_wasm;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @param {any} graph_js
|
|
194
|
+
* @param {string} node_id
|
|
195
|
+
* @returns {any}
|
|
196
|
+
*/
|
|
197
|
+
function get_edges_from_wasm(graph_js, node_id) {
|
|
198
|
+
const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
199
|
+
const len0 = WASM_VECTOR_LEN;
|
|
200
|
+
const ret = wasm.get_edges_from_wasm(graph_js, ptr0, len0);
|
|
201
|
+
if (ret[2]) {
|
|
202
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
203
|
+
}
|
|
204
|
+
return takeFromExternrefTable0(ret[0]);
|
|
205
|
+
}
|
|
206
|
+
exports.get_edges_from_wasm = get_edges_from_wasm;
|
|
207
|
+
|
|
208
|
+
function init() {
|
|
209
|
+
wasm.init();
|
|
210
|
+
}
|
|
211
|
+
exports.init = init;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @param {any} graph_js
|
|
215
|
+
* @param {string} start_ref_id
|
|
216
|
+
* @returns {any}
|
|
217
|
+
*/
|
|
218
|
+
function reachable_from_wasm(graph_js, start_ref_id) {
|
|
219
|
+
const ptr0 = passStringToWasm0(start_ref_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
220
|
+
const len0 = WASM_VECTOR_LEN;
|
|
221
|
+
const ret = wasm.reachable_from_wasm(graph_js, ptr0, len0);
|
|
222
|
+
if (ret[2]) {
|
|
223
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
224
|
+
}
|
|
225
|
+
return takeFromExternrefTable0(ret[0]);
|
|
226
|
+
}
|
|
227
|
+
exports.reachable_from_wasm = reachable_from_wasm;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @param {any} graph_js
|
|
231
|
+
* @returns {any}
|
|
232
|
+
*/
|
|
233
|
+
function resolve_current_proof_set_wasm(graph_js) {
|
|
234
|
+
const ret = wasm.resolve_current_proof_set_wasm(graph_js);
|
|
235
|
+
if (ret[2]) {
|
|
236
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
237
|
+
}
|
|
238
|
+
return takeFromExternrefTable0(ret[0]);
|
|
239
|
+
}
|
|
240
|
+
exports.resolve_current_proof_set_wasm = resolve_current_proof_set_wasm;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* @param {Uint8Array} bytes
|
|
244
|
+
* @returns {string}
|
|
245
|
+
*/
|
|
246
|
+
function to_hex_wasm(bytes) {
|
|
247
|
+
let deferred2_0;
|
|
248
|
+
let deferred2_1;
|
|
249
|
+
try {
|
|
250
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
251
|
+
const len0 = WASM_VECTOR_LEN;
|
|
252
|
+
const ret = wasm.to_hex_wasm(ptr0, len0);
|
|
253
|
+
deferred2_0 = ret[0];
|
|
254
|
+
deferred2_1 = ret[1];
|
|
255
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
256
|
+
} finally {
|
|
257
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
exports.to_hex_wasm = to_hex_wasm;
|
|
261
|
+
function __wbg_get_imports() {
|
|
262
|
+
const import0 = {
|
|
263
|
+
__proto__: null,
|
|
264
|
+
__wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
|
|
265
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
266
|
+
return ret;
|
|
267
|
+
},
|
|
268
|
+
__wbg_Number_9a4e0ecb0fa16705: function(arg0) {
|
|
269
|
+
const ret = Number(arg0);
|
|
270
|
+
return ret;
|
|
271
|
+
},
|
|
272
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
273
|
+
const ret = String(arg1);
|
|
274
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
275
|
+
const len1 = WASM_VECTOR_LEN;
|
|
276
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
277
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
278
|
+
},
|
|
279
|
+
__wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
|
|
280
|
+
const v = arg1;
|
|
281
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
282
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
283
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
284
|
+
},
|
|
285
|
+
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
|
|
286
|
+
const v = arg0;
|
|
287
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
288
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
289
|
+
},
|
|
290
|
+
__wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
|
|
291
|
+
const ret = debugString(arg1);
|
|
292
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
293
|
+
const len1 = WASM_VECTOR_LEN;
|
|
294
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
295
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
296
|
+
},
|
|
297
|
+
__wbg___wbindgen_in_aca499c5de7ff5e5: function(arg0, arg1) {
|
|
298
|
+
const ret = arg0 in arg1;
|
|
299
|
+
return ret;
|
|
300
|
+
},
|
|
301
|
+
__wbg___wbindgen_is_bigint_2f76dc55065b4273: function(arg0) {
|
|
302
|
+
const ret = typeof(arg0) === 'bigint';
|
|
303
|
+
return ret;
|
|
304
|
+
},
|
|
305
|
+
__wbg___wbindgen_is_function_1ff95bcc5517c252: function(arg0) {
|
|
306
|
+
const ret = typeof(arg0) === 'function';
|
|
307
|
+
return ret;
|
|
308
|
+
},
|
|
309
|
+
__wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
|
|
310
|
+
const val = arg0;
|
|
311
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
312
|
+
return ret;
|
|
313
|
+
},
|
|
314
|
+
__wbg___wbindgen_is_string_ea5e6cc2e4141dfe: function(arg0) {
|
|
315
|
+
const ret = typeof(arg0) === 'string';
|
|
316
|
+
return ret;
|
|
317
|
+
},
|
|
318
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
319
|
+
const ret = arg0 === undefined;
|
|
320
|
+
return ret;
|
|
321
|
+
},
|
|
322
|
+
__wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function(arg0, arg1) {
|
|
323
|
+
const ret = arg0 === arg1;
|
|
324
|
+
return ret;
|
|
325
|
+
},
|
|
326
|
+
__wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function(arg0, arg1) {
|
|
327
|
+
const ret = arg0 == arg1;
|
|
328
|
+
return ret;
|
|
329
|
+
},
|
|
330
|
+
__wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
|
|
331
|
+
const obj = arg1;
|
|
332
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
333
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
334
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
335
|
+
},
|
|
336
|
+
__wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
|
|
337
|
+
const obj = arg1;
|
|
338
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
339
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
340
|
+
var len1 = WASM_VECTOR_LEN;
|
|
341
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
342
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
343
|
+
},
|
|
344
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
345
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
346
|
+
},
|
|
347
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
348
|
+
const ret = arg0.call(arg1);
|
|
349
|
+
return ret;
|
|
350
|
+
}, arguments); },
|
|
351
|
+
__wbg_done_89b2b13e91a60321: function(arg0) {
|
|
352
|
+
const ret = arg0.done;
|
|
353
|
+
return ret;
|
|
354
|
+
},
|
|
355
|
+
__wbg_entries_015dc610cd81ede0: function(arg0) {
|
|
356
|
+
const ret = Object.entries(arg0);
|
|
357
|
+
return ret;
|
|
358
|
+
},
|
|
359
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
360
|
+
let deferred0_0;
|
|
361
|
+
let deferred0_1;
|
|
362
|
+
try {
|
|
363
|
+
deferred0_0 = arg0;
|
|
364
|
+
deferred0_1 = arg1;
|
|
365
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
366
|
+
} finally {
|
|
367
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
371
|
+
const ret = arg0[arg1 >>> 0];
|
|
372
|
+
return ret;
|
|
373
|
+
},
|
|
374
|
+
__wbg_get_c7eb1f358a7654df: function() { return handleError(function (arg0, arg1) {
|
|
375
|
+
const ret = Reflect.get(arg0, arg1);
|
|
376
|
+
return ret;
|
|
377
|
+
}, arguments); },
|
|
378
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
|
|
379
|
+
const ret = arg0[arg1 >>> 0];
|
|
380
|
+
return ret;
|
|
381
|
+
},
|
|
382
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
383
|
+
const ret = arg0[arg1];
|
|
384
|
+
return ret;
|
|
385
|
+
},
|
|
386
|
+
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function(arg0) {
|
|
387
|
+
let result;
|
|
388
|
+
try {
|
|
389
|
+
result = arg0 instanceof ArrayBuffer;
|
|
390
|
+
} catch (_) {
|
|
391
|
+
result = false;
|
|
392
|
+
}
|
|
393
|
+
const ret = result;
|
|
394
|
+
return ret;
|
|
395
|
+
},
|
|
396
|
+
__wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
|
|
397
|
+
let result;
|
|
398
|
+
try {
|
|
399
|
+
result = arg0 instanceof Map;
|
|
400
|
+
} catch (_) {
|
|
401
|
+
result = false;
|
|
402
|
+
}
|
|
403
|
+
const ret = result;
|
|
404
|
+
return ret;
|
|
405
|
+
},
|
|
406
|
+
__wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function(arg0) {
|
|
407
|
+
let result;
|
|
408
|
+
try {
|
|
409
|
+
result = arg0 instanceof Uint8Array;
|
|
410
|
+
} catch (_) {
|
|
411
|
+
result = false;
|
|
412
|
+
}
|
|
413
|
+
const ret = result;
|
|
414
|
+
return ret;
|
|
415
|
+
},
|
|
416
|
+
__wbg_isArray_0677c962b281d01a: function(arg0) {
|
|
417
|
+
const ret = Array.isArray(arg0);
|
|
418
|
+
return ret;
|
|
419
|
+
},
|
|
420
|
+
__wbg_isSafeInteger_04f36e4056f1b851: function(arg0) {
|
|
421
|
+
const ret = Number.isSafeInteger(arg0);
|
|
422
|
+
return ret;
|
|
423
|
+
},
|
|
424
|
+
__wbg_iterator_6f722e4a93058b71: function() {
|
|
425
|
+
const ret = Symbol.iterator;
|
|
426
|
+
return ret;
|
|
427
|
+
},
|
|
428
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
429
|
+
const ret = arg0.length;
|
|
430
|
+
return ret;
|
|
431
|
+
},
|
|
432
|
+
__wbg_length_370319915dc99107: function(arg0) {
|
|
433
|
+
const ret = arg0.length;
|
|
434
|
+
return ret;
|
|
435
|
+
},
|
|
436
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
437
|
+
const ret = new Error();
|
|
438
|
+
return ret;
|
|
439
|
+
},
|
|
440
|
+
__wbg_new_32b398fb48b6d94a: function() {
|
|
441
|
+
const ret = new Array();
|
|
442
|
+
return ret;
|
|
443
|
+
},
|
|
444
|
+
__wbg_new_7796ffc7ed656783: function() {
|
|
445
|
+
const ret = new Map();
|
|
446
|
+
return ret;
|
|
447
|
+
},
|
|
448
|
+
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
449
|
+
const ret = new Uint8Array(arg0);
|
|
450
|
+
return ret;
|
|
451
|
+
},
|
|
452
|
+
__wbg_new_da52cf8fe3429cb2: function() {
|
|
453
|
+
const ret = new Object();
|
|
454
|
+
return ret;
|
|
455
|
+
},
|
|
456
|
+
__wbg_next_6dbf2c0ac8cde20f: function(arg0) {
|
|
457
|
+
const ret = arg0.next;
|
|
458
|
+
return ret;
|
|
459
|
+
},
|
|
460
|
+
__wbg_next_71f2aa1cb3d1e37e: function() { return handleError(function (arg0) {
|
|
461
|
+
const ret = arg0.next();
|
|
462
|
+
return ret;
|
|
463
|
+
}, arguments); },
|
|
464
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
465
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
466
|
+
},
|
|
467
|
+
__wbg_set_575dd786d51585f8: function(arg0, arg1, arg2) {
|
|
468
|
+
const ret = arg0.set(arg1, arg2);
|
|
469
|
+
return ret;
|
|
470
|
+
},
|
|
471
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
472
|
+
arg0[arg1] = arg2;
|
|
473
|
+
},
|
|
474
|
+
__wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
|
|
475
|
+
arg0[arg1 >>> 0] = arg2;
|
|
476
|
+
},
|
|
477
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
478
|
+
const ret = arg1.stack;
|
|
479
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
480
|
+
const len1 = WASM_VECTOR_LEN;
|
|
481
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
482
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
483
|
+
},
|
|
484
|
+
__wbg_value_a5d5488a9589444a: function(arg0) {
|
|
485
|
+
const ret = arg0.value;
|
|
486
|
+
return ret;
|
|
487
|
+
},
|
|
488
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
489
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
490
|
+
const ret = arg0;
|
|
491
|
+
return ret;
|
|
492
|
+
},
|
|
493
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
494
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
495
|
+
const ret = arg0;
|
|
496
|
+
return ret;
|
|
497
|
+
},
|
|
498
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
499
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
500
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
501
|
+
return ret;
|
|
502
|
+
},
|
|
503
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
504
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
505
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
506
|
+
return ret;
|
|
507
|
+
},
|
|
508
|
+
__wbindgen_init_externref_table: function() {
|
|
509
|
+
const table = wasm.__wbindgen_externrefs;
|
|
510
|
+
const offset = table.grow(4);
|
|
511
|
+
table.set(0, undefined);
|
|
512
|
+
table.set(offset + 0, undefined);
|
|
513
|
+
table.set(offset + 1, null);
|
|
514
|
+
table.set(offset + 2, true);
|
|
515
|
+
table.set(offset + 3, false);
|
|
516
|
+
},
|
|
517
|
+
};
|
|
518
|
+
return {
|
|
519
|
+
__proto__: null,
|
|
520
|
+
"./proofgraph_wasm_bg.js": import0,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function addToExternrefTable0(obj) {
|
|
525
|
+
const idx = wasm.__externref_table_alloc();
|
|
526
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
527
|
+
return idx;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function debugString(val) {
|
|
531
|
+
// primitive types
|
|
532
|
+
const type = typeof val;
|
|
533
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
534
|
+
return `${val}`;
|
|
535
|
+
}
|
|
536
|
+
if (type == 'string') {
|
|
537
|
+
return `"${val}"`;
|
|
538
|
+
}
|
|
539
|
+
if (type == 'symbol') {
|
|
540
|
+
const description = val.description;
|
|
541
|
+
if (description == null) {
|
|
542
|
+
return 'Symbol';
|
|
543
|
+
} else {
|
|
544
|
+
return `Symbol(${description})`;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (type == 'function') {
|
|
548
|
+
const name = val.name;
|
|
549
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
550
|
+
return `Function(${name})`;
|
|
551
|
+
} else {
|
|
552
|
+
return 'Function';
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
// objects
|
|
556
|
+
if (Array.isArray(val)) {
|
|
557
|
+
const length = val.length;
|
|
558
|
+
let debug = '[';
|
|
559
|
+
if (length > 0) {
|
|
560
|
+
debug += debugString(val[0]);
|
|
561
|
+
}
|
|
562
|
+
for(let i = 1; i < length; i++) {
|
|
563
|
+
debug += ', ' + debugString(val[i]);
|
|
564
|
+
}
|
|
565
|
+
debug += ']';
|
|
566
|
+
return debug;
|
|
567
|
+
}
|
|
568
|
+
// Test for built-in
|
|
569
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
570
|
+
let className;
|
|
571
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
572
|
+
className = builtInMatches[1];
|
|
573
|
+
} else {
|
|
574
|
+
// Failed to match the standard '[object ClassName]'
|
|
575
|
+
return toString.call(val);
|
|
576
|
+
}
|
|
577
|
+
if (className == 'Object') {
|
|
578
|
+
// we're a user defined class or Object
|
|
579
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
580
|
+
// easier than looping through ownProperties of `val`.
|
|
581
|
+
try {
|
|
582
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
583
|
+
} catch (_) {
|
|
584
|
+
return 'Object';
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
// errors
|
|
588
|
+
if (val instanceof Error) {
|
|
589
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
590
|
+
}
|
|
591
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
592
|
+
return className;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
596
|
+
ptr = ptr >>> 0;
|
|
597
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
let cachedDataViewMemory0 = null;
|
|
601
|
+
function getDataViewMemory0() {
|
|
602
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
603
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
604
|
+
}
|
|
605
|
+
return cachedDataViewMemory0;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
function getStringFromWasm0(ptr, len) {
|
|
609
|
+
return decodeText(ptr >>> 0, len);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
let cachedUint8ArrayMemory0 = null;
|
|
613
|
+
function getUint8ArrayMemory0() {
|
|
614
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
615
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
616
|
+
}
|
|
617
|
+
return cachedUint8ArrayMemory0;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function handleError(f, args) {
|
|
621
|
+
try {
|
|
622
|
+
return f.apply(this, args);
|
|
623
|
+
} catch (e) {
|
|
624
|
+
const idx = addToExternrefTable0(e);
|
|
625
|
+
wasm.__wbindgen_exn_store(idx);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
function isLikeNone(x) {
|
|
630
|
+
return x === undefined || x === null;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
634
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
635
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
636
|
+
WASM_VECTOR_LEN = arg.length;
|
|
637
|
+
return ptr;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
641
|
+
if (realloc === undefined) {
|
|
642
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
643
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
644
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
645
|
+
WASM_VECTOR_LEN = buf.length;
|
|
646
|
+
return ptr;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
let len = arg.length;
|
|
650
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
651
|
+
|
|
652
|
+
const mem = getUint8ArrayMemory0();
|
|
653
|
+
|
|
654
|
+
let offset = 0;
|
|
655
|
+
|
|
656
|
+
for (; offset < len; offset++) {
|
|
657
|
+
const code = arg.charCodeAt(offset);
|
|
658
|
+
if (code > 0x7F) break;
|
|
659
|
+
mem[ptr + offset] = code;
|
|
660
|
+
}
|
|
661
|
+
if (offset !== len) {
|
|
662
|
+
if (offset !== 0) {
|
|
663
|
+
arg = arg.slice(offset);
|
|
664
|
+
}
|
|
665
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
666
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
667
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
668
|
+
|
|
669
|
+
offset += ret.written;
|
|
670
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
WASM_VECTOR_LEN = offset;
|
|
674
|
+
return ptr;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
function takeFromExternrefTable0(idx) {
|
|
678
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
679
|
+
wasm.__externref_table_dealloc(idx);
|
|
680
|
+
return value;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
684
|
+
cachedTextDecoder.decode();
|
|
685
|
+
function decodeText(ptr, len) {
|
|
686
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
const cachedTextEncoder = new TextEncoder();
|
|
690
|
+
|
|
691
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
692
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
693
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
694
|
+
view.set(buf);
|
|
695
|
+
return {
|
|
696
|
+
read: arg.length,
|
|
697
|
+
written: buf.length
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
let WASM_VECTOR_LEN = 0;
|
|
703
|
+
|
|
704
|
+
const wasmPath = `${__dirname}/proofgraph_wasm_bg.wasm`;
|
|
705
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
706
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
707
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
708
|
+
let wasm = wasmInstance.exports;
|
|
709
|
+
wasm.__wbindgen_start();
|
|
Binary file
|