saito-wasm 0.2.225 → 0.2.227
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 -2
- package/package.json +5 -13
- package/pkg/node/index.d.ts +183 -167
- package/pkg/node/index.js +398 -365
- package/pkg/node/index_bg.wasm +0 -0
- package/pkg/node/index_bg.wasm.d.ts +25 -22
- package/pkg/node/package.json +3 -3
- package/pkg/web/index.d.ts +208 -189
- package/pkg/web/index.js +389 -359
- package/pkg/web/index_bg.wasm +0 -0
- package/pkg/web/index_bg.wasm.d.ts +25 -22
- package/pkg/web/package.json +1 -1
- package/scripts/fix-wasm-pack-output.js +65 -0
- package/pkg/node/snippets/saito-wasm-174cc7c423b30661/js/msg_handler.js +0 -145
- package/pkg/web/snippets/saito-wasm-174cc7c423b30661/js/msg_handler.js +0 -145
package/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "saito-wasm"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.227"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
|
|
6
6
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
@@ -9,7 +9,7 @@ crate-type = ["cdylib"]
|
|
|
9
9
|
|
|
10
10
|
[dependencies]
|
|
11
11
|
saito-core = { path = "../saito-core" }
|
|
12
|
-
wasm-bindgen = { version = "=0.2.92" }
|
|
12
|
+
wasm-bindgen = { version = "=0.2.92" , features = ["serde-serialize"]}
|
|
13
13
|
wasm-bindgen-futures = "=0.4.42"
|
|
14
14
|
serde = { version = "=1.0.204", features = ["derive"] }
|
|
15
15
|
serde-wasm-bindgen = { version = "=0.6.5" }
|
package/package.json
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saito-wasm",
|
|
3
|
-
"version": "0.2.
|
|
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
|
-
],
|
|
3
|
+
"version": "0.2.227",
|
|
13
4
|
"description": "js wrappings around saito-core using wasm",
|
|
14
5
|
"repository": {
|
|
15
6
|
"type": "git",
|
|
@@ -18,15 +9,16 @@
|
|
|
18
9
|
"scripts": {
|
|
19
10
|
"test": "./node_modules/.bin/jest",
|
|
20
11
|
"start": "ts-node-dev index.ts",
|
|
12
|
+
"fix-wasm-pack-output": "node ./scripts/fix-wasm-pack-output.js",
|
|
21
13
|
"build-prod": "cross-env WASM_BINDGEN_WEAKREF=1 npm run build-web-prod && npm run build-nodejs-prod",
|
|
22
14
|
"build-profile": "cross-env WASM_BINDGEN_WEAKREF=1 npm run build-web-profile && npm run build-nodejs-profile",
|
|
23
15
|
"build": "cross-env WASM_BINDGEN_WEAKREF=1 npm run build-web && npm run build-nodejs",
|
|
24
16
|
"serve": "webpack-dev-server",
|
|
25
|
-
"build-web": "wasm-pack build --target web --out-dir ./pkg/web --out-name index --dev",
|
|
17
|
+
"build-web": "wasm-pack build --target web --out-dir ./pkg/web --out-name index --dev && npm run fix-wasm-pack-output",
|
|
26
18
|
"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",
|
|
19
|
+
"build-web-prod": "wasm-pack build --target web --out-dir ./pkg/web --out-name index --release && npm run fix-wasm-pack-output",
|
|
28
20
|
"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",
|
|
21
|
+
"build-web-profile": "wasm-pack build --target web --out-dir ./pkg/web --out-name index --profiling && npm run fix-wasm-pack-output",
|
|
30
22
|
"build-nodejs-profile": "wasm-pack build --target nodejs --out-dir ./pkg/node --out-name index --profiling"
|
|
31
23
|
},
|
|
32
24
|
"author": "",
|
package/pkg/node/index.d.ts
CHANGED
|
@@ -1,213 +1,129 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
5
|
-
* @param {string} signature
|
|
6
|
-
* @param {string} public_key
|
|
7
|
-
* @returns {boolean}
|
|
4
|
+
* @returns {Promise<WasmWallet>}
|
|
8
5
|
*/
|
|
9
|
-
export function
|
|
6
|
+
export function get_wallet(): Promise<WasmWallet>;
|
|
10
7
|
/**
|
|
11
|
-
* @param {string} public_key
|
|
12
8
|
* @returns {Promise<void>}
|
|
13
9
|
*/
|
|
14
|
-
export function
|
|
10
|
+
export function disable_producing_blocks_by_timer(): Promise<void>;
|
|
15
11
|
/**
|
|
16
|
-
* @param {
|
|
12
|
+
* @param {Uint8Array} hash
|
|
13
|
+
* @param {bigint} block_id
|
|
14
|
+
* @param {bigint} peer_id
|
|
17
15
|
* @returns {Promise<void>}
|
|
18
16
|
*/
|
|
19
|
-
export function
|
|
17
|
+
export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
|
|
20
18
|
/**
|
|
21
|
-
* @param {
|
|
22
|
-
* @
|
|
19
|
+
* @param {string} config_json
|
|
20
|
+
* @param {string} private_key
|
|
21
|
+
* @param {number} log_level_num
|
|
22
|
+
* @param {bigint} hasten_multiplier
|
|
23
|
+
* @param {boolean} delete_old_blocks
|
|
24
|
+
* @returns {Promise<any>}
|
|
23
25
|
*/
|
|
24
|
-
export function
|
|
26
|
+
export function initialize(config_json: string, private_key: string, log_level_num: number, hasten_multiplier: bigint, delete_old_blocks: boolean): Promise<any>;
|
|
25
27
|
/**
|
|
26
|
-
* @param {string}
|
|
27
|
-
* @returns {
|
|
28
|
+
* @param {string} private_key
|
|
29
|
+
* @returns {string}
|
|
28
30
|
*/
|
|
29
|
-
export function
|
|
31
|
+
export function generate_public_key(private_key: string): string;
|
|
30
32
|
/**
|
|
31
|
-
* @
|
|
33
|
+
* @returns {string}
|
|
34
|
+
*/
|
|
35
|
+
export function generate_private_key(): string;
|
|
36
|
+
/**
|
|
37
|
+
* @param {Uint8Array} buffer
|
|
38
|
+
* @param {string} signature
|
|
39
|
+
* @param {string} public_key
|
|
32
40
|
* @returns {boolean}
|
|
33
41
|
*/
|
|
34
|
-
export function
|
|
42
|
+
export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
|
|
35
43
|
/**
|
|
36
|
-
* @param {
|
|
37
|
-
* @
|
|
38
|
-
* @returns {Promise<WasmTransaction>}
|
|
44
|
+
* @param {WasmBalanceSnapshot} snapshot
|
|
45
|
+
* @returns {Promise<void>}
|
|
39
46
|
*/
|
|
40
|
-
export function
|
|
47
|
+
export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
|
|
41
48
|
/**
|
|
42
49
|
* @returns {Promise<WasmBlockchain>}
|
|
43
50
|
*/
|
|
44
51
|
export function get_blockchain(): Promise<WasmBlockchain>;
|
|
45
52
|
/**
|
|
46
|
-
* @param {string} slip1_utxo_key
|
|
47
|
-
* @param {string} slip2_utxo_key
|
|
48
|
-
* @param {string} slip3_utxo_key
|
|
49
|
-
* @param {Uint8Array} tx_msg
|
|
50
|
-
* @returns {Promise<WasmTransaction>}
|
|
51
|
-
*/
|
|
52
|
-
export function create_atomize_bound_transaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
53
|
-
/**
|
|
54
53
|
* @param {bigint} duration_in_ms
|
|
55
54
|
* @returns {Promise<void>}
|
|
56
55
|
*/
|
|
57
56
|
export function process_timer_event(duration_in_ms: bigint): Promise<void>;
|
|
58
57
|
/**
|
|
59
|
-
* @returns {Promise<any>}
|
|
60
|
-
*/
|
|
61
|
-
export function get_confirmations(): Promise<any>;
|
|
62
|
-
/**
|
|
63
|
-
* @returns {Promise<string>}
|
|
64
|
-
*/
|
|
65
|
-
export function get_stats(): Promise<string>;
|
|
66
|
-
/**
|
|
67
|
-
* @returns {Promise<string>}
|
|
68
|
-
*/
|
|
69
|
-
export function get_latest_block_hash(): Promise<string>;
|
|
70
|
-
/**
|
|
71
|
-
* @returns {Promise<WasmWallet>}
|
|
72
|
-
*/
|
|
73
|
-
export function get_wallet(): Promise<WasmWallet>;
|
|
74
|
-
/**
|
|
75
58
|
* @param {bigint} current_time
|
|
76
59
|
* @returns {Promise<void>}
|
|
77
60
|
*/
|
|
78
61
|
export function process_stat_interval(current_time: bigint): Promise<void>;
|
|
79
62
|
/**
|
|
80
|
-
* @returns {Promise<void>}
|
|
81
|
-
*/
|
|
82
|
-
export function start_from_received_ghost_chain(): Promise<void>;
|
|
83
|
-
/**
|
|
84
|
-
* @param {string} config_json
|
|
85
|
-
* @param {string} private_key
|
|
86
|
-
* @param {number} log_level_num
|
|
87
|
-
* @param {bigint} hasten_multiplier
|
|
88
|
-
* @param {boolean} delete_old_blocks
|
|
89
|
-
* @returns {Promise<any>}
|
|
90
|
-
*/
|
|
91
|
-
export function initialize(config_json: string, private_key: string, log_level_num: number, hasten_multiplier: bigint, delete_old_blocks: boolean): Promise<any>;
|
|
92
|
-
/**
|
|
93
63
|
* @returns {Promise<Array<any>>}
|
|
94
64
|
*/
|
|
95
65
|
export function get_nft_list(): Promise<Array<any>>;
|
|
96
66
|
/**
|
|
97
|
-
* @param {bigint}
|
|
98
|
-
* @
|
|
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>}
|
|
67
|
+
* @param {bigint} peer_id
|
|
68
|
+
* @returns {Promise<void>}
|
|
104
69
|
*/
|
|
105
|
-
export function
|
|
70
|
+
export function process_peer_disconnection(peer_id: bigint): Promise<void>;
|
|
106
71
|
/**
|
|
107
|
-
* @param {
|
|
108
|
-
* @param {
|
|
109
|
-
* @param {
|
|
110
|
-
* @param {
|
|
111
|
-
* @returns {Promise<
|
|
72
|
+
* @param {Uint8Array} buffer
|
|
73
|
+
* @param {Uint8Array} hash
|
|
74
|
+
* @param {bigint} block_id
|
|
75
|
+
* @param {bigint} peer_id
|
|
76
|
+
* @returns {Promise<void>}
|
|
112
77
|
*/
|
|
113
|
-
export function
|
|
78
|
+
export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
|
|
114
79
|
/**
|
|
115
|
-
* @
|
|
80
|
+
* @param {bigint} peer_id
|
|
81
|
+
* @param {boolean} initiate_handshake
|
|
82
|
+
* @returns {Promise<void>}
|
|
116
83
|
*/
|
|
117
|
-
export function
|
|
84
|
+
export function process_new_peer(peer_id: bigint, initiate_handshake: boolean): Promise<void>;
|
|
118
85
|
/**
|
|
86
|
+
* @param {Uint8Array} buffer
|
|
119
87
|
* @returns {string}
|
|
120
88
|
*/
|
|
121
|
-
export function
|
|
122
|
-
/**
|
|
123
|
-
* @param {Array<any>} public_keys
|
|
124
|
-
* @param {BigUint64Array} amounts
|
|
125
|
-
* @param {bigint} fee
|
|
126
|
-
* @param {boolean} _force_merge
|
|
127
|
-
* @returns {Promise<WasmTransaction>}
|
|
128
|
-
*/
|
|
129
|
-
export function create_transaction_with_multiple_payments(public_keys: Array<any>, amounts: BigUint64Array, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
|
|
89
|
+
export function hash(buffer: Uint8Array): string;
|
|
130
90
|
/**
|
|
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>}
|
|
91
|
+
* @returns {WasmNetwork}
|
|
138
92
|
*/
|
|
139
|
-
export function
|
|
93
|
+
export function get_network(): WasmNetwork;
|
|
140
94
|
/**
|
|
141
|
-
* @param {
|
|
95
|
+
* @param {bigint} threshold
|
|
142
96
|
* @returns {Promise<void>}
|
|
143
97
|
*/
|
|
144
|
-
export function
|
|
145
|
-
/**
|
|
146
|
-
* @param {string} public_key
|
|
147
|
-
* @param {bigint} amount
|
|
148
|
-
* @param {bigint} fee
|
|
149
|
-
* @param {boolean} force_merge
|
|
150
|
-
* @returns {Promise<WasmTransaction>}
|
|
151
|
-
*/
|
|
152
|
-
export function create_transaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
|
|
98
|
+
export function write_issuance_file(threshold: bigint): Promise<void>;
|
|
153
99
|
/**
|
|
154
|
-
* @param {string}
|
|
155
|
-
* @returns {
|
|
100
|
+
* @param {string} key
|
|
101
|
+
* @returns {boolean}
|
|
156
102
|
*/
|
|
157
|
-
export function
|
|
103
|
+
export function isPublicKey(key: string): boolean;
|
|
158
104
|
/**
|
|
159
105
|
* @returns {Promise<Array<any>>}
|
|
160
106
|
*/
|
|
161
107
|
export function get_mempool_txs(): Promise<Array<any>>;
|
|
162
108
|
/**
|
|
163
|
-
* @param {Uint8Array} buffer
|
|
164
|
-
* @param {Uint8Array} hash
|
|
165
|
-
* @param {bigint} block_id
|
|
166
|
-
* @param {string} key
|
|
167
|
-
* @returns {Promise<void>}
|
|
168
|
-
*/
|
|
169
|
-
export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
|
|
170
|
-
/**
|
|
171
|
-
* @param {Uint8Array} buffer
|
|
172
|
-
* @param {WasmNetworkPeer} peer
|
|
173
|
-
* @returns {Promise<Uint8Array>}
|
|
174
|
-
*/
|
|
175
|
-
export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
|
|
176
|
-
/**
|
|
177
109
|
* @param {Array<any>} keys
|
|
178
110
|
* @returns {Promise<WasmBalanceSnapshot>}
|
|
179
111
|
*/
|
|
180
112
|
export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
|
|
181
113
|
/**
|
|
182
|
-
* @returns {Promise<
|
|
183
|
-
*/
|
|
184
|
-
export function disable_producing_blocks_by_timer(): Promise<void>;
|
|
185
|
-
/**
|
|
186
|
-
* @param {string} private_key
|
|
187
|
-
* @returns {string}
|
|
188
|
-
*/
|
|
189
|
-
export function generate_public_key(private_key: string): string;
|
|
190
|
-
/**
|
|
191
|
-
* @param {Uint8Array} hash
|
|
192
|
-
* @param {bigint} block_id
|
|
193
|
-
* @param {string} key
|
|
194
|
-
* @returns {Promise<void>}
|
|
195
|
-
*/
|
|
196
|
-
export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, key: string): Promise<void>;
|
|
197
|
-
/**
|
|
198
|
-
* @param {string} key
|
|
199
|
-
* @returns {Promise<void>}
|
|
114
|
+
* @returns {Promise<boolean>}
|
|
200
115
|
*/
|
|
201
|
-
export function
|
|
116
|
+
export function produce_block_with_gt(): Promise<boolean>;
|
|
202
117
|
/**
|
|
203
|
-
* @param {
|
|
204
|
-
* @returns {
|
|
118
|
+
* @param {string | undefined} [url]
|
|
119
|
+
* @returns {Promise<WasmNetworkPeer>}
|
|
205
120
|
*/
|
|
206
|
-
export function
|
|
121
|
+
export function create_network_peer(url?: string): Promise<WasmNetworkPeer>;
|
|
207
122
|
/**
|
|
208
|
-
* @
|
|
123
|
+
* @param {string} public_key
|
|
124
|
+
* @returns {Promise<Array<any>>}
|
|
209
125
|
*/
|
|
210
|
-
export function
|
|
126
|
+
export function get_account_slips(public_key: string): Promise<Array<any>>;
|
|
211
127
|
/**
|
|
212
128
|
* @param {Uint8Array} buffer
|
|
213
129
|
* @param {string} private_key
|
|
@@ -215,28 +131,36 @@ export function get_congestion_stats(): Promise<string>;
|
|
|
215
131
|
*/
|
|
216
132
|
export function sign_buffer(buffer: Uint8Array, private_key: string): string;
|
|
217
133
|
/**
|
|
218
|
-
* @param {
|
|
219
|
-
* @param {string}
|
|
220
|
-
* @
|
|
221
|
-
* @param {number} left_count
|
|
222
|
-
* @param {number} right_count
|
|
223
|
-
* @param {Uint8Array} tx_msg
|
|
224
|
-
* @returns {Promise<WasmTransaction>}
|
|
134
|
+
* @param {bigint} peer_id
|
|
135
|
+
* @param {string} public_key
|
|
136
|
+
* @returns {Promise<void>}
|
|
225
137
|
*/
|
|
226
|
-
export function
|
|
138
|
+
export function remove_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
|
|
227
139
|
/**
|
|
228
|
-
* @param {
|
|
140
|
+
* @param {bigint} peer_id
|
|
141
|
+
* @param {string} public_key
|
|
229
142
|
* @returns {Promise<void>}
|
|
230
143
|
*/
|
|
231
|
-
export function
|
|
144
|
+
export function process_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
|
|
232
145
|
/**
|
|
233
146
|
* @returns {Promise<boolean>}
|
|
234
147
|
*/
|
|
235
148
|
export function produce_block_without_gt(): Promise<boolean>;
|
|
236
149
|
/**
|
|
237
|
-
* @
|
|
150
|
+
* @param {string} block_hash
|
|
151
|
+
* @returns {Promise<WasmBlock>}
|
|
238
152
|
*/
|
|
239
|
-
export function
|
|
153
|
+
export function get_block(block_hash: string): Promise<WasmBlock>;
|
|
154
|
+
/**
|
|
155
|
+
* @returns {Promise<string>}
|
|
156
|
+
*/
|
|
157
|
+
export function get_latest_block_hash(): Promise<string>;
|
|
158
|
+
/**
|
|
159
|
+
* @param {Uint8Array} buffer
|
|
160
|
+
* @param {WasmNetworkPeer} peer
|
|
161
|
+
* @returns {Promise<Uint8Array>}
|
|
162
|
+
*/
|
|
163
|
+
export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
|
|
240
164
|
/**
|
|
241
165
|
*/
|
|
242
166
|
export class SaitoWasm {
|
|
@@ -526,6 +450,10 @@ export class WasmBlockchain {
|
|
|
526
450
|
*/
|
|
527
451
|
get_lowest_acceptable_block_hash(): Promise<string>;
|
|
528
452
|
/**
|
|
453
|
+
* @returns {any}
|
|
454
|
+
*/
|
|
455
|
+
get(): any;
|
|
456
|
+
/**
|
|
529
457
|
* @returns {Promise<void>}
|
|
530
458
|
*/
|
|
531
459
|
reset(): Promise<void>;
|
|
@@ -631,6 +559,11 @@ export class WasmNFT {
|
|
|
631
559
|
export class WasmNetwork {
|
|
632
560
|
free(): void;
|
|
633
561
|
/**
|
|
562
|
+
* @param {bigint} peer_id
|
|
563
|
+
* @returns {Promise<WasmPeer | undefined>}
|
|
564
|
+
*/
|
|
565
|
+
getPeerByPeerId(peer_id: bigint): Promise<WasmPeer | undefined>;
|
|
566
|
+
/**
|
|
634
567
|
* @param {WasmTransaction} wtx
|
|
635
568
|
* @returns {Promise<void>}
|
|
636
569
|
*/
|
|
@@ -650,6 +583,9 @@ export class WasmNetwork {
|
|
|
650
583
|
/**
|
|
651
584
|
*/
|
|
652
585
|
readonly api: WasmNetworkApi;
|
|
586
|
+
/**
|
|
587
|
+
*/
|
|
588
|
+
readonly peers: WasmPeers;
|
|
653
589
|
}
|
|
654
590
|
/**
|
|
655
591
|
*/
|
|
@@ -682,21 +618,21 @@ export class WasmNetworkApi {
|
|
|
682
618
|
export class WasmNetworkPeer {
|
|
683
619
|
free(): void;
|
|
684
620
|
/**
|
|
685
|
-
* @returns {string}
|
|
621
|
+
* @returns {Promise<string>}
|
|
686
622
|
*/
|
|
687
|
-
get_public_key(): string
|
|
623
|
+
get_public_key(): Promise<string>;
|
|
688
624
|
/**
|
|
689
|
-
* @returns {
|
|
625
|
+
* @returns {bigint}
|
|
690
626
|
*/
|
|
691
|
-
|
|
627
|
+
get_id(): bigint;
|
|
692
628
|
/**
|
|
693
|
-
* @returns {string}
|
|
629
|
+
* @returns {Promise<string>}
|
|
694
630
|
*/
|
|
695
|
-
get_url(): string
|
|
631
|
+
get_url(): Promise<string>;
|
|
696
632
|
/**
|
|
697
|
-
* @param {
|
|
633
|
+
* @param {bigint} peer_id
|
|
698
634
|
*/
|
|
699
|
-
constructor(
|
|
635
|
+
constructor(peer_id: bigint);
|
|
700
636
|
}
|
|
701
637
|
/**
|
|
702
638
|
*/
|
|
@@ -708,6 +644,9 @@ export class WasmPeer {
|
|
|
708
644
|
*/
|
|
709
645
|
has_service(service: string): boolean;
|
|
710
646
|
/**
|
|
647
|
+
*/
|
|
648
|
+
readonly id: bigint;
|
|
649
|
+
/**
|
|
711
650
|
*/
|
|
712
651
|
readonly key_list: Array<any>;
|
|
713
652
|
/**
|
|
@@ -754,6 +693,16 @@ export class WasmPeerServiceList {
|
|
|
754
693
|
}
|
|
755
694
|
/**
|
|
756
695
|
*/
|
|
696
|
+
export class WasmPeers {
|
|
697
|
+
free(): void;
|
|
698
|
+
/**
|
|
699
|
+
* @param {string | undefined} [public_key]
|
|
700
|
+
* @returns {any}
|
|
701
|
+
*/
|
|
702
|
+
get(public_key?: string): any;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
*/
|
|
757
706
|
export class WasmSlip {
|
|
758
707
|
free(): void;
|
|
759
708
|
/**
|
|
@@ -788,11 +737,6 @@ export class WasmSlip {
|
|
|
788
737
|
}
|
|
789
738
|
/**
|
|
790
739
|
*/
|
|
791
|
-
export class WasmStats {
|
|
792
|
-
free(): void;
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
*/
|
|
796
740
|
export class WasmTransaction {
|
|
797
741
|
free(): void;
|
|
798
742
|
/**
|
|
@@ -909,6 +853,14 @@ export class WasmWallet {
|
|
|
909
853
|
*/
|
|
910
854
|
set_private_key(key: string): Promise<void>;
|
|
911
855
|
/**
|
|
856
|
+
* @param {string} public_key
|
|
857
|
+
* @param {bigint} amount
|
|
858
|
+
* @param {bigint} fee
|
|
859
|
+
* @param {boolean} force_merge
|
|
860
|
+
* @returns {Promise<WasmTransaction>}
|
|
861
|
+
*/
|
|
862
|
+
createTransaction(public_key: string, amount: bigint, fee: bigint, force_merge: boolean): Promise<WasmTransaction>;
|
|
863
|
+
/**
|
|
912
864
|
* @returns {Promise<object>}
|
|
913
865
|
*/
|
|
914
866
|
getWalletVersion(): Promise<object>;
|
|
@@ -920,6 +872,70 @@ export class WasmWallet {
|
|
|
920
872
|
*/
|
|
921
873
|
setWalletVersion(major: number, minor: number, patch: number): Promise<void>;
|
|
922
874
|
/**
|
|
875
|
+
* @param {bigint} num
|
|
876
|
+
* @param {bigint} deposit
|
|
877
|
+
* @param {Uint8Array} tx_msg
|
|
878
|
+
* @param {bigint} _fee
|
|
879
|
+
* @param {string} recipient_public_key
|
|
880
|
+
* @param {string} nft_type
|
|
881
|
+
* @returns {Promise<WasmTransaction>}
|
|
882
|
+
*/
|
|
883
|
+
createBoundTransaction(num: bigint, deposit: bigint, tx_msg: Uint8Array, _fee: bigint, recipient_public_key: string, nft_type: string): Promise<WasmTransaction>;
|
|
884
|
+
/**
|
|
885
|
+
* @param {bigint} amt
|
|
886
|
+
* @param {string} slip1
|
|
887
|
+
* @param {string} slip2
|
|
888
|
+
* @param {string} slip3
|
|
889
|
+
* @param {string} recipient
|
|
890
|
+
* @param {Uint8Array} tx_msg
|
|
891
|
+
* @returns {Promise<WasmTransaction>}
|
|
892
|
+
*/
|
|
893
|
+
createSendBoundTransaction(amt: bigint, slip1: string, slip2: string, slip3: string, recipient: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
894
|
+
/**
|
|
895
|
+
* @param {string} nft_id_hex
|
|
896
|
+
* @param {Uint8Array} tx_msg
|
|
897
|
+
* @returns {Promise<WasmTransaction>}
|
|
898
|
+
*/
|
|
899
|
+
createMergeBoundTransaction(nft_id_hex: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
900
|
+
/**
|
|
901
|
+
* @param {string} slip1
|
|
902
|
+
* @param {string} slip2
|
|
903
|
+
* @param {string} slip3
|
|
904
|
+
* @param {number} left
|
|
905
|
+
* @param {number} right
|
|
906
|
+
* @param {Uint8Array} tx_msg
|
|
907
|
+
* @returns {Promise<WasmTransaction>}
|
|
908
|
+
*/
|
|
909
|
+
createSplitBoundTransaction(slip1: string, slip2: string, slip3: string, left: number, right: number, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
910
|
+
/**
|
|
911
|
+
* @param {string} slip1_utxo_key
|
|
912
|
+
* @param {string} slip2_utxo_key
|
|
913
|
+
* @param {string} slip3_utxo_key
|
|
914
|
+
* @param {Uint8Array} tx_msg
|
|
915
|
+
* @returns {Promise<WasmTransaction>}
|
|
916
|
+
*/
|
|
917
|
+
createRemoveBoundTransaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
918
|
+
/**
|
|
919
|
+
* @param {string} slip1_utxo_key
|
|
920
|
+
* @param {string} slip2_utxo_key
|
|
921
|
+
* @param {string} slip3_utxo_key
|
|
922
|
+
* @param {Uint8Array} tx_msg
|
|
923
|
+
* @returns {Promise<WasmTransaction>}
|
|
924
|
+
*/
|
|
925
|
+
createAtomizeBoundTransaction(slip1_utxo_key: string, slip2_utxo_key: string, slip3_utxo_key: string, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
926
|
+
/**
|
|
927
|
+
* @returns {any}
|
|
928
|
+
*/
|
|
929
|
+
get(): any;
|
|
930
|
+
/**
|
|
931
|
+
* @param {Array<any>} public_keys
|
|
932
|
+
* @param {BigUint64Array} amounts
|
|
933
|
+
* @param {bigint} fee
|
|
934
|
+
* @param {boolean} _force_merge
|
|
935
|
+
* @returns {Promise<WasmTransaction>}
|
|
936
|
+
*/
|
|
937
|
+
createTransactionWithMultiplePayments(public_keys: Array<any>, amounts: BigUint64Array, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
|
|
938
|
+
/**
|
|
923
939
|
* @returns {Promise<void>}
|
|
924
940
|
*/
|
|
925
941
|
load(): Promise<void>;
|