lumina-node-wasm 0.2.0 → 0.3.1
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/README.md +31 -5
- package/lumina_node_wasm.d.ts +259 -28
- package/lumina_node_wasm.js +2435 -5
- package/lumina_node_wasm_bg.wasm +0 -0
- package/package.json +1 -3
- package/lumina_node_wasm_bg.js +0 -2277
package/README.md
CHANGED
|
@@ -3,14 +3,40 @@
|
|
|
3
3
|
A compatibility layer for the [`Lumina`](https://github.com/eigerco/lumina) node to
|
|
4
4
|
work within a browser environment and be operable with javascript.
|
|
5
5
|
|
|
6
|
+
# Example
|
|
7
|
+
Starting lumina inside a dedicated worker
|
|
8
|
+
|
|
6
9
|
```javascript
|
|
7
|
-
import
|
|
10
|
+
import { spawnNode, NodeConfig, Network } from "lumina-node";
|
|
8
11
|
|
|
9
|
-
await
|
|
12
|
+
const node = await spawnNode();
|
|
13
|
+
const mainnetConfig = NodeConfig.default(Network.Mainnet);
|
|
14
|
+
|
|
15
|
+
await node.start(mainnetConfig);
|
|
16
|
+
|
|
17
|
+
await node.waitConnected();
|
|
18
|
+
await node.requestHeadHeader();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Manual setup
|
|
10
22
|
|
|
23
|
+
Note that `spawnNode` implicitly calls wasm initialisation code. If you want to set things up manually, make sure to call the default export before using any of the wasm functionality.
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
import init, { NodeConfig, Network } from "lumina-node";
|
|
27
|
+
|
|
28
|
+
await init();
|
|
11
29
|
const config = NodeConfig.default(Network.Mainnet);
|
|
12
|
-
const node = await new Node(config);
|
|
13
30
|
|
|
14
|
-
|
|
15
|
-
|
|
31
|
+
// client and worker accept any object with MessagePort like interface e.g. Worker
|
|
32
|
+
const channel = new MessageChannel();
|
|
33
|
+
const worker = new NodeWorker(channel.port1);
|
|
34
|
+
|
|
35
|
+
// note that this runs lumina in the current context (and doesn't create a new web-worker). Promise created with `.run()` never completes.
|
|
36
|
+
const worker_promise = worker.run();
|
|
37
|
+
|
|
38
|
+
// client port can be used locally or transferred like any plain MessagePort
|
|
39
|
+
const client = await new NodeClient(channel.port2);
|
|
40
|
+
await client.waitConnected();
|
|
41
|
+
await client.requestHeadHeader();
|
|
16
42
|
```
|
package/lumina_node_wasm.d.ts
CHANGED
|
@@ -27,7 +27,34 @@ export enum Network {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
*/
|
|
30
|
+
export class BlockRange {
|
|
31
|
+
/**
|
|
32
|
+
** Return copy of self without private attributes.
|
|
33
|
+
*/
|
|
34
|
+
toJSON(): Object;
|
|
35
|
+
/**
|
|
36
|
+
* Return stringified version of self.
|
|
37
|
+
*/
|
|
38
|
+
toString(): string;
|
|
39
|
+
free(): void;
|
|
40
|
+
/**
|
|
41
|
+
*/
|
|
42
|
+
end: bigint;
|
|
43
|
+
/**
|
|
44
|
+
*/
|
|
45
|
+
start: bigint;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
*/
|
|
30
49
|
export class ConnectionCountersSnapshot {
|
|
50
|
+
/**
|
|
51
|
+
** Return copy of self without private attributes.
|
|
52
|
+
*/
|
|
53
|
+
toJSON(): Object;
|
|
54
|
+
/**
|
|
55
|
+
* Return stringified version of self.
|
|
56
|
+
*/
|
|
57
|
+
toString(): string;
|
|
31
58
|
free(): void;
|
|
32
59
|
/**
|
|
33
60
|
*/
|
|
@@ -54,13 +81,24 @@ export class ConnectionCountersSnapshot {
|
|
|
54
81
|
/**
|
|
55
82
|
*/
|
|
56
83
|
export class NetworkInfoSnapshot {
|
|
84
|
+
/**
|
|
85
|
+
** Return copy of self without private attributes.
|
|
86
|
+
*/
|
|
87
|
+
toJSON(): Object;
|
|
88
|
+
/**
|
|
89
|
+
* Return stringified version of self.
|
|
90
|
+
*/
|
|
91
|
+
toString(): string;
|
|
57
92
|
free(): void;
|
|
58
93
|
/**
|
|
94
|
+
*/
|
|
95
|
+
connection_counters: ConnectionCountersSnapshot;
|
|
96
|
+
/**
|
|
59
97
|
*/
|
|
60
98
|
num_peers: number;
|
|
61
99
|
}
|
|
62
100
|
/**
|
|
63
|
-
* `
|
|
101
|
+
* `NodeClient` is responsible for steering [`NodeWorker`] by sending it commands and receiving
|
|
64
102
|
* responses over the provided port.
|
|
65
103
|
*
|
|
66
104
|
* [`NodeWorker`]: crate::worker::NodeWorker
|
|
@@ -74,10 +112,16 @@ export class NodeClient {
|
|
|
74
112
|
*/
|
|
75
113
|
constructor(port: any);
|
|
76
114
|
/**
|
|
115
|
+
* Establish a new connection to the existing worker over provided port
|
|
116
|
+
* @param {any} port
|
|
117
|
+
* @returns {Promise<void>}
|
|
118
|
+
*/
|
|
119
|
+
addConnectionToWorker(port: any): Promise<void>;
|
|
120
|
+
/**
|
|
77
121
|
* Check whether Lumina is currently running
|
|
78
122
|
* @returns {Promise<boolean>}
|
|
79
123
|
*/
|
|
80
|
-
|
|
124
|
+
isRunning(): Promise<boolean>;
|
|
81
125
|
/**
|
|
82
126
|
* Start a node with the provided config, if it's not running
|
|
83
127
|
* @param {NodeConfig} config
|
|
@@ -88,27 +132,27 @@ export class NodeClient {
|
|
|
88
132
|
* Get node's local peer ID.
|
|
89
133
|
* @returns {Promise<string>}
|
|
90
134
|
*/
|
|
91
|
-
|
|
135
|
+
localPeerId(): Promise<string>;
|
|
92
136
|
/**
|
|
93
137
|
* Get current [`PeerTracker`] info.
|
|
94
|
-
* @returns {Promise<
|
|
138
|
+
* @returns {Promise<PeerTrackerInfoSnapshot>}
|
|
95
139
|
*/
|
|
96
|
-
|
|
140
|
+
peerTrackerInfo(): Promise<PeerTrackerInfoSnapshot>;
|
|
97
141
|
/**
|
|
98
142
|
* Wait until the node is connected to at least 1 peer.
|
|
99
143
|
* @returns {Promise<void>}
|
|
100
144
|
*/
|
|
101
|
-
|
|
145
|
+
waitConnected(): Promise<void>;
|
|
102
146
|
/**
|
|
103
147
|
* Wait until the node is connected to at least 1 trusted peer.
|
|
104
148
|
* @returns {Promise<void>}
|
|
105
149
|
*/
|
|
106
|
-
|
|
150
|
+
waitConnectedTrusted(): Promise<void>;
|
|
107
151
|
/**
|
|
108
152
|
* Get current network info.
|
|
109
153
|
* @returns {Promise<NetworkInfoSnapshot>}
|
|
110
154
|
*/
|
|
111
|
-
|
|
155
|
+
networkInfo(): Promise<NetworkInfoSnapshot>;
|
|
112
156
|
/**
|
|
113
157
|
* Get all the multiaddresses on which the node listens.
|
|
114
158
|
* @returns {Promise<Array<any>>}
|
|
@@ -118,67 +162,91 @@ export class NodeClient {
|
|
|
118
162
|
* Get all the peers that node is connected to.
|
|
119
163
|
* @returns {Promise<Array<any>>}
|
|
120
164
|
*/
|
|
121
|
-
|
|
165
|
+
connectedPeers(): Promise<Array<any>>;
|
|
122
166
|
/**
|
|
123
167
|
* Trust or untrust the peer with a given ID.
|
|
124
168
|
* @param {string} peer_id
|
|
125
169
|
* @param {boolean} is_trusted
|
|
126
170
|
* @returns {Promise<void>}
|
|
127
171
|
*/
|
|
128
|
-
|
|
172
|
+
setPeerTrust(peer_id: string, is_trusted: boolean): Promise<void>;
|
|
129
173
|
/**
|
|
130
174
|
* Request the head header from the network.
|
|
175
|
+
*
|
|
176
|
+
* Returns a javascript object with given structure:
|
|
177
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
131
178
|
* @returns {Promise<any>}
|
|
132
179
|
*/
|
|
133
|
-
|
|
180
|
+
requestHeadHeader(): Promise<any>;
|
|
134
181
|
/**
|
|
135
182
|
* Request a header for the block with a given hash from the network.
|
|
183
|
+
*
|
|
184
|
+
* Returns a javascript object with given structure:
|
|
185
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
136
186
|
* @param {string} hash
|
|
137
187
|
* @returns {Promise<any>}
|
|
138
188
|
*/
|
|
139
|
-
|
|
189
|
+
requestHeaderByHash(hash: string): Promise<any>;
|
|
140
190
|
/**
|
|
141
191
|
* Request a header for the block with a given height from the network.
|
|
192
|
+
*
|
|
193
|
+
* Returns a javascript object with given structure:
|
|
194
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
142
195
|
* @param {bigint} height
|
|
143
196
|
* @returns {Promise<any>}
|
|
144
197
|
*/
|
|
145
|
-
|
|
198
|
+
requestHeaderByHeight(height: bigint): Promise<any>;
|
|
146
199
|
/**
|
|
147
200
|
* Request headers in range (from, from + amount] from the network.
|
|
148
201
|
*
|
|
149
202
|
* The headers will be verified with the `from` header.
|
|
203
|
+
*
|
|
204
|
+
* Returns an array of javascript objects with given structure:
|
|
205
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
150
206
|
* @param {any} from_header
|
|
151
207
|
* @param {bigint} amount
|
|
152
208
|
* @returns {Promise<Array<any>>}
|
|
153
209
|
*/
|
|
154
|
-
|
|
210
|
+
requestVerifiedHeaders(from_header: any, amount: bigint): Promise<Array<any>>;
|
|
155
211
|
/**
|
|
156
212
|
* Get current header syncing info.
|
|
157
|
-
* @returns {Promise<
|
|
213
|
+
* @returns {Promise<SyncingInfoSnapshot>}
|
|
158
214
|
*/
|
|
159
|
-
|
|
215
|
+
syncerInfo(): Promise<SyncingInfoSnapshot>;
|
|
160
216
|
/**
|
|
161
217
|
* Get the latest header announced in the network.
|
|
218
|
+
*
|
|
219
|
+
* Returns a javascript object with given structure:
|
|
220
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
162
221
|
* @returns {Promise<any>}
|
|
163
222
|
*/
|
|
164
|
-
|
|
223
|
+
getNetworkHeadHeader(): Promise<any>;
|
|
165
224
|
/**
|
|
166
225
|
* Get the latest locally synced header.
|
|
226
|
+
*
|
|
227
|
+
* Returns a javascript object with given structure:
|
|
228
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
167
229
|
* @returns {Promise<any>}
|
|
168
230
|
*/
|
|
169
|
-
|
|
231
|
+
getLocalHeadHeader(): Promise<any>;
|
|
170
232
|
/**
|
|
171
233
|
* Get a synced header for the block with a given hash.
|
|
234
|
+
*
|
|
235
|
+
* Returns a javascript object with given structure:
|
|
236
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
172
237
|
* @param {string} hash
|
|
173
238
|
* @returns {Promise<any>}
|
|
174
239
|
*/
|
|
175
|
-
|
|
240
|
+
getHeaderByHash(hash: string): Promise<any>;
|
|
176
241
|
/**
|
|
177
242
|
* Get a synced header for the block with a given height.
|
|
243
|
+
*
|
|
244
|
+
* Returns a javascript object with given structure:
|
|
245
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
178
246
|
* @param {bigint} height
|
|
179
247
|
* @returns {Promise<any>}
|
|
180
248
|
*/
|
|
181
|
-
|
|
249
|
+
getHeaderByHeight(height: bigint): Promise<any>;
|
|
182
250
|
/**
|
|
183
251
|
* Get synced headers from the given heights range.
|
|
184
252
|
*
|
|
@@ -189,17 +257,23 @@ export class NodeClient {
|
|
|
189
257
|
* # Errors
|
|
190
258
|
*
|
|
191
259
|
* If range contains a height of a header that is not found in the store.
|
|
260
|
+
*
|
|
261
|
+
* Returns an array of javascript objects with given structure:
|
|
262
|
+
* https://docs.rs/celestia-types/latest/celestia_types/struct.ExtendedHeader.html
|
|
192
263
|
* @param {bigint | undefined} [start_height]
|
|
193
264
|
* @param {bigint | undefined} [end_height]
|
|
194
265
|
* @returns {Promise<Array<any>>}
|
|
195
266
|
*/
|
|
196
|
-
|
|
267
|
+
getHeaders(start_height?: bigint, end_height?: bigint): Promise<Array<any>>;
|
|
197
268
|
/**
|
|
198
269
|
* Get data sampling metadata of an already sampled height.
|
|
270
|
+
*
|
|
271
|
+
* Returns a javascript object with given structure:
|
|
272
|
+
* https://docs.rs/lumina-node/latest/lumina_node/store/struct.SamplingMetadata.html
|
|
199
273
|
* @param {bigint} height
|
|
200
274
|
* @returns {Promise<any>}
|
|
201
275
|
*/
|
|
202
|
-
|
|
276
|
+
getSamplingMetadata(height: bigint): Promise<any>;
|
|
203
277
|
/**
|
|
204
278
|
* Requests SharedWorker running lumina to close. Any events received afterwards wont
|
|
205
279
|
* be processed and new NodeClient needs to be created to restart a node.
|
|
@@ -210,12 +284,20 @@ export class NodeClient {
|
|
|
210
284
|
* Returns a [`BroadcastChannel`] for events generated by [`Node`].
|
|
211
285
|
* @returns {Promise<BroadcastChannel>}
|
|
212
286
|
*/
|
|
213
|
-
|
|
287
|
+
eventsChannel(): Promise<BroadcastChannel>;
|
|
214
288
|
}
|
|
215
289
|
/**
|
|
216
290
|
* Config for the lumina wasm node.
|
|
217
291
|
*/
|
|
218
292
|
export class NodeConfig {
|
|
293
|
+
/**
|
|
294
|
+
** Return copy of self without private attributes.
|
|
295
|
+
*/
|
|
296
|
+
toJSON(): Object;
|
|
297
|
+
/**
|
|
298
|
+
* Return stringified version of self.
|
|
299
|
+
*/
|
|
300
|
+
toString(): string;
|
|
219
301
|
free(): void;
|
|
220
302
|
/**
|
|
221
303
|
* Get the configuration with default bootnodes for provided network
|
|
@@ -237,15 +319,164 @@ export class NodeConfig {
|
|
|
237
319
|
export class NodeWorker {
|
|
238
320
|
free(): void;
|
|
239
321
|
/**
|
|
322
|
+
* @param {any} port_like_object
|
|
240
323
|
*/
|
|
241
|
-
constructor();
|
|
324
|
+
constructor(port_like_object: any);
|
|
242
325
|
/**
|
|
243
|
-
* @param {any} port
|
|
244
326
|
* @returns {Promise<void>}
|
|
245
327
|
*/
|
|
246
|
-
|
|
328
|
+
run(): Promise<void>;
|
|
329
|
+
}
|
|
247
330
|
/**
|
|
248
|
-
* @returns {Promise<void>}
|
|
249
331
|
*/
|
|
250
|
-
|
|
332
|
+
export class PeerTrackerInfoSnapshot {
|
|
333
|
+
/**
|
|
334
|
+
** Return copy of self without private attributes.
|
|
335
|
+
*/
|
|
336
|
+
toJSON(): Object;
|
|
337
|
+
/**
|
|
338
|
+
* Return stringified version of self.
|
|
339
|
+
*/
|
|
340
|
+
toString(): string;
|
|
341
|
+
free(): void;
|
|
342
|
+
/**
|
|
343
|
+
*/
|
|
344
|
+
num_connected_peers: bigint;
|
|
345
|
+
/**
|
|
346
|
+
*/
|
|
347
|
+
num_connected_trusted_peers: bigint;
|
|
251
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
*/
|
|
351
|
+
export class SyncingInfoSnapshot {
|
|
352
|
+
/**
|
|
353
|
+
** Return copy of self without private attributes.
|
|
354
|
+
*/
|
|
355
|
+
toJSON(): Object;
|
|
356
|
+
/**
|
|
357
|
+
* Return stringified version of self.
|
|
358
|
+
*/
|
|
359
|
+
toString(): string;
|
|
360
|
+
free(): void;
|
|
361
|
+
/**
|
|
362
|
+
*/
|
|
363
|
+
stored_headers: (BlockRange)[];
|
|
364
|
+
/**
|
|
365
|
+
*/
|
|
366
|
+
subjective_head: bigint;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
370
|
+
|
|
371
|
+
export interface InitOutput {
|
|
372
|
+
readonly memory: WebAssembly.Memory;
|
|
373
|
+
readonly setup_logging: () => void;
|
|
374
|
+
readonly __wbg_nodeconfig_free: (a: number, b: number) => void;
|
|
375
|
+
readonly __wbg_get_nodeconfig_network: (a: number) => number;
|
|
376
|
+
readonly __wbg_set_nodeconfig_network: (a: number, b: number) => void;
|
|
377
|
+
readonly __wbg_get_nodeconfig_bootnodes: (a: number, b: number) => void;
|
|
378
|
+
readonly __wbg_set_nodeconfig_bootnodes: (a: number, b: number, c: number) => void;
|
|
379
|
+
readonly __wbg_nodeclient_free: (a: number, b: number) => void;
|
|
380
|
+
readonly nodeclient_new: (a: number) => number;
|
|
381
|
+
readonly nodeclient_addConnectionToWorker: (a: number, b: number) => number;
|
|
382
|
+
readonly nodeclient_isRunning: (a: number) => number;
|
|
383
|
+
readonly nodeclient_start: (a: number, b: number) => number;
|
|
384
|
+
readonly nodeclient_localPeerId: (a: number) => number;
|
|
385
|
+
readonly nodeclient_peerTrackerInfo: (a: number) => number;
|
|
386
|
+
readonly nodeclient_waitConnected: (a: number) => number;
|
|
387
|
+
readonly nodeclient_waitConnectedTrusted: (a: number) => number;
|
|
388
|
+
readonly nodeclient_networkInfo: (a: number) => number;
|
|
389
|
+
readonly nodeclient_listeners: (a: number) => number;
|
|
390
|
+
readonly nodeclient_connectedPeers: (a: number) => number;
|
|
391
|
+
readonly nodeclient_setPeerTrust: (a: number, b: number, c: number, d: number) => number;
|
|
392
|
+
readonly nodeclient_requestHeadHeader: (a: number) => number;
|
|
393
|
+
readonly nodeclient_requestHeaderByHash: (a: number, b: number, c: number) => number;
|
|
394
|
+
readonly nodeclient_requestHeaderByHeight: (a: number, b: number) => number;
|
|
395
|
+
readonly nodeclient_requestVerifiedHeaders: (a: number, b: number, c: number) => number;
|
|
396
|
+
readonly nodeclient_syncerInfo: (a: number) => number;
|
|
397
|
+
readonly nodeclient_getNetworkHeadHeader: (a: number) => number;
|
|
398
|
+
readonly nodeclient_getLocalHeadHeader: (a: number) => number;
|
|
399
|
+
readonly nodeclient_getHeaderByHash: (a: number, b: number, c: number) => number;
|
|
400
|
+
readonly nodeclient_getHeaderByHeight: (a: number, b: number) => number;
|
|
401
|
+
readonly nodeclient_getHeaders: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
402
|
+
readonly nodeclient_getSamplingMetadata: (a: number, b: number) => number;
|
|
403
|
+
readonly nodeclient_close: (a: number) => number;
|
|
404
|
+
readonly nodeclient_eventsChannel: (a: number) => number;
|
|
405
|
+
readonly nodeconfig_default: (a: number) => number;
|
|
406
|
+
readonly __wbg_nodeworker_free: (a: number, b: number) => void;
|
|
407
|
+
readonly nodeworker_new: (a: number) => number;
|
|
408
|
+
readonly nodeworker_run: (a: number) => number;
|
|
409
|
+
readonly __wbg_networkinfosnapshot_free: (a: number, b: number) => void;
|
|
410
|
+
readonly __wbg_get_networkinfosnapshot_connection_counters: (a: number) => number;
|
|
411
|
+
readonly __wbg_set_networkinfosnapshot_connection_counters: (a: number, b: number) => void;
|
|
412
|
+
readonly __wbg_connectioncounterssnapshot_free: (a: number, b: number) => void;
|
|
413
|
+
readonly __wbg_get_connectioncounterssnapshot_num_connections: (a: number) => number;
|
|
414
|
+
readonly __wbg_set_connectioncounterssnapshot_num_connections: (a: number, b: number) => void;
|
|
415
|
+
readonly __wbg_get_connectioncounterssnapshot_num_pending: (a: number) => number;
|
|
416
|
+
readonly __wbg_set_connectioncounterssnapshot_num_pending: (a: number, b: number) => void;
|
|
417
|
+
readonly __wbg_get_connectioncounterssnapshot_num_pending_incoming: (a: number) => number;
|
|
418
|
+
readonly __wbg_set_connectioncounterssnapshot_num_pending_incoming: (a: number, b: number) => void;
|
|
419
|
+
readonly __wbg_get_connectioncounterssnapshot_num_pending_outgoing: (a: number) => number;
|
|
420
|
+
readonly __wbg_set_connectioncounterssnapshot_num_pending_outgoing: (a: number, b: number) => void;
|
|
421
|
+
readonly __wbg_get_connectioncounterssnapshot_num_established: (a: number) => number;
|
|
422
|
+
readonly __wbg_set_connectioncounterssnapshot_num_established: (a: number, b: number) => void;
|
|
423
|
+
readonly __wbg_get_connectioncounterssnapshot_num_established_incoming: (a: number) => number;
|
|
424
|
+
readonly __wbg_set_connectioncounterssnapshot_num_established_incoming: (a: number, b: number) => void;
|
|
425
|
+
readonly __wbg_get_connectioncounterssnapshot_num_established_outgoing: (a: number) => number;
|
|
426
|
+
readonly __wbg_set_connectioncounterssnapshot_num_established_outgoing: (a: number, b: number) => void;
|
|
427
|
+
readonly __wbg_set_networkinfosnapshot_num_peers: (a: number, b: number) => void;
|
|
428
|
+
readonly __wbg_get_networkinfosnapshot_num_peers: (a: number) => number;
|
|
429
|
+
readonly __wbg_blockrange_free: (a: number, b: number) => void;
|
|
430
|
+
readonly __wbg_get_blockrange_start: (a: number) => number;
|
|
431
|
+
readonly __wbg_set_blockrange_start: (a: number, b: number) => void;
|
|
432
|
+
readonly __wbg_get_blockrange_end: (a: number) => number;
|
|
433
|
+
readonly __wbg_set_blockrange_end: (a: number, b: number) => void;
|
|
434
|
+
readonly __wbg_syncinginfosnapshot_free: (a: number, b: number) => void;
|
|
435
|
+
readonly __wbg_get_syncinginfosnapshot_stored_headers: (a: number, b: number) => void;
|
|
436
|
+
readonly __wbg_set_syncinginfosnapshot_stored_headers: (a: number, b: number, c: number) => void;
|
|
437
|
+
readonly __wbg_set_peertrackerinfosnapshot_num_connected_peers: (a: number, b: number) => void;
|
|
438
|
+
readonly __wbg_set_peertrackerinfosnapshot_num_connected_trusted_peers: (a: number, b: number) => void;
|
|
439
|
+
readonly __wbg_set_syncinginfosnapshot_subjective_head: (a: number, b: number) => void;
|
|
440
|
+
readonly __wbg_get_peertrackerinfosnapshot_num_connected_peers: (a: number) => number;
|
|
441
|
+
readonly __wbg_get_peertrackerinfosnapshot_num_connected_trusted_peers: (a: number) => number;
|
|
442
|
+
readonly __wbg_get_syncinginfosnapshot_subjective_head: (a: number) => number;
|
|
443
|
+
readonly __wbg_peertrackerinfosnapshot_free: (a: number, b: number) => void;
|
|
444
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
445
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
446
|
+
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
447
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2f6a021db35c77b9: (a: number, b: number, c: number) => void;
|
|
448
|
+
readonly _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbb2cadc81740e52e: (a: number, b: number, c: number) => void;
|
|
449
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h551e5119637c385e: (a: number, b: number) => void;
|
|
450
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h62ad66d3e9f77ac4: (a: number, b: number, c: number) => void;
|
|
451
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0a0047be2e37408e: (a: number, b: number) => void;
|
|
452
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h80386b419f109aff: (a: number, b: number, c: number) => void;
|
|
453
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0ff40ee0b4df5b25: (a: number, b: number, c: number) => void;
|
|
454
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbfb1f6eb8d7aa58f: (a: number, b: number, c: number) => void;
|
|
455
|
+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9503509ad8c78ce2: (a: number, b: number) => void;
|
|
456
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
457
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
458
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
459
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h47e988f82b6e4529: (a: number, b: number, c: number, d: number) => void;
|
|
460
|
+
readonly __wbindgen_start: () => void;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
464
|
+
/**
|
|
465
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
466
|
+
* a precompiled `WebAssembly.Module`.
|
|
467
|
+
*
|
|
468
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
469
|
+
*
|
|
470
|
+
* @returns {InitOutput}
|
|
471
|
+
*/
|
|
472
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
476
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
477
|
+
*
|
|
478
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
479
|
+
*
|
|
480
|
+
* @returns {Promise<InitOutput>}
|
|
481
|
+
*/
|
|
482
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|