saito-wasm 0.2.171 → 0.2.172

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