saito-wasm 0.2.202 → 0.2.204

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