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