saito-wasm 0.2.204 → 0.2.205

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