saito-wasm 0.2.180 → 0.2.181

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