saito-wasm 0.2.220 → 0.2.222

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