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