saito-wasm 0.2.203 → 0.2.204

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