saito-wasm 0.2.200 → 0.2.201

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