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