saito-wasm 0.2.177 → 0.2.178

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