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