saito-wasm 0.2.173 → 0.2.175

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