saito-wasm 0.2.163 → 0.2.165

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