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