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