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