saito-wasm 0.2.182 → 0.2.185

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