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