@parity/truapi-provider 0.1.1-dev-20260908.0 → 0.1.1-dev-20260908.2
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.
|
@@ -89,7 +89,7 @@ export class ChainProviderHandle {
|
|
|
89
89
|
* alive; neither `pagehide` nor a hidden tab is guaranteed to stay
|
|
90
90
|
* scheduled long enough to finish one, and a Worker sees neither event.
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
save_database(genesis_hash: string): Promise<boolean>;
|
|
93
93
|
/**
|
|
94
94
|
* Produce a warm-start database blob for the `0x`-prefixed genesis hash.
|
|
95
95
|
* Persist it and feed it back via
|
|
@@ -186,7 +186,7 @@ export interface InitOutput {
|
|
|
186
186
|
readonly chainproviderbuilder_setDatabase: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
187
187
|
readonly chainproviderbuilder_setWarmStore: (a: number, b: number, c: number) => void;
|
|
188
188
|
readonly chainproviderhandle_connect: (a: number, b: number, c: number) => number;
|
|
189
|
-
readonly
|
|
189
|
+
readonly chainproviderhandle_save_database: (a: number, b: number, c: number) => number;
|
|
190
190
|
readonly chainproviderhandle_snapshot: (a: number, b: number, c: number) => number;
|
|
191
191
|
readonly chainproviderhandle_warmUp: (a: number, b: number, c: number) => number;
|
|
192
192
|
readonly connection_close: (a: number) => void;
|
|
@@ -197,18 +197,19 @@ export interface InitOutput {
|
|
|
197
197
|
readonly networkchains_people: (a: number, b: number) => void;
|
|
198
198
|
readonly networkchains_relay: (a: number, b: number) => void;
|
|
199
199
|
readonly setLogLevel: (a: number, b: number) => void;
|
|
200
|
-
readonly
|
|
201
|
-
readonly
|
|
202
|
-
readonly
|
|
203
|
-
readonly
|
|
204
|
-
readonly
|
|
205
|
-
readonly
|
|
200
|
+
readonly __wasm_bindgen_func_elem_19485: (a: number, b: number, c: number, d: number) => void;
|
|
201
|
+
readonly __wasm_bindgen_func_elem_19487: (a: number, b: number, c: number, d: number) => void;
|
|
202
|
+
readonly __wasm_bindgen_func_elem_3886: (a: number, b: number, c: number) => void;
|
|
203
|
+
readonly __wasm_bindgen_func_elem_3886_2: (a: number, b: number, c: number) => void;
|
|
204
|
+
readonly __wasm_bindgen_func_elem_3886_3: (a: number, b: number, c: number) => void;
|
|
205
|
+
readonly __wasm_bindgen_func_elem_3886_4: (a: number, b: number, c: number) => void;
|
|
206
|
+
readonly __wasm_bindgen_func_elem_7436: (a: number, b: number) => void;
|
|
206
207
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
207
208
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
208
209
|
readonly __wbindgen_export3: (a: number) => void;
|
|
209
|
-
readonly __wbindgen_export4: (a: number, b: number
|
|
210
|
-
readonly __wbindgen_export5: (a: number, b: number) => void;
|
|
210
|
+
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
211
211
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
212
|
+
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/dist/truapi_provider.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/* @ts-self-types="./truapi_provider.d.ts" */
|
|
2
|
-
import { warmStoreLoad, warmStoreSave } from './snippets/truapi-provider-33b01a9e5797ba85/inline0.js';
|
|
3
|
-
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Collects genesis-hash to chain-source registrations from JS.
|
|
@@ -226,10 +224,10 @@ export class ChainProviderHandle {
|
|
|
226
224
|
* @param {string} genesis_hash
|
|
227
225
|
* @returns {Promise<boolean>}
|
|
228
226
|
*/
|
|
229
|
-
|
|
227
|
+
save_database(genesis_hash) {
|
|
230
228
|
const ptr0 = passStringToWasm0(genesis_hash, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
231
229
|
const len0 = WASM_VECTOR_LEN;
|
|
232
|
-
const ret = wasm.
|
|
230
|
+
const ret = wasm.chainproviderhandle_save_database(this.__wbg_ptr, ptr0, len0);
|
|
233
231
|
return takeObject(ret);
|
|
234
232
|
}
|
|
235
233
|
/**
|
|
@@ -356,7 +354,7 @@ export class NetworkChains {
|
|
|
356
354
|
return getStringFromWasm0(r0, r1);
|
|
357
355
|
} finally {
|
|
358
356
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
359
|
-
wasm.
|
|
357
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
360
358
|
}
|
|
361
359
|
}
|
|
362
360
|
/**
|
|
@@ -376,7 +374,7 @@ export class NetworkChains {
|
|
|
376
374
|
return getStringFromWasm0(r0, r1);
|
|
377
375
|
} finally {
|
|
378
376
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
379
|
-
wasm.
|
|
377
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
380
378
|
}
|
|
381
379
|
}
|
|
382
380
|
/**
|
|
@@ -396,7 +394,7 @@ export class NetworkChains {
|
|
|
396
394
|
return getStringFromWasm0(r0, r1);
|
|
397
395
|
} finally {
|
|
398
396
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
399
|
-
wasm.
|
|
397
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
400
398
|
}
|
|
401
399
|
}
|
|
402
400
|
/**
|
|
@@ -416,7 +414,7 @@ export class NetworkChains {
|
|
|
416
414
|
return getStringFromWasm0(r0, r1);
|
|
417
415
|
} finally {
|
|
418
416
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
419
|
-
wasm.
|
|
417
|
+
wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
|
|
420
418
|
}
|
|
421
419
|
}
|
|
422
420
|
}
|
|
@@ -483,6 +481,10 @@ function __wbg_get_imports() {
|
|
|
483
481
|
__wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
|
|
484
482
|
getObject(arg0)._wbg_cb_unref();
|
|
485
483
|
},
|
|
484
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
485
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
486
|
+
return addHeapObject(ret);
|
|
487
|
+
}, arguments); },
|
|
486
488
|
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
487
489
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
488
490
|
return addHeapObject(ret);
|
|
@@ -495,6 +497,9 @@ function __wbg_get_imports() {
|
|
|
495
497
|
const ret = clearTimeout(takeObject(arg0));
|
|
496
498
|
return addHeapObject(ret);
|
|
497
499
|
},
|
|
500
|
+
__wbg_close_4c3686e8e8c6d353: function(arg0) {
|
|
501
|
+
getObject(arg0).close();
|
|
502
|
+
},
|
|
498
503
|
__wbg_close_c65ca0257e895318: function() { return handleError(function (arg0) {
|
|
499
504
|
getObject(arg0).close();
|
|
500
505
|
}, arguments); },
|
|
@@ -506,6 +511,10 @@ function __wbg_get_imports() {
|
|
|
506
511
|
const ret = Connection.__wrap(arg0);
|
|
507
512
|
return addHeapObject(ret);
|
|
508
513
|
},
|
|
514
|
+
__wbg_createObjectStore_ff668af6e79f0433: function() { return handleError(function (arg0, arg1, arg2) {
|
|
515
|
+
const ret = getObject(arg0).createObjectStore(getStringFromWasm0(arg1, arg2));
|
|
516
|
+
return addHeapObject(ret);
|
|
517
|
+
}, arguments); },
|
|
509
518
|
__wbg_crypto_38df2bab126b63dc: function(arg0) {
|
|
510
519
|
const ret = getObject(arg0).crypto;
|
|
511
520
|
return addHeapObject(ret);
|
|
@@ -527,6 +536,10 @@ function __wbg_get_imports() {
|
|
|
527
536
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
528
537
|
return addHeapObject(ret);
|
|
529
538
|
}, arguments); },
|
|
539
|
+
__wbg_get_cefddcaffca4fbb7: function() { return handleError(function (arg0, arg1) {
|
|
540
|
+
const ret = getObject(arg0).get(getObject(arg1));
|
|
541
|
+
return addHeapObject(ret);
|
|
542
|
+
}, arguments); },
|
|
530
543
|
__wbg_info_eadbe775a8e2e9eb: function(arg0) {
|
|
531
544
|
console.info(getObject(arg0));
|
|
532
545
|
},
|
|
@@ -540,6 +553,36 @@ function __wbg_get_imports() {
|
|
|
540
553
|
const ret = result;
|
|
541
554
|
return ret;
|
|
542
555
|
},
|
|
556
|
+
__wbg_instanceof_IdbDatabase_1cc734ba1b040dd7: function(arg0) {
|
|
557
|
+
let result;
|
|
558
|
+
try {
|
|
559
|
+
result = getObject(arg0) instanceof IDBDatabase;
|
|
560
|
+
} catch (_) {
|
|
561
|
+
result = false;
|
|
562
|
+
}
|
|
563
|
+
const ret = result;
|
|
564
|
+
return ret;
|
|
565
|
+
},
|
|
566
|
+
__wbg_instanceof_IdbFactory_85ccbbe95ef25434: function(arg0) {
|
|
567
|
+
let result;
|
|
568
|
+
try {
|
|
569
|
+
result = getObject(arg0) instanceof IDBFactory;
|
|
570
|
+
} catch (_) {
|
|
571
|
+
result = false;
|
|
572
|
+
}
|
|
573
|
+
const ret = result;
|
|
574
|
+
return ret;
|
|
575
|
+
},
|
|
576
|
+
__wbg_instanceof_IdbRequest_fe7a4cb10800af5b: function(arg0) {
|
|
577
|
+
let result;
|
|
578
|
+
try {
|
|
579
|
+
result = getObject(arg0) instanceof IDBRequest;
|
|
580
|
+
} catch (_) {
|
|
581
|
+
result = false;
|
|
582
|
+
}
|
|
583
|
+
const ret = result;
|
|
584
|
+
return ret;
|
|
585
|
+
},
|
|
543
586
|
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
544
587
|
const ret = getObject(arg0).length;
|
|
545
588
|
return ret;
|
|
@@ -563,7 +606,7 @@ function __wbg_get_imports() {
|
|
|
563
606
|
const a = state0.a;
|
|
564
607
|
state0.a = 0;
|
|
565
608
|
try {
|
|
566
|
-
return
|
|
609
|
+
return __wasm_bindgen_func_elem_19487(a, state0.b, arg0, arg1);
|
|
567
610
|
} finally {
|
|
568
611
|
state0.a = a;
|
|
569
612
|
}
|
|
@@ -590,6 +633,14 @@ function __wbg_get_imports() {
|
|
|
590
633
|
const ret = getObject(arg0).now();
|
|
591
634
|
return ret;
|
|
592
635
|
},
|
|
636
|
+
__wbg_objectStore_d5f47956b6c741e3: function() { return handleError(function (arg0, arg1, arg2) {
|
|
637
|
+
const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
|
|
638
|
+
return addHeapObject(ret);
|
|
639
|
+
}, arguments); },
|
|
640
|
+
__wbg_open_72e5234a49d5f85d: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
641
|
+
const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
|
|
642
|
+
return addHeapObject(ret);
|
|
643
|
+
}, arguments); },
|
|
593
644
|
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
594
645
|
const ret = getObject(arg0).performance;
|
|
595
646
|
return addHeapObject(ret);
|
|
@@ -601,6 +652,10 @@ function __wbg_get_imports() {
|
|
|
601
652
|
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
602
653
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
603
654
|
},
|
|
655
|
+
__wbg_put_a368805e3dcab3a7: function() { return handleError(function (arg0, arg1, arg2) {
|
|
656
|
+
const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
|
|
657
|
+
return addHeapObject(ret);
|
|
658
|
+
}, arguments); },
|
|
604
659
|
__wbg_queueMicrotask_0ab5b2d2393e99b9: function(arg0) {
|
|
605
660
|
const ret = getObject(arg0).queueMicrotask;
|
|
606
661
|
return addHeapObject(ret);
|
|
@@ -623,6 +678,10 @@ function __wbg_get_imports() {
|
|
|
623
678
|
const ret = Promise.resolve(getObject(arg0));
|
|
624
679
|
return addHeapObject(ret);
|
|
625
680
|
},
|
|
681
|
+
__wbg_result_2b1294a2bf8dc773: function() { return handleError(function (arg0) {
|
|
682
|
+
const ret = getObject(arg0).result;
|
|
683
|
+
return addHeapObject(ret);
|
|
684
|
+
}, arguments); },
|
|
626
685
|
__wbg_send_a321b376d40ec867: function() { return handleError(function (arg0, arg1, arg2) {
|
|
627
686
|
getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
|
|
628
687
|
}, arguments); },
|
|
@@ -636,18 +695,36 @@ function __wbg_get_imports() {
|
|
|
636
695
|
__wbg_set_binaryType_a37b086c78ca7c29: function(arg0, arg1) {
|
|
637
696
|
getObject(arg0).binaryType = __wbindgen_enum_BinaryType[arg1];
|
|
638
697
|
},
|
|
698
|
+
__wbg_set_onabort_e8ad31807de2db24: function(arg0, arg1) {
|
|
699
|
+
getObject(arg0).onabort = getObject(arg1);
|
|
700
|
+
},
|
|
639
701
|
__wbg_set_onclose_f706475385ecce07: function(arg0, arg1) {
|
|
640
702
|
getObject(arg0).onclose = getObject(arg1);
|
|
641
703
|
},
|
|
704
|
+
__wbg_set_oncomplete_e6abb66d0ad42731: function(arg0, arg1) {
|
|
705
|
+
getObject(arg0).oncomplete = getObject(arg1);
|
|
706
|
+
},
|
|
707
|
+
__wbg_set_onerror_3488a474171ed56d: function(arg0, arg1) {
|
|
708
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
709
|
+
},
|
|
642
710
|
__wbg_set_onerror_9f5773fd31512333: function(arg0, arg1) {
|
|
643
711
|
getObject(arg0).onerror = getObject(arg1);
|
|
644
712
|
},
|
|
713
|
+
__wbg_set_onerror_f8d31be44335c633: function(arg0, arg1) {
|
|
714
|
+
getObject(arg0).onerror = getObject(arg1);
|
|
715
|
+
},
|
|
645
716
|
__wbg_set_onmessage_836d2f72130b4706: function(arg0, arg1) {
|
|
646
717
|
getObject(arg0).onmessage = getObject(arg1);
|
|
647
718
|
},
|
|
648
719
|
__wbg_set_onopen_4f65470ae522a61a: function(arg0, arg1) {
|
|
649
720
|
getObject(arg0).onopen = getObject(arg1);
|
|
650
721
|
},
|
|
722
|
+
__wbg_set_onsuccess_cd0c3642a2873e66: function(arg0, arg1) {
|
|
723
|
+
getObject(arg0).onsuccess = getObject(arg1);
|
|
724
|
+
},
|
|
725
|
+
__wbg_set_onupgradeneeded_7b2cf4ba1c57e655: function(arg0, arg1) {
|
|
726
|
+
getObject(arg0).onupgradeneeded = getObject(arg1);
|
|
727
|
+
},
|
|
651
728
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
652
729
|
const ret = typeof global === 'undefined' ? null : global;
|
|
653
730
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
@@ -668,6 +745,10 @@ function __wbg_get_imports() {
|
|
|
668
745
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
669
746
|
return addHeapObject(ret);
|
|
670
747
|
},
|
|
748
|
+
__wbg_target_e759594a8d965ed7: function(arg0) {
|
|
749
|
+
const ret = getObject(arg0).target;
|
|
750
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
751
|
+
},
|
|
671
752
|
__wbg_then_16d107c451e9905d: function(arg0, arg1, arg2) {
|
|
672
753
|
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
673
754
|
return addHeapObject(ret);
|
|
@@ -676,83 +757,53 @@ function __wbg_get_imports() {
|
|
|
676
757
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
677
758
|
return addHeapObject(ret);
|
|
678
759
|
},
|
|
760
|
+
__wbg_transaction_d911d96b4b0af154: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
761
|
+
const ret = getObject(arg0).transaction(getStringFromWasm0(arg1, arg2), __wbindgen_enum_IdbTransactionMode[arg3]);
|
|
762
|
+
return addHeapObject(ret);
|
|
763
|
+
}, arguments); },
|
|
679
764
|
__wbg_versions_276b2795b1c6a219: function(arg0) {
|
|
680
765
|
const ret = getObject(arg0).versions;
|
|
681
766
|
return addHeapObject(ret);
|
|
682
767
|
},
|
|
683
|
-
__wbg_warmStoreLoad_b2d6e9e9494ec393: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
684
|
-
let deferred0_0;
|
|
685
|
-
let deferred0_1;
|
|
686
|
-
let deferred1_0;
|
|
687
|
-
let deferred1_1;
|
|
688
|
-
try {
|
|
689
|
-
deferred0_0 = arg0;
|
|
690
|
-
deferred0_1 = arg1;
|
|
691
|
-
deferred1_0 = arg2;
|
|
692
|
-
deferred1_1 = arg3;
|
|
693
|
-
const ret = warmStoreLoad(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
|
|
694
|
-
return addHeapObject(ret);
|
|
695
|
-
} finally {
|
|
696
|
-
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
697
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
698
|
-
}
|
|
699
|
-
}, arguments); },
|
|
700
|
-
__wbg_warmStoreSave_31f6536d3a5ab89d: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
701
|
-
let deferred0_0;
|
|
702
|
-
let deferred0_1;
|
|
703
|
-
let deferred1_0;
|
|
704
|
-
let deferred1_1;
|
|
705
|
-
let deferred2_0;
|
|
706
|
-
let deferred2_1;
|
|
707
|
-
try {
|
|
708
|
-
deferred0_0 = arg0;
|
|
709
|
-
deferred0_1 = arg1;
|
|
710
|
-
deferred1_0 = arg2;
|
|
711
|
-
deferred1_1 = arg3;
|
|
712
|
-
deferred2_0 = arg4;
|
|
713
|
-
deferred2_1 = arg5;
|
|
714
|
-
const ret = warmStoreSave(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
|
|
715
|
-
return addHeapObject(ret);
|
|
716
|
-
} finally {
|
|
717
|
-
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
718
|
-
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
719
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
720
|
-
}
|
|
721
|
-
}, arguments); },
|
|
722
768
|
__wbg_warn_b1370d804fa3e259: function(arg0) {
|
|
723
769
|
console.warn(getObject(arg0));
|
|
724
770
|
},
|
|
725
771
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
726
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
727
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
772
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1887, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
773
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_19485);
|
|
728
774
|
return addHeapObject(ret);
|
|
729
775
|
},
|
|
730
776
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
731
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
732
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
777
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
778
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3886);
|
|
733
779
|
return addHeapObject(ret);
|
|
734
780
|
},
|
|
735
781
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
736
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx:
|
|
737
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
782
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
783
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3886_2);
|
|
738
784
|
return addHeapObject(ret);
|
|
739
785
|
},
|
|
740
786
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
741
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("
|
|
742
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
787
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
788
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3886_3);
|
|
743
789
|
return addHeapObject(ret);
|
|
744
790
|
},
|
|
745
791
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
746
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
747
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
792
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 21, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
793
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_3886_4);
|
|
748
794
|
return addHeapObject(ret);
|
|
749
795
|
},
|
|
750
796
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
797
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 735, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
798
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_7436);
|
|
799
|
+
return addHeapObject(ret);
|
|
800
|
+
},
|
|
801
|
+
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
751
802
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
752
803
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
753
804
|
return addHeapObject(ret);
|
|
754
805
|
},
|
|
755
|
-
|
|
806
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
756
807
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
757
808
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
758
809
|
return addHeapObject(ret);
|
|
@@ -771,26 +822,30 @@ function __wbg_get_imports() {
|
|
|
771
822
|
};
|
|
772
823
|
}
|
|
773
824
|
|
|
774
|
-
function
|
|
775
|
-
wasm.
|
|
825
|
+
function __wasm_bindgen_func_elem_7436(arg0, arg1) {
|
|
826
|
+
wasm.__wasm_bindgen_func_elem_7436(arg0, arg1);
|
|
776
827
|
}
|
|
777
828
|
|
|
778
|
-
function
|
|
779
|
-
wasm.
|
|
829
|
+
function __wasm_bindgen_func_elem_3886(arg0, arg1, arg2) {
|
|
830
|
+
wasm.__wasm_bindgen_func_elem_3886(arg0, arg1, addHeapObject(arg2));
|
|
780
831
|
}
|
|
781
832
|
|
|
782
|
-
function
|
|
783
|
-
wasm.
|
|
833
|
+
function __wasm_bindgen_func_elem_3886_2(arg0, arg1, arg2) {
|
|
834
|
+
wasm.__wasm_bindgen_func_elem_3886_2(arg0, arg1, addHeapObject(arg2));
|
|
784
835
|
}
|
|
785
836
|
|
|
786
|
-
function
|
|
787
|
-
wasm.
|
|
837
|
+
function __wasm_bindgen_func_elem_3886_3(arg0, arg1, arg2) {
|
|
838
|
+
wasm.__wasm_bindgen_func_elem_3886_3(arg0, arg1, addHeapObject(arg2));
|
|
788
839
|
}
|
|
789
840
|
|
|
790
|
-
function
|
|
841
|
+
function __wasm_bindgen_func_elem_3886_4(arg0, arg1, arg2) {
|
|
842
|
+
wasm.__wasm_bindgen_func_elem_3886_4(arg0, arg1, addHeapObject(arg2));
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
function __wasm_bindgen_func_elem_19485(arg0, arg1, arg2) {
|
|
791
846
|
try {
|
|
792
847
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
793
|
-
wasm.
|
|
848
|
+
wasm.__wasm_bindgen_func_elem_19485(retptr, arg0, arg1, addHeapObject(arg2));
|
|
794
849
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
795
850
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
796
851
|
if (r1) {
|
|
@@ -801,12 +856,15 @@ function __wasm_bindgen_func_elem_19314(arg0, arg1, arg2) {
|
|
|
801
856
|
}
|
|
802
857
|
}
|
|
803
858
|
|
|
804
|
-
function
|
|
805
|
-
wasm.
|
|
859
|
+
function __wasm_bindgen_func_elem_19487(arg0, arg1, arg2, arg3) {
|
|
860
|
+
wasm.__wasm_bindgen_func_elem_19487(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
806
861
|
}
|
|
807
862
|
|
|
808
863
|
|
|
809
864
|
const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
const __wbindgen_enum_IdbTransactionMode = ["readonly", "readwrite", "versionchange", "readwriteflush", "cleanup"];
|
|
810
868
|
const ChainProviderBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
811
869
|
? { register: () => {}, unregister: () => {} }
|
|
812
870
|
: new FinalizationRegistry(ptr => wasm.__wbg_chainproviderbuilder_free(ptr, 1));
|
|
@@ -831,7 +889,7 @@ function addHeapObject(obj) {
|
|
|
831
889
|
|
|
832
890
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
833
891
|
? { register: () => {}, unregister: () => {} }
|
|
834
|
-
: new FinalizationRegistry(state => wasm.
|
|
892
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export4(state.a, state.b));
|
|
835
893
|
|
|
836
894
|
function debugString(val) {
|
|
837
895
|
// primitive types
|
|
@@ -967,7 +1025,7 @@ function makeMutClosure(arg0, arg1, f) {
|
|
|
967
1025
|
};
|
|
968
1026
|
real._wbg_cb_unref = () => {
|
|
969
1027
|
if (--state.cnt === 0) {
|
|
970
|
-
wasm.
|
|
1028
|
+
wasm.__wbindgen_export4(state.a, state.b);
|
|
971
1029
|
state.a = 0;
|
|
972
1030
|
CLOSURE_DTORS.unregister(state);
|
|
973
1031
|
}
|
|
Binary file
|
|
@@ -13,7 +13,7 @@ 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
14
|
export const chainproviderbuilder_setWarmStore: (a: number, b: number, c: number) => void;
|
|
15
15
|
export const chainproviderhandle_connect: (a: number, b: number, c: number) => number;
|
|
16
|
-
export const
|
|
16
|
+
export const chainproviderhandle_save_database: (a: number, b: number, c: number) => number;
|
|
17
17
|
export const chainproviderhandle_snapshot: (a: number, b: number, c: number) => number;
|
|
18
18
|
export const chainproviderhandle_warmUp: (a: number, b: number, c: number) => number;
|
|
19
19
|
export const connection_close: (a: number) => void;
|
|
@@ -24,15 +24,16 @@ export const networkchains_bulletin: (a: number, b: number) => void;
|
|
|
24
24
|
export const networkchains_people: (a: number, b: number) => void;
|
|
25
25
|
export const networkchains_relay: (a: number, b: number) => void;
|
|
26
26
|
export const setLogLevel: (a: number, b: number) => void;
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
29
|
-
export const
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
27
|
+
export const __wasm_bindgen_func_elem_19485: (a: number, b: number, c: number, d: number) => void;
|
|
28
|
+
export const __wasm_bindgen_func_elem_19487: (a: number, b: number, c: number, d: number) => void;
|
|
29
|
+
export const __wasm_bindgen_func_elem_3886: (a: number, b: number, c: number) => void;
|
|
30
|
+
export const __wasm_bindgen_func_elem_3886_2: (a: number, b: number, c: number) => void;
|
|
31
|
+
export const __wasm_bindgen_func_elem_3886_3: (a: number, b: number, c: number) => void;
|
|
32
|
+
export const __wasm_bindgen_func_elem_3886_4: (a: number, b: number, c: number) => void;
|
|
33
|
+
export const __wasm_bindgen_func_elem_7436: (a: number, b: number) => void;
|
|
33
34
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
34
35
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
35
36
|
export const __wbindgen_export3: (a: number) => void;
|
|
36
|
-
export const __wbindgen_export4: (a: number, b: number
|
|
37
|
-
export const __wbindgen_export5: (a: number, b: number) => void;
|
|
37
|
+
export const __wbindgen_export4: (a: number, b: number) => void;
|
|
38
38
|
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
39
|
+
export const __wbindgen_export5: (a: number, b: number, c: number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parity/truapi-provider",
|
|
3
|
-
"version": "0.1.1-dev-20260908.
|
|
3
|
+
"version": "0.1.1-dev-20260908.2",
|
|
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
|
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const STORE = "chain-databases";
|
|
3
|
-
const VERSION = 1;
|
|
4
|
-
|
|
5
|
-
function open(name) {
|
|
6
|
-
return new Promise((resolve, reject) => {
|
|
7
|
-
const request = indexedDB.open(name, VERSION);
|
|
8
|
-
request.onupgradeneeded = () => {
|
|
9
|
-
const db = request.result;
|
|
10
|
-
if (!db.objectStoreNames.contains(STORE)) db.createObjectStore(STORE);
|
|
11
|
-
};
|
|
12
|
-
// An upgrade held open by another tab would otherwise never settle.
|
|
13
|
-
request.onblocked = () =>
|
|
14
|
-
reject(new Error(`another connection is holding "${name}" open`));
|
|
15
|
-
request.onerror = () =>
|
|
16
|
-
reject(request.error ?? new Error(`could not open "${name}"`));
|
|
17
|
-
request.onsuccess = () => resolve(request.result);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function warmStoreLoad(name, key) {
|
|
22
|
-
const db = await open(name);
|
|
23
|
-
try {
|
|
24
|
-
return await new Promise((resolve, reject) => {
|
|
25
|
-
const tx = db.transaction(STORE, "readonly");
|
|
26
|
-
const request = tx.objectStore(STORE).get(key);
|
|
27
|
-
request.onsuccess = () =>
|
|
28
|
-
resolve(typeof request.result === "string" ? request.result : null);
|
|
29
|
-
tx.onerror = () => reject(tx.error ?? new Error("read failed"));
|
|
30
|
-
tx.onabort = () => reject(tx.error ?? new Error("read aborted"));
|
|
31
|
-
});
|
|
32
|
-
} finally {
|
|
33
|
-
db.close();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export async function warmStoreSave(name, key, blob) {
|
|
38
|
-
const db = await open(name);
|
|
39
|
-
try {
|
|
40
|
-
await new Promise((resolve, reject) => {
|
|
41
|
-
const tx = db.transaction(STORE, "readwrite");
|
|
42
|
-
tx.objectStore(STORE).put(blob, key);
|
|
43
|
-
tx.oncomplete = () => resolve();
|
|
44
|
-
tx.onerror = () => reject(tx.error ?? new Error("write failed"));
|
|
45
|
-
tx.onabort = () => reject(tx.error ?? new Error("write aborted"));
|
|
46
|
-
});
|
|
47
|
-
} finally {
|
|
48
|
-
db.close();
|
|
49
|
-
}
|
|
50
|
-
}
|