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