saito-wasm 0.2.178 → 0.2.179

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