saito-wasm 0.2.181 → 0.2.182

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