saito-wasm 0.2.162 → 0.2.163

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