saito-wasm 0.2.169 → 0.2.170

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