saito-wasm 0.2.162 → 0.2.164

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