saito-wasm 0.2.171 → 0.2.173

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