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