saito-wasm 0.2.172 → 0.2.174

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