saito-wasm 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/Cargo.toml +30 -0
  2. package/dist/browser/index.d.ts +428 -0
  3. package/dist/browser/index.js +220 -0
  4. package/dist/server/113b3ee1c6c31ca8f96e.module.wasm +0 -0
  5. package/dist/server/index.d.ts +300 -0
  6. package/dist/server/index.js +283 -0
  7. package/dist/server/pkg_node_index_js.index.js +55 -0
  8. package/dist/server/vendors-node_modules_text-encoding_index_js.index.js +44 -0
  9. package/dist/types/dist/browser/index.d.ts +3 -0
  10. package/dist/types/dist/browser/index.d.ts.map +1 -0
  11. package/dist/types/dist/server/index.d.ts +3 -0
  12. package/dist/types/dist/server/index.d.ts.map +1 -0
  13. package/dist/types/dist/server/pkg_node_index_js.index.d.ts +9 -0
  14. package/dist/types/dist/server/pkg_node_index_js.index.d.ts.map +1 -0
  15. package/dist/types/dist/server/vendors-node_modules_text-encoding_index_js.index.d.ts +8 -0
  16. package/dist/types/dist/server/vendors-node_modules_text-encoding_index_js.index.d.ts.map +1 -0
  17. package/dist/types/index.node.d.ts +34 -0
  18. package/dist/types/index.node.d.ts.map +1 -0
  19. package/dist/types/index.web.d.ts +3 -0
  20. package/dist/types/index.web.d.ts.map +1 -0
  21. package/dist/types/js/msg_handler.d.ts +17 -0
  22. package/dist/types/js/msg_handler.d.ts.map +1 -0
  23. package/dist/types/pkg/node/index.d.ts +2 -0
  24. package/dist/types/pkg/node/index.d.ts.map +1 -0
  25. package/dist/types/pkg/node/index_bg.d.ts +476 -0
  26. package/dist/types/pkg/node/index_bg.d.ts.map +1 -0
  27. package/dist/types/pkg/node/snippets/saito-wasm-10de7e358f6ef4db/js/msg_handler.d.ts +17 -0
  28. package/dist/types/pkg/node/snippets/saito-wasm-10de7e358f6ef4db/js/msg_handler.d.ts.map +1 -0
  29. package/dist/types/pkg/web/index.d.ts +406 -0
  30. package/dist/types/pkg/web/index.d.ts.map +1 -0
  31. package/dist/types/pkg/web/snippets/saito-wasm-10de7e358f6ef4db/js/msg_handler.d.ts +17 -0
  32. package/dist/types/pkg/web/snippets/saito-wasm-10de7e358f6ef4db/js/msg_handler.d.ts.map +1 -0
  33. package/dist/types/webpack.config.d.ts +14 -0
  34. package/dist/types/webpack.config.d.ts.map +1 -0
  35. package/index.node.ts +5 -0
  36. package/index.web.ts +8 -0
  37. package/js/msg_handler.js +60 -0
  38. package/package.json +39 -0
  39. package/src/lib.rs +18 -0
  40. package/src/saitowasm.rs +718 -0
  41. package/src/wasm_block.rs +97 -0
  42. package/src/wasm_configuration.rs +94 -0
  43. package/src/wasm_io_handler.rs +258 -0
  44. package/src/wasm_peer.rs +80 -0
  45. package/src/wasm_slip.rs +101 -0
  46. package/src/wasm_task_runner.rs +12 -0
  47. package/src/wasm_time_keeper.rs +12 -0
  48. package/src/wasm_transaction.rs +177 -0
  49. package/tsconfig.json +116 -0
  50. package/webpack.config.js +171 -0
@@ -0,0 +1,3 @@
1
+ export = __webpack_exports__;
2
+ /******/ declare var __webpack_exports__: any;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../browser/index.js"],"names":[],"mappings":";AAuNA,QAAQ,CAAE,qCAAgE"}
@@ -0,0 +1,3 @@
1
+ export = __webpack_exports__;
2
+ /******/ declare var __webpack_exports__: any;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/index.js"],"names":[],"mappings":";AAsRA,QAAQ,CAAE,qCAAiE"}
@@ -0,0 +1,9 @@
1
+ export const id: "pkg_node_index_js";
2
+ export const ids: string[];
3
+ export const modules: {
4
+ /***/ "./pkg/node/index.js": (module: any, __webpack_exports__: any, __webpack_require__: any) => void;
5
+ /***/ "./pkg/node/index_bg.js": (module: any, __webpack_exports__: any, __webpack_require__: any) => void;
6
+ /***/ "./pkg/node/snippets/saito-wasm-10de7e358f6ef4db/js/msg_handler.js": (__unused_webpack_module: any, __webpack_exports__: any, __webpack_require__: any) => void;
7
+ /***/ "./pkg/node/index_bg.wasm": (module: any, exports: any, __webpack_require__: any) => void;
8
+ };
9
+ //# sourceMappingURL=pkg_node_index_js.index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pkg_node_index_js.index.d.ts","sourceRoot":"","sources":["../../../server/pkg_node_index_js.index.js"],"names":[],"mappings":";;;IAaA,KAAK;IAUL,KAAK;IAUL,KAAK;IAUL,KAAK"}
@@ -0,0 +1,8 @@
1
+ export const id: "vendors-node_modules_text-encoding_index_js";
2
+ export const ids: string[];
3
+ export const modules: {
4
+ /***/ "./node_modules/text-encoding/index.js": (module: any, __unused_webpack_exports: any, __webpack_require__: any) => void;
5
+ /***/ "./node_modules/text-encoding/lib/encoding-indexes.js": (module: any) => void;
6
+ /***/ "./node_modules/text-encoding/lib/encoding.js": (module: any, __unused_webpack_exports: any, __webpack_require__: any) => void;
7
+ };
8
+ //# sourceMappingURL=vendors-node_modules_text-encoding_index_js.index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendors-node_modules_text-encoding_index_js.index.d.ts","sourceRoot":"","sources":["../../../server/vendors-node_modules_text-encoding_index_js.index.js"],"names":[],"mappings":";;;IAYA,KAAK;IAUL,KAAK;IAUL,KAAK"}
@@ -0,0 +1,34 @@
1
+ declare const _default: Promise<void | {
2
+ default: typeof import("./pkg/node");
3
+ initialize(json: string): Promise<any>;
4
+ create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<import("./pkg/node").WasmTransaction>;
5
+ get_latest_block_hash(): Promise<string>;
6
+ process_new_peer(index: bigint, peer_config: any): Promise<void>;
7
+ process_peer_disconnection(peer_index: bigint): Promise<void>;
8
+ process_msg_buffer_from_peer(buffer: Uint8Array, peer_index: bigint): Promise<void>;
9
+ process_fetched_block(buffer: Uint8Array, hash: Uint8Array, peer_index: bigint): Promise<void>;
10
+ process_timer_event(duration_in_ms: bigint): Promise<void>;
11
+ hash(buffer: Uint8Array): string;
12
+ sign_buffer(buffer: Uint8Array, private_key: string): string;
13
+ verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
14
+ get_peers(): Promise<any[]>;
15
+ get_peer(peer_index: bigint): Promise<import("./pkg/node").WasmPeer>;
16
+ get_public_key(): Promise<string>;
17
+ get_private_key(): Promise<string>;
18
+ get_pending_txs(): Promise<any[]>;
19
+ get_balance(_ticker: string): Promise<bigint>;
20
+ generate_private_key(): string;
21
+ generate_public_key(private_key: string): string;
22
+ propagate_transaction(tx: import("./pkg/node").WasmTransaction): Promise<void>;
23
+ send_api_call(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
24
+ send_api_success(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
25
+ send_api_error(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
26
+ propagate_services(peer_index: bigint, services: any): Promise<void>;
27
+ SaitoWasm: typeof import("./pkg/node").SaitoWasm;
28
+ WasmBlock: typeof import("./pkg/node").WasmBlock;
29
+ WasmPeer: typeof import("./pkg/node").WasmPeer;
30
+ WasmSlip: typeof import("./pkg/node").WasmSlip;
31
+ WasmTransaction: typeof import("./pkg/node").WasmTransaction;
32
+ }>;
33
+ export default _default;
34
+ //# sourceMappingURL=index.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../index.node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAIG"}
@@ -0,0 +1,3 @@
1
+ declare const _default: Promise<any>;
2
+ export default _default;
3
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../index.web.ts"],"names":[],"mappings":";AAAA,wBAOM"}
@@ -0,0 +1,17 @@
1
+ export class MsgHandler {
2
+ static send_message(peer_index: any, buffer: any): any;
3
+ static send_message_to_all(buffer: any, exceptions: any): any;
4
+ static connect_to_peer(peer_data: any): any;
5
+ static write_value(key: any, value: any): any;
6
+ static read_value(key: any): any;
7
+ static load_block_file_list(): any;
8
+ static is_existing_file(key: any): any;
9
+ static remove_value(key: any): any;
10
+ static disconnect_from_peer(peer_index: any): any;
11
+ static fetch_block_from_peer(hash: any, peer_index: any, url: any): any;
12
+ static process_api_call(buffer: any, msgIndex: any, peerIndex: any): any;
13
+ static process_api_success(buffer: any, msgIndex: any, peerIndex: any): any;
14
+ static process_api_error(buffer: any, msgIndex: any, peerIndex: any): any;
15
+ static send_interface_event(event: any, peerIndex: any): any;
16
+ }
17
+ //# sourceMappingURL=msg_handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"msg_handler.d.ts","sourceRoot":"","sources":["../../../js/msg_handler.js"],"names":[],"mappings":"AAAA;IACI,uDAGC;IAED,8DAGC;IAED,4CAEC;IAED,8CAEC;IAED,iCAEC;IAED,mCAEC;IAED,uCAEC;IAED,mCAEC;IAED,kDAEC;IAED,wEAEC;IAED,yEAEC;IAGD,4EAEC;IAED,0EAEC;IAED,6DAEC;CACJ"}
@@ -0,0 +1,2 @@
1
+ export * from "./index_bg.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../pkg/node/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,476 @@
1
+ /**
2
+ * @param {string} json
3
+ * @returns {Promise<any>}
4
+ */
5
+ export function initialize(json: string): Promise<any>;
6
+ /**
7
+ * @param {string} public_key
8
+ * @param {bigint} amount
9
+ * @param {bigint} fee
10
+ * @param {boolean} force_merge
11
+ * @returns {Promise<WasmTransaction>}
12
+ */
13
+ export function create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
14
+ /**
15
+ * @returns {Promise<string>}
16
+ */
17
+ export function get_latest_block_hash(): Promise<string>;
18
+ /**
19
+ * @param {bigint} index
20
+ * @param {any} peer_config
21
+ * @returns {Promise<void>}
22
+ */
23
+ export function process_new_peer(index: bigint, peer_config: any): Promise<void>;
24
+ /**
25
+ * @param {bigint} peer_index
26
+ * @returns {Promise<void>}
27
+ */
28
+ export function process_peer_disconnection(peer_index: bigint): Promise<void>;
29
+ /**
30
+ * @param {Uint8Array} buffer
31
+ * @param {bigint} peer_index
32
+ * @returns {Promise<void>}
33
+ */
34
+ export function process_msg_buffer_from_peer(buffer: Uint8Array, peer_index: bigint): Promise<void>;
35
+ /**
36
+ * @param {Uint8Array} buffer
37
+ * @param {Uint8Array} hash
38
+ * @param {bigint} peer_index
39
+ * @returns {Promise<void>}
40
+ */
41
+ export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, peer_index: bigint): Promise<void>;
42
+ /**
43
+ * @param {bigint} duration_in_ms
44
+ * @returns {Promise<void>}
45
+ */
46
+ export function process_timer_event(duration_in_ms: bigint): Promise<void>;
47
+ /**
48
+ * @param {Uint8Array} buffer
49
+ * @returns {string}
50
+ */
51
+ export function hash(buffer: Uint8Array): string;
52
+ /**
53
+ * @param {Uint8Array} buffer
54
+ * @param {string} private_key
55
+ * @returns {string}
56
+ */
57
+ export function sign_buffer(buffer: Uint8Array, private_key: string): string;
58
+ /**
59
+ * @param {Uint8Array} buffer
60
+ * @param {string} signature
61
+ * @param {string} public_key
62
+ * @returns {boolean}
63
+ */
64
+ export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
65
+ /**
66
+ * @returns {Promise<Array<any>>}
67
+ */
68
+ export function get_peers(): Promise<Array<any>>;
69
+ /**
70
+ * @param {bigint} peer_index
71
+ * @returns {Promise<WasmPeer | undefined>}
72
+ */
73
+ export function get_peer(peer_index: bigint): Promise<WasmPeer | undefined>;
74
+ /**
75
+ * @returns {Promise<string>}
76
+ */
77
+ export function get_public_key(): Promise<string>;
78
+ /**
79
+ * @returns {Promise<string>}
80
+ */
81
+ export function get_private_key(): Promise<string>;
82
+ /**
83
+ * @returns {Promise<Array<any>>}
84
+ */
85
+ export function get_pending_txs(): Promise<Array<any>>;
86
+ /**
87
+ * @param {string} _ticker
88
+ * @returns {Promise<bigint>}
89
+ */
90
+ export function get_balance(_ticker: string): Promise<bigint>;
91
+ /**
92
+ * @returns {string}
93
+ */
94
+ export function generate_private_key(): string;
95
+ /**
96
+ * @param {string} private_key
97
+ * @returns {string}
98
+ */
99
+ export function generate_public_key(private_key: string): string;
100
+ /**
101
+ * @param {WasmTransaction} tx
102
+ * @returns {Promise<void>}
103
+ */
104
+ export function propagate_transaction(tx: WasmTransaction): Promise<void>;
105
+ /**
106
+ * @param {Uint8Array} buffer
107
+ * @param {number} msg_index
108
+ * @param {bigint} peer_index
109
+ * @returns {Promise<void>}
110
+ */
111
+ export function send_api_call(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
112
+ /**
113
+ * @param {Uint8Array} buffer
114
+ * @param {number} msg_index
115
+ * @param {bigint} peer_index
116
+ * @returns {Promise<void>}
117
+ */
118
+ export function send_api_success(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
119
+ /**
120
+ * @param {Uint8Array} buffer
121
+ * @param {number} msg_index
122
+ * @param {bigint} peer_index
123
+ * @returns {Promise<void>}
124
+ */
125
+ export function send_api_error(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
126
+ /**
127
+ * @param {bigint} peer_index
128
+ * @param {any} services
129
+ * @returns {Promise<void>}
130
+ */
131
+ export function propagate_services(peer_index: bigint, services: any): Promise<void>;
132
+ export function __wbindgen_string_new(arg0: any, arg1: any): number;
133
+ export function __wbindgen_is_falsy(arg0: any): boolean;
134
+ export function __wbindgen_string_get(arg0: any, arg1: any): void;
135
+ export function __wbindgen_bigint_from_u64(arg0: any): number;
136
+ export function __wbg_wasmpeer_new(...args: any[]): any;
137
+ export function __wbg_wasmslip_new(...args: any[]): any;
138
+ export function __wbg_wasmtransaction_new(...args: any[]): any;
139
+ export function __wbg_sendmessage_c96fd619266e0c7d(...args: any[]): any;
140
+ export function __wbg_sendmessagetoall_b6d035525d5e0ec2(...args: any[]): any;
141
+ export function __wbg_connecttopeer_badf90742832d10a(...args: any[]): any;
142
+ export function __wbg_writevalue_7061eeeaf863e986(...args: any[]): any;
143
+ export function __wbg_readvalue_4a5d7d511b690e2d(...args: any[]): any;
144
+ export function __wbg_loadblockfilelist_12f847f45aba5ca6(...args: any[]): any;
145
+ export function __wbg_isexistingfile_7dee5e49312d362d(...args: any[]): any;
146
+ export function __wbg_removevalue_e0a259f99262aaf4(...args: any[]): any;
147
+ export function __wbg_disconnectfrompeer_96e056ca5bc62fbd(...args: any[]): any;
148
+ export function __wbg_fetchblockfrompeer_30701cfde70012fb(...args: any[]): any;
149
+ export function __wbg_processapicall_c3c90c833ed9cb7b(...args: any[]): any;
150
+ export function __wbg_processapisuccess_00655cba8af07db3(...args: any[]): any;
151
+ export function __wbg_processapierror_1a27c79b87a3c999(...args: any[]): any;
152
+ export function __wbg_sendinterfaceevent_891cd1806c7b3501(...args: any[]): any;
153
+ export function __wbindgen_cb_drop(arg0: any): boolean;
154
+ export function __wbg_debug_64711eb2fc6980ef(...args: any[]): any;
155
+ export function __wbg_error_00c5d571f754f629(...args: any[]): any;
156
+ export function __wbg_info_d60a960a4e955dc2(...args: any[]): any;
157
+ export function __wbg_log_de258f66ad9eb784(...args: any[]): any;
158
+ export function __wbg_warn_be542501a57387a5(...args: any[]): any;
159
+ export function __wbindgen_is_object(arg0: any): boolean;
160
+ export function __wbindgen_is_string(arg0: any): boolean;
161
+ export function __wbg_crypto_e1d53a1d73fb10b8(...args: any[]): any;
162
+ export function __wbg_msCrypto_6e7d3e1f92610cbb(...args: any[]): any;
163
+ export function __wbg_getRandomValues_805f1c3d65988a5a(...args: any[]): any;
164
+ export function __wbg_randomFillSync_6894564c2c334c42(...args: any[]): any;
165
+ export function __wbg_require_78a3dcfbdba9cbce(...args: any[]): any;
166
+ export function __wbg_process_038c26bf42b093f8(...args: any[]): any;
167
+ export function __wbg_versions_ab37218d2f0b24a8(...args: any[]): any;
168
+ export function __wbg_node_080f4b19d15bc1fe(...args: any[]): any;
169
+ export function __wbg_newwithlength_7c42f7e738a9d5d3(...args: any[]): any;
170
+ export function __wbg_at_6063dd3cb77a913d(...args: any[]): any;
171
+ export function __wbg_get_57245cc7d7c7619d(...args: any[]): any;
172
+ export function __wbg_set_a68214f35c417fa9(...args: any[]): any;
173
+ export function __wbg_from_7ce3cb27cb258569(...args: any[]): any;
174
+ export function __wbg_length_6e3bbe7c8bd4dbd8(...args: any[]): any;
175
+ export function __wbg_valueOf_8404142eb850b917(...args: any[]): any;
176
+ export function __wbg_newnoargs_b5b063fc6c2f0376(...args: any[]): any;
177
+ export function __wbg_call_97ae9d8645dc388b(...args: any[]): any;
178
+ export function __wbg_call_168da88779e35f61(...args: any[]): any;
179
+ export function __wbg_getTime_cb82adb2556ed13e(...args: any[]): any;
180
+ export function __wbg_new0_a57059d72c5b7aee(...args: any[]): any;
181
+ export function __wbg_new_9962f939219f1820(...args: any[]): any;
182
+ export function __wbg_resolve_99fe17964f31ffc0(...args: any[]): any;
183
+ export function __wbg_then_11f7a54d67b4bfad(...args: any[]): any;
184
+ export function __wbg_globalThis_7f206bda628d5286(...args: any[]): any;
185
+ export function __wbg_self_6d479506f72c6a71(...args: any[]): any;
186
+ export function __wbg_window_f2557cc78490aceb(...args: any[]): any;
187
+ export function __wbg_global_ba75c50d1cf384f4(...args: any[]): any;
188
+ export function __wbg_new_8c3f0052272a457a(...args: any[]): any;
189
+ export function __wbg_newwithlength_f5933855e4f48a19(...args: any[]): any;
190
+ export function __wbg_newwithbyteoffsetandlength_d9aa266703cb98be(...args: any[]): any;
191
+ export function __wbg_subarray_58ad4efbb5bcb886(...args: any[]): any;
192
+ export function __wbg_length_9e1ae1900cb0fbd5(...args: any[]): any;
193
+ export function __wbg_set_83db9690f9353e79(...args: any[]): any;
194
+ export function __wbg_buffer_3f3d764d4747d564(...args: any[]): any;
195
+ export function __wbg_parse_e23be3fecd886e2a(...args: any[]): any;
196
+ export function __wbg_stringify_d6471d300ded9b68(...args: any[]): any;
197
+ export function __wbindgen_is_function(arg0: any): boolean;
198
+ export function __wbindgen_is_undefined(arg0: any): boolean;
199
+ export function __wbindgen_object_clone_ref(arg0: any): number;
200
+ export function __wbindgen_object_drop_ref(arg0: any): void;
201
+ export function __wbindgen_debug_string(arg0: any, arg1: any): void;
202
+ export function __wbindgen_throw(arg0: any, arg1: any): void;
203
+ export function __wbindgen_memory(): number;
204
+ export function __wbindgen_closure_wrapper3609(...args: any[]): any;
205
+ /**
206
+ */
207
+ export class SaitoWasm {
208
+ __destroy_into_raw(): number;
209
+ ptr: number;
210
+ free(): void;
211
+ }
212
+ /**
213
+ */
214
+ export class WasmBlock {
215
+ static __wrap(ptr: any): any;
216
+ __destroy_into_raw(): number;
217
+ ptr: number;
218
+ free(): void;
219
+ /**
220
+ * @returns {Array<any>}
221
+ */
222
+ get transactions(): any[];
223
+ /**
224
+ * @param {bigint} id
225
+ */
226
+ set id(arg: bigint);
227
+ /**
228
+ * @returns {bigint}
229
+ */
230
+ get id(): bigint;
231
+ /**
232
+ * @param {bigint} timestamp
233
+ */
234
+ set timestamp(arg: bigint);
235
+ /**
236
+ * @returns {bigint}
237
+ */
238
+ get timestamp(): bigint;
239
+ /**
240
+ * @param {string} hash
241
+ */
242
+ set previous_block_hash(arg: string);
243
+ /**
244
+ * @returns {string}
245
+ */
246
+ get previous_block_hash(): string;
247
+ /**
248
+ * @param {string} key
249
+ */
250
+ set creator(arg: string);
251
+ /**
252
+ * @returns {string}
253
+ */
254
+ get creator(): string;
255
+ /**
256
+ * @param {number} t
257
+ */
258
+ set type(arg: number);
259
+ /**
260
+ * @returns {number}
261
+ */
262
+ get type(): number;
263
+ /**
264
+ * @returns {string}
265
+ */
266
+ get hash(): string;
267
+ /**
268
+ * @returns {Uint8Array}
269
+ */
270
+ serialize(): Uint8Array;
271
+ }
272
+ /**
273
+ */
274
+ export class WasmPeer {
275
+ static __wrap(ptr: any): any;
276
+ /**
277
+ * @param {bigint} peer_index
278
+ */
279
+ constructor(peer_index: bigint);
280
+ __destroy_into_raw(): number;
281
+ ptr: number;
282
+ free(): void;
283
+ /**
284
+ * @returns {string}
285
+ */
286
+ get public_key(): string;
287
+ /**
288
+ * @returns {Array<any>}
289
+ */
290
+ get key_list(): any[];
291
+ /**
292
+ * @returns {bigint}
293
+ */
294
+ get peer_index(): bigint;
295
+ /**
296
+ * @returns {string}
297
+ */
298
+ get sync_type(): string;
299
+ /**
300
+ * @param {any} services
301
+ */
302
+ set services(arg: any);
303
+ /**
304
+ * @returns {any}
305
+ */
306
+ get services(): any;
307
+ /**
308
+ * @param {string} service
309
+ * @returns {boolean}
310
+ */
311
+ has_service(service: string): boolean;
312
+ /**
313
+ * @returns {boolean}
314
+ */
315
+ is_main_peer(): boolean;
316
+ }
317
+ /**
318
+ */
319
+ export class WasmSlip {
320
+ static __wrap(ptr: any): any;
321
+ __destroy_into_raw(): number;
322
+ ptr: number;
323
+ free(): void;
324
+ /**
325
+ * @param {bigint} amount
326
+ */
327
+ set amount(arg: bigint);
328
+ /**
329
+ * @returns {bigint}
330
+ */
331
+ get amount(): bigint;
332
+ /**
333
+ * @param {number} slip_type
334
+ */
335
+ set slip_type(arg: number);
336
+ /**
337
+ * @returns {number}
338
+ */
339
+ get slip_type(): number;
340
+ /**
341
+ * @param {string} key
342
+ */
343
+ set public_key(arg: string);
344
+ /**
345
+ * @returns {string}
346
+ */
347
+ get public_key(): string;
348
+ /**
349
+ * @param {number} index
350
+ */
351
+ set slip_index(arg: number);
352
+ /**
353
+ * @returns {number}
354
+ */
355
+ get slip_index(): number;
356
+ /**
357
+ * @param {bigint} id
358
+ */
359
+ set block_id(arg: bigint);
360
+ /**
361
+ * @returns {bigint}
362
+ */
363
+ get block_id(): bigint;
364
+ /**
365
+ * @param {bigint} ordinal
366
+ */
367
+ set tx_ordinal(arg: bigint);
368
+ /**
369
+ * @returns {bigint}
370
+ */
371
+ get tx_ordinal(): bigint;
372
+ /**
373
+ * @param {string} key
374
+ */
375
+ set utxo_key(arg: string);
376
+ /**
377
+ * @returns {string}
378
+ */
379
+ get utxo_key(): string;
380
+ }
381
+ /**
382
+ */
383
+ export class WasmTransaction {
384
+ static __wrap(ptr: any): any;
385
+ /**
386
+ * @param {Uint8Array} buffer
387
+ * @returns {WasmTransaction}
388
+ */
389
+ static deserialize(buffer: Uint8Array): WasmTransaction;
390
+ __destroy_into_raw(): number;
391
+ ptr: number;
392
+ free(): void;
393
+ /**
394
+ * @param {string} signature
395
+ */
396
+ set signature(arg: string);
397
+ /**
398
+ * @returns {string}
399
+ */
400
+ get signature(): string;
401
+ /**
402
+ * @param {WasmSlip} slip
403
+ */
404
+ add_to_slip(slip: WasmSlip): void;
405
+ /**
406
+ * @param {WasmSlip} slip
407
+ */
408
+ add_from_slip(slip: WasmSlip): void;
409
+ /**
410
+ * @param {number} r
411
+ */
412
+ set txs_replacements(arg: number);
413
+ /**
414
+ * @returns {number}
415
+ */
416
+ get txs_replacements(): number;
417
+ /**
418
+ * @returns {Array<any>}
419
+ */
420
+ get to(): any[];
421
+ /**
422
+ * @returns {Array<any>}
423
+ */
424
+ get from(): any[];
425
+ /**
426
+ * @param {string} key
427
+ * @returns {boolean}
428
+ */
429
+ is_from(key: string): boolean;
430
+ /**
431
+ * @param {string} key
432
+ * @returns {boolean}
433
+ */
434
+ is_to(key: string): boolean;
435
+ /**
436
+ * @param {Uint8Array} buffer
437
+ */
438
+ set data(arg: Uint8Array);
439
+ /**
440
+ * @returns {Uint8Array}
441
+ */
442
+ get data(): Uint8Array;
443
+ /**
444
+ * @param {bigint} timestamp
445
+ */
446
+ set timestamp(arg: bigint);
447
+ /**
448
+ * @returns {bigint}
449
+ */
450
+ get timestamp(): bigint;
451
+ /**
452
+ * @returns {Promise<void>}
453
+ */
454
+ sign(): Promise<void>;
455
+ /**
456
+ * @returns {Promise<void>}
457
+ */
458
+ sign_and_encrypt(): Promise<void>;
459
+ /**
460
+ * @param {number} t
461
+ */
462
+ set type(arg: number);
463
+ /**
464
+ * @returns {number}
465
+ */
466
+ get type(): number;
467
+ /**
468
+ * @returns {bigint}
469
+ */
470
+ get total_fees(): bigint;
471
+ /**
472
+ * @returns {Uint8Array}
473
+ */
474
+ serialize(): Uint8Array;
475
+ }
476
+ //# sourceMappingURL=index_bg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index_bg.d.ts","sourceRoot":"","sources":["../../../../pkg/node/index_bg.js"],"names":[],"mappings":"AAyPA;;;EAGE;AACF,iCAHU,MAAM,GACJ,QAAQ,GAAG,CAAC,CAKvB;AAED;;;;;;EAME;AACF,+CANU,MAAM,UACN,MAAM,OACN,MAAM,eACN,OAAO,GACL,QAAQ,eAAe,CAAC,CAQnC;AAED;;EAEE;AACF,yCAFY,QAAQ,MAAM,CAAC,CAK1B;AAED;;;;EAIE;AACF,wCAJU,MAAM,eACN,GAAG,GACD,QAAQ,IAAI,CAAC,CAMxB;AAED;;;EAGE;AACF,uDAHU,MAAM,GACJ,QAAQ,IAAI,CAAC,CAMxB;AAED;;;;EAIE;AACF,qDAJU,UAAU,cACV,MAAM,GACJ,QAAQ,IAAI,CAAC,CAMxB;AAED;;;;;EAKE;AACF,8CALU,UAAU,QACV,UAAU,cACV,MAAM,GACJ,QAAQ,IAAI,CAAC,CAMxB;AAED;;;EAGE;AACF,oDAHU,MAAM,GACJ,QAAQ,IAAI,CAAC,CAMxB;AAED;;;EAGE;AACF,6BAHU,UAAU,GACR,MAAM,CAKjB;AAED;;;;EAIE;AACF,oCAJU,UAAU,eACV,MAAM,GACJ,MAAM,CAKjB;AAED;;;;;EAKE;AACF,yCALU,UAAU,aACV,MAAM,cACN,MAAM,GACJ,OAAO,CAKlB;AAED;;EAEE;AACF,6BAFY,QAAQ,MAAM,GAAG,CAAC,CAAC,CAK9B;AAED;;;EAGE;AACF,q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;;MAEE;IACF,yBAKC;IACD;;MAEE;IACF,aAFY,UAAU,CAOrB;CAoBJ"}
@@ -0,0 +1,17 @@
1
+ export class MsgHandler {
2
+ static send_message(peer_index: any, buffer: any): any;
3
+ static send_message_to_all(buffer: any, exceptions: any): any;
4
+ static connect_to_peer(peer_data: any): any;
5
+ static write_value(key: any, value: any): any;
6
+ static read_value(key: any): any;
7
+ static load_block_file_list(): any;
8
+ static is_existing_file(key: any): any;
9
+ static remove_value(key: any): any;
10
+ static disconnect_from_peer(peer_index: any): any;
11
+ static fetch_block_from_peer(hash: any, peer_index: any, url: any): any;
12
+ static process_api_call(buffer: any, msgIndex: any, peerIndex: any): any;
13
+ static process_api_success(buffer: any, msgIndex: any, peerIndex: any): any;
14
+ static process_api_error(buffer: any, msgIndex: any, peerIndex: any): any;
15
+ static send_interface_event(event: any, peerIndex: any): any;
16
+ }
17
+ //# sourceMappingURL=msg_handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"msg_handler.d.ts","sourceRoot":"","sources":["../../../../../../../pkg/node/snippets/saito-wasm-10de7e358f6ef4db/js/msg_handler.js"],"names":[],"mappings":"AAAA;IACI,uDAGC;IAED,8DAGC;IAED,4CAEC;IAED,8CAEC;IAED,iCAEC;IAED,mCAEC;IAED,uCAEC;IAED,mCAEC;IAED,kDAEC;IAED,wEAEC;IAED,yEAEC;IAGD,4EAEC;IAED,0EAEC;IAED,6DAEC;CACJ"}