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