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