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