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