saito-wasm 0.2.172 → 0.2.173

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