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