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