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