saito-wasm 0.2.219 → 0.2.220

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