saito-wasm 0.2.178 → 0.2.180

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