saito-wasm 0.2.221 → 0.2.222

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