saito-wasm 0.2.221 → 0.2.223

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.221"
3
+ version = "0.2.223"
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.221",
3
+ "version": "0.2.223",
4
4
  "description": "js wrappings around saito-core using wasm",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,47 +1,43 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * @param {bigint} duration_in_ms
5
- * @returns {Promise<void>}
6
- */
7
- export function process_timer_event(duration_in_ms: bigint): Promise<void>;
8
- /**
9
- * @param {bigint} num
10
- * @param {bigint} deposit
11
- * @param {Uint8Array} tx_msg
12
- * @param {bigint} _fee
13
- * @param {string} recipient_public_key
14
- * @param {string} nft_type
15
- * @returns {Promise<WasmTransaction>}
4
+ * @returns {Promise<string>}
16
5
  */
17
- export function create_bound_transaction(num: bigint, deposit: bigint, tx_msg: Uint8Array, _fee: bigint, recipient_public_key: string, nft_type: string): Promise<WasmTransaction>;
6
+ export function get_latest_block_hash(): Promise<string>;
18
7
  /**
19
- * @returns {Promise<Array<any>>}
8
+ * @returns {Promise<void>}
20
9
  */
21
- export function get_nft_list(): Promise<Array<any>>;
10
+ export function start_from_received_ghost_chain(): Promise<void>;
22
11
  /**
23
- * @param {Uint8Array} buffer
24
- * @returns {string}
12
+ * @param {string} key
13
+ * @returns {Promise<void>}
25
14
  */
26
- export function hash(buffer: Uint8Array): string;
15
+ export function process_peer_disconnection(key: string): Promise<void>;
27
16
  /**
28
17
  * @param {string} slip1_utxo_key
29
18
  * @param {string} slip2_utxo_key
30
19
  * @param {string} slip3_utxo_key
31
- * @param {number} left_count
32
- * @param {number} right_count
33
20
  * @param {Uint8Array} tx_msg
34
21
  * @returns {Promise<WasmTransaction>}
35
22
  */
36
- 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>;
23
+ export function create_remove_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
37
24
  /**
38
- * @param {Array<any>} public_keys
39
- * @param {BigUint64Array} amounts
40
- * @param {bigint} fee
41
- * @param {boolean} _force_merge
42
- * @returns {Promise<WasmTransaction>}
25
+ * @param {WasmBalanceSnapshot} snapshot
26
+ * @returns {Promise<void>}
43
27
  */
44
- export function create_transaction_with_multiple_payments(public_keys: Array<any>, amounts: BigUint64Array, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
28
+ export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
29
+ /**
30
+ * @param {Array<any>} keys
31
+ * @returns {Promise<WasmBalanceSnapshot>}
32
+ */
33
+ export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
34
+ /**
35
+ * @param {Uint8Array} hash
36
+ * @param {bigint} block_id
37
+ * @param {string} key
38
+ * @returns {Promise<void>}
39
+ */
40
+ export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
45
41
  /**
46
42
  * @param {string} config_json
47
43
  * @param {string} private_key
@@ -52,125 +48,130 @@ export function create_transaction_with_multiple_payments(public_keys: Array<any
52
48
  */
53
49
  export function initialize(config_json: string, private_key: string, log_level_num: number, hasten_multiplier: bigint, delete_old_blocks: boolean): Promise<any>;
54
50
  /**
55
- * @param {string} private_key
56
- * @returns {string}
51
+ * @returns {Promise<void>}
57
52
  */
58
- export function generate_public_key(private_key: string): string;
53
+ export function disable_producing_blocks_by_timer(): Promise<void>;
59
54
  /**
60
- * @param {string} slip1_utxo_key
61
- * @param {string} slip2_utxo_key
62
- * @param {string} slip3_utxo_key
63
- * @param {Uint8Array} tx_msg
64
- * @returns {Promise<WasmTransaction>}
55
+ * @param {string} public_key
56
+ * @returns {Promise<Array<any>>}
65
57
  */
66
- export function create_remove_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
58
+ export function get_account_slips(public_key: string): Promise<Array<any>>;
67
59
  /**
68
- * @returns {Promise<WasmWallet>}
60
+ * @param {Uint8Array} buffer
61
+ * @param {Uint8Array} hash
62
+ * @param {bigint} block_id
63
+ * @param {string} key
64
+ * @returns {Promise<void>}
69
65
  */
70
- export function get_wallet(): Promise<WasmWallet>;
66
+ export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
71
67
  /**
72
- * @param {WasmTransaction} tx
68
+ * @param {bigint} threshold
73
69
  * @returns {Promise<void>}
74
70
  */
75
- export function propagate_transaction(tx: WasmTransaction): Promise<void>;
71
+ export function write_issuance_file(threshold: bigint): Promise<void>;
76
72
  /**
77
- * @returns {Promise<boolean>}
73
+ * @returns {Promise<WasmBlockchain>}
78
74
  */
79
- export function produce_block_without_gt(): Promise<boolean>;
75
+ export function get_blockchain(): Promise<WasmBlockchain>;
80
76
  /**
77
+ * @param {Uint8Array} buffer
78
+ * @param {string} private_key
81
79
  * @returns {string}
82
80
  */
83
- export function generate_private_key(): string;
84
- /**
85
- * @returns {Promise<boolean>}
86
- */
87
- export function produce_block_with_gt(): Promise<boolean>;
81
+ export function sign_buffer(buffer: Uint8Array, private_key: string): string;
88
82
  /**
89
- * @param {bigint} threshold
90
- * @returns {Promise<void>}
83
+ * @returns {Promise<Array<any>>}
91
84
  */
92
- export function write_issuance_file(threshold: bigint): Promise<void>;
85
+ export function get_mempool_txs(): Promise<Array<any>>;
93
86
  /**
94
- * @param {Uint8Array} buffer
95
- * @param {number} msg_index
96
- * @param {string} key
87
+ * @param {bigint} duration_in_ms
97
88
  * @returns {Promise<void>}
98
89
  */
99
- export function send_api_success(buffer: Uint8Array, msg_index: number, key: string): Promise<void>;
90
+ export function process_timer_event(duration_in_ms: bigint): Promise<void>;
100
91
  /**
101
- * @param {string} nft_id_hex
92
+ * @param {string} slip1_utxo_key
93
+ * @param {string} slip2_utxo_key
94
+ * @param {string} slip3_utxo_key
95
+ * @param {number} left_count
96
+ * @param {number} right_count
102
97
  * @param {Uint8Array} tx_msg
103
98
  * @returns {Promise<WasmTransaction>}
104
99
  */
105
- export function create_merge_bound_transaction(nft_id_hex: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
100
+ 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>;
106
101
  /**
107
102
  * @returns {Promise<string>}
108
103
  */
109
- export function get_congestion_stats(): Promise<string>;
104
+ export function get_stats(): Promise<string>;
110
105
  /**
111
- * @param {Uint8Array} buffer
112
- * @param {string} signature
113
- * @param {string} public_key
114
- * @returns {boolean}
106
+ * @param {string} block_hash
107
+ * @returns {Promise<WasmBlock>}
115
108
  */
116
- export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
109
+ export function get_block(block_hash: string): Promise<WasmBlock>;
117
110
  /**
118
- * @returns {Promise<string>}
111
+ * @returns {Promise<boolean>}
119
112
  */
120
- export function get_stats(): Promise<string>;
113
+ export function produce_block_with_gt(): Promise<boolean>;
121
114
  /**
122
- * @param {string} key
123
- * @returns {boolean}
115
+ * @param {string} nft_id_hex
116
+ * @param {Uint8Array} tx_msg
117
+ * @returns {Promise<WasmTransaction>}
118
+ */
119
+ export function create_merge_bound_transaction(nft_id_hex: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
120
+ /**
121
+ * @param {string} public_key
122
+ * @param {bigint} amount
123
+ * @param {bigint} fee
124
+ * @param {boolean} force_merge
125
+ * @returns {Promise<WasmTransaction>}
124
126
  */
125
- export function is_valid_public_key(key: string): boolean;
127
+ export function create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
126
128
  /**
127
129
  * @param {bigint} current_time
128
130
  * @returns {Promise<void>}
129
131
  */
130
132
  export function process_stat_interval(current_time: bigint): Promise<void>;
131
133
  /**
132
- * @param {Uint8Array} buffer
133
- * @param {string} private_key
134
- * @returns {string}
134
+ * @param {string} slip1_utxo_key
135
+ * @param {string} slip2_utxo_key
136
+ * @param {string} slip3_utxo_key
137
+ * @param {Uint8Array} tx_msg
138
+ * @returns {Promise<WasmTransaction>}
135
139
  */
136
- export function sign_buffer(buffer: Uint8Array, private_key: string): string;
140
+ export function create_atomize_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
137
141
  /**
138
- * @param {string} public_key
139
- * @returns {Promise<void>}
142
+ * @param {string} key
143
+ * @returns {boolean}
140
144
  */
141
- export function remove_stun_peer(public_key: string): Promise<void>;
145
+ export function isPublicKey(key: string): boolean;
142
146
  /**
143
- * @returns {Promise<Array<any>>}
147
+ * @param {string} public_key
148
+ * @returns {Promise<void>}
144
149
  */
145
- export function get_mempool_txs(): Promise<Array<any>>;
150
+ export function process_stun_peer(public_key: string): Promise<void>;
146
151
  /**
147
152
  * @returns {Promise<any>}
148
153
  */
149
154
  export function get_confirmations(): Promise<any>;
150
155
  /**
151
- * @returns {Promise<WasmBlockchain>}
156
+ * @param {Uint8Array} buffer
157
+ * @returns {string}
152
158
  */
153
- export function get_blockchain(): Promise<WasmBlockchain>;
159
+ export function hash(buffer: Uint8Array): string;
154
160
  /**
155
- * @param {string} slip1_utxo_key
156
- * @param {string} slip2_utxo_key
157
- * @param {string} slip3_utxo_key
158
- * @param {Uint8Array} tx_msg
159
- * @returns {Promise<WasmTransaction>}
161
+ * @param {string} public_key
162
+ * @returns {Promise<void>}
160
163
  */
161
- export function create_atomize_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
164
+ export function remove_stun_peer(public_key: string): Promise<void>;
162
165
  /**
163
- * @returns {Promise<void>}
166
+ * @returns {Promise<string>}
164
167
  */
165
- export function disable_producing_blocks_by_timer(): Promise<void>;
168
+ export function get_congestion_stats(): Promise<string>;
166
169
  /**
167
170
  * @param {Uint8Array} buffer
168
- * @param {Uint8Array} hash
169
- * @param {bigint} block_id
170
- * @param {string} key
171
- * @returns {Promise<void>}
171
+ * @param {WasmNetworkPeer} peer
172
+ * @returns {Promise<Uint8Array>}
172
173
  */
173
- export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
174
+ export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
174
175
  /**
175
176
  * @param {bigint} amt
176
177
  * @param {string} slip1_utxo_key
@@ -182,99 +183,60 @@ export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, bloc
182
183
  */
183
184
  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>;
184
185
  /**
185
- * @param {number} major
186
- * @param {number} minor
187
- * @param {number} patch
188
- * @returns {Promise<void>}
189
- */
190
- export function set_wallet_version(major: number, minor: number, patch: number): Promise<void>;
191
- /**
192
- * @param {Uint8Array} buffer
193
- * @param {WasmNetworkPeer} peer
194
- * @returns {Promise<Uint8Array>}
195
- */
196
- export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
197
- /**
198
- * @param {Uint8Array} buffer
199
- * @param {number} msg_index
200
- * @param {string} key
201
- * @returns {Promise<void>}
202
- */
203
- export function send_api_error(buffer: Uint8Array, msg_index: number, key: string): Promise<void>;
204
- /**
205
- * @param {Array<any>} keys
206
- * @returns {Promise<WasmBalanceSnapshot>}
207
- */
208
- export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
209
- /**
210
- * @param {string} key
211
- * @returns {Promise<WasmPeer | undefined>}
212
- */
213
- export function get_peer(key: string): Promise<WasmPeer | undefined>;
214
- /**
215
- * @param {string} key
216
- * @returns {Promise<void>}
217
- */
218
- export function process_peer_disconnection(key: string): Promise<void>;
219
- /**
220
186
  * @param {WasmNetworkPeer} peer
221
187
  * @returns {Promise<void>}
222
188
  */
223
189
  export function process_new_peer(peer: WasmNetworkPeer): Promise<void>;
224
190
  /**
225
- * @returns {Promise<string>}
226
- */
227
- export function get_latest_block_hash(): Promise<string>;
228
- /**
229
- * @param {string} block_hash
230
- * @returns {Promise<WasmBlock>}
191
+ * @param {Array<any>} public_keys
192
+ * @param {BigUint64Array} amounts
193
+ * @param {bigint} fee
194
+ * @param {boolean} _force_merge
195
+ * @returns {Promise<WasmTransaction>}
231
196
  */
232
- export function get_block(block_hash: string): Promise<WasmBlock>;
197
+ export function create_transaction_with_multiple_payments(public_keys: Array<any>, amounts: BigUint64Array, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
233
198
  /**
234
- * @param {Uint8Array} hash
235
- * @param {bigint} block_id
236
- * @param {string} key
237
- * @returns {Promise<void>}
199
+ * @returns {WasmNetwork}
238
200
  */
239
- export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
201
+ export function get_network(): WasmNetwork;
240
202
  /**
241
- * @param {string} public_key
242
- * @param {bigint} amount
243
- * @param {bigint} fee
244
- * @param {boolean} force_merge
245
- * @returns {Promise<WasmTransaction>}
203
+ * @returns {Promise<WasmWallet>}
246
204
  */
247
- export function create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
205
+ export function get_wallet(): Promise<WasmWallet>;
248
206
  /**
249
- * @param {string} public_key
250
- * @returns {Promise<Array<any>>}
207
+ * @param {string} private_key
208
+ * @returns {string}
251
209
  */
252
- export function get_account_slips(public_key: string): Promise<Array<any>>;
210
+ export function generate_public_key(private_key: string): string;
253
211
  /**
254
- * @returns {Promise<Array<any>>}
212
+ * @returns {Promise<boolean>}
255
213
  */
256
- export function get_peers(): Promise<Array<any>>;
214
+ export function produce_block_without_gt(): Promise<boolean>;
257
215
  /**
258
216
  * @param {Uint8Array} buffer
259
- * @param {number} msg_index
260
- * @param {string} key
261
- * @returns {Promise<void>}
217
+ * @param {string} signature
218
+ * @param {string} public_key
219
+ * @returns {boolean}
262
220
  */
263
- export function send_api_call(buffer: Uint8Array, msg_index: number, key: string): Promise<void>;
221
+ export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
264
222
  /**
265
- * @param {WasmBalanceSnapshot} snapshot
266
- * @returns {Promise<void>}
223
+ * @returns {Promise<Array<any>>}
267
224
  */
268
- export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
225
+ export function get_nft_list(): Promise<Array<any>>;
269
226
  /**
270
- * @param {string} public_key
271
- * @returns {Promise<void>}
227
+ * @returns {string}
272
228
  */
273
- export function process_stun_peer(public_key: string): Promise<void>;
229
+ export function generate_private_key(): string;
274
230
  /**
275
- * @returns {Promise<void>}
231
+ * @param {bigint} num
232
+ * @param {bigint} deposit
233
+ * @param {Uint8Array} tx_msg
234
+ * @param {bigint} _fee
235
+ * @param {string} recipient_public_key
236
+ * @param {string} nft_type
237
+ * @returns {Promise<WasmTransaction>}
276
238
  */
277
- export function start_from_received_ghost_chain(): Promise<void>;
239
+ export function create_bound_transaction(num: bigint, deposit: bigint, tx_msg: Uint8Array, _fee: bigint, recipient_public_key: string, nft_type: string): Promise<WasmTransaction>;
278
240
  /**
279
241
  */
280
242
  export class SaitoWasm {
@@ -666,6 +628,57 @@ export class WasmNFT {
666
628
  }
667
629
  /**
668
630
  */
631
+ export class WasmNetwork {
632
+ free(): void;
633
+ /**
634
+ * @param {WasmTransaction} wtx
635
+ * @returns {Promise<void>}
636
+ */
637
+ propagateTransaction(wtx: WasmTransaction): Promise<void>;
638
+ /**
639
+ */
640
+ constructor();
641
+ /**
642
+ * @param {string} key
643
+ * @returns {Promise<WasmPeer | undefined>}
644
+ */
645
+ getPeer(key: string): Promise<WasmPeer | undefined>;
646
+ /**
647
+ * @returns {Promise<Array<any>>}
648
+ */
649
+ getPeers(): Promise<Array<any>>;
650
+ /**
651
+ */
652
+ readonly api: WasmNetworkApi;
653
+ }
654
+ /**
655
+ */
656
+ export class WasmNetworkApi {
657
+ free(): void;
658
+ /**
659
+ * @param {Uint8Array} buffer
660
+ * @param {number} msg_index
661
+ * @param {string} key
662
+ * @returns {Promise<void>}
663
+ */
664
+ send(buffer: Uint8Array, msg_index: number, key: string): Promise<void>;
665
+ /**
666
+ * @param {Uint8Array} buffer
667
+ * @param {number} msg_index
668
+ * @param {string} key
669
+ * @returns {Promise<void>}
670
+ */
671
+ error(buffer: Uint8Array, msg_index: number, key: string): Promise<void>;
672
+ /**
673
+ * @param {Uint8Array} buffer
674
+ * @param {number} msg_index
675
+ * @param {string} key
676
+ * @returns {Promise<void>}
677
+ */
678
+ success(buffer: Uint8Array, msg_index: number, key: string): Promise<void>;
679
+ }
680
+ /**
681
+ */
669
682
  export class WasmNetworkPeer {
670
683
  free(): void;
671
684
  /**
@@ -896,6 +909,17 @@ export class WasmWallet {
896
909
  */
897
910
  set_private_key(key: string): Promise<void>;
898
911
  /**
912
+ * @returns {Promise<object>}
913
+ */
914
+ getWalletVersion(): Promise<object>;
915
+ /**
916
+ * @param {number} major
917
+ * @param {number} minor
918
+ * @param {number} patch
919
+ * @returns {Promise<void>}
920
+ */
921
+ setWalletVersion(major: number, minor: number, patch: number): Promise<void>;
922
+ /**
899
923
  * @returns {Promise<void>}
900
924
  */
901
925
  load(): Promise<void>;