saito-wasm 0.2.167 → 0.2.169

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