saito-wasm 0.2.173 → 0.2.174

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