saito-wasm 0.2.224 → 0.2.225

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.224"
3
+ version = "0.2.225"
4
4
  edition = "2021"
5
5
 
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -16,7 +16,7 @@ serde-wasm-bindgen = { version = "=0.6.5" }
16
16
  web-sys = "=0.3.69"
17
17
  async-trait = "=0.1.80"
18
18
  hex = "=0.4.3"
19
- tokio = "=1.37.0"
19
+ tokio = "=1.51.0"
20
20
  js-sys = { version = "=0.3.69" }
21
21
  lazy_static = "=1.4.0"
22
22
  console_log = { version = "=1.0.0", features = ["color"] }
@@ -35,11 +35,5 @@ rayon = "=1.10.0"
35
35
  [package.metadata.wasm-pack.profile.release]
36
36
  wasm-opt = ['-Oz']
37
37
 
38
- [profile.release]
39
- lto = "thin"
40
- codegen-units = 1
41
- opt-level = 3
42
- panic = "abort"
43
-
44
38
  [features]
45
39
  default = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.2.224",
3
+ "version": "0.2.225",
4
4
  "files": [
5
5
  "pkg/web/**/*",
6
6
  "pkg/node/**/*",
@@ -2,51 +2,46 @@
2
2
  /* eslint-disable */
3
3
  /**
4
4
  * @param {Uint8Array} buffer
5
- * @param {WasmNetworkPeer} peer
6
- * @returns {Promise<Uint8Array>}
5
+ * @param {string} signature
6
+ * @param {string} public_key
7
+ * @returns {boolean}
7
8
  */
8
- export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
9
+ export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
9
10
  /**
10
- * @returns {Promise<Array<any>>}
11
+ * @param {string} public_key
12
+ * @returns {Promise<void>}
11
13
  */
12
- export function get_mempool_txs(): Promise<Array<any>>;
14
+ export function process_stun_peer(public_key: string): Promise<void>;
13
15
  /**
14
- * @param {Uint8Array} hash
15
- * @param {bigint} block_id
16
- * @param {string} key
16
+ * @param {bigint} threshold
17
17
  * @returns {Promise<void>}
18
18
  */
19
- export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
19
+ export function write_issuance_file(threshold: bigint): Promise<void>;
20
20
  /**
21
- * @returns {Promise<boolean>}
21
+ * @param {WasmBalanceSnapshot} snapshot
22
+ * @returns {Promise<void>}
22
23
  */
23
- export function produce_block_without_gt(): Promise<boolean>;
24
+ export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
24
25
  /**
25
- * @returns {Promise<string>}
26
+ * @param {string} block_hash
27
+ * @returns {Promise<WasmBlock>}
26
28
  */
27
- export function get_latest_block_hash(): Promise<string>;
29
+ export function get_block(block_hash: string): Promise<WasmBlock>;
28
30
  /**
29
- * @param {Array<any>} public_keys
30
- * @param {BigUint64Array} amounts
31
- * @param {bigint} fee
32
- * @param {boolean} _force_merge
33
- * @returns {Promise<WasmTransaction>}
31
+ * @param {string} key
32
+ * @returns {boolean}
34
33
  */
35
- export function create_transaction_with_multiple_payments(public_keys: Array<any>, amounts: BigUint64Array, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
34
+ export function isPublicKey(key: string): boolean;
36
35
  /**
37
- * @param {bigint} num
38
- * @param {bigint} deposit
36
+ * @param {string} nft_id_hex
39
37
  * @param {Uint8Array} tx_msg
40
- * @param {bigint} _fee
41
- * @param {string} recipient_public_key
42
- * @param {string} nft_type
43
38
  * @returns {Promise<WasmTransaction>}
44
39
  */
45
- export function create_bound_transaction(num: bigint, deposit: bigint, tx_msg: Uint8Array, _fee: bigint, recipient_public_key: string, nft_type: string): Promise<WasmTransaction>;
40
+ export function create_merge_bound_transaction(nft_id_hex: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
46
41
  /**
47
- * @returns {Promise<void>}
42
+ * @returns {Promise<WasmBlockchain>}
48
43
  */
49
- export function disable_producing_blocks_by_timer(): Promise<void>;
44
+ export function get_blockchain(): Promise<WasmBlockchain>;
50
45
  /**
51
46
  * @param {string} slip1_utxo_key
52
47
  * @param {string} slip2_utxo_key
@@ -54,57 +49,37 @@ export function disable_producing_blocks_by_timer(): Promise<void>;
54
49
  * @param {Uint8Array} tx_msg
55
50
  * @returns {Promise<WasmTransaction>}
56
51
  */
57
- export function create_remove_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
52
+ export function create_atomize_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
58
53
  /**
59
- * @param {Uint8Array} buffer
60
- * @returns {string}
54
+ * @param {bigint} duration_in_ms
55
+ * @returns {Promise<void>}
61
56
  */
62
- export function hash(buffer: Uint8Array): string;
57
+ export function process_timer_event(duration_in_ms: bigint): Promise<void>;
63
58
  /**
64
- * @param {string} slip1_utxo_key
65
- * @param {string} slip2_utxo_key
66
- * @param {string} slip3_utxo_key
67
- * @param {Uint8Array} tx_msg
68
- * @returns {Promise<WasmTransaction>}
59
+ * @returns {Promise<any>}
69
60
  */
70
- export function create_atomize_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
61
+ export function get_confirmations(): Promise<any>;
71
62
  /**
72
- * @param {WasmBalanceSnapshot} snapshot
73
- * @returns {Promise<void>}
63
+ * @returns {Promise<string>}
74
64
  */
75
- export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
65
+ export function get_stats(): Promise<string>;
76
66
  /**
77
- * @returns {WasmNetwork}
67
+ * @returns {Promise<string>}
78
68
  */
79
- export function get_network(): WasmNetwork;
69
+ export function get_latest_block_hash(): Promise<string>;
80
70
  /**
81
- * @param {string} slip1_utxo_key
82
- * @param {string} slip2_utxo_key
83
- * @param {string} slip3_utxo_key
84
- * @param {number} left_count
85
- * @param {number} right_count
86
- * @param {Uint8Array} tx_msg
87
- * @returns {Promise<WasmTransaction>}
71
+ * @returns {Promise<WasmWallet>}
88
72
  */
89
- 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>;
73
+ export function get_wallet(): Promise<WasmWallet>;
90
74
  /**
91
- * @param {Uint8Array} buffer
92
- * @param {Uint8Array} hash
93
- * @param {bigint} block_id
94
- * @param {string} key
75
+ * @param {bigint} current_time
95
76
  * @returns {Promise<void>}
96
77
  */
97
- export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
78
+ export function process_stat_interval(current_time: bigint): Promise<void>;
98
79
  /**
99
- * @param {bigint} amt
100
- * @param {string} slip1_utxo_key
101
- * @param {string} slip2_utxo_key
102
- * @param {string} slip3_utxo_key
103
- * @param {string} recipient_public_key
104
- * @param {Uint8Array} tx_msg
105
- * @returns {Promise<WasmTransaction>}
80
+ * @returns {Promise<void>}
106
81
  */
107
- 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>;
82
+ export function start_from_received_ghost_chain(): Promise<void>;
108
83
  /**
109
84
  * @param {string} config_json
110
85
  * @param {string} private_key
@@ -115,101 +90,124 @@ export function create_send_bound_transaction(amt: bigint, slip1_utxo_key: strin
115
90
  */
116
91
  export function initialize(config_json: string, private_key: string, log_level_num: number, hasten_multiplier: bigint, delete_old_blocks: boolean): Promise<any>;
117
92
  /**
118
- * @param {string} public_key
119
- * @returns {Promise<void>}
93
+ * @returns {Promise<Array<any>>}
120
94
  */
121
- export function process_stun_peer(public_key: string): Promise<void>;
95
+ export function get_nft_list(): Promise<Array<any>>;
122
96
  /**
123
- * @returns {Promise<any>}
97
+ * @param {bigint} amt
98
+ * @param {string} slip1_utxo_key
99
+ * @param {string} slip2_utxo_key
100
+ * @param {string} slip3_utxo_key
101
+ * @param {string} recipient_public_key
102
+ * @param {Uint8Array} tx_msg
103
+ * @returns {Promise<WasmTransaction>}
124
104
  */
125
- export function get_confirmations(): Promise<any>;
105
+ 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>;
126
106
  /**
127
- * @returns {Promise<WasmWallet>}
107
+ * @param {string} slip1_utxo_key
108
+ * @param {string} slip2_utxo_key
109
+ * @param {string} slip3_utxo_key
110
+ * @param {Uint8Array} tx_msg
111
+ * @returns {Promise<WasmTransaction>}
128
112
  */
129
- export function get_wallet(): Promise<WasmWallet>;
113
+ export function create_remove_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
130
114
  /**
131
- * @returns {Promise<string>}
115
+ * @returns {WasmNetwork}
132
116
  */
133
- export function get_stats(): Promise<string>;
117
+ export function get_network(): WasmNetwork;
134
118
  /**
135
- * @param {string} private_key
136
119
  * @returns {string}
137
120
  */
138
- export function generate_public_key(private_key: string): string;
139
- /**
140
- * @param {bigint} threshold
141
- * @returns {Promise<void>}
142
- */
143
- export function write_issuance_file(threshold: bigint): Promise<void>;
144
- /**
145
- * @param {bigint} current_time
146
- * @returns {Promise<void>}
147
- */
148
- export function process_stat_interval(current_time: bigint): Promise<void>;
149
- /**
150
- * @param {string} key
151
- * @returns {boolean}
152
- */
153
- export function isPublicKey(key: string): boolean;
121
+ export function generate_private_key(): string;
154
122
  /**
155
- * @param {WasmNetworkPeer} peer
156
- * @returns {Promise<void>}
123
+ * @param {Array<any>} public_keys
124
+ * @param {BigUint64Array} amounts
125
+ * @param {bigint} fee
126
+ * @param {boolean} _force_merge
127
+ * @returns {Promise<WasmTransaction>}
157
128
  */
158
- export function process_new_peer(peer: WasmNetworkPeer): Promise<void>;
129
+ export function create_transaction_with_multiple_payments(public_keys: Array<any>, amounts: BigUint64Array, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
159
130
  /**
160
- * @param {string} nft_id_hex
131
+ * @param {bigint} num
132
+ * @param {bigint} deposit
161
133
  * @param {Uint8Array} tx_msg
134
+ * @param {bigint} _fee
135
+ * @param {string} recipient_public_key
136
+ * @param {string} nft_type
162
137
  * @returns {Promise<WasmTransaction>}
163
138
  */
164
- export function create_merge_bound_transaction(nft_id_hex: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
165
- /**
166
- * @returns {string}
167
- */
168
- export function generate_private_key(): string;
139
+ export function create_bound_transaction(num: bigint, deposit: bigint, tx_msg: Uint8Array, _fee: bigint, recipient_public_key: string, nft_type: string): Promise<WasmTransaction>;
169
140
  /**
170
141
  * @param {string} public_key
171
142
  * @returns {Promise<void>}
172
143
  */
173
144
  export function remove_stun_peer(public_key: string): Promise<void>;
174
145
  /**
175
- * @param {Uint8Array} buffer
176
- * @param {string} signature
177
146
  * @param {string} public_key
178
- * @returns {boolean}
147
+ * @param {bigint} amount
148
+ * @param {bigint} fee
149
+ * @param {boolean} force_merge
150
+ * @returns {Promise<WasmTransaction>}
179
151
  */
180
- export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
152
+ export function create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
181
153
  /**
154
+ * @param {string} public_key
182
155
  * @returns {Promise<Array<any>>}
183
156
  */
184
- export function get_nft_list(): Promise<Array<any>>;
157
+ export function get_account_slips(public_key: string): Promise<Array<any>>;
185
158
  /**
186
- * @param {string} block_hash
187
- * @returns {Promise<WasmBlock>}
159
+ * @returns {Promise<Array<any>>}
188
160
  */
189
- export function get_block(block_hash: string): Promise<WasmBlock>;
161
+ export function get_mempool_txs(): Promise<Array<any>>;
190
162
  /**
191
- * @param {string} public_key
192
- * @returns {Promise<Array<any>>}
163
+ * @param {Uint8Array} buffer
164
+ * @param {Uint8Array} hash
165
+ * @param {bigint} block_id
166
+ * @param {string} key
167
+ * @returns {Promise<void>}
193
168
  */
194
- export function get_account_slips(public_key: string): Promise<Array<any>>;
169
+ export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
170
+ /**
171
+ * @param {Uint8Array} buffer
172
+ * @param {WasmNetworkPeer} peer
173
+ * @returns {Promise<Uint8Array>}
174
+ */
175
+ export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
195
176
  /**
196
177
  * @param {Array<any>} keys
197
178
  * @returns {Promise<WasmBalanceSnapshot>}
198
179
  */
199
180
  export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
200
181
  /**
182
+ * @returns {Promise<void>}
183
+ */
184
+ export function disable_producing_blocks_by_timer(): Promise<void>;
185
+ /**
186
+ * @param {string} private_key
187
+ * @returns {string}
188
+ */
189
+ export function generate_public_key(private_key: string): string;
190
+ /**
191
+ * @param {Uint8Array} hash
192
+ * @param {bigint} block_id
193
+ * @param {string} key
194
+ * @returns {Promise<void>}
195
+ */
196
+ export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
197
+ /**
201
198
  * @param {string} key
202
199
  * @returns {Promise<void>}
203
200
  */
204
201
  export function process_peer_disconnection(key: string): Promise<void>;
205
202
  /**
206
- * @returns {Promise<boolean>}
203
+ * @param {Uint8Array} buffer
204
+ * @returns {string}
207
205
  */
208
- export function produce_block_with_gt(): Promise<boolean>;
206
+ export function hash(buffer: Uint8Array): string;
209
207
  /**
210
- * @returns {Promise<void>}
208
+ * @returns {Promise<string>}
211
209
  */
212
- export function start_from_received_ghost_chain(): Promise<void>;
210
+ export function get_congestion_stats(): Promise<string>;
213
211
  /**
214
212
  * @param {Uint8Array} buffer
215
213
  * @param {string} private_key
@@ -217,26 +215,28 @@ export function start_from_received_ghost_chain(): Promise<void>;
217
215
  */
218
216
  export function sign_buffer(buffer: Uint8Array, private_key: string): string;
219
217
  /**
220
- * @returns {Promise<WasmBlockchain>}
218
+ * @param {string} slip1_utxo_key
219
+ * @param {string} slip2_utxo_key
220
+ * @param {string} slip3_utxo_key
221
+ * @param {number} left_count
222
+ * @param {number} right_count
223
+ * @param {Uint8Array} tx_msg
224
+ * @returns {Promise<WasmTransaction>}
221
225
  */
222
- export function get_blockchain(): Promise<WasmBlockchain>;
226
+ 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>;
223
227
  /**
224
- * @param {string} public_key
225
- * @param {bigint} amount
226
- * @param {bigint} fee
227
- * @param {boolean} force_merge
228
- * @returns {Promise<WasmTransaction>}
228
+ * @param {WasmNetworkPeer} peer
229
+ * @returns {Promise<void>}
229
230
  */
230
- export function create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
231
+ export function process_new_peer(peer: WasmNetworkPeer): Promise<void>;
231
232
  /**
232
- * @returns {Promise<string>}
233
+ * @returns {Promise<boolean>}
233
234
  */
234
- export function get_congestion_stats(): Promise<string>;
235
+ export function produce_block_without_gt(): Promise<boolean>;
235
236
  /**
236
- * @param {bigint} duration_in_ms
237
- * @returns {Promise<void>}
237
+ * @returns {Promise<boolean>}
238
238
  */
239
- export function process_timer_event(duration_in_ms: bigint): Promise<void>;
239
+ export function produce_block_with_gt(): Promise<boolean>;
240
240
  /**
241
241
  */
242
242
  export class SaitoWasm {