saito-wasm 0.0.12 → 0.0.14
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/Cargo.toml +5 -5
- package/package.json +1 -1
- package/pkg/node/index.d.ts +36 -0
- package/pkg/node/index.js +183 -111
- package/pkg/node/index_bg.wasm +0 -0
- package/pkg/node/index_bg.wasm.d.ts +63 -54
- package/pkg/node/package.json +2 -2
- package/pkg/web/index.d.ts +99 -54
- package/pkg/web/index.js +174 -99
- package/pkg/web/index_bg.wasm +0 -0
- package/pkg/web/index_bg.wasm.d.ts +63 -54
- package/pkg/web/package.json +2 -2
- package/index.node.ts +0 -7
- package/index.web.ts +0 -9
package/Cargo.toml
CHANGED
|
@@ -12,12 +12,12 @@ saito-core = { path = "../saito-core" }
|
|
|
12
12
|
wasm-bindgen = { version = "0.2.86" }
|
|
13
13
|
wasm-bindgen-futures = "0.4.36"
|
|
14
14
|
serde = { version = "1.0.163", features = ["derive"] }
|
|
15
|
-
serde-wasm-bindgen = "0.5.0"
|
|
15
|
+
serde-wasm-bindgen = { version = "0.5.0" }
|
|
16
16
|
web-sys = "0.3.63"
|
|
17
17
|
async-trait = "0.1.68"
|
|
18
18
|
hex = "0.4.3"
|
|
19
19
|
tokio = "1.24.2"
|
|
20
|
-
js-sys = "0.3.63"
|
|
20
|
+
js-sys = { version = "0.3.63" }
|
|
21
21
|
lazy_static = "1.4.0"
|
|
22
22
|
console_log = { version = "0.2.2", features = ["color"] }
|
|
23
23
|
log = "0.4.17"
|
|
@@ -26,9 +26,9 @@ rand = { version = "0.8.5", features = ["getrandom"] }
|
|
|
26
26
|
secp256k1 = { version = "0.27.0", features = ["bitcoin_hashes", "global-context", "serde"] }
|
|
27
27
|
base58 = "0.2.0"
|
|
28
28
|
figment = { version = "0.10.8", features = ["json"] }
|
|
29
|
-
serde_json = "1.0.96"
|
|
30
|
-
num-derive = "0.3.3"
|
|
31
|
-
num-traits = "0.2.15"
|
|
29
|
+
serde_json = { version = "1.0.96" }
|
|
30
|
+
num-derive = { version = "0.3.3" }
|
|
31
|
+
num-traits = { version = "0.2.15" }
|
|
32
32
|
wee_alloc = "0.4.5"
|
|
33
33
|
|
|
34
34
|
[package.metadata.wasm-pack.profile.release]
|
package/package.json
CHANGED
package/pkg/node/index.d.ts
CHANGED
|
@@ -217,6 +217,42 @@ export class WasmBlockchain {
|
|
|
217
217
|
* @returns {Promise<string>}
|
|
218
218
|
*/
|
|
219
219
|
get_longest_chain_hash_at(id: bigint): Promise<string>;
|
|
220
|
+
/**
|
|
221
|
+
* @returns {Promise<string>}
|
|
222
|
+
*/
|
|
223
|
+
get_last_block_hash(): Promise<string>;
|
|
224
|
+
/**
|
|
225
|
+
* @returns {Promise<bigint>}
|
|
226
|
+
*/
|
|
227
|
+
get_last_burnfee(): Promise<bigint>;
|
|
228
|
+
/**
|
|
229
|
+
* @returns {Promise<bigint>}
|
|
230
|
+
*/
|
|
231
|
+
get_genesis_block_id(): Promise<bigint>;
|
|
232
|
+
/**
|
|
233
|
+
* @returns {Promise<bigint>}
|
|
234
|
+
*/
|
|
235
|
+
get_genesis_timestamp(): Promise<bigint>;
|
|
236
|
+
/**
|
|
237
|
+
* @returns {Promise<bigint>}
|
|
238
|
+
*/
|
|
239
|
+
get_lowest_acceptable_timestamp(): Promise<bigint>;
|
|
240
|
+
/**
|
|
241
|
+
* @returns {Promise<string>}
|
|
242
|
+
*/
|
|
243
|
+
get_lowest_acceptable_block_hash(): Promise<string>;
|
|
244
|
+
/**
|
|
245
|
+
* @returns {Promise<bigint>}
|
|
246
|
+
*/
|
|
247
|
+
get_lowest_acceptable_block_id(): Promise<bigint>;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
*/
|
|
251
|
+
export class WasmConfiguration {
|
|
252
|
+
free(): void;
|
|
253
|
+
/**
|
|
254
|
+
*/
|
|
255
|
+
constructor();
|
|
220
256
|
}
|
|
221
257
|
/**
|
|
222
258
|
*/
|
package/pkg/node/index.js
CHANGED
|
@@ -2,15 +2,11 @@ let imports = {};
|
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
4
|
const { MsgHandler } = require(String.raw`./snippets/saito-wasm-ab5a63a608170761/js/msg_handler.js`);
|
|
5
|
-
const {
|
|
5
|
+
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
heap.push(undefined, null, true, false);
|
|
10
|
-
|
|
11
|
-
function getObject(idx) { return heap[idx]; }
|
|
7
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
cachedTextDecoder.decode();
|
|
14
10
|
|
|
15
11
|
let cachedUint8Memory0 = null;
|
|
16
12
|
|
|
@@ -21,6 +17,42 @@ function getUint8Memory0() {
|
|
|
21
17
|
return cachedUint8Memory0;
|
|
22
18
|
}
|
|
23
19
|
|
|
20
|
+
function getStringFromWasm0(ptr, len) {
|
|
21
|
+
ptr = ptr >>> 0;
|
|
22
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const heap = new Array(128).fill(undefined);
|
|
26
|
+
|
|
27
|
+
heap.push(undefined, null, true, false);
|
|
28
|
+
|
|
29
|
+
let heap_next = heap.length;
|
|
30
|
+
|
|
31
|
+
function addHeapObject(obj) {
|
|
32
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
33
|
+
const idx = heap_next;
|
|
34
|
+
heap_next = heap[idx];
|
|
35
|
+
|
|
36
|
+
heap[idx] = obj;
|
|
37
|
+
return idx;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getObject(idx) { return heap[idx]; }
|
|
41
|
+
|
|
42
|
+
function dropObject(idx) {
|
|
43
|
+
if (idx < 132) return;
|
|
44
|
+
heap[idx] = heap_next;
|
|
45
|
+
heap_next = idx;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function takeObject(idx) {
|
|
49
|
+
const ret = getObject(idx);
|
|
50
|
+
dropObject(idx);
|
|
51
|
+
return ret;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let WASM_VECTOR_LEN = 0;
|
|
55
|
+
|
|
24
56
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
25
57
|
|
|
26
58
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -87,38 +119,6 @@ function getInt32Memory0() {
|
|
|
87
119
|
return cachedInt32Memory0;
|
|
88
120
|
}
|
|
89
121
|
|
|
90
|
-
let heap_next = heap.length;
|
|
91
|
-
|
|
92
|
-
function dropObject(idx) {
|
|
93
|
-
if (idx < 132) return;
|
|
94
|
-
heap[idx] = heap_next;
|
|
95
|
-
heap_next = idx;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function takeObject(idx) {
|
|
99
|
-
const ret = getObject(idx);
|
|
100
|
-
dropObject(idx);
|
|
101
|
-
return ret;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
105
|
-
|
|
106
|
-
cachedTextDecoder.decode();
|
|
107
|
-
|
|
108
|
-
function getStringFromWasm0(ptr, len) {
|
|
109
|
-
ptr = ptr >>> 0;
|
|
110
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function addHeapObject(obj) {
|
|
114
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
115
|
-
const idx = heap_next;
|
|
116
|
-
heap_next = heap[idx];
|
|
117
|
-
|
|
118
|
-
heap[idx] = obj;
|
|
119
|
-
return idx;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
122
|
let cachedFloat64Memory0 = null;
|
|
123
123
|
|
|
124
124
|
function getFloat64Memory0() {
|
|
@@ -218,9 +218,23 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
218
218
|
return real;
|
|
219
219
|
}
|
|
220
220
|
function __wbg_adapter_40(arg0, arg1, arg2) {
|
|
221
|
-
wasm.
|
|
221
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd42d246e394f3432(arg0, arg1, addHeapObject(arg2));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function _assertClass(instance, klass) {
|
|
225
|
+
if (!(instance instanceof klass)) {
|
|
226
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
227
|
+
}
|
|
228
|
+
return instance.ptr;
|
|
222
229
|
}
|
|
223
230
|
|
|
231
|
+
function handleError(f, args) {
|
|
232
|
+
try {
|
|
233
|
+
return f.apply(this, args);
|
|
234
|
+
} catch (e) {
|
|
235
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
224
238
|
/**
|
|
225
239
|
* @param {string} json
|
|
226
240
|
* @param {string} private_key
|
|
@@ -373,12 +387,6 @@ module.exports.generate_public_key = function(private_key) {
|
|
|
373
387
|
return takeObject(ret);
|
|
374
388
|
};
|
|
375
389
|
|
|
376
|
-
function _assertClass(instance, klass) {
|
|
377
|
-
if (!(instance instanceof klass)) {
|
|
378
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
379
|
-
}
|
|
380
|
-
return instance.ptr;
|
|
381
|
-
}
|
|
382
390
|
/**
|
|
383
391
|
* @param {WasmTransaction} tx
|
|
384
392
|
* @returns {Promise<void>}
|
|
@@ -461,20 +469,12 @@ module.exports.test_buffer_out_async = function() {
|
|
|
461
469
|
return takeObject(ret);
|
|
462
470
|
};
|
|
463
471
|
|
|
464
|
-
function handleError(f, args) {
|
|
465
|
-
try {
|
|
466
|
-
return f.apply(this, args);
|
|
467
|
-
} catch (e) {
|
|
468
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
472
|
function getArrayU8FromWasm0(ptr, len) {
|
|
473
473
|
ptr = ptr >>> 0;
|
|
474
474
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
wasm.
|
|
476
|
+
function __wbg_adapter_274(arg0, arg1, arg2, arg3) {
|
|
477
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h5cc70648b3a77aa5(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
478
478
|
}
|
|
479
479
|
|
|
480
480
|
/**
|
|
@@ -719,10 +719,90 @@ class WasmBlockchain {
|
|
|
719
719
|
const ret = wasm.wasmblockchain_get_longest_chain_hash_at(this.__wbg_ptr, id);
|
|
720
720
|
return takeObject(ret);
|
|
721
721
|
}
|
|
722
|
+
/**
|
|
723
|
+
* @returns {Promise<string>}
|
|
724
|
+
*/
|
|
725
|
+
get_last_block_hash() {
|
|
726
|
+
const ret = wasm.wasmblockchain_get_last_block_hash(this.__wbg_ptr);
|
|
727
|
+
return takeObject(ret);
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* @returns {Promise<bigint>}
|
|
731
|
+
*/
|
|
732
|
+
get_last_burnfee() {
|
|
733
|
+
const ret = wasm.wasmblockchain_get_last_burnfee(this.__wbg_ptr);
|
|
734
|
+
return takeObject(ret);
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* @returns {Promise<bigint>}
|
|
738
|
+
*/
|
|
739
|
+
get_genesis_block_id() {
|
|
740
|
+
const ret = wasm.wasmblockchain_get_genesis_block_id(this.__wbg_ptr);
|
|
741
|
+
return takeObject(ret);
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* @returns {Promise<bigint>}
|
|
745
|
+
*/
|
|
746
|
+
get_genesis_timestamp() {
|
|
747
|
+
const ret = wasm.wasmblockchain_get_genesis_timestamp(this.__wbg_ptr);
|
|
748
|
+
return takeObject(ret);
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* @returns {Promise<bigint>}
|
|
752
|
+
*/
|
|
753
|
+
get_lowest_acceptable_timestamp() {
|
|
754
|
+
const ret = wasm.wasmblockchain_get_lowest_acceptable_timestamp(this.__wbg_ptr);
|
|
755
|
+
return takeObject(ret);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* @returns {Promise<string>}
|
|
759
|
+
*/
|
|
760
|
+
get_lowest_acceptable_block_hash() {
|
|
761
|
+
const ret = wasm.wasmblockchain_get_lowest_acceptable_block_hash(this.__wbg_ptr);
|
|
762
|
+
return takeObject(ret);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* @returns {Promise<bigint>}
|
|
766
|
+
*/
|
|
767
|
+
get_lowest_acceptable_block_id() {
|
|
768
|
+
const ret = wasm.wasmblockchain_get_lowest_acceptable_block_id(this.__wbg_ptr);
|
|
769
|
+
return takeObject(ret);
|
|
770
|
+
}
|
|
722
771
|
}
|
|
723
772
|
module.exports.WasmBlockchain = WasmBlockchain;
|
|
724
773
|
/**
|
|
725
774
|
*/
|
|
775
|
+
class WasmConfiguration {
|
|
776
|
+
|
|
777
|
+
static __wrap(ptr) {
|
|
778
|
+
ptr = ptr >>> 0;
|
|
779
|
+
const obj = Object.create(WasmConfiguration.prototype);
|
|
780
|
+
obj.__wbg_ptr = ptr;
|
|
781
|
+
|
|
782
|
+
return obj;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
__destroy_into_raw() {
|
|
786
|
+
const ptr = this.__wbg_ptr;
|
|
787
|
+
this.__wbg_ptr = 0;
|
|
788
|
+
|
|
789
|
+
return ptr;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
free() {
|
|
793
|
+
const ptr = this.__destroy_into_raw();
|
|
794
|
+
wasm.__wbg_wasmconfiguration_free(ptr);
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
*/
|
|
798
|
+
constructor() {
|
|
799
|
+
const ret = wasm.wasmconfiguration_new();
|
|
800
|
+
return WasmConfiguration.__wrap(ret);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
module.exports.WasmConfiguration = WasmConfiguration;
|
|
804
|
+
/**
|
|
805
|
+
*/
|
|
726
806
|
class WasmPeer {
|
|
727
807
|
|
|
728
808
|
static __wrap(ptr) {
|
|
@@ -1320,6 +1400,40 @@ class WasmWallet {
|
|
|
1320
1400
|
}
|
|
1321
1401
|
module.exports.WasmWallet = WasmWallet;
|
|
1322
1402
|
|
|
1403
|
+
module.exports.__wbg_wasmblockchain_new = function(arg0) {
|
|
1404
|
+
const ret = WasmBlockchain.__wrap(arg0);
|
|
1405
|
+
return addHeapObject(ret);
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
module.exports.__wbg_wasmwallet_new = function(arg0) {
|
|
1409
|
+
const ret = WasmWallet.__wrap(arg0);
|
|
1410
|
+
return addHeapObject(ret);
|
|
1411
|
+
};
|
|
1412
|
+
|
|
1413
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
1414
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1415
|
+
return addHeapObject(ret);
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
module.exports.__wbg_wasmblock_new = function(arg0) {
|
|
1419
|
+
const ret = WasmBlock.__wrap(arg0);
|
|
1420
|
+
return addHeapObject(ret);
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
module.exports.__wbg_wasmtransaction_new = function(arg0) {
|
|
1424
|
+
const ret = WasmTransaction.__wrap(arg0);
|
|
1425
|
+
return addHeapObject(ret);
|
|
1426
|
+
};
|
|
1427
|
+
|
|
1428
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1429
|
+
takeObject(arg0);
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
1433
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1434
|
+
return addHeapObject(ret);
|
|
1435
|
+
};
|
|
1436
|
+
|
|
1323
1437
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
1324
1438
|
const obj = getObject(arg1);
|
|
1325
1439
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -1329,10 +1443,6 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
1329
1443
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1330
1444
|
};
|
|
1331
1445
|
|
|
1332
|
-
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1333
|
-
takeObject(arg0);
|
|
1334
|
-
};
|
|
1335
|
-
|
|
1336
1446
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
1337
1447
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1338
1448
|
return addHeapObject(ret);
|
|
@@ -1343,23 +1453,13 @@ module.exports.__wbg_wasmpeerservice_new = function(arg0) {
|
|
|
1343
1453
|
return addHeapObject(ret);
|
|
1344
1454
|
};
|
|
1345
1455
|
|
|
1346
|
-
module.exports.__wbg_wasmslip_new = function(arg0) {
|
|
1347
|
-
const ret = WasmSlip.__wrap(arg0);
|
|
1348
|
-
return addHeapObject(ret);
|
|
1349
|
-
};
|
|
1350
|
-
|
|
1351
1456
|
module.exports.__wbg_wasmpeer_new = function(arg0) {
|
|
1352
1457
|
const ret = WasmPeer.__wrap(arg0);
|
|
1353
1458
|
return addHeapObject(ret);
|
|
1354
1459
|
};
|
|
1355
1460
|
|
|
1356
|
-
module.exports.
|
|
1357
|
-
const ret =
|
|
1358
|
-
return addHeapObject(ret);
|
|
1359
|
-
};
|
|
1360
|
-
|
|
1361
|
-
module.exports.__wbg_wasmtransaction_new = function(arg0) {
|
|
1362
|
-
const ret = WasmTransaction.__wrap(arg0);
|
|
1461
|
+
module.exports.__wbg_wasmslip_new = function(arg0) {
|
|
1462
|
+
const ret = WasmSlip.__wrap(arg0);
|
|
1363
1463
|
return addHeapObject(ret);
|
|
1364
1464
|
};
|
|
1365
1465
|
|
|
@@ -1379,16 +1479,6 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
|
1379
1479
|
return ret;
|
|
1380
1480
|
};
|
|
1381
1481
|
|
|
1382
|
-
module.exports.__wbg_wasmblock_new = function(arg0) {
|
|
1383
|
-
const ret = WasmBlock.__wrap(arg0);
|
|
1384
|
-
return addHeapObject(ret);
|
|
1385
|
-
};
|
|
1386
|
-
|
|
1387
|
-
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
1388
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
1389
|
-
return addHeapObject(ret);
|
|
1390
|
-
};
|
|
1391
|
-
|
|
1392
1482
|
module.exports.__wbg_sendmessage_2a7cb3960340003f = function(arg0, arg1) {
|
|
1393
1483
|
MsgHandler.send_message(takeObject(arg0), getObject(arg1));
|
|
1394
1484
|
};
|
|
@@ -1520,14 +1610,6 @@ module.exports.__wbg_loadwallet_46802d85c0a99c4d = function() {
|
|
|
1520
1610
|
MsgHandler.load_wallet();
|
|
1521
1611
|
};
|
|
1522
1612
|
|
|
1523
|
-
module.exports.__wbg_saveblockchain_d8b9d6baad01725e = function() {
|
|
1524
|
-
MsgHandler.save_blockchain();
|
|
1525
|
-
};
|
|
1526
|
-
|
|
1527
|
-
module.exports.__wbg_loadblockchain_dc6f8dd1758f25fa = function() {
|
|
1528
|
-
MsgHandler.load_blockchain();
|
|
1529
|
-
};
|
|
1530
|
-
|
|
1531
1613
|
module.exports.__wbg_getmyservices_07cd9026693aca08 = function() {
|
|
1532
1614
|
const ret = MsgHandler.get_my_services();
|
|
1533
1615
|
_assertClass(ret, WasmPeerServiceList);
|
|
@@ -1535,16 +1617,6 @@ module.exports.__wbg_getmyservices_07cd9026693aca08 = function() {
|
|
|
1535
1617
|
return ptr1;
|
|
1536
1618
|
};
|
|
1537
1619
|
|
|
1538
|
-
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
1539
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1540
|
-
return addHeapObject(ret);
|
|
1541
|
-
};
|
|
1542
|
-
|
|
1543
|
-
module.exports.__wbg_wasmwallet_new = function(arg0) {
|
|
1544
|
-
const ret = WasmWallet.__wrap(arg0);
|
|
1545
|
-
return addHeapObject(ret);
|
|
1546
|
-
};
|
|
1547
|
-
|
|
1548
1620
|
module.exports.__wbindgen_is_falsy = function(arg0) {
|
|
1549
1621
|
const ret = !getObject(arg0);
|
|
1550
1622
|
return ret;
|
|
@@ -1608,6 +1680,14 @@ module.exports.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
|
1608
1680
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
1609
1681
|
};
|
|
1610
1682
|
|
|
1683
|
+
module.exports.__wbg_randomFillSync_6894564c2c334c42 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1684
|
+
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
1685
|
+
}, arguments) };
|
|
1686
|
+
|
|
1687
|
+
module.exports.__wbg_getRandomValues_805f1c3d65988a5a = function() { return handleError(function (arg0, arg1) {
|
|
1688
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
1689
|
+
}, arguments) };
|
|
1690
|
+
|
|
1611
1691
|
module.exports.__wbg_crypto_e1d53a1d73fb10b8 = function(arg0) {
|
|
1612
1692
|
const ret = getObject(arg0).crypto;
|
|
1613
1693
|
return addHeapObject(ret);
|
|
@@ -1648,14 +1728,6 @@ module.exports.__wbindgen_is_function = function(arg0) {
|
|
|
1648
1728
|
return ret;
|
|
1649
1729
|
};
|
|
1650
1730
|
|
|
1651
|
-
module.exports.__wbg_getRandomValues_805f1c3d65988a5a = function() { return handleError(function (arg0, arg1) {
|
|
1652
|
-
getObject(arg0).getRandomValues(getObject(arg1));
|
|
1653
|
-
}, arguments) };
|
|
1654
|
-
|
|
1655
|
-
module.exports.__wbg_randomFillSync_6894564c2c334c42 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1656
|
-
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
1657
|
-
}, arguments) };
|
|
1658
|
-
|
|
1659
1731
|
module.exports.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
1660
1732
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
1661
1733
|
return addHeapObject(ret);
|
|
@@ -1778,7 +1850,7 @@ module.exports.__wbg_new_2b55e405e4af4986 = function(arg0, arg1) {
|
|
|
1778
1850
|
const a = state0.a;
|
|
1779
1851
|
state0.a = 0;
|
|
1780
1852
|
try {
|
|
1781
|
-
return
|
|
1853
|
+
return __wbg_adapter_274(a, state0.b, arg0, arg1);
|
|
1782
1854
|
} finally {
|
|
1783
1855
|
state0.a = a;
|
|
1784
1856
|
}
|
|
@@ -1872,8 +1944,8 @@ module.exports.__wbindgen_memory = function() {
|
|
|
1872
1944
|
return addHeapObject(ret);
|
|
1873
1945
|
};
|
|
1874
1946
|
|
|
1875
|
-
module.exports.
|
|
1876
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1947
|
+
module.exports.__wbindgen_closure_wrapper943 = function(arg0, arg1, arg2) {
|
|
1948
|
+
const ret = makeMutClosure(arg0, arg1, 314, __wbg_adapter_40);
|
|
1877
1949
|
return addHeapObject(ret);
|
|
1878
1950
|
};
|
|
1879
1951
|
|
package/pkg/node/index_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,42 +1,28 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function
|
|
5
|
-
export function
|
|
6
|
-
export function
|
|
7
|
-
export function
|
|
8
|
-
export function
|
|
9
|
-
export function
|
|
10
|
-
export function
|
|
11
|
-
export function
|
|
12
|
-
export function
|
|
13
|
-
export function
|
|
14
|
-
export function
|
|
15
|
-
export function
|
|
16
|
-
export function
|
|
17
|
-
export function
|
|
18
|
-
export function
|
|
19
|
-
export function
|
|
20
|
-
export function
|
|
21
|
-
export function
|
|
22
|
-
export function
|
|
23
|
-
export function
|
|
24
|
-
export function
|
|
25
|
-
export function
|
|
26
|
-
export function get_blockchain(): number;
|
|
27
|
-
export function test_buffer_in(a: number): void;
|
|
28
|
-
export function test_buffer_out(): number;
|
|
29
|
-
export function test_buffer_out_async(): number;
|
|
30
|
-
export function __wbg_wasmpeer_free(a: number): void;
|
|
31
|
-
export function wasmpeer_get_public_key(a: number): number;
|
|
32
|
-
export function wasmpeer_get_key_list(a: number): number;
|
|
33
|
-
export function wasmpeer_get_peer_index(a: number): number;
|
|
34
|
-
export function wasmpeer_new(a: number): number;
|
|
35
|
-
export function wasmpeer_get_sync_type(a: number): number;
|
|
36
|
-
export function wasmpeer_get_services(a: number): number;
|
|
37
|
-
export function wasmpeer_set_services(a: number, b: number): void;
|
|
38
|
-
export function wasmpeer_has_service(a: number, b: number): number;
|
|
39
|
-
export function wasmpeer_is_main_peer(a: number): number;
|
|
4
|
+
export function __wbg_wasmblockchain_free(a: number): void;
|
|
5
|
+
export function wasmblockchain_reset(a: number): number;
|
|
6
|
+
export function wasmblockchain_get_last_block_id(a: number): number;
|
|
7
|
+
export function wasmblockchain_get_last_timestamp(a: number): number;
|
|
8
|
+
export function wasmblockchain_get_longest_chain_hash_at(a: number, b: number): number;
|
|
9
|
+
export function wasmblockchain_get_last_block_hash(a: number): number;
|
|
10
|
+
export function wasmblockchain_get_last_burnfee(a: number): number;
|
|
11
|
+
export function wasmblockchain_get_genesis_block_id(a: number): number;
|
|
12
|
+
export function wasmblockchain_get_genesis_timestamp(a: number): number;
|
|
13
|
+
export function wasmblockchain_get_lowest_acceptable_timestamp(a: number): number;
|
|
14
|
+
export function wasmblockchain_get_lowest_acceptable_block_hash(a: number): number;
|
|
15
|
+
export function wasmblockchain_get_lowest_acceptable_block_id(a: number): number;
|
|
16
|
+
export function __wbg_wasmwallet_free(a: number): void;
|
|
17
|
+
export function wasmwallet_save(a: number): number;
|
|
18
|
+
export function wasmwallet_reset(a: number): number;
|
|
19
|
+
export function wasmwallet_load(a: number): number;
|
|
20
|
+
export function wasmwallet_get_public_key(a: number): number;
|
|
21
|
+
export function wasmwallet_set_public_key(a: number, b: number): number;
|
|
22
|
+
export function wasmwallet_get_private_key(a: number): number;
|
|
23
|
+
export function wasmwallet_set_private_key(a: number, b: number): number;
|
|
24
|
+
export function wasmwallet_get_balance(a: number): number;
|
|
25
|
+
export function wasmwallet_get_pending_txs(a: number): number;
|
|
40
26
|
export function __wbg_wasmpeerservicelist_free(a: number): void;
|
|
41
27
|
export function __wbg_wasmpeerservice_free(a: number): void;
|
|
42
28
|
export function wasmpeerservice_new(): number;
|
|
@@ -48,6 +34,16 @@ export function wasmpeerservice_set_domain(a: number, b: number): void;
|
|
|
48
34
|
export function wasmpeerservice_get_domain(a: number): number;
|
|
49
35
|
export function wasmpeerservicelist_push(a: number, b: number): void;
|
|
50
36
|
export function wasmpeerservicelist_new(): number;
|
|
37
|
+
export function __wbg_wasmpeer_free(a: number): void;
|
|
38
|
+
export function wasmpeer_get_public_key(a: number): number;
|
|
39
|
+
export function wasmpeer_get_key_list(a: number): number;
|
|
40
|
+
export function wasmpeer_get_peer_index(a: number): number;
|
|
41
|
+
export function wasmpeer_new(a: number): number;
|
|
42
|
+
export function wasmpeer_get_sync_type(a: number): number;
|
|
43
|
+
export function wasmpeer_get_services(a: number): number;
|
|
44
|
+
export function wasmpeer_set_services(a: number, b: number): void;
|
|
45
|
+
export function wasmpeer_has_service(a: number, b: number): number;
|
|
46
|
+
export function wasmpeer_is_main_peer(a: number): number;
|
|
51
47
|
export function __wbg_wasmslip_free(a: number): void;
|
|
52
48
|
export function wasmslip_amount(a: number): number;
|
|
53
49
|
export function wasmslip_set_amount(a: number, b: number): void;
|
|
@@ -108,21 +104,34 @@ export function wasmblock_serialize(a: number): number;
|
|
|
108
104
|
export function wasmblock_deserialize(a: number, b: number, c: number): void;
|
|
109
105
|
export function wasmblock_has_keylist_txs(a: number, b: number): number;
|
|
110
106
|
export function wasmblock_generate_lite_block(a: number, b: number): number;
|
|
111
|
-
export function
|
|
112
|
-
export function
|
|
113
|
-
export function
|
|
114
|
-
export function
|
|
115
|
-
export function
|
|
116
|
-
export function
|
|
117
|
-
export function
|
|
118
|
-
export function
|
|
119
|
-
export function
|
|
120
|
-
export function
|
|
121
|
-
export function
|
|
122
|
-
export function
|
|
123
|
-
export function
|
|
124
|
-
export function
|
|
125
|
-
export function
|
|
107
|
+
export function __wbg_wasmconfiguration_free(a: number): void;
|
|
108
|
+
export function wasmconfiguration_new(): number;
|
|
109
|
+
export function __wbg_saitowasm_free(a: number): void;
|
|
110
|
+
export function initialize(a: number, b: number): number;
|
|
111
|
+
export function create_transaction(a: number, b: number, c: number, d: number): number;
|
|
112
|
+
export function get_latest_block_hash(): number;
|
|
113
|
+
export function get_block(a: number): number;
|
|
114
|
+
export function process_new_peer(a: number, b: number): number;
|
|
115
|
+
export function process_peer_disconnection(a: number): number;
|
|
116
|
+
export function process_msg_buffer_from_peer(a: number, b: number): number;
|
|
117
|
+
export function process_fetched_block(a: number, b: number, c: number): number;
|
|
118
|
+
export function process_timer_event(a: number): number;
|
|
119
|
+
export function hash(a: number): number;
|
|
120
|
+
export function sign_buffer(a: number, b: number): number;
|
|
121
|
+
export function verify_signature(a: number, b: number, c: number): number;
|
|
122
|
+
export function get_peers(): number;
|
|
123
|
+
export function get_peer(a: number): number;
|
|
124
|
+
export function generate_private_key(): number;
|
|
125
|
+
export function generate_public_key(a: number): number;
|
|
126
|
+
export function propagate_transaction(a: number): number;
|
|
127
|
+
export function send_api_call(a: number, b: number, c: number): number;
|
|
128
|
+
export function send_api_success(a: number, b: number, c: number): number;
|
|
129
|
+
export function send_api_error(a: number, b: number, c: number): number;
|
|
130
|
+
export function get_wallet(): number;
|
|
131
|
+
export function get_blockchain(): number;
|
|
132
|
+
export function test_buffer_in(a: number): void;
|
|
133
|
+
export function test_buffer_out(): number;
|
|
134
|
+
export function test_buffer_out_async(): number;
|
|
126
135
|
export function rustsecp256k1_v0_8_1_context_create(a: number): number;
|
|
127
136
|
export function rustsecp256k1_v0_8_1_context_destroy(a: number): void;
|
|
128
137
|
export function rustsecp256k1_v0_8_1_default_illegal_callback_fn(a: number, b: number): void;
|
|
@@ -130,8 +139,8 @@ export function rustsecp256k1_v0_8_1_default_error_callback_fn(a: number, b: num
|
|
|
130
139
|
export function __wbindgen_malloc(a: number): number;
|
|
131
140
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
132
141
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
133
|
-
export function
|
|
134
|
-
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
142
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd42d246e394f3432(a: number, b: number, c: number): void;
|
|
135
143
|
export function __wbindgen_exn_store(a: number): void;
|
|
136
144
|
export function __wbindgen_free(a: number, b: number): void;
|
|
137
|
-
export function
|
|
145
|
+
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
146
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h5cc70648b3a77aa5(a: number, b: number, c: number, d: number): void;
|