saito-wasm 0.2.166 → 0.2.167
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 +2 -1
- package/package.json +1 -1
- package/pkg/node/index.d.ts +148 -148
- package/pkg/node/index.js +297 -297
- package/pkg/node/index_bg.wasm +0 -0
- package/pkg/node/package.json +3 -3
- package/pkg/web/index.d.ts +148 -148
- package/pkg/web/index.js +295 -295
- package/pkg/web/index_bg.wasm +0 -0
- package/pkg/web/package.json +1 -1
- /package/pkg/node/snippets/{saito-wasm-083e81febfc0ef0c → saito-wasm-25d13ca010c26982}/js/msg_handler.js +0 -0
- /package/pkg/web/snippets/{saito-wasm-083e81febfc0ef0c → saito-wasm-25d13ca010c26982}/js/msg_handler.js +0 -0
package/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "saito-wasm"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.167"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
|
|
6
6
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
@@ -30,6 +30,7 @@ serde_json = { version = "=1.0.120" }
|
|
|
30
30
|
num-derive = { version = "=0.4.2" }
|
|
31
31
|
num-traits = { version = "=0.2.19" }
|
|
32
32
|
console_error_panic_hook = "=0.1.7"
|
|
33
|
+
rayon = "=1.10.0"
|
|
33
34
|
|
|
34
35
|
[package.metadata.wasm-pack.profile.release]
|
|
35
36
|
wasm-opt = ['-Oz']
|
package/package.json
CHANGED
package/pkg/node/index.d.ts
CHANGED
|
@@ -1,128 +1,122 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @returns {Promise<
|
|
4
|
+
* @returns {Promise<boolean>}
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function produce_block_with_gt(): Promise<boolean>;
|
|
7
7
|
/**
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {bigint} duration_in_ms
|
|
9
9
|
* @returns {Promise<void>}
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function process_timer_event(duration_in_ms: bigint): Promise<void>;
|
|
12
12
|
/**
|
|
13
|
-
* @
|
|
13
|
+
* @param {Array<any>} public_keys
|
|
14
|
+
* @param {BigUint64Array} amounts
|
|
15
|
+
* @param {bigint} fee
|
|
16
|
+
* @param {boolean} _force_merge
|
|
17
|
+
* @returns {Promise<WasmTransaction>}
|
|
14
18
|
*/
|
|
15
|
-
export function
|
|
19
|
+
export function create_transaction_with_multiple_payments(public_keys: Array<any>, amounts: BigUint64Array, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
|
|
16
20
|
/**
|
|
17
|
-
* @returns {Promise<
|
|
21
|
+
* @returns {Promise<boolean>}
|
|
18
22
|
*/
|
|
19
|
-
export function
|
|
23
|
+
export function produce_block_without_gt(): Promise<boolean>;
|
|
20
24
|
/**
|
|
21
|
-
* @param {
|
|
22
|
-
* @
|
|
25
|
+
* @param {Uint8Array} buffer
|
|
26
|
+
* @param {number} msg_index
|
|
27
|
+
* @param {bigint} peer_index
|
|
28
|
+
* @returns {Promise<void>}
|
|
23
29
|
*/
|
|
24
|
-
export function
|
|
30
|
+
export function send_api_success(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
|
|
25
31
|
/**
|
|
26
|
-
* @param {
|
|
27
|
-
* @param {
|
|
28
|
-
* @param {
|
|
29
|
-
* @
|
|
30
|
-
* @param {string} recipient_public_key
|
|
31
|
-
* @param {string} nft_type
|
|
32
|
-
* @returns {Promise<WasmTransaction>}
|
|
32
|
+
* @param {number} major
|
|
33
|
+
* @param {number} minor
|
|
34
|
+
* @param {number} patch
|
|
35
|
+
* @returns {Promise<void>}
|
|
33
36
|
*/
|
|
34
|
-
export function
|
|
37
|
+
export function set_wallet_version(major: number, minor: number, patch: number): Promise<void>;
|
|
35
38
|
/**
|
|
39
|
+
* @param {Uint8Array} hash
|
|
40
|
+
* @param {bigint} block_id
|
|
36
41
|
* @param {bigint} peer_index
|
|
37
42
|
* @returns {Promise<void>}
|
|
38
43
|
*/
|
|
39
|
-
export function
|
|
44
|
+
export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, peer_index: bigint): Promise<void>;
|
|
40
45
|
/**
|
|
41
|
-
* @
|
|
46
|
+
* @param {string} block_hash
|
|
47
|
+
* @returns {Promise<WasmBlock>}
|
|
42
48
|
*/
|
|
43
|
-
export function
|
|
49
|
+
export function get_block(block_hash: string): Promise<WasmBlock>;
|
|
44
50
|
/**
|
|
45
|
-
* @param {
|
|
46
|
-
* @returns {
|
|
51
|
+
* @param {string} private_key
|
|
52
|
+
* @returns {string}
|
|
47
53
|
*/
|
|
48
|
-
export function
|
|
54
|
+
export function generate_public_key(private_key: string): string;
|
|
49
55
|
/**
|
|
50
|
-
* @
|
|
51
|
-
* @returns {boolean}
|
|
56
|
+
* @returns {Promise<Array<any>>}
|
|
52
57
|
*/
|
|
53
|
-
export function
|
|
58
|
+
export function get_nft_list(): Promise<Array<any>>;
|
|
54
59
|
/**
|
|
55
|
-
* @param {
|
|
56
|
-
* @param {string}
|
|
57
|
-
* @param {
|
|
58
|
-
* @
|
|
59
|
-
* @param {boolean} delete_old_blocks
|
|
60
|
-
* @returns {Promise<any>}
|
|
60
|
+
* @param {Uint8Array} buffer
|
|
61
|
+
* @param {string} signature
|
|
62
|
+
* @param {string} public_key
|
|
63
|
+
* @returns {boolean}
|
|
61
64
|
*/
|
|
62
|
-
export function
|
|
65
|
+
export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
|
|
63
66
|
/**
|
|
64
|
-
* @
|
|
65
|
-
* @param {string} slip1_utxo_key
|
|
66
|
-
* @param {string} slip2_utxo_key
|
|
67
|
-
* @param {string} slip3_utxo_key
|
|
68
|
-
* @param {string} recipient_public_key
|
|
69
|
-
* @param {Uint8Array} tx_msg
|
|
70
|
-
* @returns {Promise<WasmTransaction>}
|
|
67
|
+
* @returns {Promise<string>}
|
|
71
68
|
*/
|
|
72
|
-
export function
|
|
69
|
+
export function get_stats(): Promise<string>;
|
|
73
70
|
/**
|
|
74
|
-
* @
|
|
75
|
-
* @param {string} slip2_utxo_key
|
|
76
|
-
* @param {string} slip3_utxo_key
|
|
77
|
-
* @returns {Promise<WasmTransaction>}
|
|
71
|
+
* @returns {Promise<any>}
|
|
78
72
|
*/
|
|
79
|
-
export function
|
|
73
|
+
export function get_confirmations(): Promise<any>;
|
|
80
74
|
/**
|
|
81
|
-
* @returns {Promise<
|
|
75
|
+
* @returns {Promise<string>}
|
|
82
76
|
*/
|
|
83
|
-
export function
|
|
77
|
+
export function get_latest_block_hash(): Promise<string>;
|
|
84
78
|
/**
|
|
85
|
-
* @
|
|
79
|
+
* @param {Uint8Array} buffer
|
|
80
|
+
* @returns {string}
|
|
86
81
|
*/
|
|
87
|
-
export function
|
|
82
|
+
export function hash(buffer: Uint8Array): string;
|
|
88
83
|
/**
|
|
89
|
-
* @
|
|
90
|
-
* @param {Uint8Array} tx_msg
|
|
91
|
-
* @returns {Promise<WasmTransaction>}
|
|
84
|
+
* @returns {Promise<string>}
|
|
92
85
|
*/
|
|
93
|
-
export function
|
|
86
|
+
export function get_peer_stats(): Promise<string>;
|
|
94
87
|
/**
|
|
95
|
-
* @
|
|
88
|
+
* @param {bigint} peer_index
|
|
89
|
+
* @param {string} public_key
|
|
90
|
+
* @returns {Promise<void>}
|
|
96
91
|
*/
|
|
97
|
-
export function
|
|
92
|
+
export function process_stun_peer(peer_index: bigint, public_key: string): Promise<void>;
|
|
98
93
|
/**
|
|
99
|
-
* @returns {Promise<
|
|
94
|
+
* @returns {Promise<WasmWallet>}
|
|
100
95
|
*/
|
|
101
|
-
export function
|
|
96
|
+
export function get_wallet(): Promise<WasmWallet>;
|
|
102
97
|
/**
|
|
103
98
|
* @param {Uint8Array} buffer
|
|
104
|
-
* @param {
|
|
105
|
-
* @returns {
|
|
99
|
+
* @param {bigint} peer_index
|
|
100
|
+
* @returns {Promise<void>}
|
|
106
101
|
*/
|
|
107
|
-
export function
|
|
102
|
+
export function process_msg_buffer_from_peer(buffer: Uint8Array, peer_index: bigint): Promise<void>;
|
|
108
103
|
/**
|
|
109
|
-
* @
|
|
110
|
-
* @returns {Promise<WasmPeer | undefined>}
|
|
104
|
+
* @returns {Promise<bigint>}
|
|
111
105
|
*/
|
|
112
|
-
export function
|
|
106
|
+
export function get_next_peer_index(): Promise<bigint>;
|
|
113
107
|
/**
|
|
114
|
-
* @returns {Promise<
|
|
108
|
+
* @returns {Promise<Array<any>>}
|
|
115
109
|
*/
|
|
116
|
-
export function
|
|
110
|
+
export function get_peers(): Promise<Array<any>>;
|
|
117
111
|
/**
|
|
118
|
-
* @returns {
|
|
112
|
+
* @returns {Promise<WasmBlockchain>}
|
|
119
113
|
*/
|
|
120
|
-
export function
|
|
114
|
+
export function get_blockchain(): Promise<WasmBlockchain>;
|
|
121
115
|
/**
|
|
122
|
-
* @param {
|
|
123
|
-
* @returns {Promise<
|
|
116
|
+
* @param {bigint} threshold
|
|
117
|
+
* @returns {Promise<void>}
|
|
124
118
|
*/
|
|
125
|
-
export function
|
|
119
|
+
export function write_issuance_file(threshold: bigint): Promise<void>;
|
|
126
120
|
/**
|
|
127
121
|
* @param {Uint8Array} buffer
|
|
128
122
|
* @param {number} msg_index
|
|
@@ -131,29 +125,29 @@ export function get_block(block_hash: string): Promise<WasmBlock>;
|
|
|
131
125
|
*/
|
|
132
126
|
export function send_api_error(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
|
|
133
127
|
/**
|
|
134
|
-
* @param {
|
|
135
|
-
* @param {
|
|
136
|
-
* @param {bigint} fee
|
|
137
|
-
* @param {boolean} _force_merge
|
|
128
|
+
* @param {string} nft_id_hex
|
|
129
|
+
* @param {Uint8Array} tx_msg
|
|
138
130
|
* @returns {Promise<WasmTransaction>}
|
|
139
131
|
*/
|
|
140
|
-
export function
|
|
132
|
+
export function create_merge_bound_transaction(nft_id_hex: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
141
133
|
/**
|
|
142
|
-
* @param {Uint8Array} buffer
|
|
143
134
|
* @returns {string}
|
|
144
135
|
*/
|
|
145
|
-
export function
|
|
136
|
+
export function generate_private_key(): string;
|
|
146
137
|
/**
|
|
147
|
-
* @
|
|
138
|
+
* @param {bigint} peer_index
|
|
139
|
+
* @returns {Promise<void>}
|
|
148
140
|
*/
|
|
149
|
-
export function
|
|
141
|
+
export function remove_stun_peer(peer_index: bigint): Promise<void>;
|
|
150
142
|
/**
|
|
151
|
-
* @param {
|
|
152
|
-
* @param {bigint} block_id
|
|
153
|
-
* @param {bigint} peer_index
|
|
143
|
+
* @param {WasmBalanceSnapshot} snapshot
|
|
154
144
|
* @returns {Promise<void>}
|
|
155
145
|
*/
|
|
156
|
-
export function
|
|
146
|
+
export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* @returns {Promise<string>}
|
|
149
|
+
*/
|
|
150
|
+
export function get_congestion_stats(): Promise<string>;
|
|
157
151
|
/**
|
|
158
152
|
* @param {Uint8Array} buffer
|
|
159
153
|
* @param {Uint8Array} hash
|
|
@@ -163,26 +157,16 @@ export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, p
|
|
|
163
157
|
*/
|
|
164
158
|
export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, peer_index: bigint): Promise<void>;
|
|
165
159
|
/**
|
|
166
|
-
* @param {
|
|
167
|
-
* @param {
|
|
168
|
-
* @param {
|
|
169
|
-
* @returns {Promise<
|
|
170
|
-
*/
|
|
171
|
-
export function set_wallet_version(major: number, minor: number, patch: number): Promise<void>;
|
|
172
|
-
/**
|
|
173
|
-
* @returns {Promise<boolean>}
|
|
174
|
-
*/
|
|
175
|
-
export function produce_block_without_gt(): Promise<boolean>;
|
|
176
|
-
/**
|
|
177
|
-
* @param {bigint} threshold
|
|
178
|
-
* @returns {Promise<void>}
|
|
160
|
+
* @param {string} slip1_utxo_key
|
|
161
|
+
* @param {string} slip2_utxo_key
|
|
162
|
+
* @param {string} slip3_utxo_key
|
|
163
|
+
* @returns {Promise<WasmTransaction>}
|
|
179
164
|
*/
|
|
180
|
-
export function
|
|
165
|
+
export function create_remove_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string): Promise<WasmTransaction>;
|
|
181
166
|
/**
|
|
182
|
-
* @param {bigint} peer_index
|
|
183
167
|
* @returns {Promise<void>}
|
|
184
168
|
*/
|
|
185
|
-
export function
|
|
169
|
+
export function disable_producing_blocks_by_timer(): Promise<void>;
|
|
186
170
|
/**
|
|
187
171
|
* @param {string} public_key
|
|
188
172
|
* @param {bigint} amount
|
|
@@ -192,37 +176,57 @@ export function process_peer_disconnection(peer_index: bigint): Promise<void>;
|
|
|
192
176
|
*/
|
|
193
177
|
export function create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
|
|
194
178
|
/**
|
|
195
|
-
* @
|
|
196
|
-
* @returns {Promise<WasmBalanceSnapshot>}
|
|
179
|
+
* @returns {Promise<Array<any>>}
|
|
197
180
|
*/
|
|
198
|
-
export function
|
|
181
|
+
export function get_mempool_txs(): Promise<Array<any>>;
|
|
199
182
|
/**
|
|
200
|
-
* @param {Uint8Array} buffer
|
|
201
|
-
* @param {bigint} peer_index
|
|
202
183
|
* @returns {Promise<void>}
|
|
203
184
|
*/
|
|
204
|
-
export function
|
|
185
|
+
export function start_from_received_ghost_chain(): Promise<void>;
|
|
205
186
|
/**
|
|
206
187
|
* @param {bigint} peer_index
|
|
207
|
-
* @
|
|
208
|
-
* @returns {Promise<void>}
|
|
188
|
+
* @returns {Promise<WasmPeer | undefined>}
|
|
209
189
|
*/
|
|
210
|
-
export function
|
|
190
|
+
export function get_peer(peer_index: bigint): Promise<WasmPeer | undefined>;
|
|
211
191
|
/**
|
|
212
|
-
* @param {
|
|
213
|
-
* @param {
|
|
214
|
-
* @param {
|
|
215
|
-
* @
|
|
192
|
+
* @param {bigint} amt
|
|
193
|
+
* @param {string} slip1_utxo_key
|
|
194
|
+
* @param {string} slip2_utxo_key
|
|
195
|
+
* @param {string} slip3_utxo_key
|
|
196
|
+
* @param {string} recipient_public_key
|
|
197
|
+
* @param {Uint8Array} tx_msg
|
|
198
|
+
* @returns {Promise<WasmTransaction>}
|
|
216
199
|
*/
|
|
217
|
-
export function
|
|
200
|
+
export function create_send_bound_transaction(amt: bigint, slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, recipient_public_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
218
201
|
/**
|
|
219
|
-
* @
|
|
202
|
+
* @param {string} key
|
|
203
|
+
* @returns {boolean}
|
|
220
204
|
*/
|
|
221
|
-
export function
|
|
205
|
+
export function is_valid_public_key(key: string): boolean;
|
|
222
206
|
/**
|
|
223
|
-
* @
|
|
207
|
+
* @param {Array<any>} keys
|
|
208
|
+
* @returns {Promise<WasmBalanceSnapshot>}
|
|
224
209
|
*/
|
|
225
|
-
export function
|
|
210
|
+
export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
|
|
211
|
+
/**
|
|
212
|
+
* @param {string} config_json
|
|
213
|
+
* @param {string} private_key
|
|
214
|
+
* @param {number} log_level_num
|
|
215
|
+
* @param {bigint} hasten_multiplier
|
|
216
|
+
* @param {boolean} delete_old_blocks
|
|
217
|
+
* @returns {Promise<any>}
|
|
218
|
+
*/
|
|
219
|
+
export function initialize(config_json: string, private_key: string, log_level_num: number, hasten_multiplier: bigint, delete_old_blocks: boolean): Promise<any>;
|
|
220
|
+
/**
|
|
221
|
+
* @param {string} slip1_utxo_key
|
|
222
|
+
* @param {string} slip2_utxo_key
|
|
223
|
+
* @param {string} slip3_utxo_key
|
|
224
|
+
* @param {number} left_count
|
|
225
|
+
* @param {number} right_count
|
|
226
|
+
* @param {Uint8Array} tx_msg
|
|
227
|
+
* @returns {Promise<WasmTransaction>}
|
|
228
|
+
*/
|
|
229
|
+
export function create_split_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, left_count: number, right_count: number, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
226
230
|
/**
|
|
227
231
|
* @param {Uint8Array} buffer
|
|
228
232
|
* @param {number} msg_index
|
|
@@ -231,51 +235,47 @@ export function get_peers(): Promise<Array<any>>;
|
|
|
231
235
|
*/
|
|
232
236
|
export function send_api_call(buffer: Uint8Array, msg_index: number, peer_index: bigint): Promise<void>;
|
|
233
237
|
/**
|
|
234
|
-
* @param {
|
|
235
|
-
* @
|
|
236
|
-
* @returns {Promise<void>}
|
|
238
|
+
* @param {string} public_key
|
|
239
|
+
* @returns {Promise<Array<any>>}
|
|
237
240
|
*/
|
|
238
|
-
export function
|
|
241
|
+
export function get_account_slips(public_key: string): Promise<Array<any>>;
|
|
239
242
|
/**
|
|
240
243
|
* @param {WasmTransaction} tx
|
|
241
244
|
* @returns {Promise<void>}
|
|
242
245
|
*/
|
|
243
246
|
export function propagate_transaction(tx: WasmTransaction): Promise<void>;
|
|
244
247
|
/**
|
|
245
|
-
* @
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* @param {Uint8Array} buffer
|
|
250
|
-
* @param {string} signature
|
|
251
|
-
* @param {string} public_key
|
|
252
|
-
* @returns {boolean}
|
|
253
|
-
*/
|
|
254
|
-
export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
|
|
255
|
-
/**
|
|
256
|
-
* @returns {Promise<bigint>}
|
|
248
|
+
* @param {bigint} peer_index
|
|
249
|
+
* @param {string} ip
|
|
250
|
+
* @returns {Promise<void>}
|
|
257
251
|
*/
|
|
258
|
-
export function
|
|
252
|
+
export function process_new_peer(peer_index: bigint, ip: string): Promise<void>;
|
|
259
253
|
/**
|
|
260
|
-
* @param {
|
|
261
|
-
* @returns {
|
|
254
|
+
* @param {bigint} current_time
|
|
255
|
+
* @returns {Promise<void>}
|
|
262
256
|
*/
|
|
263
|
-
export function
|
|
257
|
+
export function process_stat_interval(current_time: bigint): Promise<void>;
|
|
264
258
|
/**
|
|
265
|
-
* @param {bigint}
|
|
259
|
+
* @param {bigint} peer_index
|
|
266
260
|
* @returns {Promise<void>}
|
|
267
261
|
*/
|
|
268
|
-
export function
|
|
262
|
+
export function process_peer_disconnection(peer_index: bigint): Promise<void>;
|
|
269
263
|
/**
|
|
270
|
-
* @param {
|
|
271
|
-
* @param {
|
|
272
|
-
* @param {string} slip3_utxo_key
|
|
273
|
-
* @param {number} left_count
|
|
274
|
-
* @param {number} right_count
|
|
264
|
+
* @param {bigint} num
|
|
265
|
+
* @param {bigint} deposit
|
|
275
266
|
* @param {Uint8Array} tx_msg
|
|
267
|
+
* @param {bigint} fee
|
|
268
|
+
* @param {string} recipient_public_key
|
|
269
|
+
* @param {string} nft_type
|
|
276
270
|
* @returns {Promise<WasmTransaction>}
|
|
277
271
|
*/
|
|
278
|
-
export function
|
|
272
|
+
export function create_bound_transaction(num: bigint, deposit: bigint, tx_msg: Uint8Array, fee: bigint, recipient_public_key: string, nft_type: string): Promise<WasmTransaction>;
|
|
273
|
+
/**
|
|
274
|
+
* @param {Uint8Array} buffer
|
|
275
|
+
* @param {string} private_key
|
|
276
|
+
* @returns {string}
|
|
277
|
+
*/
|
|
278
|
+
export function sign_buffer(buffer: Uint8Array, private_key: string): string;
|
|
279
279
|
/**
|
|
280
280
|
*/
|
|
281
281
|
export class SaitoWasm {
|