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