saito-wasm 0.2.185 → 0.2.187

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