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