saito-wasm 0.2.176 → 0.2.178

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