saito-wasm 0.2.184 → 0.2.185

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