saito-wasm 0.2.175 → 0.2.177

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