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