@totemsdk/wots-lease 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,547 @@
1
+ /**
2
+ * @param {number} device_slot
3
+ * @param {string} device_id
4
+ * @returns {any}
5
+ */
6
+ export function allocate_device_range_wasm(device_slot, device_id) {
7
+ const ptr0 = passStringToWasm0(device_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8
+ const len0 = WASM_VECTOR_LEN;
9
+ const ret = wasm.allocate_device_range_wasm(device_slot, ptr0, len0);
10
+ if (ret[2]) {
11
+ throw takeFromExternrefTable0(ret[1]);
12
+ }
13
+ return takeFromExternrefTable0(ret[0]);
14
+ }
15
+
16
+ /**
17
+ * @param {number} address_index
18
+ * @returns {number}
19
+ */
20
+ export function device_slot_for_address_index_wasm(address_index) {
21
+ const ret = wasm.device_slot_for_address_index_wasm(address_index);
22
+ return ret >>> 0;
23
+ }
24
+
25
+ /**
26
+ * @param {number} address_index
27
+ * @param {number} l1
28
+ * @param {number} l2
29
+ * @returns {number}
30
+ */
31
+ export function flat_index_wasm(address_index, l1, l2) {
32
+ const ret = wasm.flat_index_wasm(address_index, l1, l2);
33
+ return ret >>> 0;
34
+ }
35
+
36
+ /**
37
+ * @param {number} flat
38
+ * @returns {any}
39
+ */
40
+ export function from_flat_index_wasm(flat) {
41
+ const ret = wasm.from_flat_index_wasm(flat);
42
+ if (ret[2]) {
43
+ throw takeFromExternrefTable0(ret[1]);
44
+ }
45
+ return takeFromExternrefTable0(ret[0]);
46
+ }
47
+
48
+ /**
49
+ * @returns {number}
50
+ */
51
+ export function get_capacity_per_tree_wasm() {
52
+ const ret = wasm.get_capacity_per_tree_wasm();
53
+ return ret >>> 0;
54
+ }
55
+
56
+ /**
57
+ * @param {any} state_js
58
+ * @param {string} tree_id
59
+ * @returns {any}
60
+ */
61
+ export function get_local_watermark_wasm(state_js, tree_id) {
62
+ const ptr0 = passStringToWasm0(tree_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
63
+ const len0 = WASM_VECTOR_LEN;
64
+ const ret = wasm.get_local_watermark_wasm(state_js, ptr0, len0);
65
+ if (ret[2]) {
66
+ throw takeFromExternrefTable0(ret[1]);
67
+ }
68
+ return takeFromExternrefTable0(ret[0]);
69
+ }
70
+
71
+ /**
72
+ * @param {any} state_js
73
+ * @param {string} tree_id
74
+ * @returns {any}
75
+ */
76
+ export function get_next_indices_wasm(state_js, tree_id) {
77
+ const ptr0 = passStringToWasm0(tree_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
78
+ const len0 = WASM_VECTOR_LEN;
79
+ const ret = wasm.get_next_indices_wasm(state_js, ptr0, len0);
80
+ if (ret[2]) {
81
+ throw takeFromExternrefTable0(ret[1]);
82
+ }
83
+ return takeFromExternrefTable0(ret[0]);
84
+ }
85
+
86
+ export function init() {
87
+ wasm.init();
88
+ }
89
+
90
+ /**
91
+ * @param {any} state_js
92
+ * @param {string} tree_id
93
+ * @param {any} indices_js
94
+ * @returns {boolean}
95
+ */
96
+ export function is_unavailable_wasm(state_js, tree_id, indices_js) {
97
+ const ptr0 = passStringToWasm0(tree_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
98
+ const len0 = WASM_VECTOR_LEN;
99
+ const ret = wasm.is_unavailable_wasm(state_js, ptr0, len0, indices_js);
100
+ if (ret[2]) {
101
+ throw takeFromExternrefTable0(ret[1]);
102
+ }
103
+ return ret[0] !== 0;
104
+ }
105
+
106
+ /**
107
+ * @param {any} state_js
108
+ * @param {string} tree_id
109
+ * @param {any} indices_js
110
+ * @param {string} reason
111
+ * @returns {any}
112
+ */
113
+ export function mark_unavailable_wasm(state_js, tree_id, indices_js, reason) {
114
+ const ptr0 = passStringToWasm0(tree_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
115
+ const len0 = WASM_VECTOR_LEN;
116
+ const ptr1 = passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
117
+ const len1 = WASM_VECTOR_LEN;
118
+ const ret = wasm.mark_unavailable_wasm(state_js, ptr0, len0, indices_js, ptr1, len1);
119
+ if (ret[2]) {
120
+ throw takeFromExternrefTable0(ret[1]);
121
+ }
122
+ return takeFromExternrefTable0(ret[0]);
123
+ }
124
+
125
+ /**
126
+ * @returns {any}
127
+ */
128
+ export function new_watermark_state_wasm() {
129
+ const ret = wasm.new_watermark_state_wasm();
130
+ if (ret[2]) {
131
+ throw takeFromExternrefTable0(ret[1]);
132
+ }
133
+ return takeFromExternrefTable0(ret[0]);
134
+ }
135
+ export function __wbg_Error_92b29b0548f8b746(arg0, arg1) {
136
+ const ret = Error(getStringFromWasm0(arg0, arg1));
137
+ return ret;
138
+ }
139
+ export function __wbg_Number_9a4e0ecb0fa16705(arg0) {
140
+ const ret = Number(arg0);
141
+ return ret;
142
+ }
143
+ export function __wbg_String_8564e559799eccda(arg0, arg1) {
144
+ const ret = String(arg1);
145
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
146
+ const len1 = WASM_VECTOR_LEN;
147
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
148
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
149
+ }
150
+ export function __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f(arg0, arg1) {
151
+ const v = arg1;
152
+ const ret = typeof(v) === 'bigint' ? v : undefined;
153
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
154
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
155
+ }
156
+ export function __wbg___wbindgen_boolean_get_fa956cfa2d1bd751(arg0) {
157
+ const v = arg0;
158
+ const ret = typeof(v) === 'boolean' ? v : undefined;
159
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
160
+ }
161
+ export function __wbg___wbindgen_debug_string_c25d447a39f5578f(arg0, arg1) {
162
+ const ret = debugString(arg1);
163
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
164
+ const len1 = WASM_VECTOR_LEN;
165
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
166
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
167
+ }
168
+ export function __wbg___wbindgen_in_aca499c5de7ff5e5(arg0, arg1) {
169
+ const ret = arg0 in arg1;
170
+ return ret;
171
+ }
172
+ export function __wbg___wbindgen_is_bigint_2f76dc55065b4273(arg0) {
173
+ const ret = typeof(arg0) === 'bigint';
174
+ return ret;
175
+ }
176
+ export function __wbg___wbindgen_is_function_1ff95bcc5517c252(arg0) {
177
+ const ret = typeof(arg0) === 'function';
178
+ return ret;
179
+ }
180
+ export function __wbg___wbindgen_is_object_a27215656b807791(arg0) {
181
+ const val = arg0;
182
+ const ret = typeof(val) === 'object' && val !== null;
183
+ return ret;
184
+ }
185
+ export function __wbg___wbindgen_is_string_ea5e6cc2e4141dfe(arg0) {
186
+ const ret = typeof(arg0) === 'string';
187
+ return ret;
188
+ }
189
+ export function __wbg___wbindgen_is_undefined_c05833b95a3cf397(arg0) {
190
+ const ret = arg0 === undefined;
191
+ return ret;
192
+ }
193
+ export function __wbg___wbindgen_jsval_eq_e659fcf7b0e32763(arg0, arg1) {
194
+ const ret = arg0 === arg1;
195
+ return ret;
196
+ }
197
+ export function __wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170(arg0, arg1) {
198
+ const ret = arg0 == arg1;
199
+ return ret;
200
+ }
201
+ export function __wbg___wbindgen_number_get_394265ed1e1b84ee(arg0, arg1) {
202
+ const obj = arg1;
203
+ const ret = typeof(obj) === 'number' ? obj : undefined;
204
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
205
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
206
+ }
207
+ export function __wbg___wbindgen_string_get_b0ca35b86a603356(arg0, arg1) {
208
+ const obj = arg1;
209
+ const ret = typeof(obj) === 'string' ? obj : undefined;
210
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
211
+ var len1 = WASM_VECTOR_LEN;
212
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
213
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
214
+ }
215
+ export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
216
+ throw new Error(getStringFromWasm0(arg0, arg1));
217
+ }
218
+ export function __wbg_call_8a2dd23819f8a60a() { return handleError(function (arg0, arg1) {
219
+ const ret = arg0.call(arg1);
220
+ return ret;
221
+ }, arguments); }
222
+ export function __wbg_done_89b2b13e91a60321(arg0) {
223
+ const ret = arg0.done;
224
+ return ret;
225
+ }
226
+ export function __wbg_entries_015dc610cd81ede0(arg0) {
227
+ const ret = Object.entries(arg0);
228
+ return ret;
229
+ }
230
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
231
+ let deferred0_0;
232
+ let deferred0_1;
233
+ try {
234
+ deferred0_0 = arg0;
235
+ deferred0_1 = arg1;
236
+ console.error(getStringFromWasm0(arg0, arg1));
237
+ } finally {
238
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
239
+ }
240
+ }
241
+ export function __wbg_get_507a50627bffa49b(arg0, arg1) {
242
+ const ret = arg0[arg1 >>> 0];
243
+ return ret;
244
+ }
245
+ export function __wbg_get_c7eb1f358a7654df() { return handleError(function (arg0, arg1) {
246
+ const ret = Reflect.get(arg0, arg1);
247
+ return ret;
248
+ }, arguments); }
249
+ export function __wbg_get_unchecked_6e0ad6d2a41b06f6(arg0, arg1) {
250
+ const ret = arg0[arg1 >>> 0];
251
+ return ret;
252
+ }
253
+ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
254
+ const ret = arg0[arg1];
255
+ return ret;
256
+ }
257
+ export function __wbg_instanceof_ArrayBuffer_4480b9e0068a8adb(arg0) {
258
+ let result;
259
+ try {
260
+ result = arg0 instanceof ArrayBuffer;
261
+ } catch (_) {
262
+ result = false;
263
+ }
264
+ const ret = result;
265
+ return ret;
266
+ }
267
+ export function __wbg_instanceof_Uint8Array_309b927aaf7a3fc7(arg0) {
268
+ let result;
269
+ try {
270
+ result = arg0 instanceof Uint8Array;
271
+ } catch (_) {
272
+ result = false;
273
+ }
274
+ const ret = result;
275
+ return ret;
276
+ }
277
+ export function __wbg_isSafeInteger_04f36e4056f1b851(arg0) {
278
+ const ret = Number.isSafeInteger(arg0);
279
+ return ret;
280
+ }
281
+ export function __wbg_iterator_6f722e4a93058b71() {
282
+ const ret = Symbol.iterator;
283
+ return ret;
284
+ }
285
+ export function __wbg_length_1f0964f4a5e2c6d8(arg0) {
286
+ const ret = arg0.length;
287
+ return ret;
288
+ }
289
+ export function __wbg_length_370319915dc99107(arg0) {
290
+ const ret = arg0.length;
291
+ return ret;
292
+ }
293
+ export function __wbg_new_227d7c05414eb861() {
294
+ const ret = new Error();
295
+ return ret;
296
+ }
297
+ export function __wbg_new_7796ffc7ed656783() {
298
+ const ret = new Map();
299
+ return ret;
300
+ }
301
+ export function __wbg_new_cd45aabdf6073e84(arg0) {
302
+ const ret = new Uint8Array(arg0);
303
+ return ret;
304
+ }
305
+ export function __wbg_new_da52cf8fe3429cb2() {
306
+ const ret = new Object();
307
+ return ret;
308
+ }
309
+ export function __wbg_next_6dbf2c0ac8cde20f(arg0) {
310
+ const ret = arg0.next;
311
+ return ret;
312
+ }
313
+ export function __wbg_next_71f2aa1cb3d1e37e() { return handleError(function (arg0) {
314
+ const ret = arg0.next();
315
+ return ret;
316
+ }, arguments); }
317
+ export function __wbg_prototypesetcall_4770620bbe4688a0(arg0, arg1, arg2) {
318
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
319
+ }
320
+ export function __wbg_set_575dd786d51585f8(arg0, arg1, arg2) {
321
+ const ret = arg0.set(arg1, arg2);
322
+ return ret;
323
+ }
324
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
325
+ arg0[arg1] = arg2;
326
+ }
327
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
328
+ const ret = arg1.stack;
329
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
330
+ const len1 = WASM_VECTOR_LEN;
331
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
332
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
333
+ }
334
+ export function __wbg_value_a5d5488a9589444a(arg0) {
335
+ const ret = arg0.value;
336
+ return ret;
337
+ }
338
+ export function __wbindgen_cast_0000000000000001(arg0) {
339
+ // Cast intrinsic for `F64 -> Externref`.
340
+ const ret = arg0;
341
+ return ret;
342
+ }
343
+ export function __wbindgen_cast_0000000000000002(arg0, arg1) {
344
+ // Cast intrinsic for `Ref(String) -> Externref`.
345
+ const ret = getStringFromWasm0(arg0, arg1);
346
+ return ret;
347
+ }
348
+ export function __wbindgen_cast_0000000000000003(arg0) {
349
+ // Cast intrinsic for `U64 -> Externref`.
350
+ const ret = BigInt.asUintN(64, arg0);
351
+ return ret;
352
+ }
353
+ export function __wbindgen_init_externref_table() {
354
+ const table = wasm.__wbindgen_externrefs;
355
+ const offset = table.grow(4);
356
+ table.set(0, undefined);
357
+ table.set(offset + 0, undefined);
358
+ table.set(offset + 1, null);
359
+ table.set(offset + 2, true);
360
+ table.set(offset + 3, false);
361
+ }
362
+ function addToExternrefTable0(obj) {
363
+ const idx = wasm.__externref_table_alloc();
364
+ wasm.__wbindgen_externrefs.set(idx, obj);
365
+ return idx;
366
+ }
367
+
368
+ function debugString(val) {
369
+ // primitive types
370
+ const type = typeof val;
371
+ if (type == 'number' || type == 'boolean' || val == null) {
372
+ return `${val}`;
373
+ }
374
+ if (type == 'string') {
375
+ return `"${val}"`;
376
+ }
377
+ if (type == 'symbol') {
378
+ const description = val.description;
379
+ if (description == null) {
380
+ return 'Symbol';
381
+ } else {
382
+ return `Symbol(${description})`;
383
+ }
384
+ }
385
+ if (type == 'function') {
386
+ const name = val.name;
387
+ if (typeof name == 'string' && name.length > 0) {
388
+ return `Function(${name})`;
389
+ } else {
390
+ return 'Function';
391
+ }
392
+ }
393
+ // objects
394
+ if (Array.isArray(val)) {
395
+ const length = val.length;
396
+ let debug = '[';
397
+ if (length > 0) {
398
+ debug += debugString(val[0]);
399
+ }
400
+ for(let i = 1; i < length; i++) {
401
+ debug += ', ' + debugString(val[i]);
402
+ }
403
+ debug += ']';
404
+ return debug;
405
+ }
406
+ // Test for built-in
407
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
408
+ let className;
409
+ if (builtInMatches && builtInMatches.length > 1) {
410
+ className = builtInMatches[1];
411
+ } else {
412
+ // Failed to match the standard '[object ClassName]'
413
+ return toString.call(val);
414
+ }
415
+ if (className == 'Object') {
416
+ // we're a user defined class or Object
417
+ // JSON.stringify avoids problems with cycles, and is generally much
418
+ // easier than looping through ownProperties of `val`.
419
+ try {
420
+ return 'Object(' + JSON.stringify(val) + ')';
421
+ } catch (_) {
422
+ return 'Object';
423
+ }
424
+ }
425
+ // errors
426
+ if (val instanceof Error) {
427
+ return `${val.name}: ${val.message}\n${val.stack}`;
428
+ }
429
+ // TODO we could test for more things here, like `Set`s and `Map`s.
430
+ return className;
431
+ }
432
+
433
+ function getArrayU8FromWasm0(ptr, len) {
434
+ ptr = ptr >>> 0;
435
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
436
+ }
437
+
438
+ let cachedDataViewMemory0 = null;
439
+ function getDataViewMemory0() {
440
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
441
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
442
+ }
443
+ return cachedDataViewMemory0;
444
+ }
445
+
446
+ function getStringFromWasm0(ptr, len) {
447
+ return decodeText(ptr >>> 0, len);
448
+ }
449
+
450
+ let cachedUint8ArrayMemory0 = null;
451
+ function getUint8ArrayMemory0() {
452
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
453
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
454
+ }
455
+ return cachedUint8ArrayMemory0;
456
+ }
457
+
458
+ function handleError(f, args) {
459
+ try {
460
+ return f.apply(this, args);
461
+ } catch (e) {
462
+ const idx = addToExternrefTable0(e);
463
+ wasm.__wbindgen_exn_store(idx);
464
+ }
465
+ }
466
+
467
+ function isLikeNone(x) {
468
+ return x === undefined || x === null;
469
+ }
470
+
471
+ function passStringToWasm0(arg, malloc, realloc) {
472
+ if (realloc === undefined) {
473
+ const buf = cachedTextEncoder.encode(arg);
474
+ const ptr = malloc(buf.length, 1) >>> 0;
475
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
476
+ WASM_VECTOR_LEN = buf.length;
477
+ return ptr;
478
+ }
479
+
480
+ let len = arg.length;
481
+ let ptr = malloc(len, 1) >>> 0;
482
+
483
+ const mem = getUint8ArrayMemory0();
484
+
485
+ let offset = 0;
486
+
487
+ for (; offset < len; offset++) {
488
+ const code = arg.charCodeAt(offset);
489
+ if (code > 0x7F) break;
490
+ mem[ptr + offset] = code;
491
+ }
492
+ if (offset !== len) {
493
+ if (offset !== 0) {
494
+ arg = arg.slice(offset);
495
+ }
496
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
497
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
498
+ const ret = cachedTextEncoder.encodeInto(arg, view);
499
+
500
+ offset += ret.written;
501
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
502
+ }
503
+
504
+ WASM_VECTOR_LEN = offset;
505
+ return ptr;
506
+ }
507
+
508
+ function takeFromExternrefTable0(idx) {
509
+ const value = wasm.__wbindgen_externrefs.get(idx);
510
+ wasm.__externref_table_dealloc(idx);
511
+ return value;
512
+ }
513
+
514
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
515
+ cachedTextDecoder.decode();
516
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
517
+ let numBytesDecoded = 0;
518
+ function decodeText(ptr, len) {
519
+ numBytesDecoded += len;
520
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
521
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
522
+ cachedTextDecoder.decode();
523
+ numBytesDecoded = len;
524
+ }
525
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
526
+ }
527
+
528
+ const cachedTextEncoder = new TextEncoder();
529
+
530
+ if (!('encodeInto' in cachedTextEncoder)) {
531
+ cachedTextEncoder.encodeInto = function (arg, view) {
532
+ const buf = cachedTextEncoder.encode(arg);
533
+ view.set(buf);
534
+ return {
535
+ read: arg.length,
536
+ written: buf.length
537
+ };
538
+ };
539
+ }
540
+
541
+ let WASM_VECTOR_LEN = 0;
542
+
543
+
544
+ let wasm;
545
+ export function __wbg_set_wasm(val) {
546
+ wasm = val;
547
+ }
Binary file
@@ -0,0 +1,22 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const allocate_device_range_wasm: (a: number, b: number, c: number) => [number, number, number];
5
+ export const device_slot_for_address_index_wasm: (a: number) => number;
6
+ export const flat_index_wasm: (a: number, b: number, c: number) => number;
7
+ export const from_flat_index_wasm: (a: number) => [number, number, number];
8
+ export const get_capacity_per_tree_wasm: () => number;
9
+ export const get_local_watermark_wasm: (a: any, b: number, c: number) => [number, number, number];
10
+ export const get_next_indices_wasm: (a: any, b: number, c: number) => [number, number, number];
11
+ export const init: () => void;
12
+ export const is_unavailable_wasm: (a: any, b: number, c: number, d: any) => [number, number, number];
13
+ export const mark_unavailable_wasm: (a: any, b: number, c: number, d: any, e: number, f: number) => [number, number, number];
14
+ export const new_watermark_state_wasm: () => [number, number, number];
15
+ export const __wbindgen_malloc: (a: number, b: number) => number;
16
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
17
+ export const __wbindgen_exn_store: (a: number) => void;
18
+ export const __externref_table_alloc: () => number;
19
+ export const __wbindgen_externrefs: WebAssembly.Table;
20
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
21
+ export const __externref_table_dealloc: (a: number) => void;
22
+ export const __wbindgen_start: () => void;
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "wots-lease-wasm",
3
+ "collaborators": [
4
+ "Totem SDK Contributors"
5
+ ],
6
+ "description": "WOTS key-use coordination — canonical v3 watermark, flat index computation, monotonicity enforcement, device keyspace partitioning (Rust/WASM)",
7
+ "version": "0.1.0",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/totem-sdk/totem-sdk"
12
+ },
13
+ "files": [
14
+ "wots_lease_wasm_bg.wasm",
15
+ "wots_lease_wasm.js",
16
+ "wots_lease_wasm.d.ts"
17
+ ],
18
+ "main": "wots_lease_wasm.js",
19
+ "homepage": "https://totem.ing",
20
+ "types": "wots_lease_wasm.d.ts"
21
+ }
@@ -0,0 +1,24 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function allocate_device_range_wasm(device_slot: number, device_id: string): any;
5
+
6
+ export function device_slot_for_address_index_wasm(address_index: number): number;
7
+
8
+ export function flat_index_wasm(address_index: number, l1: number, l2: number): number;
9
+
10
+ export function from_flat_index_wasm(flat: number): any;
11
+
12
+ export function get_capacity_per_tree_wasm(): number;
13
+
14
+ export function get_local_watermark_wasm(state_js: any, tree_id: string): any;
15
+
16
+ export function get_next_indices_wasm(state_js: any, tree_id: string): any;
17
+
18
+ export function init(): void;
19
+
20
+ export function is_unavailable_wasm(state_js: any, tree_id: string, indices_js: any): boolean;
21
+
22
+ export function mark_unavailable_wasm(state_js: any, tree_id: string, indices_js: any, reason: string): any;
23
+
24
+ export function new_watermark_state_wasm(): any;