saito-wasm 0.2.175 → 0.2.176

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