saito-wasm 0.2.167 → 0.2.168

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