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