@parity/truapi-provider 0.1.1-dev-20260902.0 → 0.1.1-dev-20260908.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 +7 -20
- package/dist/truapi_provider.d.ts +54 -6
- package/dist/truapi_provider.js +197 -24
- package/dist/truapi_provider_bg.wasm +0 -0
- package/dist/truapi_provider_bg.wasm.d.ts +10 -6
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -8,15 +8,11 @@ for browser and desktop (webview) hosts.
|
|
|
8
8
|
You connect to a network by its genesis hash, and everything else is handled for
|
|
9
9
|
you: the bundled catalog provides the spec and relay wiring, so clients never
|
|
10
10
|
ship or refresh specs of their own. One light client is shared across all
|
|
11
|
-
connections
|
|
11
|
+
connections, and its synced state is kept between launches, so a launch resumes
|
|
12
12
|
from finalized state instead of syncing from scratch.
|
|
13
13
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
|
-
Build a provider, connect to a network by its genesis hash, and exchange JSON-RPC
|
|
17
|
-
request and response strings over the connection. Every connection shares the one
|
|
18
|
-
embedded light client.
|
|
19
|
-
|
|
20
16
|
#### Web (JavaScript)
|
|
21
17
|
|
|
22
18
|
The published package is `wasm-bindgen` glue plus a `.wasm` binary. Instantiate
|
|
@@ -28,28 +24,19 @@ import wasmUrl from "@parity/truapi-provider/truapi_provider_bg.wasm?url";
|
|
|
28
24
|
|
|
29
25
|
await init({ module_or_path: wasmUrl });
|
|
30
26
|
|
|
31
|
-
const genesis = "0x3740…";
|
|
32
27
|
const builder = new ChainProviderBuilder();
|
|
33
|
-
|
|
34
|
-
// Resume from the state saved by the previous run, when there is one.
|
|
35
|
-
const saved = localStorage.getItem(`chain-db:${genesis}`);
|
|
36
|
-
if (saved) builder.setDatabase(genesis, saved);
|
|
28
|
+
const chains = builder.addNetwork("paseo-next-v2");
|
|
37
29
|
|
|
38
30
|
const provider = builder.build();
|
|
39
|
-
const connection = await provider.connect(
|
|
31
|
+
const connection = await provider.connect(chains.relay);
|
|
40
32
|
|
|
41
|
-
connection.send(
|
|
33
|
+
connection.send(
|
|
34
|
+
'{"jsonrpc":"2.0","id":1,"method":"chainSpec_v1_genesisHash","params":[]}',
|
|
35
|
+
);
|
|
42
36
|
const response = await connection.nextResponse(); // undefined once closed
|
|
43
37
|
connection.close();
|
|
44
|
-
|
|
45
|
-
// Later, once the light client has synced, save state for the next launch.
|
|
46
|
-
localStorage.setItem(`chain-db:${genesis}`, await provider.snapshot(genesis));
|
|
47
38
|
```
|
|
48
39
|
|
|
49
|
-
Warm start is driven by the host: call `snapshot()` once the light client has
|
|
50
|
-
synced, persist the string, and hand it back through `setDatabase()` before
|
|
51
|
-
`build()` on the next launch.
|
|
52
|
-
|
|
53
40
|
## Native hosts
|
|
54
41
|
|
|
55
42
|
Android and iOS do not consume this package. The same `truapi-provider` crate is
|
|
@@ -62,7 +49,7 @@ contract with the same bundled catalog, so the wiring differs only in language.
|
|
|
62
49
|
The `dist/` bundle is generated and gitignored. Rebuild it from the Rust crate:
|
|
63
50
|
|
|
64
51
|
```bash
|
|
65
|
-
npm run build
|
|
52
|
+
npm run build # wasm-pack --target web, features "js networks"
|
|
66
53
|
```
|
|
67
54
|
|
|
68
55
|
`wasm-pack` is required (`cargo install wasm-pack`). Set `TRUAPI_WASM_PROFILE=dev`
|
|
@@ -28,6 +28,10 @@ export class ChainProviderBuilder {
|
|
|
28
28
|
addRpcChain(genesis_hash: string, url: string): void;
|
|
29
29
|
/**
|
|
30
30
|
* Build the provider, consuming the builder.
|
|
31
|
+
*
|
|
32
|
+
* Unless the host chose otherwise through
|
|
33
|
+
* [`set_warm_store`](Self::set_warm_store), chains resume from state kept
|
|
34
|
+
* in the browser's own database.
|
|
31
35
|
*/
|
|
32
36
|
build(): ChainProviderHandle;
|
|
33
37
|
/**
|
|
@@ -41,6 +45,26 @@ export class ChainProviderBuilder {
|
|
|
41
45
|
* instead of re-syncing from the checkpoint.
|
|
42
46
|
*/
|
|
43
47
|
setDatabase(genesis_hash: string, blob: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Keep warm-start blobs somewhere other than the browser's own database,
|
|
50
|
+
* or nowhere at all.
|
|
51
|
+
*
|
|
52
|
+
* Warm start needs no setup: without this call the provider keeps blobs in
|
|
53
|
+
* IndexedDB for the origin. Pass a JS object with `load(genesisHash)`
|
|
54
|
+
* resolving to the stored string or `null` and `save(genesisHash, blob)`
|
|
55
|
+
* to store them elsewhere, or `null` to turn warm start off and have every
|
|
56
|
+
* chain sync from the chain-spec checkpoint.
|
|
57
|
+
*
|
|
58
|
+
* A store that cannot answer must reject rather than resolve empty: an
|
|
59
|
+
* empty read is taken as nothing stored yet, and would let a later
|
|
60
|
+
* snapshot overwrite good state.
|
|
61
|
+
*
|
|
62
|
+
* A loaded blob is trusted input: it becomes the finalized state the light
|
|
63
|
+
* client resumes from, so whatever can write to the store can steer the
|
|
64
|
+
* client's view of the chain. Origin-scoped storage satisfies that; a
|
|
65
|
+
* store fed by another page or a server does not.
|
|
66
|
+
*/
|
|
67
|
+
setWarmStore(store: any): void;
|
|
44
68
|
}
|
|
45
69
|
|
|
46
70
|
/**
|
|
@@ -55,12 +79,32 @@ export class ChainProviderHandle {
|
|
|
55
79
|
* hash. Rejects when the chain is not registered or the transport fails.
|
|
56
80
|
*/
|
|
57
81
|
connect(genesis_hash: string): Promise<Connection>;
|
|
82
|
+
/**
|
|
83
|
+
* Snapshot the chain's finalized state and write it to the warm store.
|
|
84
|
+
* Resolves with whether a blob was stored.
|
|
85
|
+
*
|
|
86
|
+
* A chain that has finalized nothing yet is skipped rather than stored,
|
|
87
|
+
* since that blob would be discarded on the next run. This is a full round
|
|
88
|
+
* trip against the light client, so drive it while the page or worker is
|
|
89
|
+
* alive; neither `pagehide` nor a hidden tab is guaranteed to stay
|
|
90
|
+
* scheduled long enough to finish one, and a Worker sees neither event.
|
|
91
|
+
*/
|
|
92
|
+
persist(genesis_hash: string): Promise<boolean>;
|
|
58
93
|
/**
|
|
59
94
|
* Produce a warm-start database blob for the `0x`-prefixed genesis hash.
|
|
60
95
|
* Persist it and feed it back via
|
|
61
96
|
* [`setDatabase`](ChainProviderBuilder::set_database) on a later run.
|
|
62
97
|
*/
|
|
63
98
|
snapshot(genesis_hash: string): Promise<string>;
|
|
99
|
+
/**
|
|
100
|
+
* Read the warm store's blob for the `0x`-prefixed genesis hash into this
|
|
101
|
+
* provider, so the next [`connect`](ChainProviderHandle::connect) to that
|
|
102
|
+
* chain resumes from it. Resolves with whether a blob is now in hand.
|
|
103
|
+
*
|
|
104
|
+
* Call this before connecting. The store is read at most once per chain,
|
|
105
|
+
* because only a chain's first add consumes a blob.
|
|
106
|
+
*/
|
|
107
|
+
warmUp(genesis_hash: string): Promise<boolean>;
|
|
64
108
|
}
|
|
65
109
|
|
|
66
110
|
/**
|
|
@@ -140,8 +184,11 @@ export interface InitOutput {
|
|
|
140
184
|
readonly chainproviderbuilder_build: (a: number, b: number) => void;
|
|
141
185
|
readonly chainproviderbuilder_new: () => number;
|
|
142
186
|
readonly chainproviderbuilder_setDatabase: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
187
|
+
readonly chainproviderbuilder_setWarmStore: (a: number, b: number, c: number) => void;
|
|
143
188
|
readonly chainproviderhandle_connect: (a: number, b: number, c: number) => number;
|
|
189
|
+
readonly chainproviderhandle_persist: (a: number, b: number, c: number) => number;
|
|
144
190
|
readonly chainproviderhandle_snapshot: (a: number, b: number, c: number) => number;
|
|
191
|
+
readonly chainproviderhandle_warmUp: (a: number, b: number, c: number) => number;
|
|
145
192
|
readonly connection_close: (a: number) => void;
|
|
146
193
|
readonly connection_nextResponse: (a: number) => number;
|
|
147
194
|
readonly connection_send: (a: number, b: number, c: number) => void;
|
|
@@ -150,12 +197,13 @@ export interface InitOutput {
|
|
|
150
197
|
readonly networkchains_people: (a: number, b: number) => void;
|
|
151
198
|
readonly networkchains_relay: (a: number, b: number) => void;
|
|
152
199
|
readonly setLogLevel: (a: number, b: number) => void;
|
|
153
|
-
readonly
|
|
154
|
-
readonly
|
|
155
|
-
readonly
|
|
156
|
-
readonly
|
|
157
|
-
readonly
|
|
158
|
-
readonly
|
|
200
|
+
readonly __wasm_bindgen_func_elem_19487: (a: number, b: number, c: number, d: number) => void;
|
|
201
|
+
readonly __wasm_bindgen_func_elem_19489: (a: number, b: number, c: number, d: number) => void;
|
|
202
|
+
readonly __wasm_bindgen_func_elem_3887: (a: number, b: number, c: number) => void;
|
|
203
|
+
readonly __wasm_bindgen_func_elem_3887_2: (a: number, b: number, c: number) => void;
|
|
204
|
+
readonly __wasm_bindgen_func_elem_3887_3: (a: number, b: number, c: number) => void;
|
|
205
|
+
readonly __wasm_bindgen_func_elem_3887_4: (a: number, b: number, c: number) => void;
|
|
206
|
+
readonly __wasm_bindgen_func_elem_7441: (a: number, b: number) => void;
|
|
159
207
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
160
208
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
161
209
|
readonly __wbindgen_export3: (a: number) => void;
|
package/dist/truapi_provider.js
CHANGED
|
@@ -89,6 +89,10 @@ export class ChainProviderBuilder {
|
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Build the provider, consuming the builder.
|
|
92
|
+
*
|
|
93
|
+
* Unless the host chose otherwise through
|
|
94
|
+
* [`set_warm_store`](Self::set_warm_store), chains resume from state kept
|
|
95
|
+
* in the browser's own database.
|
|
92
96
|
* @returns {ChainProviderHandle}
|
|
93
97
|
*/
|
|
94
98
|
build() {
|
|
@@ -140,6 +144,39 @@ export class ChainProviderBuilder {
|
|
|
140
144
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
141
145
|
}
|
|
142
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Keep warm-start blobs somewhere other than the browser's own database,
|
|
149
|
+
* or nowhere at all.
|
|
150
|
+
*
|
|
151
|
+
* Warm start needs no setup: without this call the provider keeps blobs in
|
|
152
|
+
* IndexedDB for the origin. Pass a JS object with `load(genesisHash)`
|
|
153
|
+
* resolving to the stored string or `null` and `save(genesisHash, blob)`
|
|
154
|
+
* to store them elsewhere, or `null` to turn warm start off and have every
|
|
155
|
+
* chain sync from the chain-spec checkpoint.
|
|
156
|
+
*
|
|
157
|
+
* A store that cannot answer must reject rather than resolve empty: an
|
|
158
|
+
* empty read is taken as nothing stored yet, and would let a later
|
|
159
|
+
* snapshot overwrite good state.
|
|
160
|
+
*
|
|
161
|
+
* A loaded blob is trusted input: it becomes the finalized state the light
|
|
162
|
+
* client resumes from, so whatever can write to the store can steer the
|
|
163
|
+
* client's view of the chain. Origin-scoped storage satisfies that; a
|
|
164
|
+
* store fed by another page or a server does not.
|
|
165
|
+
* @param {any} store
|
|
166
|
+
*/
|
|
167
|
+
setWarmStore(store) {
|
|
168
|
+
try {
|
|
169
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
170
|
+
wasm.chainproviderbuilder_setWarmStore(retptr, this.__wbg_ptr, addHeapObject(store));
|
|
171
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
172
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
173
|
+
if (r1) {
|
|
174
|
+
throw takeObject(r0);
|
|
175
|
+
}
|
|
176
|
+
} finally {
|
|
177
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
143
180
|
}
|
|
144
181
|
if (Symbol.dispose) ChainProviderBuilder.prototype[Symbol.dispose] = ChainProviderBuilder.prototype.free;
|
|
145
182
|
|
|
@@ -175,6 +212,24 @@ export class ChainProviderHandle {
|
|
|
175
212
|
const ret = wasm.chainproviderhandle_connect(this.__wbg_ptr, ptr0, len0);
|
|
176
213
|
return takeObject(ret);
|
|
177
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Snapshot the chain's finalized state and write it to the warm store.
|
|
217
|
+
* Resolves with whether a blob was stored.
|
|
218
|
+
*
|
|
219
|
+
* A chain that has finalized nothing yet is skipped rather than stored,
|
|
220
|
+
* since that blob would be discarded on the next run. This is a full round
|
|
221
|
+
* trip against the light client, so drive it while the page or worker is
|
|
222
|
+
* alive; neither `pagehide` nor a hidden tab is guaranteed to stay
|
|
223
|
+
* scheduled long enough to finish one, and a Worker sees neither event.
|
|
224
|
+
* @param {string} genesis_hash
|
|
225
|
+
* @returns {Promise<boolean>}
|
|
226
|
+
*/
|
|
227
|
+
persist(genesis_hash) {
|
|
228
|
+
const ptr0 = passStringToWasm0(genesis_hash, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
229
|
+
const len0 = WASM_VECTOR_LEN;
|
|
230
|
+
const ret = wasm.chainproviderhandle_persist(this.__wbg_ptr, ptr0, len0);
|
|
231
|
+
return takeObject(ret);
|
|
232
|
+
}
|
|
178
233
|
/**
|
|
179
234
|
* Produce a warm-start database blob for the `0x`-prefixed genesis hash.
|
|
180
235
|
* Persist it and feed it back via
|
|
@@ -188,6 +243,22 @@ export class ChainProviderHandle {
|
|
|
188
243
|
const ret = wasm.chainproviderhandle_snapshot(this.__wbg_ptr, ptr0, len0);
|
|
189
244
|
return takeObject(ret);
|
|
190
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* Read the warm store's blob for the `0x`-prefixed genesis hash into this
|
|
248
|
+
* provider, so the next [`connect`](ChainProviderHandle::connect) to that
|
|
249
|
+
* chain resumes from it. Resolves with whether a blob is now in hand.
|
|
250
|
+
*
|
|
251
|
+
* Call this before connecting. The store is read at most once per chain,
|
|
252
|
+
* because only a chain's first add consumes a blob.
|
|
253
|
+
* @param {string} genesis_hash
|
|
254
|
+
* @returns {Promise<boolean>}
|
|
255
|
+
*/
|
|
256
|
+
warmUp(genesis_hash) {
|
|
257
|
+
const ptr0 = passStringToWasm0(genesis_hash, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
259
|
+
const ret = wasm.chainproviderhandle_warmUp(this.__wbg_ptr, ptr0, len0);
|
|
260
|
+
return takeObject(ret);
|
|
261
|
+
}
|
|
191
262
|
}
|
|
192
263
|
if (Symbol.dispose) ChainProviderHandle.prototype[Symbol.dispose] = ChainProviderHandle.prototype.free;
|
|
193
264
|
|
|
@@ -379,6 +450,10 @@ function __wbg_get_imports() {
|
|
|
379
450
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
380
451
|
return ret;
|
|
381
452
|
},
|
|
453
|
+
__wbg___wbindgen_is_null_ea9085d691f535d3: function(arg0) {
|
|
454
|
+
const ret = getObject(arg0) === null;
|
|
455
|
+
return ret;
|
|
456
|
+
},
|
|
382
457
|
__wbg___wbindgen_is_object_a27215656b807791: function(arg0) {
|
|
383
458
|
const val = getObject(arg0);
|
|
384
459
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -410,10 +485,17 @@ function __wbg_get_imports() {
|
|
|
410
485
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
411
486
|
return addHeapObject(ret);
|
|
412
487
|
}, arguments); },
|
|
488
|
+
__wbg_call_e3b662382210db98: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
489
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
490
|
+
return addHeapObject(ret);
|
|
491
|
+
}, arguments); },
|
|
413
492
|
__wbg_clearTimeout_3629d6209dfcc46e: function(arg0) {
|
|
414
493
|
const ret = clearTimeout(takeObject(arg0));
|
|
415
494
|
return addHeapObject(ret);
|
|
416
495
|
},
|
|
496
|
+
__wbg_close_4c3686e8e8c6d353: function(arg0) {
|
|
497
|
+
getObject(arg0).close();
|
|
498
|
+
},
|
|
417
499
|
__wbg_close_c65ca0257e895318: function() { return handleError(function (arg0) {
|
|
418
500
|
getObject(arg0).close();
|
|
419
501
|
}, arguments); },
|
|
@@ -425,6 +507,10 @@ function __wbg_get_imports() {
|
|
|
425
507
|
const ret = Connection.__wrap(arg0);
|
|
426
508
|
return addHeapObject(ret);
|
|
427
509
|
},
|
|
510
|
+
__wbg_createObjectStore_ff668af6e79f0433: function() { return handleError(function (arg0, arg1, arg2) {
|
|
511
|
+
const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2));
|
|
512
|
+
return addHeapObject(ret);
|
|
513
|
+
}, arguments); },
|
|
428
514
|
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
429
515
|
const ret = getObject(arg0).crypto;
|
|
430
516
|
return addHeapObject(ret);
|
|
@@ -442,6 +528,14 @@ function __wbg_get_imports() {
|
|
|
442
528
|
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
443
529
|
getObject(arg0).getRandomValues(getObject(arg1));
|
|
444
530
|
}, arguments); },
|
|
531
|
+
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
532
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
533
|
+
return addHeapObject(ret);
|
|
534
|
+
}, arguments); },
|
|
535
|
+
__wbg_get_cefddcaffca4fbb7: function() { return handleError(function (arg0, arg1) {
|
|
536
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
|
537
|
+
return addHeapObject(ret);
|
|
538
|
+
}, arguments); },
|
|
445
539
|
__wbg_info_eadbe775a8e2e9eb: function(arg0) {
|
|
446
540
|
console.info(getObject(arg0));
|
|
447
541
|
},
|
|
@@ -455,6 +549,36 @@ function __wbg_get_imports() {
|
|
|
455
549
|
const ret = result;
|
|
456
550
|
return ret;
|
|
457
551
|
},
|
|
552
|
+
__wbg_instanceof_IdbDatabase_1cc734ba1b040dd7: function(arg0) {
|
|
553
|
+
let result;
|
|
554
|
+
try {
|
|
555
|
+
result = getObject(arg0) instanceof IDBDatabase;
|
|
556
|
+
} catch (_) {
|
|
557
|
+
result = false;
|
|
558
|
+
}
|
|
559
|
+
const ret = result;
|
|
560
|
+
return ret;
|
|
561
|
+
},
|
|
562
|
+
__wbg_instanceof_IdbFactory_85ccbbe95ef25434: function(arg0) {
|
|
563
|
+
let result;
|
|
564
|
+
try {
|
|
565
|
+
result = getObject(arg0) instanceof IDBFactory;
|
|
566
|
+
} catch (_) {
|
|
567
|
+
result = false;
|
|
568
|
+
}
|
|
569
|
+
const ret = result;
|
|
570
|
+
return ret;
|
|
571
|
+
},
|
|
572
|
+
__wbg_instanceof_IdbRequest_fe7a4cb10800af5b: function(arg0) {
|
|
573
|
+
let result;
|
|
574
|
+
try {
|
|
575
|
+
result = getObject(arg0) instanceof IDBRequest;
|
|
576
|
+
} catch (_) {
|
|
577
|
+
result = false;
|
|
578
|
+
}
|
|
579
|
+
const ret = result;
|
|
580
|
+
return ret;
|
|
581
|
+
},
|
|
458
582
|
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
459
583
|
const ret = getObject(arg0).length;
|
|
460
584
|
return ret;
|
|
@@ -478,7 +602,7 @@ function __wbg_get_imports() {
|
|
|
478
602
|
const a = state0.a;
|
|
479
603
|
state0.a = 0;
|
|
480
604
|
try {
|
|
481
|
-
return
|
|
605
|
+
return __wasm_bindgen_func_elem_19489(a, state0.b, arg0, arg1);
|
|
482
606
|
} finally {
|
|
483
607
|
state0.a = a;
|
|
484
608
|
}
|
|
@@ -505,6 +629,14 @@ function __wbg_get_imports() {
|
|
|
505
629
|
const ret = getObject(arg0).now();
|
|
506
630
|
return ret;
|
|
507
631
|
},
|
|
632
|
+
__wbg_objectStore_d5f47956b6c741e3: function() { return handleError(function (arg0, arg1, arg2) {
|
|
633
|
+
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
|
634
|
+
return addHeapObject(ret);
|
|
635
|
+
}, arguments); },
|
|
636
|
+
__wbg_open_72e5234a49d5f85d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
637
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
638
|
+
return addHeapObject(ret);
|
|
639
|
+
}, arguments); },
|
|
508
640
|
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
509
641
|
const ret = getObject(arg0).performance;
|
|
510
642
|
return addHeapObject(ret);
|
|
@@ -516,6 +648,10 @@ function __wbg_get_imports() {
|
|
|
516
648
|
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
517
649
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
518
650
|
},
|
|
651
|
+
__wbg_put_a368805e3dcab3a7: function() { return handleError(function (arg0, arg1, arg2) {
|
|
652
|
+
const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
|
|
653
|
+
return addHeapObject(ret);
|
|
654
|
+
}, arguments); },
|
|
519
655
|
__wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
|
|
520
656
|
const ret = getObject(arg0).queueMicrotask;
|
|
521
657
|
return addHeapObject(ret);
|
|
@@ -538,6 +674,10 @@ function __wbg_get_imports() {
|
|
|
538
674
|
const ret = Promise.resolve(getObject(arg0));
|
|
539
675
|
return addHeapObject(ret);
|
|
540
676
|
},
|
|
677
|
+
__wbg_result_2b1294a2bf8dc773: function() { return handleError(function (arg0) {
|
|
678
|
+
const ret = getObject(arg0).result;
|
|
679
|
+
return addHeapObject(ret);
|
|
680
|
+
}, arguments); },
|
|
541
681
|
__wbg_send_a321b376d40ec867: function() { return handleError(function (arg0, arg1, arg2) {
|
|
542
682
|
getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
|
|
543
683
|
}, arguments); },
|
|
@@ -554,6 +694,9 @@ function __wbg_get_imports() {
|
|
|
554
694
|
__wbg_set_onclose_f706475385ecce07: function(arg0, arg1) {
|
|
555
695
|
getObject(arg0).onclose = getObject(arg1);
|
|
556
696
|
},
|
|
697
|
+
__wbg_set_onerror_3488a474171ed56d: function(arg0, arg1) {
|
|
698
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
699
|
+
},
|
|
557
700
|
__wbg_set_onerror_9f5773fd31512333: function(arg0, arg1) {
|
|
558
701
|
getObject(arg0).onerror = getObject(arg1);
|
|
559
702
|
},
|
|
@@ -563,6 +706,12 @@ function __wbg_get_imports() {
|
|
|
563
706
|
__wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
|
|
564
707
|
getObject(arg0).onopen = getObject(arg1);
|
|
565
708
|
},
|
|
709
|
+
__wbg_set_onsuccess_cd0c3642a2873e66: function(arg0, arg1) {
|
|
710
|
+
getObject(arg0).onsuccess = getObject(arg1);
|
|
711
|
+
},
|
|
712
|
+
__wbg_set_onupgradeneeded_7b2cf4ba1c57e655: function(arg0, arg1) {
|
|
713
|
+
getObject(arg0).onupgradeneeded = getObject(arg1);
|
|
714
|
+
},
|
|
566
715
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
567
716
|
const ret = typeof global === 'undefined' ? null : global;
|
|
568
717
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
@@ -583,10 +732,22 @@ function __wbg_get_imports() {
|
|
|
583
732
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
584
733
|
return addHeapObject(ret);
|
|
585
734
|
},
|
|
735
|
+
__wbg_target_e759594a8d965ed7: function(arg0) {
|
|
736
|
+
const ret = getObject(arg0).target;
|
|
737
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
738
|
+
},
|
|
739
|
+
__wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
|
|
740
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
741
|
+
return addHeapObject(ret);
|
|
742
|
+
},
|
|
586
743
|
__wbg_then_6ec10ae38b3e92f7: function(arg0, arg1) {
|
|
587
744
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
588
745
|
return addHeapObject(ret);
|
|
589
746
|
},
|
|
747
|
+
__wbg_transaction_d911d96b4b0af154: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
748
|
+
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]);
|
|
749
|
+
return addHeapObject(ret);
|
|
750
|
+
}, arguments); },
|
|
590
751
|
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
591
752
|
const ret = getObject(arg0).versions;
|
|
592
753
|
return addHeapObject(ret);
|
|
@@ -595,36 +756,41 @@ function __wbg_get_imports() {
|
|
|
595
756
|
console.warn(getObject(arg0));
|
|
596
757
|
},
|
|
597
758
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
598
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
599
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
759
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1893, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
760
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_19487);
|
|
600
761
|
return addHeapObject(ret);
|
|
601
762
|
},
|
|
602
763
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
603
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
604
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
764
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
765
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3887);
|
|
605
766
|
return addHeapObject(ret);
|
|
606
767
|
},
|
|
607
768
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
608
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx:
|
|
609
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
769
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
770
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3887_2);
|
|
610
771
|
return addHeapObject(ret);
|
|
611
772
|
},
|
|
612
773
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
613
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("
|
|
614
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
774
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
775
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3887_3);
|
|
615
776
|
return addHeapObject(ret);
|
|
616
777
|
},
|
|
617
778
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
618
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
619
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
779
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
780
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3887_4);
|
|
620
781
|
return addHeapObject(ret);
|
|
621
782
|
},
|
|
622
783
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
784
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 741, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
785
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_7441);
|
|
786
|
+
return addHeapObject(ret);
|
|
787
|
+
},
|
|
788
|
+
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
623
789
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
624
790
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
625
791
|
return addHeapObject(ret);
|
|
626
792
|
},
|
|
627
|
-
|
|
793
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
628
794
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
629
795
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
630
796
|
return addHeapObject(ret);
|
|
@@ -643,26 +809,30 @@ function __wbg_get_imports() {
|
|
|
643
809
|
};
|
|
644
810
|
}
|
|
645
811
|
|
|
646
|
-
function
|
|
647
|
-
wasm.
|
|
812
|
+
function __wasm_bindgen_func_elem_7441(arg0, arg1) {
|
|
813
|
+
wasm.__wasm_bindgen_func_elem_7441(arg0, arg1);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function __wasm_bindgen_func_elem_3887(arg0, arg1, arg2) {
|
|
817
|
+
wasm.__wasm_bindgen_func_elem_3887(arg0, arg1, addHeapObject(arg2));
|
|
648
818
|
}
|
|
649
819
|
|
|
650
|
-
function
|
|
651
|
-
wasm.
|
|
820
|
+
function __wasm_bindgen_func_elem_3887_2(arg0, arg1, arg2) {
|
|
821
|
+
wasm.__wasm_bindgen_func_elem_3887_2(arg0, arg1, addHeapObject(arg2));
|
|
652
822
|
}
|
|
653
823
|
|
|
654
|
-
function
|
|
655
|
-
wasm.
|
|
824
|
+
function __wasm_bindgen_func_elem_3887_3(arg0, arg1, arg2) {
|
|
825
|
+
wasm.__wasm_bindgen_func_elem_3887_3(arg0, arg1, addHeapObject(arg2));
|
|
656
826
|
}
|
|
657
827
|
|
|
658
|
-
function
|
|
659
|
-
wasm.
|
|
828
|
+
function __wasm_bindgen_func_elem_3887_4(arg0, arg1, arg2) {
|
|
829
|
+
wasm.__wasm_bindgen_func_elem_3887_4(arg0, arg1, addHeapObject(arg2));
|
|
660
830
|
}
|
|
661
831
|
|
|
662
|
-
function
|
|
832
|
+
function __wasm_bindgen_func_elem_19487(arg0, arg1, arg2) {
|
|
663
833
|
try {
|
|
664
834
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
665
|
-
wasm.
|
|
835
|
+
wasm.__wasm_bindgen_func_elem_19487(retptr, arg0, arg1, addHeapObject(arg2));
|
|
666
836
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
667
837
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
668
838
|
if (r1) {
|
|
@@ -673,12 +843,15 @@ function __wasm_bindgen_func_elem_19123(arg0, arg1, arg2) {
|
|
|
673
843
|
}
|
|
674
844
|
}
|
|
675
845
|
|
|
676
|
-
function
|
|
677
|
-
wasm.
|
|
846
|
+
function __wasm_bindgen_func_elem_19489(arg0, arg1, arg2, arg3) {
|
|
847
|
+
wasm.__wasm_bindgen_func_elem_19489(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
678
848
|
}
|
|
679
849
|
|
|
680
850
|
|
|
681
851
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
682
855
|
const ChainProviderBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
683
856
|
? { register: () => {}, unregister: () => {} }
|
|
684
857
|
: new FinalizationRegistry(ptr => wasm.__wbg_chainproviderbuilder_free(ptr, 1));
|
|
Binary file
|
|
@@ -11,8 +11,11 @@ export const chainproviderbuilder_addRpcChain: (a: number, b: number, c: number,
|
|
|
11
11
|
export const chainproviderbuilder_build: (a: number, b: number) => void;
|
|
12
12
|
export const chainproviderbuilder_new: () => number;
|
|
13
13
|
export const chainproviderbuilder_setDatabase: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
14
|
+
export const chainproviderbuilder_setWarmStore: (a: number, b: number, c: number) => void;
|
|
14
15
|
export const chainproviderhandle_connect: (a: number, b: number, c: number) => number;
|
|
16
|
+
export const chainproviderhandle_persist: (a: number, b: number, c: number) => number;
|
|
15
17
|
export const chainproviderhandle_snapshot: (a: number, b: number, c: number) => number;
|
|
18
|
+
export const chainproviderhandle_warmUp: (a: number, b: number, c: number) => number;
|
|
16
19
|
export const connection_close: (a: number) => void;
|
|
17
20
|
export const connection_nextResponse: (a: number) => number;
|
|
18
21
|
export const connection_send: (a: number, b: number, c: number) => void;
|
|
@@ -21,12 +24,13 @@ export const networkchains_bulletin: (a: number, b: number) => void;
|
|
|
21
24
|
export const networkchains_people: (a: number, b: number) => void;
|
|
22
25
|
export const networkchains_relay: (a: number, b: number) => void;
|
|
23
26
|
export const setLogLevel: (a: number, b: number) => void;
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
26
|
-
export const
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
27
|
+
export const __wasm_bindgen_func_elem_19487: (a: number, b: number, c: number, d: number) => void;
|
|
28
|
+
export const __wasm_bindgen_func_elem_19489: (a: number, b: number, c: number, d: number) => void;
|
|
29
|
+
export const __wasm_bindgen_func_elem_3887: (a: number, b: number, c: number) => void;
|
|
30
|
+
export const __wasm_bindgen_func_elem_3887_2: (a: number, b: number, c: number) => void;
|
|
31
|
+
export const __wasm_bindgen_func_elem_3887_3: (a: number, b: number, c: number) => void;
|
|
32
|
+
export const __wasm_bindgen_func_elem_3887_4: (a: number, b: number, c: number) => void;
|
|
33
|
+
export const __wasm_bindgen_func_elem_7441: (a: number, b: number) => void;
|
|
30
34
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
31
35
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
32
36
|
export const __wbindgen_export3: (a: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parity/truapi-provider",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-20260908.1",
|
|
4
4
|
"description": "Network provider backends for the TrUAPI ChainProvider: an embedded smoldot light client and remote WebSocket JSON-RPC nodes, compiled to WebAssembly for browser hosts",
|
|
5
5
|
"license": "MIT AND Apache-2.0",
|
|
6
6
|
"author": "Parity Technologies <admin@parity.io>",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "node scripts/build-wasm.mjs"
|
|
41
|
-
"build:wasm": "node scripts/build-wasm.mjs"
|
|
40
|
+
"build": "node scripts/build-wasm.mjs"
|
|
42
41
|
}
|
|
43
42
|
}
|