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