saito-wasm 0.2.163 → 0.2.164

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