saito-wasm 0.1.8 → 0.1.9
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 +1 -1
- package/package.json +1 -1
- package/pkg/node/index.js +48 -44
- package/pkg/node/index_bg.wasm +0 -0
- package/pkg/node/index_bg.wasm.d.ts +18 -18
- package/pkg/node/package.json +3 -3
- package/pkg/node/snippets/saito-wasm-5b3c4a602f544c28/js/msg_handler.js +97 -0
- package/pkg/web/index.d.ts +18 -18
- package/pkg/web/index.js +44 -41
- package/pkg/web/index_bg.wasm +0 -0
- package/pkg/web/index_bg.wasm.d.ts +18 -18
- package/pkg/web/package.json +3 -3
- package/pkg/web/snippets/saito-wasm-5b3c4a602f544c28/js/msg_handler.js +97 -0
- package/pkg/node/snippets/saito-wasm-a75e30037217955a/js/msg_handler.js +0 -93
- package/pkg/web/snippets/saito-wasm-a75e30037217955a/js/msg_handler.js +0 -93
package/Cargo.toml
CHANGED
package/package.json
CHANGED
package/pkg/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let imports = {};
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
|
-
const { MsgHandler } = require(String.raw`./snippets/saito-wasm-
|
|
4
|
+
const { MsgHandler } = require(String.raw`./snippets/saito-wasm-5b3c4a602f544c28/js/msg_handler.js`);
|
|
5
5
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
7
|
const heap = new Array(128).fill(undefined);
|
|
@@ -488,7 +488,7 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
488
488
|
ptr = ptr >>> 0;
|
|
489
489
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function __wbg_adapter_304(arg0, arg1, arg2, arg3) {
|
|
492
492
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4a288e6ecccb986f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
493
493
|
}
|
|
494
494
|
|
|
@@ -1639,18 +1639,18 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
1639
1639
|
takeObject(arg0);
|
|
1640
1640
|
};
|
|
1641
1641
|
|
|
1642
|
-
module.exports.
|
|
1643
|
-
const ret =
|
|
1642
|
+
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
1643
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1644
1644
|
return addHeapObject(ret);
|
|
1645
1645
|
};
|
|
1646
1646
|
|
|
1647
|
-
module.exports.
|
|
1648
|
-
const ret =
|
|
1647
|
+
module.exports.__wbg_wasmtransaction_new = function(arg0) {
|
|
1648
|
+
const ret = WasmTransaction.__wrap(arg0);
|
|
1649
1649
|
return addHeapObject(ret);
|
|
1650
1650
|
};
|
|
1651
1651
|
|
|
1652
|
-
module.exports.
|
|
1653
|
-
const ret =
|
|
1652
|
+
module.exports.__wbg_wasmpeer_new = function(arg0) {
|
|
1653
|
+
const ret = WasmPeer.__wrap(arg0);
|
|
1654
1654
|
return addHeapObject(ret);
|
|
1655
1655
|
};
|
|
1656
1656
|
|
|
@@ -1664,21 +1664,6 @@ module.exports.__wbg_wasmblock_new = function(arg0) {
|
|
|
1664
1664
|
return addHeapObject(ret);
|
|
1665
1665
|
};
|
|
1666
1666
|
|
|
1667
|
-
module.exports.__wbg_wasmslip_new = function(arg0) {
|
|
1668
|
-
const ret = WasmSlip.__wrap(arg0);
|
|
1669
|
-
return addHeapObject(ret);
|
|
1670
|
-
};
|
|
1671
|
-
|
|
1672
|
-
module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
|
|
1673
|
-
const ret = WasmBalanceSnapshot.__wrap(arg0);
|
|
1674
|
-
return addHeapObject(ret);
|
|
1675
|
-
};
|
|
1676
|
-
|
|
1677
|
-
module.exports.__wbg_wasmpeer_new = function(arg0) {
|
|
1678
|
-
const ret = WasmPeer.__wrap(arg0);
|
|
1679
|
-
return addHeapObject(ret);
|
|
1680
|
-
};
|
|
1681
|
-
|
|
1682
1667
|
module.exports.__wbindgen_is_falsy = function(arg0) {
|
|
1683
1668
|
const ret = !getObject(arg0);
|
|
1684
1669
|
return ret;
|
|
@@ -1693,6 +1678,16 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
1693
1678
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1694
1679
|
};
|
|
1695
1680
|
|
|
1681
|
+
module.exports.__wbg_wasmslip_new = function(arg0) {
|
|
1682
|
+
const ret = WasmSlip.__wrap(arg0);
|
|
1683
|
+
return addHeapObject(ret);
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
module.exports.__wbg_wasmwalletslip_new = function(arg0) {
|
|
1687
|
+
const ret = WasmWalletSlip.__wrap(arg0);
|
|
1688
|
+
return addHeapObject(ret);
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1696
1691
|
module.exports.__wbg_wasmwallet_new = function(arg0) {
|
|
1697
1692
|
const ret = WasmWallet.__wrap(arg0);
|
|
1698
1693
|
return addHeapObject(ret);
|
|
@@ -1703,6 +1698,11 @@ module.exports.__wbg_wasmblockchain_new = function(arg0) {
|
|
|
1703
1698
|
return addHeapObject(ret);
|
|
1704
1699
|
};
|
|
1705
1700
|
|
|
1701
|
+
module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
|
|
1702
|
+
const ret = WasmBalanceSnapshot.__wrap(arg0);
|
|
1703
|
+
return addHeapObject(ret);
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
1706
|
module.exports.__wbg_wasmpeerservice_new = function(arg0) {
|
|
1707
1707
|
const ret = WasmPeerService.__wrap(arg0);
|
|
1708
1708
|
return addHeapObject(ret);
|
|
@@ -1729,25 +1729,25 @@ module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
|
1729
1729
|
return addHeapObject(ret);
|
|
1730
1730
|
};
|
|
1731
1731
|
|
|
1732
|
-
module.exports.
|
|
1732
|
+
module.exports.__wbg_sendmessage_f7b5e2432ecc321b = function(arg0, arg1) {
|
|
1733
1733
|
MsgHandler.send_message(takeObject(arg0), getObject(arg1));
|
|
1734
1734
|
};
|
|
1735
1735
|
|
|
1736
|
-
module.exports.
|
|
1736
|
+
module.exports.__wbg_sendmessagetoall_36fafd2ed11a8f9d = function(arg0, arg1) {
|
|
1737
1737
|
MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
|
|
1738
1738
|
};
|
|
1739
1739
|
|
|
1740
|
-
module.exports.
|
|
1740
|
+
module.exports.__wbg_connecttopeer_98a6a25481bff60a = function() { return handleError(function (arg0) {
|
|
1741
1741
|
const ret = MsgHandler.connect_to_peer(takeObject(arg0));
|
|
1742
1742
|
return addHeapObject(ret);
|
|
1743
1743
|
}, arguments) };
|
|
1744
1744
|
|
|
1745
|
-
module.exports.
|
|
1745
|
+
module.exports.__wbg_disconnectfrompeer_a7a11ba69586e7ef = function() { return handleError(function (arg0) {
|
|
1746
1746
|
const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
|
|
1747
1747
|
return addHeapObject(ret);
|
|
1748
1748
|
}, arguments) };
|
|
1749
1749
|
|
|
1750
|
-
module.exports.
|
|
1750
|
+
module.exports.__wbg_fetchblockfrompeer_dcb41b4c5d746667 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1751
1751
|
let deferred0_0;
|
|
1752
1752
|
let deferred0_1;
|
|
1753
1753
|
try {
|
|
@@ -1760,7 +1760,7 @@ module.exports.__wbg_fetchblockfrompeer_12ff531c1b29ede5 = function() { return h
|
|
|
1760
1760
|
}
|
|
1761
1761
|
}, arguments) };
|
|
1762
1762
|
|
|
1763
|
-
module.exports.
|
|
1763
|
+
module.exports.__wbg_writevalue_06a83d2abeac7dcf = function(arg0, arg1, arg2) {
|
|
1764
1764
|
let deferred0_0;
|
|
1765
1765
|
let deferred0_1;
|
|
1766
1766
|
try {
|
|
@@ -1772,7 +1772,7 @@ module.exports.__wbg_writevalue_cd72d643a8bf35a9 = function(arg0, arg1, arg2) {
|
|
|
1772
1772
|
}
|
|
1773
1773
|
};
|
|
1774
1774
|
|
|
1775
|
-
module.exports.
|
|
1775
|
+
module.exports.__wbg_readvalue_3fbda1defcd595bc = function() { return handleError(function (arg0, arg1) {
|
|
1776
1776
|
let deferred0_0;
|
|
1777
1777
|
let deferred0_1;
|
|
1778
1778
|
try {
|
|
@@ -1785,12 +1785,12 @@ module.exports.__wbg_readvalue_8b947c29e8838490 = function() { return handleErro
|
|
|
1785
1785
|
}
|
|
1786
1786
|
}, arguments) };
|
|
1787
1787
|
|
|
1788
|
-
module.exports.
|
|
1788
|
+
module.exports.__wbg_loadblockfilelist_bdb3c04d91771a7f = function() { return handleError(function () {
|
|
1789
1789
|
const ret = MsgHandler.load_block_file_list();
|
|
1790
1790
|
return addHeapObject(ret);
|
|
1791
1791
|
}, arguments) };
|
|
1792
1792
|
|
|
1793
|
-
module.exports.
|
|
1793
|
+
module.exports.__wbg_isexistingfile_498f00d1b89afd50 = function() { return handleError(function (arg0, arg1) {
|
|
1794
1794
|
let deferred0_0;
|
|
1795
1795
|
let deferred0_1;
|
|
1796
1796
|
try {
|
|
@@ -1803,7 +1803,7 @@ module.exports.__wbg_isexistingfile_b8f92bb7e94f75be = function() { return handl
|
|
|
1803
1803
|
}
|
|
1804
1804
|
}, arguments) };
|
|
1805
1805
|
|
|
1806
|
-
module.exports.
|
|
1806
|
+
module.exports.__wbg_removevalue_e066054eb1657099 = function() { return handleError(function (arg0, arg1) {
|
|
1807
1807
|
let deferred0_0;
|
|
1808
1808
|
let deferred0_1;
|
|
1809
1809
|
try {
|
|
@@ -1816,19 +1816,19 @@ module.exports.__wbg_removevalue_3733f8ebd341e93d = function() { return handleEr
|
|
|
1816
1816
|
}
|
|
1817
1817
|
}, arguments) };
|
|
1818
1818
|
|
|
1819
|
-
module.exports.
|
|
1819
|
+
module.exports.__wbg_processapicall_13c70522e31b16c4 = function(arg0, arg1, arg2) {
|
|
1820
1820
|
MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1821
1821
|
};
|
|
1822
1822
|
|
|
1823
|
-
module.exports.
|
|
1823
|
+
module.exports.__wbg_processapisuccess_30d85a940ef0a6ea = function(arg0, arg1, arg2) {
|
|
1824
1824
|
MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1825
1825
|
};
|
|
1826
1826
|
|
|
1827
|
-
module.exports.
|
|
1827
|
+
module.exports.__wbg_processapierror_0dca0ed72df429a1 = function(arg0, arg1, arg2) {
|
|
1828
1828
|
MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1829
1829
|
};
|
|
1830
1830
|
|
|
1831
|
-
module.exports.
|
|
1831
|
+
module.exports.__wbg_sendinterfaceevent_ab8f5523671d6685 = function(arg0, arg1, arg2) {
|
|
1832
1832
|
let deferred0_0;
|
|
1833
1833
|
let deferred0_1;
|
|
1834
1834
|
try {
|
|
@@ -1840,7 +1840,7 @@ module.exports.__wbg_sendinterfaceevent_10b8415cc087e87c = function(arg0, arg1,
|
|
|
1840
1840
|
}
|
|
1841
1841
|
};
|
|
1842
1842
|
|
|
1843
|
-
module.exports.
|
|
1843
|
+
module.exports.__wbg_sendblocksuccess_9286c520f7163de6 = function(arg0, arg1, arg2) {
|
|
1844
1844
|
let deferred0_0;
|
|
1845
1845
|
let deferred0_1;
|
|
1846
1846
|
try {
|
|
@@ -1852,15 +1852,19 @@ module.exports.__wbg_sendblocksuccess_fac8865c525186cd = function(arg0, arg1, ar
|
|
|
1852
1852
|
}
|
|
1853
1853
|
};
|
|
1854
1854
|
|
|
1855
|
-
module.exports.
|
|
1855
|
+
module.exports.__wbg_sendwalletupdate_f3403d32e113e313 = function() {
|
|
1856
|
+
MsgHandler.send_wallet_update();
|
|
1857
|
+
};
|
|
1858
|
+
|
|
1859
|
+
module.exports.__wbg_savewallet_4fc39122d40d7a80 = function() {
|
|
1856
1860
|
MsgHandler.save_wallet();
|
|
1857
1861
|
};
|
|
1858
1862
|
|
|
1859
|
-
module.exports.
|
|
1863
|
+
module.exports.__wbg_loadwallet_0777b2b933199c2b = function() {
|
|
1860
1864
|
MsgHandler.load_wallet();
|
|
1861
1865
|
};
|
|
1862
1866
|
|
|
1863
|
-
module.exports.
|
|
1867
|
+
module.exports.__wbg_getmyservices_053c9092365ef0b1 = function() {
|
|
1864
1868
|
const ret = MsgHandler.get_my_services();
|
|
1865
1869
|
_assertClass(ret, WasmPeerServiceList);
|
|
1866
1870
|
var ptr1 = ret.__destroy_into_raw();
|
|
@@ -2095,7 +2099,7 @@ module.exports.__wbg_new_2b55e405e4af4986 = function(arg0, arg1) {
|
|
|
2095
2099
|
const a = state0.a;
|
|
2096
2100
|
state0.a = 0;
|
|
2097
2101
|
try {
|
|
2098
|
-
return
|
|
2102
|
+
return __wbg_adapter_304(a, state0.b, arg0, arg1);
|
|
2099
2103
|
} finally {
|
|
2100
2104
|
state0.a = a;
|
|
2101
2105
|
}
|
|
@@ -2189,8 +2193,8 @@ module.exports.__wbindgen_memory = function() {
|
|
|
2189
2193
|
return addHeapObject(ret);
|
|
2190
2194
|
};
|
|
2191
2195
|
|
|
2192
|
-
module.exports.
|
|
2193
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2196
|
+
module.exports.__wbindgen_closure_wrapper1008 = function(arg0, arg1, arg2) {
|
|
2197
|
+
const ret = makeMutClosure(arg0, arg1, 334, __wbg_adapter_40);
|
|
2194
2198
|
return addHeapObject(ret);
|
|
2195
2199
|
};
|
|
2196
2200
|
|
package/pkg/node/index_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function __wbg_wasmbalancesnapshot_free(a: number): void;
|
|
5
|
-
export function wasmbalancesnapshot_get_file_name(a: number): number;
|
|
6
|
-
export function wasmbalancesnapshot_get_entries(a: number): number;
|
|
7
|
-
export function wasmbalancesnapshot_from_string(a: number, b: number): void;
|
|
8
|
-
export function wasmbalancesnapshot_to_string(a: number): number;
|
|
9
4
|
export function __wbg_wasmpeer_free(a: number): void;
|
|
10
5
|
export function wasmpeer_get_public_key(a: number): number;
|
|
11
6
|
export function wasmpeer_get_key_list(a: number): number;
|
|
@@ -16,19 +11,6 @@ export function wasmpeer_get_services(a: number): number;
|
|
|
16
11
|
export function wasmpeer_set_services(a: number, b: number): void;
|
|
17
12
|
export function wasmpeer_has_service(a: number, b: number): number;
|
|
18
13
|
export function wasmpeer_is_main_peer(a: number): number;
|
|
19
|
-
export function __wbg_wasmpeerservicelist_free(a: number): void;
|
|
20
|
-
export function __wbg_wasmpeerservice_free(a: number): void;
|
|
21
|
-
export function wasmpeerservice_new(): number;
|
|
22
|
-
export function wasmpeerservice_set_service(a: number, b: number): void;
|
|
23
|
-
export function wasmpeerservice_get_service(a: number): number;
|
|
24
|
-
export function wasmpeerservice_set_name(a: number, b: number): void;
|
|
25
|
-
export function wasmpeerservice_get_name(a: number): number;
|
|
26
|
-
export function wasmpeerservice_set_domain(a: number, b: number): void;
|
|
27
|
-
export function wasmpeerservice_get_domain(a: number): number;
|
|
28
|
-
export function wasmpeerservicelist_push(a: number, b: number): void;
|
|
29
|
-
export function wasmpeerservicelist_new(): number;
|
|
30
|
-
export function __wbg_wasmconfiguration_free(a: number): void;
|
|
31
|
-
export function wasmconfiguration_new(): number;
|
|
32
14
|
export function __wbg_wasmslip_free(a: number): void;
|
|
33
15
|
export function wasmslip_amount(a: number): number;
|
|
34
16
|
export function wasmslip_set_amount(a: number, b: number): void;
|
|
@@ -45,6 +27,24 @@ export function wasmslip_set_tx_ordinal(a: number, b: number): void;
|
|
|
45
27
|
export function wasmslip_set_utxo_key(a: number, b: number): void;
|
|
46
28
|
export function wasmslip_utxo_key(a: number): number;
|
|
47
29
|
export function wasmslip_new(): number;
|
|
30
|
+
export function __wbg_wasmbalancesnapshot_free(a: number): void;
|
|
31
|
+
export function wasmbalancesnapshot_get_file_name(a: number): number;
|
|
32
|
+
export function wasmbalancesnapshot_get_entries(a: number): number;
|
|
33
|
+
export function wasmbalancesnapshot_from_string(a: number, b: number): void;
|
|
34
|
+
export function wasmbalancesnapshot_to_string(a: number): number;
|
|
35
|
+
export function __wbg_wasmconfiguration_free(a: number): void;
|
|
36
|
+
export function wasmconfiguration_new(): number;
|
|
37
|
+
export function __wbg_wasmpeerservicelist_free(a: number): void;
|
|
38
|
+
export function __wbg_wasmpeerservice_free(a: number): void;
|
|
39
|
+
export function wasmpeerservice_new(): number;
|
|
40
|
+
export function wasmpeerservice_set_service(a: number, b: number): void;
|
|
41
|
+
export function wasmpeerservice_get_service(a: number): number;
|
|
42
|
+
export function wasmpeerservice_set_name(a: number, b: number): void;
|
|
43
|
+
export function wasmpeerservice_get_name(a: number): number;
|
|
44
|
+
export function wasmpeerservice_set_domain(a: number, b: number): void;
|
|
45
|
+
export function wasmpeerservice_get_domain(a: number): number;
|
|
46
|
+
export function wasmpeerservicelist_push(a: number, b: number): void;
|
|
47
|
+
export function wasmpeerservicelist_new(): number;
|
|
48
48
|
export function __wbg_wasmblock_free(a: number): void;
|
|
49
49
|
export function wasmblock_new(): number;
|
|
50
50
|
export function wasmblock_get_transactions(a: number): number;
|
package/pkg/node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saito-wasm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"files": [
|
|
5
5
|
"index_bg.wasm",
|
|
6
6
|
"index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"types": "index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"cross-env": "^7.0.3",
|
|
13
|
+
"node-fetch": "^3.3.0"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
class MsgHandler {
|
|
2
|
+
static send_message(peer_index, buffer) {
|
|
3
|
+
return global.shared_methods.send_message(peer_index, buffer);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
static send_message_to_all(buffer, exceptions) {
|
|
7
|
+
return global.shared_methods.send_message_to_all(buffer, exceptions);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static connect_to_peer(peer_data) {
|
|
11
|
+
return global.shared_methods.connect_to_peer(peer_data);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static write_value(key, value) {
|
|
15
|
+
return global.shared_methods.write_value(key, value);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static read_value(key) {
|
|
19
|
+
return global.shared_methods.read_value(key);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static load_block_file_list() {
|
|
23
|
+
return global.shared_methods.load_block_file_list();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static is_existing_file(key) {
|
|
27
|
+
return global.shared_methods.is_existing_file(key);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static remove_value(key) {
|
|
31
|
+
return global.shared_methods.remove_value(key);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static disconnect_from_peer(peer_index) {
|
|
35
|
+
return global.shared_methods.disconnect_from_peer(peer_index);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static fetch_block_from_peer(hash, peer_index, url) {
|
|
39
|
+
return global.shared_methods.fetch_block_from_peer(hash, peer_index, url);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static process_api_call(buffer, msgIndex, peerIndex) {
|
|
43
|
+
return global.shared_methods.process_api_call(buffer, msgIndex, peerIndex);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
static process_api_success(buffer, msgIndex, peerIndex) {
|
|
48
|
+
return global.shared_methods.process_api_success(buffer, msgIndex, peerIndex);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static process_api_error(buffer, msgIndex, peerIndex) {
|
|
52
|
+
return global.shared_methods.process_api_error(buffer, msgIndex, peerIndex);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static send_interface_event(event, peerIndex) {
|
|
56
|
+
return global.shared_methods.send_interface_event(event, peerIndex);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static save_wallet() {
|
|
60
|
+
return global.shared_methods.save_wallet();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static load_wallet() {
|
|
64
|
+
return global.shared_methods.load_wallet();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static save_blockchain() {
|
|
68
|
+
return global.shared_methods.save_blockchain();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static load_blockchain() {
|
|
72
|
+
return global.shared_methods.load_blockchain();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static get_my_services() {
|
|
76
|
+
return global.shared_methods.get_my_services();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static send_block_success(hash, block_id) {
|
|
80
|
+
return global.shared_methods.send_block_success(hash, block_id);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static send_wallet_update() {
|
|
84
|
+
return global.shared_methods.send_wallet_update();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
// if (typeof exports === "undefined") {
|
|
90
|
+
// module.exports = MsgHandler;
|
|
91
|
+
// } else {
|
|
92
|
+
// exports = MsgHandler;
|
|
93
|
+
// }
|
|
94
|
+
module.exports = exports = { MsgHandler };
|
|
95
|
+
} catch (e) {
|
|
96
|
+
console.error(e);
|
|
97
|
+
}
|
package/pkg/web/index.d.ts
CHANGED
|
@@ -573,11 +573,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
573
573
|
|
|
574
574
|
export interface InitOutput {
|
|
575
575
|
readonly memory: WebAssembly.Memory;
|
|
576
|
-
readonly __wbg_wasmbalancesnapshot_free: (a: number) => void;
|
|
577
|
-
readonly wasmbalancesnapshot_get_file_name: (a: number) => number;
|
|
578
|
-
readonly wasmbalancesnapshot_get_entries: (a: number) => number;
|
|
579
|
-
readonly wasmbalancesnapshot_from_string: (a: number, b: number) => void;
|
|
580
|
-
readonly wasmbalancesnapshot_to_string: (a: number) => number;
|
|
581
576
|
readonly __wbg_wasmpeer_free: (a: number) => void;
|
|
582
577
|
readonly wasmpeer_get_public_key: (a: number) => number;
|
|
583
578
|
readonly wasmpeer_get_key_list: (a: number) => number;
|
|
@@ -588,19 +583,6 @@ export interface InitOutput {
|
|
|
588
583
|
readonly wasmpeer_set_services: (a: number, b: number) => void;
|
|
589
584
|
readonly wasmpeer_has_service: (a: number, b: number) => number;
|
|
590
585
|
readonly wasmpeer_is_main_peer: (a: number) => number;
|
|
591
|
-
readonly __wbg_wasmpeerservicelist_free: (a: number) => void;
|
|
592
|
-
readonly __wbg_wasmpeerservice_free: (a: number) => void;
|
|
593
|
-
readonly wasmpeerservice_new: () => number;
|
|
594
|
-
readonly wasmpeerservice_set_service: (a: number, b: number) => void;
|
|
595
|
-
readonly wasmpeerservice_get_service: (a: number) => number;
|
|
596
|
-
readonly wasmpeerservice_set_name: (a: number, b: number) => void;
|
|
597
|
-
readonly wasmpeerservice_get_name: (a: number) => number;
|
|
598
|
-
readonly wasmpeerservice_set_domain: (a: number, b: number) => void;
|
|
599
|
-
readonly wasmpeerservice_get_domain: (a: number) => number;
|
|
600
|
-
readonly wasmpeerservicelist_push: (a: number, b: number) => void;
|
|
601
|
-
readonly wasmpeerservicelist_new: () => number;
|
|
602
|
-
readonly __wbg_wasmconfiguration_free: (a: number) => void;
|
|
603
|
-
readonly wasmconfiguration_new: () => number;
|
|
604
586
|
readonly __wbg_wasmslip_free: (a: number) => void;
|
|
605
587
|
readonly wasmslip_amount: (a: number) => number;
|
|
606
588
|
readonly wasmslip_set_amount: (a: number, b: number) => void;
|
|
@@ -617,6 +599,24 @@ export interface InitOutput {
|
|
|
617
599
|
readonly wasmslip_set_utxo_key: (a: number, b: number) => void;
|
|
618
600
|
readonly wasmslip_utxo_key: (a: number) => number;
|
|
619
601
|
readonly wasmslip_new: () => number;
|
|
602
|
+
readonly __wbg_wasmbalancesnapshot_free: (a: number) => void;
|
|
603
|
+
readonly wasmbalancesnapshot_get_file_name: (a: number) => number;
|
|
604
|
+
readonly wasmbalancesnapshot_get_entries: (a: number) => number;
|
|
605
|
+
readonly wasmbalancesnapshot_from_string: (a: number, b: number) => void;
|
|
606
|
+
readonly wasmbalancesnapshot_to_string: (a: number) => number;
|
|
607
|
+
readonly __wbg_wasmconfiguration_free: (a: number) => void;
|
|
608
|
+
readonly wasmconfiguration_new: () => number;
|
|
609
|
+
readonly __wbg_wasmpeerservicelist_free: (a: number) => void;
|
|
610
|
+
readonly __wbg_wasmpeerservice_free: (a: number) => void;
|
|
611
|
+
readonly wasmpeerservice_new: () => number;
|
|
612
|
+
readonly wasmpeerservice_set_service: (a: number, b: number) => void;
|
|
613
|
+
readonly wasmpeerservice_get_service: (a: number) => number;
|
|
614
|
+
readonly wasmpeerservice_set_name: (a: number, b: number) => void;
|
|
615
|
+
readonly wasmpeerservice_get_name: (a: number) => number;
|
|
616
|
+
readonly wasmpeerservice_set_domain: (a: number, b: number) => void;
|
|
617
|
+
readonly wasmpeerservice_get_domain: (a: number) => number;
|
|
618
|
+
readonly wasmpeerservicelist_push: (a: number, b: number) => void;
|
|
619
|
+
readonly wasmpeerservicelist_new: () => number;
|
|
620
620
|
readonly __wbg_wasmblock_free: (a: number) => void;
|
|
621
621
|
readonly wasmblock_new: () => number;
|
|
622
622
|
readonly wasmblock_get_transactions: (a: number) => number;
|
package/pkg/web/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MsgHandler } from './snippets/saito-wasm-
|
|
1
|
+
import { MsgHandler } from './snippets/saito-wasm-5b3c4a602f544c28/js/msg_handler.js';
|
|
2
2
|
|
|
3
3
|
let wasm;
|
|
4
4
|
|
|
@@ -490,7 +490,7 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
490
490
|
ptr = ptr >>> 0;
|
|
491
491
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function __wbg_adapter_304(arg0, arg1, arg2, arg3) {
|
|
494
494
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4a288e6ecccb986f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
495
495
|
}
|
|
496
496
|
|
|
@@ -1685,16 +1685,16 @@ function __wbg_get_imports() {
|
|
|
1685
1685
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
1686
1686
|
takeObject(arg0);
|
|
1687
1687
|
};
|
|
1688
|
-
imports.wbg.
|
|
1689
|
-
const ret =
|
|
1688
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
1689
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1690
1690
|
return addHeapObject(ret);
|
|
1691
1691
|
};
|
|
1692
|
-
imports.wbg.
|
|
1693
|
-
const ret =
|
|
1692
|
+
imports.wbg.__wbg_wasmtransaction_new = function(arg0) {
|
|
1693
|
+
const ret = WasmTransaction.__wrap(arg0);
|
|
1694
1694
|
return addHeapObject(ret);
|
|
1695
1695
|
};
|
|
1696
|
-
imports.wbg.
|
|
1697
|
-
const ret =
|
|
1696
|
+
imports.wbg.__wbg_wasmpeer_new = function(arg0) {
|
|
1697
|
+
const ret = WasmPeer.__wrap(arg0);
|
|
1698
1698
|
return addHeapObject(ret);
|
|
1699
1699
|
};
|
|
1700
1700
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
@@ -1705,18 +1705,6 @@ function __wbg_get_imports() {
|
|
|
1705
1705
|
const ret = WasmBlock.__wrap(arg0);
|
|
1706
1706
|
return addHeapObject(ret);
|
|
1707
1707
|
};
|
|
1708
|
-
imports.wbg.__wbg_wasmslip_new = function(arg0) {
|
|
1709
|
-
const ret = WasmSlip.__wrap(arg0);
|
|
1710
|
-
return addHeapObject(ret);
|
|
1711
|
-
};
|
|
1712
|
-
imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
|
|
1713
|
-
const ret = WasmBalanceSnapshot.__wrap(arg0);
|
|
1714
|
-
return addHeapObject(ret);
|
|
1715
|
-
};
|
|
1716
|
-
imports.wbg.__wbg_wasmpeer_new = function(arg0) {
|
|
1717
|
-
const ret = WasmPeer.__wrap(arg0);
|
|
1718
|
-
return addHeapObject(ret);
|
|
1719
|
-
};
|
|
1720
1708
|
imports.wbg.__wbindgen_is_falsy = function(arg0) {
|
|
1721
1709
|
const ret = !getObject(arg0);
|
|
1722
1710
|
return ret;
|
|
@@ -1729,6 +1717,14 @@ function __wbg_get_imports() {
|
|
|
1729
1717
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
1730
1718
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1731
1719
|
};
|
|
1720
|
+
imports.wbg.__wbg_wasmslip_new = function(arg0) {
|
|
1721
|
+
const ret = WasmSlip.__wrap(arg0);
|
|
1722
|
+
return addHeapObject(ret);
|
|
1723
|
+
};
|
|
1724
|
+
imports.wbg.__wbg_wasmwalletslip_new = function(arg0) {
|
|
1725
|
+
const ret = WasmWalletSlip.__wrap(arg0);
|
|
1726
|
+
return addHeapObject(ret);
|
|
1727
|
+
};
|
|
1732
1728
|
imports.wbg.__wbg_wasmwallet_new = function(arg0) {
|
|
1733
1729
|
const ret = WasmWallet.__wrap(arg0);
|
|
1734
1730
|
return addHeapObject(ret);
|
|
@@ -1737,6 +1733,10 @@ function __wbg_get_imports() {
|
|
|
1737
1733
|
const ret = WasmBlockchain.__wrap(arg0);
|
|
1738
1734
|
return addHeapObject(ret);
|
|
1739
1735
|
};
|
|
1736
|
+
imports.wbg.__wbg_wasmbalancesnapshot_new = function(arg0) {
|
|
1737
|
+
const ret = WasmBalanceSnapshot.__wrap(arg0);
|
|
1738
|
+
return addHeapObject(ret);
|
|
1739
|
+
};
|
|
1740
1740
|
imports.wbg.__wbg_wasmpeerservice_new = function(arg0) {
|
|
1741
1741
|
const ret = WasmPeerService.__wrap(arg0);
|
|
1742
1742
|
return addHeapObject(ret);
|
|
@@ -1758,21 +1758,21 @@ function __wbg_get_imports() {
|
|
|
1758
1758
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1759
1759
|
return addHeapObject(ret);
|
|
1760
1760
|
};
|
|
1761
|
-
imports.wbg.
|
|
1761
|
+
imports.wbg.__wbg_sendmessage_f7b5e2432ecc321b = function(arg0, arg1) {
|
|
1762
1762
|
MsgHandler.send_message(takeObject(arg0), getObject(arg1));
|
|
1763
1763
|
};
|
|
1764
|
-
imports.wbg.
|
|
1764
|
+
imports.wbg.__wbg_sendmessagetoall_36fafd2ed11a8f9d = function(arg0, arg1) {
|
|
1765
1765
|
MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
|
|
1766
1766
|
};
|
|
1767
|
-
imports.wbg.
|
|
1767
|
+
imports.wbg.__wbg_connecttopeer_98a6a25481bff60a = function() { return handleError(function (arg0) {
|
|
1768
1768
|
const ret = MsgHandler.connect_to_peer(takeObject(arg0));
|
|
1769
1769
|
return addHeapObject(ret);
|
|
1770
1770
|
}, arguments) };
|
|
1771
|
-
imports.wbg.
|
|
1771
|
+
imports.wbg.__wbg_disconnectfrompeer_a7a11ba69586e7ef = function() { return handleError(function (arg0) {
|
|
1772
1772
|
const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
|
|
1773
1773
|
return addHeapObject(ret);
|
|
1774
1774
|
}, arguments) };
|
|
1775
|
-
imports.wbg.
|
|
1775
|
+
imports.wbg.__wbg_fetchblockfrompeer_dcb41b4c5d746667 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1776
1776
|
let deferred0_0;
|
|
1777
1777
|
let deferred0_1;
|
|
1778
1778
|
try {
|
|
@@ -1784,7 +1784,7 @@ function __wbg_get_imports() {
|
|
|
1784
1784
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
1785
1785
|
}
|
|
1786
1786
|
}, arguments) };
|
|
1787
|
-
imports.wbg.
|
|
1787
|
+
imports.wbg.__wbg_writevalue_06a83d2abeac7dcf = function(arg0, arg1, arg2) {
|
|
1788
1788
|
let deferred0_0;
|
|
1789
1789
|
let deferred0_1;
|
|
1790
1790
|
try {
|
|
@@ -1795,7 +1795,7 @@ function __wbg_get_imports() {
|
|
|
1795
1795
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
1796
1796
|
}
|
|
1797
1797
|
};
|
|
1798
|
-
imports.wbg.
|
|
1798
|
+
imports.wbg.__wbg_readvalue_3fbda1defcd595bc = function() { return handleError(function (arg0, arg1) {
|
|
1799
1799
|
let deferred0_0;
|
|
1800
1800
|
let deferred0_1;
|
|
1801
1801
|
try {
|
|
@@ -1807,11 +1807,11 @@ function __wbg_get_imports() {
|
|
|
1807
1807
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
1808
1808
|
}
|
|
1809
1809
|
}, arguments) };
|
|
1810
|
-
imports.wbg.
|
|
1810
|
+
imports.wbg.__wbg_loadblockfilelist_bdb3c04d91771a7f = function() { return handleError(function () {
|
|
1811
1811
|
const ret = MsgHandler.load_block_file_list();
|
|
1812
1812
|
return addHeapObject(ret);
|
|
1813
1813
|
}, arguments) };
|
|
1814
|
-
imports.wbg.
|
|
1814
|
+
imports.wbg.__wbg_isexistingfile_498f00d1b89afd50 = function() { return handleError(function (arg0, arg1) {
|
|
1815
1815
|
let deferred0_0;
|
|
1816
1816
|
let deferred0_1;
|
|
1817
1817
|
try {
|
|
@@ -1823,7 +1823,7 @@ function __wbg_get_imports() {
|
|
|
1823
1823
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
1824
1824
|
}
|
|
1825
1825
|
}, arguments) };
|
|
1826
|
-
imports.wbg.
|
|
1826
|
+
imports.wbg.__wbg_removevalue_e066054eb1657099 = function() { return handleError(function (arg0, arg1) {
|
|
1827
1827
|
let deferred0_0;
|
|
1828
1828
|
let deferred0_1;
|
|
1829
1829
|
try {
|
|
@@ -1835,16 +1835,16 @@ function __wbg_get_imports() {
|
|
|
1835
1835
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
1836
1836
|
}
|
|
1837
1837
|
}, arguments) };
|
|
1838
|
-
imports.wbg.
|
|
1838
|
+
imports.wbg.__wbg_processapicall_13c70522e31b16c4 = function(arg0, arg1, arg2) {
|
|
1839
1839
|
MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1840
1840
|
};
|
|
1841
|
-
imports.wbg.
|
|
1841
|
+
imports.wbg.__wbg_processapisuccess_30d85a940ef0a6ea = function(arg0, arg1, arg2) {
|
|
1842
1842
|
MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1843
1843
|
};
|
|
1844
|
-
imports.wbg.
|
|
1844
|
+
imports.wbg.__wbg_processapierror_0dca0ed72df429a1 = function(arg0, arg1, arg2) {
|
|
1845
1845
|
MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1846
1846
|
};
|
|
1847
|
-
imports.wbg.
|
|
1847
|
+
imports.wbg.__wbg_sendinterfaceevent_ab8f5523671d6685 = function(arg0, arg1, arg2) {
|
|
1848
1848
|
let deferred0_0;
|
|
1849
1849
|
let deferred0_1;
|
|
1850
1850
|
try {
|
|
@@ -1855,7 +1855,7 @@ function __wbg_get_imports() {
|
|
|
1855
1855
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
1856
1856
|
}
|
|
1857
1857
|
};
|
|
1858
|
-
imports.wbg.
|
|
1858
|
+
imports.wbg.__wbg_sendblocksuccess_9286c520f7163de6 = function(arg0, arg1, arg2) {
|
|
1859
1859
|
let deferred0_0;
|
|
1860
1860
|
let deferred0_1;
|
|
1861
1861
|
try {
|
|
@@ -1866,13 +1866,16 @@ function __wbg_get_imports() {
|
|
|
1866
1866
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
1867
1867
|
}
|
|
1868
1868
|
};
|
|
1869
|
-
imports.wbg.
|
|
1869
|
+
imports.wbg.__wbg_sendwalletupdate_f3403d32e113e313 = function() {
|
|
1870
|
+
MsgHandler.send_wallet_update();
|
|
1871
|
+
};
|
|
1872
|
+
imports.wbg.__wbg_savewallet_4fc39122d40d7a80 = function() {
|
|
1870
1873
|
MsgHandler.save_wallet();
|
|
1871
1874
|
};
|
|
1872
|
-
imports.wbg.
|
|
1875
|
+
imports.wbg.__wbg_loadwallet_0777b2b933199c2b = function() {
|
|
1873
1876
|
MsgHandler.load_wallet();
|
|
1874
1877
|
};
|
|
1875
|
-
imports.wbg.
|
|
1878
|
+
imports.wbg.__wbg_getmyservices_053c9092365ef0b1 = function() {
|
|
1876
1879
|
const ret = MsgHandler.get_my_services();
|
|
1877
1880
|
_assertClass(ret, WasmPeerServiceList);
|
|
1878
1881
|
var ptr1 = ret.__destroy_into_raw();
|
|
@@ -2063,7 +2066,7 @@ function __wbg_get_imports() {
|
|
|
2063
2066
|
const a = state0.a;
|
|
2064
2067
|
state0.a = 0;
|
|
2065
2068
|
try {
|
|
2066
|
-
return
|
|
2069
|
+
return __wbg_adapter_304(a, state0.b, arg0, arg1);
|
|
2067
2070
|
} finally {
|
|
2068
2071
|
state0.a = a;
|
|
2069
2072
|
}
|
|
@@ -2141,8 +2144,8 @@ function __wbg_get_imports() {
|
|
|
2141
2144
|
const ret = wasm.memory;
|
|
2142
2145
|
return addHeapObject(ret);
|
|
2143
2146
|
};
|
|
2144
|
-
imports.wbg.
|
|
2145
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2147
|
+
imports.wbg.__wbindgen_closure_wrapper1008 = function(arg0, arg1, arg2) {
|
|
2148
|
+
const ret = makeMutClosure(arg0, arg1, 334, __wbg_adapter_40);
|
|
2146
2149
|
return addHeapObject(ret);
|
|
2147
2150
|
};
|
|
2148
2151
|
|
package/pkg/web/index_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function __wbg_wasmbalancesnapshot_free(a: number): void;
|
|
5
|
-
export function wasmbalancesnapshot_get_file_name(a: number): number;
|
|
6
|
-
export function wasmbalancesnapshot_get_entries(a: number): number;
|
|
7
|
-
export function wasmbalancesnapshot_from_string(a: number, b: number): void;
|
|
8
|
-
export function wasmbalancesnapshot_to_string(a: number): number;
|
|
9
4
|
export function __wbg_wasmpeer_free(a: number): void;
|
|
10
5
|
export function wasmpeer_get_public_key(a: number): number;
|
|
11
6
|
export function wasmpeer_get_key_list(a: number): number;
|
|
@@ -16,19 +11,6 @@ export function wasmpeer_get_services(a: number): number;
|
|
|
16
11
|
export function wasmpeer_set_services(a: number, b: number): void;
|
|
17
12
|
export function wasmpeer_has_service(a: number, b: number): number;
|
|
18
13
|
export function wasmpeer_is_main_peer(a: number): number;
|
|
19
|
-
export function __wbg_wasmpeerservicelist_free(a: number): void;
|
|
20
|
-
export function __wbg_wasmpeerservice_free(a: number): void;
|
|
21
|
-
export function wasmpeerservice_new(): number;
|
|
22
|
-
export function wasmpeerservice_set_service(a: number, b: number): void;
|
|
23
|
-
export function wasmpeerservice_get_service(a: number): number;
|
|
24
|
-
export function wasmpeerservice_set_name(a: number, b: number): void;
|
|
25
|
-
export function wasmpeerservice_get_name(a: number): number;
|
|
26
|
-
export function wasmpeerservice_set_domain(a: number, b: number): void;
|
|
27
|
-
export function wasmpeerservice_get_domain(a: number): number;
|
|
28
|
-
export function wasmpeerservicelist_push(a: number, b: number): void;
|
|
29
|
-
export function wasmpeerservicelist_new(): number;
|
|
30
|
-
export function __wbg_wasmconfiguration_free(a: number): void;
|
|
31
|
-
export function wasmconfiguration_new(): number;
|
|
32
14
|
export function __wbg_wasmslip_free(a: number): void;
|
|
33
15
|
export function wasmslip_amount(a: number): number;
|
|
34
16
|
export function wasmslip_set_amount(a: number, b: number): void;
|
|
@@ -45,6 +27,24 @@ export function wasmslip_set_tx_ordinal(a: number, b: number): void;
|
|
|
45
27
|
export function wasmslip_set_utxo_key(a: number, b: number): void;
|
|
46
28
|
export function wasmslip_utxo_key(a: number): number;
|
|
47
29
|
export function wasmslip_new(): number;
|
|
30
|
+
export function __wbg_wasmbalancesnapshot_free(a: number): void;
|
|
31
|
+
export function wasmbalancesnapshot_get_file_name(a: number): number;
|
|
32
|
+
export function wasmbalancesnapshot_get_entries(a: number): number;
|
|
33
|
+
export function wasmbalancesnapshot_from_string(a: number, b: number): void;
|
|
34
|
+
export function wasmbalancesnapshot_to_string(a: number): number;
|
|
35
|
+
export function __wbg_wasmconfiguration_free(a: number): void;
|
|
36
|
+
export function wasmconfiguration_new(): number;
|
|
37
|
+
export function __wbg_wasmpeerservicelist_free(a: number): void;
|
|
38
|
+
export function __wbg_wasmpeerservice_free(a: number): void;
|
|
39
|
+
export function wasmpeerservice_new(): number;
|
|
40
|
+
export function wasmpeerservice_set_service(a: number, b: number): void;
|
|
41
|
+
export function wasmpeerservice_get_service(a: number): number;
|
|
42
|
+
export function wasmpeerservice_set_name(a: number, b: number): void;
|
|
43
|
+
export function wasmpeerservice_get_name(a: number): number;
|
|
44
|
+
export function wasmpeerservice_set_domain(a: number, b: number): void;
|
|
45
|
+
export function wasmpeerservice_get_domain(a: number): number;
|
|
46
|
+
export function wasmpeerservicelist_push(a: number, b: number): void;
|
|
47
|
+
export function wasmpeerservicelist_new(): number;
|
|
48
48
|
export function __wbg_wasmblock_free(a: number): void;
|
|
49
49
|
export function wasmblock_new(): number;
|
|
50
50
|
export function wasmblock_get_transactions(a: number): number;
|
package/pkg/web/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saito-wasm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"files": [
|
|
5
5
|
"index_bg.wasm",
|
|
6
6
|
"index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"./snippets/*"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"cross-env": "^7.0.3",
|
|
16
|
+
"node-fetch": "^3.3.0"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
class MsgHandler {
|
|
2
|
+
static send_message(peer_index, buffer) {
|
|
3
|
+
return global.shared_methods.send_message(peer_index, buffer);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
static send_message_to_all(buffer, exceptions) {
|
|
7
|
+
return global.shared_methods.send_message_to_all(buffer, exceptions);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static connect_to_peer(peer_data) {
|
|
11
|
+
return global.shared_methods.connect_to_peer(peer_data);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static write_value(key, value) {
|
|
15
|
+
return global.shared_methods.write_value(key, value);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static read_value(key) {
|
|
19
|
+
return global.shared_methods.read_value(key);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static load_block_file_list() {
|
|
23
|
+
return global.shared_methods.load_block_file_list();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static is_existing_file(key) {
|
|
27
|
+
return global.shared_methods.is_existing_file(key);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static remove_value(key) {
|
|
31
|
+
return global.shared_methods.remove_value(key);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static disconnect_from_peer(peer_index) {
|
|
35
|
+
return global.shared_methods.disconnect_from_peer(peer_index);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static fetch_block_from_peer(hash, peer_index, url) {
|
|
39
|
+
return global.shared_methods.fetch_block_from_peer(hash, peer_index, url);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static process_api_call(buffer, msgIndex, peerIndex) {
|
|
43
|
+
return global.shared_methods.process_api_call(buffer, msgIndex, peerIndex);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
static process_api_success(buffer, msgIndex, peerIndex) {
|
|
48
|
+
return global.shared_methods.process_api_success(buffer, msgIndex, peerIndex);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static process_api_error(buffer, msgIndex, peerIndex) {
|
|
52
|
+
return global.shared_methods.process_api_error(buffer, msgIndex, peerIndex);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static send_interface_event(event, peerIndex) {
|
|
56
|
+
return global.shared_methods.send_interface_event(event, peerIndex);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static save_wallet() {
|
|
60
|
+
return global.shared_methods.save_wallet();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static load_wallet() {
|
|
64
|
+
return global.shared_methods.load_wallet();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static save_blockchain() {
|
|
68
|
+
return global.shared_methods.save_blockchain();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static load_blockchain() {
|
|
72
|
+
return global.shared_methods.load_blockchain();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static get_my_services() {
|
|
76
|
+
return global.shared_methods.get_my_services();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static send_block_success(hash, block_id) {
|
|
80
|
+
return global.shared_methods.send_block_success(hash, block_id);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static send_wallet_update() {
|
|
84
|
+
return global.shared_methods.send_wallet_update();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
// if (typeof exports === "undefined") {
|
|
90
|
+
// module.exports = MsgHandler;
|
|
91
|
+
// } else {
|
|
92
|
+
// exports = MsgHandler;
|
|
93
|
+
// }
|
|
94
|
+
module.exports = exports = { MsgHandler };
|
|
95
|
+
} catch (e) {
|
|
96
|
+
console.error(e);
|
|
97
|
+
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
class MsgHandler {
|
|
2
|
-
static send_message(peer_index, buffer) {
|
|
3
|
-
return global.shared_methods.send_message(peer_index, buffer);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
static send_message_to_all(buffer, exceptions) {
|
|
7
|
-
return global.shared_methods.send_message_to_all(buffer, exceptions);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
static connect_to_peer(peer_data) {
|
|
11
|
-
return global.shared_methods.connect_to_peer(peer_data);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
static write_value(key, value) {
|
|
15
|
-
return global.shared_methods.write_value(key, value);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static read_value(key) {
|
|
19
|
-
return global.shared_methods.read_value(key);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static load_block_file_list() {
|
|
23
|
-
return global.shared_methods.load_block_file_list();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static is_existing_file(key) {
|
|
27
|
-
return global.shared_methods.is_existing_file(key);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static remove_value(key) {
|
|
31
|
-
return global.shared_methods.remove_value(key);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static disconnect_from_peer(peer_index) {
|
|
35
|
-
return global.shared_methods.disconnect_from_peer(peer_index);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static fetch_block_from_peer(hash, peer_index, url) {
|
|
39
|
-
return global.shared_methods.fetch_block_from_peer(hash, peer_index, url);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static process_api_call(buffer, msgIndex, peerIndex) {
|
|
43
|
-
return global.shared_methods.process_api_call(buffer, msgIndex, peerIndex);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
static process_api_success(buffer, msgIndex, peerIndex) {
|
|
48
|
-
return global.shared_methods.process_api_success(buffer, msgIndex, peerIndex);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static process_api_error(buffer, msgIndex, peerIndex) {
|
|
52
|
-
return global.shared_methods.process_api_error(buffer, msgIndex, peerIndex);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
static send_interface_event(event, peerIndex) {
|
|
56
|
-
return global.shared_methods.send_interface_event(event, peerIndex);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static save_wallet() {
|
|
60
|
-
return global.shared_methods.save_wallet();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
static load_wallet() {
|
|
64
|
-
return global.shared_methods.load_wallet();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
static save_blockchain() {
|
|
68
|
-
return global.shared_methods.save_blockchain();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
static load_blockchain() {
|
|
72
|
-
return global.shared_methods.load_blockchain();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
static get_my_services() {
|
|
76
|
-
return global.shared_methods.get_my_services();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static send_block_success(hash, block_id) {
|
|
80
|
-
return global.shared_methods.send_block_success(hash, block_id);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
// if (typeof exports === "undefined") {
|
|
86
|
-
// module.exports = MsgHandler;
|
|
87
|
-
// } else {
|
|
88
|
-
// exports = MsgHandler;
|
|
89
|
-
// }
|
|
90
|
-
module.exports = exports = {MsgHandler};
|
|
91
|
-
} catch (e) {
|
|
92
|
-
console.error(e);
|
|
93
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
class MsgHandler {
|
|
2
|
-
static send_message(peer_index, buffer) {
|
|
3
|
-
return global.shared_methods.send_message(peer_index, buffer);
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
static send_message_to_all(buffer, exceptions) {
|
|
7
|
-
return global.shared_methods.send_message_to_all(buffer, exceptions);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
static connect_to_peer(peer_data) {
|
|
11
|
-
return global.shared_methods.connect_to_peer(peer_data);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
static write_value(key, value) {
|
|
15
|
-
return global.shared_methods.write_value(key, value);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static read_value(key) {
|
|
19
|
-
return global.shared_methods.read_value(key);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static load_block_file_list() {
|
|
23
|
-
return global.shared_methods.load_block_file_list();
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static is_existing_file(key) {
|
|
27
|
-
return global.shared_methods.is_existing_file(key);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static remove_value(key) {
|
|
31
|
-
return global.shared_methods.remove_value(key);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static disconnect_from_peer(peer_index) {
|
|
35
|
-
return global.shared_methods.disconnect_from_peer(peer_index);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
static fetch_block_from_peer(hash, peer_index, url) {
|
|
39
|
-
return global.shared_methods.fetch_block_from_peer(hash, peer_index, url);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
static process_api_call(buffer, msgIndex, peerIndex) {
|
|
43
|
-
return global.shared_methods.process_api_call(buffer, msgIndex, peerIndex);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
static process_api_success(buffer, msgIndex, peerIndex) {
|
|
48
|
-
return global.shared_methods.process_api_success(buffer, msgIndex, peerIndex);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static process_api_error(buffer, msgIndex, peerIndex) {
|
|
52
|
-
return global.shared_methods.process_api_error(buffer, msgIndex, peerIndex);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
static send_interface_event(event, peerIndex) {
|
|
56
|
-
return global.shared_methods.send_interface_event(event, peerIndex);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static save_wallet() {
|
|
60
|
-
return global.shared_methods.save_wallet();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
static load_wallet() {
|
|
64
|
-
return global.shared_methods.load_wallet();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
static save_blockchain() {
|
|
68
|
-
return global.shared_methods.save_blockchain();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
static load_blockchain() {
|
|
72
|
-
return global.shared_methods.load_blockchain();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
static get_my_services() {
|
|
76
|
-
return global.shared_methods.get_my_services();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static send_block_success(hash, block_id) {
|
|
80
|
-
return global.shared_methods.send_block_success(hash, block_id);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
// if (typeof exports === "undefined") {
|
|
86
|
-
// module.exports = MsgHandler;
|
|
87
|
-
// } else {
|
|
88
|
-
// exports = MsgHandler;
|
|
89
|
-
// }
|
|
90
|
-
module.exports = exports = {MsgHandler};
|
|
91
|
-
} catch (e) {
|
|
92
|
-
console.error(e);
|
|
93
|
-
}
|