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