@withautonomi/autonomi 0.2.2-rc.3 → 0.4.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/.yarnrc.yml +3 -0
- package/Cargo.toml +24 -0
- package/build.rs +5 -0
- package/index.d.ts +648 -0
- package/index.js +358 -0
- package/package.json +49 -19
- package/src/lib.rs +2290 -0
- package/README.md +0 -30
- package/autonomi.d.ts +0 -314
- package/autonomi.js +0 -1447
- package/autonomi_bg.wasm +0 -0
package/autonomi.js
DELETED
|
@@ -1,1447 +0,0 @@
|
|
|
1
|
-
let wasm;
|
|
2
|
-
|
|
3
|
-
const heap = new Array(128).fill(undefined);
|
|
4
|
-
|
|
5
|
-
heap.push(undefined, null, true, false);
|
|
6
|
-
|
|
7
|
-
function getObject(idx) { return heap[idx]; }
|
|
8
|
-
|
|
9
|
-
let heap_next = heap.length;
|
|
10
|
-
|
|
11
|
-
function dropObject(idx) {
|
|
12
|
-
if (idx < 132) return;
|
|
13
|
-
heap[idx] = heap_next;
|
|
14
|
-
heap_next = idx;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function takeObject(idx) {
|
|
18
|
-
const ret = getObject(idx);
|
|
19
|
-
dropObject(idx);
|
|
20
|
-
return ret;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
24
|
-
|
|
25
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
26
|
-
|
|
27
|
-
let cachedUint8ArrayMemory0 = null;
|
|
28
|
-
|
|
29
|
-
function getUint8ArrayMemory0() {
|
|
30
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
31
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
32
|
-
}
|
|
33
|
-
return cachedUint8ArrayMemory0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function getStringFromWasm0(ptr, len) {
|
|
37
|
-
ptr = ptr >>> 0;
|
|
38
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function addHeapObject(obj) {
|
|
42
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
43
|
-
const idx = heap_next;
|
|
44
|
-
heap_next = heap[idx];
|
|
45
|
-
|
|
46
|
-
heap[idx] = obj;
|
|
47
|
-
return idx;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
let WASM_VECTOR_LEN = 0;
|
|
51
|
-
|
|
52
|
-
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
53
|
-
|
|
54
|
-
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
55
|
-
? function (arg, view) {
|
|
56
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
57
|
-
}
|
|
58
|
-
: function (arg, view) {
|
|
59
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
60
|
-
view.set(buf);
|
|
61
|
-
return {
|
|
62
|
-
read: arg.length,
|
|
63
|
-
written: buf.length
|
|
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 = encodeString(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
|
-
function isLikeNone(x) {
|
|
107
|
-
return x === undefined || x === null;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
let cachedDataViewMemory0 = null;
|
|
111
|
-
|
|
112
|
-
function getDataViewMemory0() {
|
|
113
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
114
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
115
|
-
}
|
|
116
|
-
return cachedDataViewMemory0;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function debugString(val) {
|
|
120
|
-
// primitive types
|
|
121
|
-
const type = typeof val;
|
|
122
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
123
|
-
return `${val}`;
|
|
124
|
-
}
|
|
125
|
-
if (type == 'string') {
|
|
126
|
-
return `"${val}"`;
|
|
127
|
-
}
|
|
128
|
-
if (type == 'symbol') {
|
|
129
|
-
const description = val.description;
|
|
130
|
-
if (description == null) {
|
|
131
|
-
return 'Symbol';
|
|
132
|
-
} else {
|
|
133
|
-
return `Symbol(${description})`;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (type == 'function') {
|
|
137
|
-
const name = val.name;
|
|
138
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
139
|
-
return `Function(${name})`;
|
|
140
|
-
} else {
|
|
141
|
-
return 'Function';
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// objects
|
|
145
|
-
if (Array.isArray(val)) {
|
|
146
|
-
const length = val.length;
|
|
147
|
-
let debug = '[';
|
|
148
|
-
if (length > 0) {
|
|
149
|
-
debug += debugString(val[0]);
|
|
150
|
-
}
|
|
151
|
-
for(let i = 1; i < length; i++) {
|
|
152
|
-
debug += ', ' + debugString(val[i]);
|
|
153
|
-
}
|
|
154
|
-
debug += ']';
|
|
155
|
-
return debug;
|
|
156
|
-
}
|
|
157
|
-
// Test for built-in
|
|
158
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
159
|
-
let className;
|
|
160
|
-
if (builtInMatches.length > 1) {
|
|
161
|
-
className = builtInMatches[1];
|
|
162
|
-
} else {
|
|
163
|
-
// Failed to match the standard '[object ClassName]'
|
|
164
|
-
return toString.call(val);
|
|
165
|
-
}
|
|
166
|
-
if (className == 'Object') {
|
|
167
|
-
// we're a user defined class or Object
|
|
168
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
169
|
-
// easier than looping through ownProperties of `val`.
|
|
170
|
-
try {
|
|
171
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
172
|
-
} catch (_) {
|
|
173
|
-
return 'Object';
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
// errors
|
|
177
|
-
if (val instanceof Error) {
|
|
178
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
179
|
-
}
|
|
180
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
181
|
-
return className;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
185
|
-
ptr = ptr >>> 0;
|
|
186
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
190
|
-
? { register: () => {}, unregister: () => {} }
|
|
191
|
-
: new FinalizationRegistry(state => {
|
|
192
|
-
wasm.__wbindgen_export_3.get(state.dtor)(state.a, state.b)
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
196
|
-
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
197
|
-
const real = (...args) => {
|
|
198
|
-
// First up with a closure we increment the internal reference
|
|
199
|
-
// count. This ensures that the Rust closure environment won't
|
|
200
|
-
// be deallocated while we're invoking it.
|
|
201
|
-
state.cnt++;
|
|
202
|
-
const a = state.a;
|
|
203
|
-
state.a = 0;
|
|
204
|
-
try {
|
|
205
|
-
return f(a, state.b, ...args);
|
|
206
|
-
} finally {
|
|
207
|
-
if (--state.cnt === 0) {
|
|
208
|
-
wasm.__wbindgen_export_3.get(state.dtor)(a, state.b);
|
|
209
|
-
CLOSURE_DTORS.unregister(state);
|
|
210
|
-
} else {
|
|
211
|
-
state.a = a;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
real.original = state;
|
|
216
|
-
CLOSURE_DTORS.register(real, state, state);
|
|
217
|
-
return real;
|
|
218
|
-
}
|
|
219
|
-
function __wbg_adapter_34(arg0, arg1) {
|
|
220
|
-
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb1127ec8a5f76069(arg0, arg1);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function __wbg_adapter_37(arg0, arg1, arg2) {
|
|
224
|
-
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7964ee7a46fd96a5(arg0, arg1, addHeapObject(arg2));
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function __wbg_adapter_44(arg0, arg1, arg2) {
|
|
228
|
-
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6d1a6f0013d59045(arg0, arg1, addHeapObject(arg2));
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
function __wbg_adapter_47(arg0, arg1) {
|
|
232
|
-
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdcedccdc30da04ac(arg0, arg1);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function passArrayJsValueToWasm0(array, malloc) {
|
|
236
|
-
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
237
|
-
const mem = getDataViewMemory0();
|
|
238
|
-
for (let i = 0; i < array.length; i++) {
|
|
239
|
-
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
240
|
-
}
|
|
241
|
-
WASM_VECTOR_LEN = array.length;
|
|
242
|
-
return ptr;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
246
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
247
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
248
|
-
WASM_VECTOR_LEN = arg.length;
|
|
249
|
-
return ptr;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
function _assertClass(instance, klass) {
|
|
253
|
-
if (!(instance instanceof klass)) {
|
|
254
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
255
|
-
}
|
|
256
|
-
return instance.ptr;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* # Example
|
|
260
|
-
*
|
|
261
|
-
* ```js
|
|
262
|
-
* const secretKey = genSecretKey();
|
|
263
|
-
* await client.putUserDataToVault(userData, wallet, secretKey);
|
|
264
|
-
* const userDataFetched = await client.getUserDataFromVault(secretKey);
|
|
265
|
-
* ```
|
|
266
|
-
* @returns {SecretKey}
|
|
267
|
-
*/
|
|
268
|
-
export function genSecretKey() {
|
|
269
|
-
const ret = wasm.genSecretKey();
|
|
270
|
-
return SecretKey.__wrap(ret);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Get the current `EvmNetwork` that was set using environment variables that were used during the build process of this library.
|
|
275
|
-
* @returns {any}
|
|
276
|
-
*/
|
|
277
|
-
export function getEvmNetwork() {
|
|
278
|
-
try {
|
|
279
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
280
|
-
wasm.getEvmNetwork(retptr);
|
|
281
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
282
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
283
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
284
|
-
if (r2) {
|
|
285
|
-
throw takeObject(r1);
|
|
286
|
-
}
|
|
287
|
-
return takeObject(r0);
|
|
288
|
-
} finally {
|
|
289
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Get a funded wallet for testing. This either uses a default private key or the `EVM_PRIVATE_KEY`
|
|
295
|
-
* environment variable that was used during the build process of this library.
|
|
296
|
-
* @returns {Wallet}
|
|
297
|
-
*/
|
|
298
|
-
export function getFundedWallet() {
|
|
299
|
-
const ret = wasm.getFundedWallet();
|
|
300
|
-
return Wallet.__wrap(ret);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Enable tracing logging in the console.
|
|
305
|
-
*
|
|
306
|
-
* A level could be passed like `trace` or `warn`. Or set for a specific module/crate
|
|
307
|
-
* with `sn_networking=trace,autonomi=info`.
|
|
308
|
-
*
|
|
309
|
-
* # Example
|
|
310
|
-
*
|
|
311
|
-
* ```js
|
|
312
|
-
* logInit("sn_networking=warn,autonomi=trace");
|
|
313
|
-
* ```
|
|
314
|
-
* @param {string} directive
|
|
315
|
-
*/
|
|
316
|
-
export function logInit(directive) {
|
|
317
|
-
const ptr0 = passStringToWasm0(directive, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
318
|
-
const len0 = WASM_VECTOR_LEN;
|
|
319
|
-
wasm.logInit(ptr0, len0);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
function handleError(f, args) {
|
|
323
|
-
try {
|
|
324
|
-
return f.apply(this, args);
|
|
325
|
-
} catch (e) {
|
|
326
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
function __wbg_adapter_239(arg0, arg1, arg2, arg3) {
|
|
330
|
-
wasm.wasm_bindgen__convert__closures__invoke2_mut__h2d9c0b8c5965541d(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
const ArchiveFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
334
|
-
? { register: () => {}, unregister: () => {} }
|
|
335
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_archive_free(ptr >>> 0, 1));
|
|
336
|
-
/**
|
|
337
|
-
* Structure mapping paths to data addresses.
|
|
338
|
-
*/
|
|
339
|
-
export class Archive {
|
|
340
|
-
|
|
341
|
-
static __wrap(ptr) {
|
|
342
|
-
ptr = ptr >>> 0;
|
|
343
|
-
const obj = Object.create(Archive.prototype);
|
|
344
|
-
obj.__wbg_ptr = ptr;
|
|
345
|
-
ArchiveFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
346
|
-
return obj;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
__destroy_into_raw() {
|
|
350
|
-
const ptr = this.__wbg_ptr;
|
|
351
|
-
this.__wbg_ptr = 0;
|
|
352
|
-
ArchiveFinalization.unregister(this);
|
|
353
|
-
return ptr;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
free() {
|
|
357
|
-
const ptr = this.__destroy_into_raw();
|
|
358
|
-
wasm.__wbg_archive_free(ptr, 0);
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Create a new archive.
|
|
362
|
-
*/
|
|
363
|
-
constructor() {
|
|
364
|
-
const ret = wasm.archive_new();
|
|
365
|
-
this.__wbg_ptr = ret >>> 0;
|
|
366
|
-
ArchiveFinalization.register(this, this.__wbg_ptr, this);
|
|
367
|
-
return this;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Add a new file to the archive.
|
|
371
|
-
* @param {string} path
|
|
372
|
-
* @param {string} data_addr
|
|
373
|
-
*/
|
|
374
|
-
addNewFile(path, data_addr) {
|
|
375
|
-
try {
|
|
376
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
377
|
-
const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
378
|
-
const len0 = WASM_VECTOR_LEN;
|
|
379
|
-
const ptr1 = passStringToWasm0(data_addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
380
|
-
const len1 = WASM_VECTOR_LEN;
|
|
381
|
-
wasm.archive_addNewFile(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
382
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
383
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
384
|
-
if (r1) {
|
|
385
|
-
throw takeObject(r0);
|
|
386
|
-
}
|
|
387
|
-
} finally {
|
|
388
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* @param {string} old_path
|
|
393
|
-
* @param {string} new_path
|
|
394
|
-
*/
|
|
395
|
-
renameFile(old_path, new_path) {
|
|
396
|
-
try {
|
|
397
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
398
|
-
const ptr0 = passStringToWasm0(old_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
399
|
-
const len0 = WASM_VECTOR_LEN;
|
|
400
|
-
const ptr1 = passStringToWasm0(new_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
401
|
-
const len1 = WASM_VECTOR_LEN;
|
|
402
|
-
wasm.archive_renameFile(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
403
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
404
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
405
|
-
if (r1) {
|
|
406
|
-
throw takeObject(r0);
|
|
407
|
-
}
|
|
408
|
-
} finally {
|
|
409
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* @returns {any}
|
|
414
|
-
*/
|
|
415
|
-
map() {
|
|
416
|
-
try {
|
|
417
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
418
|
-
wasm.archive_map(retptr, this.__wbg_ptr);
|
|
419
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
420
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
421
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
422
|
-
if (r2) {
|
|
423
|
-
throw takeObject(r1);
|
|
424
|
-
}
|
|
425
|
-
return takeObject(r0);
|
|
426
|
-
} finally {
|
|
427
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
const AttoTokensFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
433
|
-
? { register: () => {}, unregister: () => {} }
|
|
434
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_attotokens_free(ptr >>> 0, 1));
|
|
435
|
-
/**
|
|
436
|
-
*/
|
|
437
|
-
export class AttoTokens {
|
|
438
|
-
|
|
439
|
-
static __wrap(ptr) {
|
|
440
|
-
ptr = ptr >>> 0;
|
|
441
|
-
const obj = Object.create(AttoTokens.prototype);
|
|
442
|
-
obj.__wbg_ptr = ptr;
|
|
443
|
-
AttoTokensFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
444
|
-
return obj;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
__destroy_into_raw() {
|
|
448
|
-
const ptr = this.__wbg_ptr;
|
|
449
|
-
this.__wbg_ptr = 0;
|
|
450
|
-
AttoTokensFinalization.unregister(this);
|
|
451
|
-
return ptr;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
free() {
|
|
455
|
-
const ptr = this.__destroy_into_raw();
|
|
456
|
-
wasm.__wbg_attotokens_free(ptr, 0);
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
* @returns {string}
|
|
460
|
-
*/
|
|
461
|
-
toString() {
|
|
462
|
-
let deferred1_0;
|
|
463
|
-
let deferred1_1;
|
|
464
|
-
try {
|
|
465
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
466
|
-
wasm.attotokens_toString(retptr, this.__wbg_ptr);
|
|
467
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
468
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
469
|
-
deferred1_0 = r0;
|
|
470
|
-
deferred1_1 = r1;
|
|
471
|
-
return getStringFromWasm0(r0, r1);
|
|
472
|
-
} finally {
|
|
473
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
474
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
const ClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
480
|
-
? { register: () => {}, unregister: () => {} }
|
|
481
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_client_free(ptr >>> 0, 1));
|
|
482
|
-
/**
|
|
483
|
-
* The `Client` object allows interaction with the network to store and retrieve data.
|
|
484
|
-
*
|
|
485
|
-
* To connect to the network, see {@link Client.connect}.
|
|
486
|
-
*
|
|
487
|
-
* # Example
|
|
488
|
-
*
|
|
489
|
-
* ```js
|
|
490
|
-
* let client = await Client.connect(["/ip4/127.0.0.1/tcp/36075/ws/p2p/12D3KooWALb...BhDAfJY"]);
|
|
491
|
-
* const dataAddr = await client.dataPut(new Uint8Array([0, 1, 2, 3]), wallet);
|
|
492
|
-
*
|
|
493
|
-
* const archive = new Archive();
|
|
494
|
-
* archive.addNewFile("foo", dataAddr);
|
|
495
|
-
*
|
|
496
|
-
* const archiveAddr = await client.archivePut(archive, wallet);
|
|
497
|
-
* const archiveFetched = await client.archiveGet(archiveAddr);
|
|
498
|
-
* ```
|
|
499
|
-
*/
|
|
500
|
-
export class Client {
|
|
501
|
-
|
|
502
|
-
static __wrap(ptr) {
|
|
503
|
-
ptr = ptr >>> 0;
|
|
504
|
-
const obj = Object.create(Client.prototype);
|
|
505
|
-
obj.__wbg_ptr = ptr;
|
|
506
|
-
ClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
507
|
-
return obj;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
__destroy_into_raw() {
|
|
511
|
-
const ptr = this.__wbg_ptr;
|
|
512
|
-
this.__wbg_ptr = 0;
|
|
513
|
-
ClientFinalization.unregister(this);
|
|
514
|
-
return ptr;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
free() {
|
|
518
|
-
const ptr = this.__destroy_into_raw();
|
|
519
|
-
wasm.__wbg_client_free(ptr, 0);
|
|
520
|
-
}
|
|
521
|
-
/**
|
|
522
|
-
* Connect to the network via the given peers.
|
|
523
|
-
*
|
|
524
|
-
* # Example
|
|
525
|
-
*
|
|
526
|
-
* ```js
|
|
527
|
-
* let client = await Client.connect(["/ip4/127.0.0.1/tcp/36075/ws/p2p/12D3KooWALb...BhDAfJY"]);
|
|
528
|
-
* ```
|
|
529
|
-
* @param {(string)[]} peers
|
|
530
|
-
* @returns {Promise<Client>}
|
|
531
|
-
*/
|
|
532
|
-
static connect(peers) {
|
|
533
|
-
const ptr0 = passArrayJsValueToWasm0(peers, wasm.__wbindgen_malloc);
|
|
534
|
-
const len0 = WASM_VECTOR_LEN;
|
|
535
|
-
const ret = wasm.client_connect(ptr0, len0);
|
|
536
|
-
return takeObject(ret);
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Upload a chunk to the network.
|
|
540
|
-
*
|
|
541
|
-
* Returns the hex encoded address of the chunk.
|
|
542
|
-
*
|
|
543
|
-
* This is not yet implemented.
|
|
544
|
-
* @param {Uint8Array} _data
|
|
545
|
-
* @param {Wallet} _wallet
|
|
546
|
-
* @returns {Promise<string>}
|
|
547
|
-
*/
|
|
548
|
-
chunkPut(_data, _wallet) {
|
|
549
|
-
const ptr0 = passArray8ToWasm0(_data, wasm.__wbindgen_malloc);
|
|
550
|
-
const len0 = WASM_VECTOR_LEN;
|
|
551
|
-
_assertClass(_wallet, Wallet);
|
|
552
|
-
const ret = wasm.client_chunkPut(this.__wbg_ptr, ptr0, len0, _wallet.__wbg_ptr);
|
|
553
|
-
return takeObject(ret);
|
|
554
|
-
}
|
|
555
|
-
/**
|
|
556
|
-
* Fetch the chunk from the network.
|
|
557
|
-
* @param {string} addr
|
|
558
|
-
* @returns {Promise<Uint8Array>}
|
|
559
|
-
*/
|
|
560
|
-
chunkGet(addr) {
|
|
561
|
-
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
562
|
-
const len0 = WASM_VECTOR_LEN;
|
|
563
|
-
const ret = wasm.client_chunkGet(this.__wbg_ptr, ptr0, len0);
|
|
564
|
-
return takeObject(ret);
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* Upload data to the network.
|
|
568
|
-
*
|
|
569
|
-
* Returns the hex encoded address of the data.
|
|
570
|
-
* @param {Uint8Array} data
|
|
571
|
-
* @param {Wallet} wallet
|
|
572
|
-
* @returns {Promise<string>}
|
|
573
|
-
*/
|
|
574
|
-
dataPut(data, wallet) {
|
|
575
|
-
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
576
|
-
const len0 = WASM_VECTOR_LEN;
|
|
577
|
-
_assertClass(wallet, Wallet);
|
|
578
|
-
const ret = wasm.client_dataPut(this.__wbg_ptr, ptr0, len0, wallet.__wbg_ptr);
|
|
579
|
-
return takeObject(ret);
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* Fetch the data from the network.
|
|
583
|
-
* @param {string} addr
|
|
584
|
-
* @returns {Promise<Uint8Array>}
|
|
585
|
-
*/
|
|
586
|
-
dataGet(addr) {
|
|
587
|
-
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
588
|
-
const len0 = WASM_VECTOR_LEN;
|
|
589
|
-
const ret = wasm.client_dataGet(this.__wbg_ptr, ptr0, len0);
|
|
590
|
-
return takeObject(ret);
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* Get the cost of uploading data to the network.
|
|
594
|
-
* @param {Uint8Array} data
|
|
595
|
-
* @returns {Promise<AttoTokens>}
|
|
596
|
-
*/
|
|
597
|
-
dataCost(data) {
|
|
598
|
-
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
599
|
-
const len0 = WASM_VECTOR_LEN;
|
|
600
|
-
const ret = wasm.client_dataCost(this.__wbg_ptr, ptr0, len0);
|
|
601
|
-
return takeObject(ret);
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* Fetch an archive from the network.
|
|
605
|
-
* @param {string} addr
|
|
606
|
-
* @returns {Promise<Archive>}
|
|
607
|
-
*/
|
|
608
|
-
archiveGet(addr) {
|
|
609
|
-
const ptr0 = passStringToWasm0(addr, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
610
|
-
const len0 = WASM_VECTOR_LEN;
|
|
611
|
-
const ret = wasm.client_archiveGet(this.__wbg_ptr, ptr0, len0);
|
|
612
|
-
return takeObject(ret);
|
|
613
|
-
}
|
|
614
|
-
/**
|
|
615
|
-
* Upload an archive to the network.
|
|
616
|
-
*
|
|
617
|
-
* Returns the hex encoded address of the archive.
|
|
618
|
-
* @param {Archive} archive
|
|
619
|
-
* @param {Wallet} wallet
|
|
620
|
-
* @returns {Promise<string>}
|
|
621
|
-
*/
|
|
622
|
-
archivePut(archive, wallet) {
|
|
623
|
-
_assertClass(archive, Archive);
|
|
624
|
-
_assertClass(wallet, Wallet);
|
|
625
|
-
const ret = wasm.client_archivePut(this.__wbg_ptr, archive.__wbg_ptr, wallet.__wbg_ptr);
|
|
626
|
-
return takeObject(ret);
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Fetch the user data from the vault.
|
|
630
|
-
*
|
|
631
|
-
* # Example
|
|
632
|
-
*
|
|
633
|
-
* ```js
|
|
634
|
-
* const secretKey = genSecretKey();
|
|
635
|
-
* const userData = await client.getUserDataFromVault(secretKey);
|
|
636
|
-
* ```
|
|
637
|
-
* @param {SecretKey} secret_key
|
|
638
|
-
* @returns {Promise<UserData>}
|
|
639
|
-
*/
|
|
640
|
-
getUserDataFromVault(secret_key) {
|
|
641
|
-
_assertClass(secret_key, SecretKey);
|
|
642
|
-
const ret = wasm.client_getUserDataFromVault(this.__wbg_ptr, secret_key.__wbg_ptr);
|
|
643
|
-
return takeObject(ret);
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Put the user data to the vault.
|
|
647
|
-
*
|
|
648
|
-
* # Example
|
|
649
|
-
*
|
|
650
|
-
* ```js
|
|
651
|
-
* const secretKey = genSecretKey();
|
|
652
|
-
* await client.putUserDataToVault(userData, wallet, secretKey);
|
|
653
|
-
* ```
|
|
654
|
-
* @param {UserData} user_data
|
|
655
|
-
* @param {Wallet} wallet
|
|
656
|
-
* @param {SecretKey} secret_key
|
|
657
|
-
* @returns {Promise<void>}
|
|
658
|
-
*/
|
|
659
|
-
putUserDataToVault(user_data, wallet, secret_key) {
|
|
660
|
-
_assertClass(user_data, UserData);
|
|
661
|
-
_assertClass(wallet, Wallet);
|
|
662
|
-
_assertClass(secret_key, SecretKey);
|
|
663
|
-
const ret = wasm.client_putUserDataToVault(this.__wbg_ptr, user_data.__wbg_ptr, wallet.__wbg_ptr, secret_key.__wbg_ptr);
|
|
664
|
-
return takeObject(ret);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
const SecretKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
669
|
-
? { register: () => {}, unregister: () => {} }
|
|
670
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_secretkey_free(ptr >>> 0, 1));
|
|
671
|
-
/**
|
|
672
|
-
*/
|
|
673
|
-
export class SecretKey {
|
|
674
|
-
|
|
675
|
-
static __wrap(ptr) {
|
|
676
|
-
ptr = ptr >>> 0;
|
|
677
|
-
const obj = Object.create(SecretKey.prototype);
|
|
678
|
-
obj.__wbg_ptr = ptr;
|
|
679
|
-
SecretKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
680
|
-
return obj;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
__destroy_into_raw() {
|
|
684
|
-
const ptr = this.__wbg_ptr;
|
|
685
|
-
this.__wbg_ptr = 0;
|
|
686
|
-
SecretKeyFinalization.unregister(this);
|
|
687
|
-
return ptr;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
free() {
|
|
691
|
-
const ptr = this.__destroy_into_raw();
|
|
692
|
-
wasm.__wbg_secretkey_free(ptr, 0);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
const UserDataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
697
|
-
? { register: () => {}, unregister: () => {} }
|
|
698
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_userdata_free(ptr >>> 0, 1));
|
|
699
|
-
/**
|
|
700
|
-
* Structure to keep track of uploaded archives, registers and other data.
|
|
701
|
-
*/
|
|
702
|
-
export class UserData {
|
|
703
|
-
|
|
704
|
-
static __wrap(ptr) {
|
|
705
|
-
ptr = ptr >>> 0;
|
|
706
|
-
const obj = Object.create(UserData.prototype);
|
|
707
|
-
obj.__wbg_ptr = ptr;
|
|
708
|
-
UserDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
709
|
-
return obj;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
__destroy_into_raw() {
|
|
713
|
-
const ptr = this.__wbg_ptr;
|
|
714
|
-
this.__wbg_ptr = 0;
|
|
715
|
-
UserDataFinalization.unregister(this);
|
|
716
|
-
return ptr;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
free() {
|
|
720
|
-
const ptr = this.__destroy_into_raw();
|
|
721
|
-
wasm.__wbg_userdata_free(ptr, 0);
|
|
722
|
-
}
|
|
723
|
-
/**
|
|
724
|
-
* Create a new user data structure.
|
|
725
|
-
*/
|
|
726
|
-
constructor() {
|
|
727
|
-
const ret = wasm.userdata_new();
|
|
728
|
-
this.__wbg_ptr = ret >>> 0;
|
|
729
|
-
UserDataFinalization.register(this, this.__wbg_ptr, this);
|
|
730
|
-
return this;
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* Store an archive address in the user data with an optional name.
|
|
734
|
-
*
|
|
735
|
-
* # Example
|
|
736
|
-
*
|
|
737
|
-
* ```js
|
|
738
|
-
* userData.addFileArchive(archiveAddr, "foo");
|
|
739
|
-
* ```
|
|
740
|
-
* @param {string} archive
|
|
741
|
-
* @param {string | undefined} [name]
|
|
742
|
-
*/
|
|
743
|
-
addFileArchive(archive, name) {
|
|
744
|
-
try {
|
|
745
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
746
|
-
const ptr0 = passStringToWasm0(archive, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
747
|
-
const len0 = WASM_VECTOR_LEN;
|
|
748
|
-
var ptr1 = isLikeNone(name) ? 0 : passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
749
|
-
var len1 = WASM_VECTOR_LEN;
|
|
750
|
-
wasm.userdata_addFileArchive(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
751
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
752
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
753
|
-
if (r1) {
|
|
754
|
-
throw takeObject(r0);
|
|
755
|
-
}
|
|
756
|
-
} finally {
|
|
757
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* @param {string} archive
|
|
762
|
-
*/
|
|
763
|
-
removeFileArchive(archive) {
|
|
764
|
-
try {
|
|
765
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
766
|
-
const ptr0 = passStringToWasm0(archive, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
767
|
-
const len0 = WASM_VECTOR_LEN;
|
|
768
|
-
wasm.userdata_removeFileArchive(retptr, this.__wbg_ptr, ptr0, len0);
|
|
769
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
770
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
771
|
-
if (r1) {
|
|
772
|
-
throw takeObject(r0);
|
|
773
|
-
}
|
|
774
|
-
} finally {
|
|
775
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
* @returns {any}
|
|
780
|
-
*/
|
|
781
|
-
fileArchives() {
|
|
782
|
-
try {
|
|
783
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
784
|
-
wasm.userdata_fileArchives(retptr, this.__wbg_ptr);
|
|
785
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
786
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
787
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
788
|
-
if (r2) {
|
|
789
|
-
throw takeObject(r1);
|
|
790
|
-
}
|
|
791
|
-
return takeObject(r0);
|
|
792
|
-
} finally {
|
|
793
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
const WalletFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
799
|
-
? { register: () => {}, unregister: () => {} }
|
|
800
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wallet_free(ptr >>> 0, 1));
|
|
801
|
-
/**
|
|
802
|
-
*/
|
|
803
|
-
export class Wallet {
|
|
804
|
-
|
|
805
|
-
static __wrap(ptr) {
|
|
806
|
-
ptr = ptr >>> 0;
|
|
807
|
-
const obj = Object.create(Wallet.prototype);
|
|
808
|
-
obj.__wbg_ptr = ptr;
|
|
809
|
-
WalletFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
810
|
-
return obj;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
__destroy_into_raw() {
|
|
814
|
-
const ptr = this.__wbg_ptr;
|
|
815
|
-
this.__wbg_ptr = 0;
|
|
816
|
-
WalletFinalization.unregister(this);
|
|
817
|
-
return ptr;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
free() {
|
|
821
|
-
const ptr = this.__destroy_into_raw();
|
|
822
|
-
wasm.__wbg_wallet_free(ptr, 0);
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
async function __wbg_load(module, imports) {
|
|
827
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
828
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
829
|
-
try {
|
|
830
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
831
|
-
|
|
832
|
-
} catch (e) {
|
|
833
|
-
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
834
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
835
|
-
|
|
836
|
-
} else {
|
|
837
|
-
throw e;
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
const bytes = await module.arrayBuffer();
|
|
843
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
844
|
-
|
|
845
|
-
} else {
|
|
846
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
847
|
-
|
|
848
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
849
|
-
return { instance, module };
|
|
850
|
-
|
|
851
|
-
} else {
|
|
852
|
-
return instance;
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
function __wbg_get_imports() {
|
|
858
|
-
const imports = {};
|
|
859
|
-
imports.wbg = {};
|
|
860
|
-
imports.wbg.__wbg_archive_new = function(arg0) {
|
|
861
|
-
const ret = Archive.__wrap(arg0);
|
|
862
|
-
return addHeapObject(ret);
|
|
863
|
-
};
|
|
864
|
-
imports.wbg.__wbg_userdata_new = function(arg0) {
|
|
865
|
-
const ret = UserData.__wrap(arg0);
|
|
866
|
-
return addHeapObject(ret);
|
|
867
|
-
};
|
|
868
|
-
imports.wbg.__wbg_attotokens_new = function(arg0) {
|
|
869
|
-
const ret = AttoTokens.__wrap(arg0);
|
|
870
|
-
return addHeapObject(ret);
|
|
871
|
-
};
|
|
872
|
-
imports.wbg.__wbg_client_new = function(arg0) {
|
|
873
|
-
const ret = Client.__wrap(arg0);
|
|
874
|
-
return addHeapObject(ret);
|
|
875
|
-
};
|
|
876
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
877
|
-
takeObject(arg0);
|
|
878
|
-
};
|
|
879
|
-
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
880
|
-
const obj = takeObject(arg0).original;
|
|
881
|
-
if (obj.cnt-- == 1) {
|
|
882
|
-
obj.a = 0;
|
|
883
|
-
return true;
|
|
884
|
-
}
|
|
885
|
-
const ret = false;
|
|
886
|
-
return ret;
|
|
887
|
-
};
|
|
888
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
889
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
890
|
-
return addHeapObject(ret);
|
|
891
|
-
};
|
|
892
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
893
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
894
|
-
return addHeapObject(ret);
|
|
895
|
-
};
|
|
896
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
897
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
898
|
-
return ret;
|
|
899
|
-
};
|
|
900
|
-
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
901
|
-
const ret = new Error();
|
|
902
|
-
return addHeapObject(ret);
|
|
903
|
-
};
|
|
904
|
-
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
905
|
-
const ret = getObject(arg1).stack;
|
|
906
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
907
|
-
const len1 = WASM_VECTOR_LEN;
|
|
908
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
909
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
910
|
-
};
|
|
911
|
-
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
912
|
-
let deferred0_0;
|
|
913
|
-
let deferred0_1;
|
|
914
|
-
try {
|
|
915
|
-
deferred0_0 = arg0;
|
|
916
|
-
deferred0_1 = arg1;
|
|
917
|
-
console.error(getStringFromWasm0(arg0, arg1));
|
|
918
|
-
} finally {
|
|
919
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
920
|
-
}
|
|
921
|
-
};
|
|
922
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
923
|
-
const val = getObject(arg0);
|
|
924
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
925
|
-
return ret;
|
|
926
|
-
};
|
|
927
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
928
|
-
const obj = getObject(arg1);
|
|
929
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
930
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
931
|
-
var len1 = WASM_VECTOR_LEN;
|
|
932
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
933
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
934
|
-
};
|
|
935
|
-
imports.wbg.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
|
|
936
|
-
const ret = String(getObject(arg1));
|
|
937
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
938
|
-
const len1 = WASM_VECTOR_LEN;
|
|
939
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
940
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
941
|
-
};
|
|
942
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
943
|
-
const ret = arg0;
|
|
944
|
-
return addHeapObject(ret);
|
|
945
|
-
};
|
|
946
|
-
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
947
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
948
|
-
return addHeapObject(ret);
|
|
949
|
-
};
|
|
950
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
951
|
-
const ret = getObject(arg0);
|
|
952
|
-
return addHeapObject(ret);
|
|
953
|
-
};
|
|
954
|
-
imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
955
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
956
|
-
};
|
|
957
|
-
imports.wbg.__wbg_fetch_25e3a297f7b04639 = function(arg0) {
|
|
958
|
-
const ret = fetch(getObject(arg0));
|
|
959
|
-
return addHeapObject(ret);
|
|
960
|
-
};
|
|
961
|
-
imports.wbg.__wbg_setTimeout_2cb6c793c4aa44f8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
962
|
-
const ret = getObject(arg0).setTimeout(getObject(arg1), arg2);
|
|
963
|
-
return ret;
|
|
964
|
-
}, arguments) };
|
|
965
|
-
imports.wbg.__wbg_performance_ffc4e815dfb3449f = function(arg0) {
|
|
966
|
-
const ret = getObject(arg0).performance;
|
|
967
|
-
return addHeapObject(ret);
|
|
968
|
-
};
|
|
969
|
-
imports.wbg.__wbg_now_8799be02ba81a22e = function(arg0) {
|
|
970
|
-
const ret = getObject(arg0).now();
|
|
971
|
-
return ret;
|
|
972
|
-
};
|
|
973
|
-
imports.wbg.__wbg_WorkerGlobalScope_c44775816e379c0e = function(arg0) {
|
|
974
|
-
const ret = getObject(arg0).WorkerGlobalScope;
|
|
975
|
-
return addHeapObject(ret);
|
|
976
|
-
};
|
|
977
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
978
|
-
const ret = getObject(arg0) === undefined;
|
|
979
|
-
return ret;
|
|
980
|
-
};
|
|
981
|
-
imports.wbg.__wbg_instanceof_Window_5012736c80a01584 = function(arg0) {
|
|
982
|
-
let result;
|
|
983
|
-
try {
|
|
984
|
-
result = getObject(arg0) instanceof Window;
|
|
985
|
-
} catch (_) {
|
|
986
|
-
result = false;
|
|
987
|
-
}
|
|
988
|
-
const ret = result;
|
|
989
|
-
return ret;
|
|
990
|
-
};
|
|
991
|
-
imports.wbg.__wbg_clearInterval_df3409c32c572e85 = function(arg0, arg1) {
|
|
992
|
-
getObject(arg0).clearInterval(arg1);
|
|
993
|
-
};
|
|
994
|
-
imports.wbg.__wbg_setInterval_d4a371ef4db258a7 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
995
|
-
const ret = getObject(arg0).setInterval(getObject(arg1), arg2, ...getObject(arg3));
|
|
996
|
-
return ret;
|
|
997
|
-
}, arguments) };
|
|
998
|
-
imports.wbg.__wbg_clearInterval_26e463ce3f550c4b = function(arg0, arg1) {
|
|
999
|
-
getObject(arg0).clearInterval(arg1);
|
|
1000
|
-
};
|
|
1001
|
-
imports.wbg.__wbg_fetch_ba7fe179e527d942 = function(arg0, arg1) {
|
|
1002
|
-
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
1003
|
-
return addHeapObject(ret);
|
|
1004
|
-
};
|
|
1005
|
-
imports.wbg.__wbg_setInterval_1758524273ba5b22 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1006
|
-
const ret = getObject(arg0).setInterval(getObject(arg1), arg2, ...getObject(arg3));
|
|
1007
|
-
return ret;
|
|
1008
|
-
}, arguments) };
|
|
1009
|
-
imports.wbg.__wbg_data_5c47a6985fefc490 = function(arg0) {
|
|
1010
|
-
const ret = getObject(arg0).data;
|
|
1011
|
-
return addHeapObject(ret);
|
|
1012
|
-
};
|
|
1013
|
-
imports.wbg.__wbg_newwithstrandinit_a31c69e4cc337183 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1014
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
1015
|
-
return addHeapObject(ret);
|
|
1016
|
-
}, arguments) };
|
|
1017
|
-
imports.wbg.__wbg_debug_5a33c41aeac15ee6 = function(arg0) {
|
|
1018
|
-
console.debug(getObject(arg0));
|
|
1019
|
-
};
|
|
1020
|
-
imports.wbg.__wbg_debug_d7780810b3a93632 = function(arg0, arg1, arg2, arg3) {
|
|
1021
|
-
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1022
|
-
};
|
|
1023
|
-
imports.wbg.__wbg_error_09480e4aadca50ad = function(arg0) {
|
|
1024
|
-
console.error(getObject(arg0));
|
|
1025
|
-
};
|
|
1026
|
-
imports.wbg.__wbg_error_f02f3d66b42c6251 = function(arg0, arg1, arg2, arg3) {
|
|
1027
|
-
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1028
|
-
};
|
|
1029
|
-
imports.wbg.__wbg_info_c261acb2deacd903 = function(arg0) {
|
|
1030
|
-
console.info(getObject(arg0));
|
|
1031
|
-
};
|
|
1032
|
-
imports.wbg.__wbg_info_123d8c35ec14384a = function(arg0, arg1, arg2, arg3) {
|
|
1033
|
-
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1034
|
-
};
|
|
1035
|
-
imports.wbg.__wbg_warn_2b3adb99ce26c314 = function(arg0) {
|
|
1036
|
-
console.warn(getObject(arg0));
|
|
1037
|
-
};
|
|
1038
|
-
imports.wbg.__wbg_warn_60924fcf321399f0 = function(arg0, arg1, arg2, arg3) {
|
|
1039
|
-
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1040
|
-
};
|
|
1041
|
-
imports.wbg.__wbg_instanceof_Response_e91b7eb7c611a9ae = function(arg0) {
|
|
1042
|
-
let result;
|
|
1043
|
-
try {
|
|
1044
|
-
result = getObject(arg0) instanceof Response;
|
|
1045
|
-
} catch (_) {
|
|
1046
|
-
result = false;
|
|
1047
|
-
}
|
|
1048
|
-
const ret = result;
|
|
1049
|
-
return ret;
|
|
1050
|
-
};
|
|
1051
|
-
imports.wbg.__wbg_url_1bf85c8abeb8c92d = function(arg0, arg1) {
|
|
1052
|
-
const ret = getObject(arg1).url;
|
|
1053
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1054
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1055
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1056
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1057
|
-
};
|
|
1058
|
-
imports.wbg.__wbg_status_ae8de515694c5c7c = function(arg0) {
|
|
1059
|
-
const ret = getObject(arg0).status;
|
|
1060
|
-
return ret;
|
|
1061
|
-
};
|
|
1062
|
-
imports.wbg.__wbg_headers_5e283e8345689121 = function(arg0) {
|
|
1063
|
-
const ret = getObject(arg0).headers;
|
|
1064
|
-
return addHeapObject(ret);
|
|
1065
|
-
};
|
|
1066
|
-
imports.wbg.__wbg_arrayBuffer_a5fbad63cc7e663b = function() { return handleError(function (arg0) {
|
|
1067
|
-
const ret = getObject(arg0).arrayBuffer();
|
|
1068
|
-
return addHeapObject(ret);
|
|
1069
|
-
}, arguments) };
|
|
1070
|
-
imports.wbg.__wbg_signal_41e46ccad44bb5e2 = function(arg0) {
|
|
1071
|
-
const ret = getObject(arg0).signal;
|
|
1072
|
-
return addHeapObject(ret);
|
|
1073
|
-
};
|
|
1074
|
-
imports.wbg.__wbg_new_ebf2727385ee825c = function() { return handleError(function () {
|
|
1075
|
-
const ret = new AbortController();
|
|
1076
|
-
return addHeapObject(ret);
|
|
1077
|
-
}, arguments) };
|
|
1078
|
-
imports.wbg.__wbg_abort_8659d889a7877ae3 = function(arg0) {
|
|
1079
|
-
getObject(arg0).abort();
|
|
1080
|
-
};
|
|
1081
|
-
imports.wbg.__wbg_readyState_7237e2b1adac03a6 = function(arg0) {
|
|
1082
|
-
const ret = getObject(arg0).readyState;
|
|
1083
|
-
return ret;
|
|
1084
|
-
};
|
|
1085
|
-
imports.wbg.__wbg_bufferedAmount_77ba515edae4df34 = function(arg0) {
|
|
1086
|
-
const ret = getObject(arg0).bufferedAmount;
|
|
1087
|
-
return ret;
|
|
1088
|
-
};
|
|
1089
|
-
imports.wbg.__wbg_setonopen_7e770c87269cae90 = function(arg0, arg1) {
|
|
1090
|
-
getObject(arg0).onopen = getObject(arg1);
|
|
1091
|
-
};
|
|
1092
|
-
imports.wbg.__wbg_setonerror_5ec4625df3060159 = function(arg0, arg1) {
|
|
1093
|
-
getObject(arg0).onerror = getObject(arg1);
|
|
1094
|
-
};
|
|
1095
|
-
imports.wbg.__wbg_setonclose_40f935717ad6ffcd = function(arg0, arg1) {
|
|
1096
|
-
getObject(arg0).onclose = getObject(arg1);
|
|
1097
|
-
};
|
|
1098
|
-
imports.wbg.__wbg_setonmessage_b670c12ea34acd8b = function(arg0, arg1) {
|
|
1099
|
-
getObject(arg0).onmessage = getObject(arg1);
|
|
1100
|
-
};
|
|
1101
|
-
imports.wbg.__wbg_setbinaryType_d164a0be4c212c9c = function(arg0, arg1) {
|
|
1102
|
-
getObject(arg0).binaryType = ["blob","arraybuffer",][arg1];
|
|
1103
|
-
};
|
|
1104
|
-
imports.wbg.__wbg_new_0bf4a5b0632517ed = function() { return handleError(function (arg0, arg1) {
|
|
1105
|
-
const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
|
|
1106
|
-
return addHeapObject(ret);
|
|
1107
|
-
}, arguments) };
|
|
1108
|
-
imports.wbg.__wbg_close_0a0cd79519b11318 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1109
|
-
getObject(arg0).close(arg1, getStringFromWasm0(arg2, arg3));
|
|
1110
|
-
}, arguments) };
|
|
1111
|
-
imports.wbg.__wbg_send_1b333b26681a902d = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1112
|
-
getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
|
|
1113
|
-
}, arguments) };
|
|
1114
|
-
imports.wbg.__wbg_setbody_734cb3d7ee8e6e96 = function(arg0, arg1) {
|
|
1115
|
-
getObject(arg0).body = getObject(arg1);
|
|
1116
|
-
};
|
|
1117
|
-
imports.wbg.__wbg_setcredentials_2b67800db3f7b621 = function(arg0, arg1) {
|
|
1118
|
-
getObject(arg0).credentials = ["omit","same-origin","include",][arg1];
|
|
1119
|
-
};
|
|
1120
|
-
imports.wbg.__wbg_setheaders_be10a5ab566fd06f = function(arg0, arg1) {
|
|
1121
|
-
getObject(arg0).headers = getObject(arg1);
|
|
1122
|
-
};
|
|
1123
|
-
imports.wbg.__wbg_setmethod_dc68a742c2db5c6a = function(arg0, arg1, arg2) {
|
|
1124
|
-
getObject(arg0).method = getStringFromWasm0(arg1, arg2);
|
|
1125
|
-
};
|
|
1126
|
-
imports.wbg.__wbg_setmode_a781aae2bd3df202 = function(arg0, arg1) {
|
|
1127
|
-
getObject(arg0).mode = ["same-origin","no-cors","cors","navigate",][arg1];
|
|
1128
|
-
};
|
|
1129
|
-
imports.wbg.__wbg_setsignal_91c4e8ebd04eb935 = function(arg0, arg1) {
|
|
1130
|
-
getObject(arg0).signal = getObject(arg1);
|
|
1131
|
-
};
|
|
1132
|
-
imports.wbg.__wbg_new_e27c93803e1acc42 = function() { return handleError(function () {
|
|
1133
|
-
const ret = new Headers();
|
|
1134
|
-
return addHeapObject(ret);
|
|
1135
|
-
}, arguments) };
|
|
1136
|
-
imports.wbg.__wbg_append_f3a4426bb50622c5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1137
|
-
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1138
|
-
}, arguments) };
|
|
1139
|
-
imports.wbg.__wbg_queueMicrotask_48421b3cc9052b68 = function(arg0) {
|
|
1140
|
-
const ret = getObject(arg0).queueMicrotask;
|
|
1141
|
-
return addHeapObject(ret);
|
|
1142
|
-
};
|
|
1143
|
-
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
1144
|
-
const ret = typeof(getObject(arg0)) === 'function';
|
|
1145
|
-
return ret;
|
|
1146
|
-
};
|
|
1147
|
-
imports.wbg.__wbg_queueMicrotask_12a30234db4045d3 = function(arg0) {
|
|
1148
|
-
queueMicrotask(getObject(arg0));
|
|
1149
|
-
};
|
|
1150
|
-
imports.wbg.__wbg_clearTimeout_76877dbc010e786d = function(arg0) {
|
|
1151
|
-
const ret = clearTimeout(takeObject(arg0));
|
|
1152
|
-
return addHeapObject(ret);
|
|
1153
|
-
};
|
|
1154
|
-
imports.wbg.__wbg_setTimeout_75cb9b6991a4031d = function() { return handleError(function (arg0, arg1) {
|
|
1155
|
-
const ret = setTimeout(getObject(arg0), arg1);
|
|
1156
|
-
return addHeapObject(ret);
|
|
1157
|
-
}, arguments) };
|
|
1158
|
-
imports.wbg.__wbg_performance_a1b8bde2ee512264 = function(arg0) {
|
|
1159
|
-
const ret = getObject(arg0).performance;
|
|
1160
|
-
return addHeapObject(ret);
|
|
1161
|
-
};
|
|
1162
|
-
imports.wbg.__wbg_now_abd80e969af37148 = function(arg0) {
|
|
1163
|
-
const ret = getObject(arg0).now();
|
|
1164
|
-
return ret;
|
|
1165
|
-
};
|
|
1166
|
-
imports.wbg.__wbg_crypto_1d1f22824a6a080c = function(arg0) {
|
|
1167
|
-
const ret = getObject(arg0).crypto;
|
|
1168
|
-
return addHeapObject(ret);
|
|
1169
|
-
};
|
|
1170
|
-
imports.wbg.__wbg_process_4a72847cc503995b = function(arg0) {
|
|
1171
|
-
const ret = getObject(arg0).process;
|
|
1172
|
-
return addHeapObject(ret);
|
|
1173
|
-
};
|
|
1174
|
-
imports.wbg.__wbg_versions_f686565e586dd935 = function(arg0) {
|
|
1175
|
-
const ret = getObject(arg0).versions;
|
|
1176
|
-
return addHeapObject(ret);
|
|
1177
|
-
};
|
|
1178
|
-
imports.wbg.__wbg_node_104a2ff8d6ea03a2 = function(arg0) {
|
|
1179
|
-
const ret = getObject(arg0).node;
|
|
1180
|
-
return addHeapObject(ret);
|
|
1181
|
-
};
|
|
1182
|
-
imports.wbg.__wbg_require_cca90b1a94a0255b = function() { return handleError(function () {
|
|
1183
|
-
const ret = module.require;
|
|
1184
|
-
return addHeapObject(ret);
|
|
1185
|
-
}, arguments) };
|
|
1186
|
-
imports.wbg.__wbg_msCrypto_eb05e62b530a1508 = function(arg0) {
|
|
1187
|
-
const ret = getObject(arg0).msCrypto;
|
|
1188
|
-
return addHeapObject(ret);
|
|
1189
|
-
};
|
|
1190
|
-
imports.wbg.__wbg_randomFillSync_5c9c955aa56b6049 = function() { return handleError(function (arg0, arg1) {
|
|
1191
|
-
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
1192
|
-
}, arguments) };
|
|
1193
|
-
imports.wbg.__wbg_getRandomValues_3aa56aa6edec874c = function() { return handleError(function (arg0, arg1) {
|
|
1194
|
-
getObject(arg0).getRandomValues(getObject(arg1));
|
|
1195
|
-
}, arguments) };
|
|
1196
|
-
imports.wbg.__wbg_new_a220cf903aa02ca2 = function() {
|
|
1197
|
-
const ret = new Array();
|
|
1198
|
-
return addHeapObject(ret);
|
|
1199
|
-
};
|
|
1200
|
-
imports.wbg.__wbg_newnoargs_76313bd6ff35d0f2 = function(arg0, arg1) {
|
|
1201
|
-
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1202
|
-
return addHeapObject(ret);
|
|
1203
|
-
};
|
|
1204
|
-
imports.wbg.__wbg_new_8608a2b51a5f6737 = function() {
|
|
1205
|
-
const ret = new Map();
|
|
1206
|
-
return addHeapObject(ret);
|
|
1207
|
-
};
|
|
1208
|
-
imports.wbg.__wbg_next_de3e9db4440638b2 = function(arg0) {
|
|
1209
|
-
const ret = getObject(arg0).next;
|
|
1210
|
-
return addHeapObject(ret);
|
|
1211
|
-
};
|
|
1212
|
-
imports.wbg.__wbg_next_f9cb570345655b9a = function() { return handleError(function (arg0) {
|
|
1213
|
-
const ret = getObject(arg0).next();
|
|
1214
|
-
return addHeapObject(ret);
|
|
1215
|
-
}, arguments) };
|
|
1216
|
-
imports.wbg.__wbg_done_bfda7aa8f252b39f = function(arg0) {
|
|
1217
|
-
const ret = getObject(arg0).done;
|
|
1218
|
-
return ret;
|
|
1219
|
-
};
|
|
1220
|
-
imports.wbg.__wbg_value_6d39332ab4788d86 = function(arg0) {
|
|
1221
|
-
const ret = getObject(arg0).value;
|
|
1222
|
-
return addHeapObject(ret);
|
|
1223
|
-
};
|
|
1224
|
-
imports.wbg.__wbg_iterator_888179a48810a9fe = function() {
|
|
1225
|
-
const ret = Symbol.iterator;
|
|
1226
|
-
return addHeapObject(ret);
|
|
1227
|
-
};
|
|
1228
|
-
imports.wbg.__wbg_get_224d16597dbbfd96 = function() { return handleError(function (arg0, arg1) {
|
|
1229
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1230
|
-
return addHeapObject(ret);
|
|
1231
|
-
}, arguments) };
|
|
1232
|
-
imports.wbg.__wbg_call_1084a111329e68ce = function() { return handleError(function (arg0, arg1) {
|
|
1233
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
1234
|
-
return addHeapObject(ret);
|
|
1235
|
-
}, arguments) };
|
|
1236
|
-
imports.wbg.__wbg_new_525245e2b9901204 = function() {
|
|
1237
|
-
const ret = new Object();
|
|
1238
|
-
return addHeapObject(ret);
|
|
1239
|
-
};
|
|
1240
|
-
imports.wbg.__wbg_self_3093d5d1f7bcb682 = function() { return handleError(function () {
|
|
1241
|
-
const ret = self.self;
|
|
1242
|
-
return addHeapObject(ret);
|
|
1243
|
-
}, arguments) };
|
|
1244
|
-
imports.wbg.__wbg_window_3bcfc4d31bc012f8 = function() { return handleError(function () {
|
|
1245
|
-
const ret = window.window;
|
|
1246
|
-
return addHeapObject(ret);
|
|
1247
|
-
}, arguments) };
|
|
1248
|
-
imports.wbg.__wbg_globalThis_86b222e13bdf32ed = function() { return handleError(function () {
|
|
1249
|
-
const ret = globalThis.globalThis;
|
|
1250
|
-
return addHeapObject(ret);
|
|
1251
|
-
}, arguments) };
|
|
1252
|
-
imports.wbg.__wbg_global_e5a3fe56f8be9485 = function() { return handleError(function () {
|
|
1253
|
-
const ret = global.global;
|
|
1254
|
-
return addHeapObject(ret);
|
|
1255
|
-
}, arguments) };
|
|
1256
|
-
imports.wbg.__wbg_set_673dda6c73d19609 = function(arg0, arg1, arg2) {
|
|
1257
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
1258
|
-
};
|
|
1259
|
-
imports.wbg.__wbg_call_89af060b4e1523f2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1260
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1261
|
-
return addHeapObject(ret);
|
|
1262
|
-
}, arguments) };
|
|
1263
|
-
imports.wbg.__wbg_set_49185437f0ab06f8 = function(arg0, arg1, arg2) {
|
|
1264
|
-
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
1265
|
-
return addHeapObject(ret);
|
|
1266
|
-
};
|
|
1267
|
-
imports.wbg.__wbg_now_b7a162010a9e75b4 = function() {
|
|
1268
|
-
const ret = Date.now();
|
|
1269
|
-
return ret;
|
|
1270
|
-
};
|
|
1271
|
-
imports.wbg.__wbg_new_b85e72ed1bfd57f9 = function(arg0, arg1) {
|
|
1272
|
-
try {
|
|
1273
|
-
var state0 = {a: arg0, b: arg1};
|
|
1274
|
-
var cb0 = (arg0, arg1) => {
|
|
1275
|
-
const a = state0.a;
|
|
1276
|
-
state0.a = 0;
|
|
1277
|
-
try {
|
|
1278
|
-
return __wbg_adapter_239(a, state0.b, arg0, arg1);
|
|
1279
|
-
} finally {
|
|
1280
|
-
state0.a = a;
|
|
1281
|
-
}
|
|
1282
|
-
};
|
|
1283
|
-
const ret = new Promise(cb0);
|
|
1284
|
-
return addHeapObject(ret);
|
|
1285
|
-
} finally {
|
|
1286
|
-
state0.a = state0.b = 0;
|
|
1287
|
-
}
|
|
1288
|
-
};
|
|
1289
|
-
imports.wbg.__wbg_resolve_570458cb99d56a43 = function(arg0) {
|
|
1290
|
-
const ret = Promise.resolve(getObject(arg0));
|
|
1291
|
-
return addHeapObject(ret);
|
|
1292
|
-
};
|
|
1293
|
-
imports.wbg.__wbg_then_95e6edc0f89b73b1 = function(arg0, arg1) {
|
|
1294
|
-
const ret = getObject(arg0).then(getObject(arg1));
|
|
1295
|
-
return addHeapObject(ret);
|
|
1296
|
-
};
|
|
1297
|
-
imports.wbg.__wbg_then_876bb3c633745cc6 = function(arg0, arg1, arg2) {
|
|
1298
|
-
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
1299
|
-
return addHeapObject(ret);
|
|
1300
|
-
};
|
|
1301
|
-
imports.wbg.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
|
|
1302
|
-
const ret = getObject(arg0).buffer;
|
|
1303
|
-
return addHeapObject(ret);
|
|
1304
|
-
};
|
|
1305
|
-
imports.wbg.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function(arg0, arg1, arg2) {
|
|
1306
|
-
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
1307
|
-
return addHeapObject(ret);
|
|
1308
|
-
};
|
|
1309
|
-
imports.wbg.__wbg_new_ea1883e1e5e86686 = function(arg0) {
|
|
1310
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
1311
|
-
return addHeapObject(ret);
|
|
1312
|
-
};
|
|
1313
|
-
imports.wbg.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
|
|
1314
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1315
|
-
};
|
|
1316
|
-
imports.wbg.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
|
|
1317
|
-
const ret = getObject(arg0).length;
|
|
1318
|
-
return ret;
|
|
1319
|
-
};
|
|
1320
|
-
imports.wbg.__wbg_newwithlength_ec548f448387c968 = function(arg0) {
|
|
1321
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
1322
|
-
return addHeapObject(ret);
|
|
1323
|
-
};
|
|
1324
|
-
imports.wbg.__wbg_subarray_7c2e3576afe181d1 = function(arg0, arg1, arg2) {
|
|
1325
|
-
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1326
|
-
return addHeapObject(ret);
|
|
1327
|
-
};
|
|
1328
|
-
imports.wbg.__wbg_stringify_bbf45426c92a6bf5 = function() { return handleError(function (arg0) {
|
|
1329
|
-
const ret = JSON.stringify(getObject(arg0));
|
|
1330
|
-
return addHeapObject(ret);
|
|
1331
|
-
}, arguments) };
|
|
1332
|
-
imports.wbg.__wbg_has_4bfbc01db38743f7 = function() { return handleError(function (arg0, arg1) {
|
|
1333
|
-
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
1334
|
-
return ret;
|
|
1335
|
-
}, arguments) };
|
|
1336
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
1337
|
-
const ret = debugString(getObject(arg1));
|
|
1338
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1339
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1340
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1341
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1342
|
-
};
|
|
1343
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
1344
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1345
|
-
};
|
|
1346
|
-
imports.wbg.__wbindgen_memory = function() {
|
|
1347
|
-
const ret = wasm.memory;
|
|
1348
|
-
return addHeapObject(ret);
|
|
1349
|
-
};
|
|
1350
|
-
imports.wbg.__wbindgen_uint8_array_new = function(arg0, arg1) {
|
|
1351
|
-
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
1352
|
-
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
1353
|
-
const ret = v0;
|
|
1354
|
-
return addHeapObject(ret);
|
|
1355
|
-
};
|
|
1356
|
-
imports.wbg.__wbindgen_closure_wrapper7391 = function(arg0, arg1, arg2) {
|
|
1357
|
-
const ret = makeMutClosure(arg0, arg1, 2638, __wbg_adapter_34);
|
|
1358
|
-
return addHeapObject(ret);
|
|
1359
|
-
};
|
|
1360
|
-
imports.wbg.__wbindgen_closure_wrapper8074 = function(arg0, arg1, arg2) {
|
|
1361
|
-
const ret = makeMutClosure(arg0, arg1, 2941, __wbg_adapter_37);
|
|
1362
|
-
return addHeapObject(ret);
|
|
1363
|
-
};
|
|
1364
|
-
imports.wbg.__wbindgen_closure_wrapper8075 = function(arg0, arg1, arg2) {
|
|
1365
|
-
const ret = makeMutClosure(arg0, arg1, 2941, __wbg_adapter_37);
|
|
1366
|
-
return addHeapObject(ret);
|
|
1367
|
-
};
|
|
1368
|
-
imports.wbg.__wbindgen_closure_wrapper8076 = function(arg0, arg1, arg2) {
|
|
1369
|
-
const ret = makeMutClosure(arg0, arg1, 2941, __wbg_adapter_37);
|
|
1370
|
-
return addHeapObject(ret);
|
|
1371
|
-
};
|
|
1372
|
-
imports.wbg.__wbindgen_closure_wrapper9904 = function(arg0, arg1, arg2) {
|
|
1373
|
-
const ret = makeMutClosure(arg0, arg1, 3552, __wbg_adapter_44);
|
|
1374
|
-
return addHeapObject(ret);
|
|
1375
|
-
};
|
|
1376
|
-
imports.wbg.__wbindgen_closure_wrapper10017 = function(arg0, arg1, arg2) {
|
|
1377
|
-
const ret = makeMutClosure(arg0, arg1, 3614, __wbg_adapter_47);
|
|
1378
|
-
return addHeapObject(ret);
|
|
1379
|
-
};
|
|
1380
|
-
|
|
1381
|
-
return imports;
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
function __wbg_init_memory(imports, memory) {
|
|
1385
|
-
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
function __wbg_finalize_init(instance, module) {
|
|
1389
|
-
wasm = instance.exports;
|
|
1390
|
-
__wbg_init.__wbindgen_wasm_module = module;
|
|
1391
|
-
cachedDataViewMemory0 = null;
|
|
1392
|
-
cachedUint8ArrayMemory0 = null;
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
return wasm;
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
function initSync(module) {
|
|
1400
|
-
if (wasm !== undefined) return wasm;
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
if (typeof module !== 'undefined' && Object.getPrototypeOf(module) === Object.prototype)
|
|
1404
|
-
({module} = module)
|
|
1405
|
-
else
|
|
1406
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1407
|
-
|
|
1408
|
-
const imports = __wbg_get_imports();
|
|
1409
|
-
|
|
1410
|
-
__wbg_init_memory(imports);
|
|
1411
|
-
|
|
1412
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
1413
|
-
module = new WebAssembly.Module(module);
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
1417
|
-
|
|
1418
|
-
return __wbg_finalize_init(instance, module);
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
async function __wbg_init(module_or_path) {
|
|
1422
|
-
if (wasm !== undefined) return wasm;
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
|
|
1426
|
-
({module_or_path} = module_or_path)
|
|
1427
|
-
else
|
|
1428
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1429
|
-
|
|
1430
|
-
if (typeof module_or_path === 'undefined') {
|
|
1431
|
-
module_or_path = new URL('autonomi_bg.wasm', import.meta.url);
|
|
1432
|
-
}
|
|
1433
|
-
const imports = __wbg_get_imports();
|
|
1434
|
-
|
|
1435
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1436
|
-
module_or_path = fetch(module_or_path);
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
__wbg_init_memory(imports);
|
|
1440
|
-
|
|
1441
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1442
|
-
|
|
1443
|
-
return __wbg_finalize_init(instance, module);
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
export { initSync };
|
|
1447
|
-
export default __wbg_init;
|