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