veriq-client 0.1.0 → 0.1.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.
- package/README.md +33 -3
- package/dist/bin/veriq.js +100 -7
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +814 -48
- package/dist/index.d.ts +814 -48
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +6 -2
- package/wasm/veriq_verifier.wasm +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Transport } from 'viem';
|
|
2
1
|
import { z } from 'zod';
|
|
2
|
+
import { Transport } from 'viem';
|
|
3
3
|
|
|
4
4
|
/** 32-byte hash (B256). */
|
|
5
5
|
declare const Hex32Schema: z.ZodString;
|
|
@@ -7,7 +7,7 @@ declare const VerificationStatusSchema: z.ZodEnum<["verified", "unverified", "un
|
|
|
7
7
|
declare const RootSourceSchema: z.ZodEnum<["local-light-client", "fixture", "untrusted-rpc"]>;
|
|
8
8
|
declare const VerifierLocationSchema: z.ZodEnum<["local-engine", "remote-engine", "browser"]>;
|
|
9
9
|
declare const MechanismSchema: z.ZodEnum<["account-proof", "storage-proof", "code-hash"]>;
|
|
10
|
-
declare const TransportKindSchema: z.ZodEnum<["direct", "ohttp", "anyone-socks"]>;
|
|
10
|
+
declare const TransportKindSchema: z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>;
|
|
11
11
|
declare const ComparisonSchema: z.ZodEnum<["not-run", "agree", "divergent"]>;
|
|
12
12
|
declare const IdentitySchema: z.ZodObject<{
|
|
13
13
|
requestId: z.ZodString;
|
|
@@ -30,16 +30,20 @@ declare const BlockSchema: z.ZodObject<{
|
|
|
30
30
|
hash: z.ZodString;
|
|
31
31
|
stateRoot: z.ZodString;
|
|
32
32
|
finalized: z.ZodBoolean;
|
|
33
|
+
/** S6: the chain this block is on. Absent in receipts from engines before mainnet support. */
|
|
34
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
33
35
|
}, "strip", z.ZodTypeAny, {
|
|
34
36
|
number: number;
|
|
35
37
|
hash: string;
|
|
36
38
|
stateRoot: string;
|
|
37
39
|
finalized: boolean;
|
|
40
|
+
chainId?: number | undefined;
|
|
38
41
|
}, {
|
|
39
42
|
number: number;
|
|
40
43
|
hash: string;
|
|
41
44
|
stateRoot: string;
|
|
42
45
|
finalized: boolean;
|
|
46
|
+
chainId?: number | undefined;
|
|
43
47
|
}>;
|
|
44
48
|
declare const BootstrapSchema: z.ZodObject<{
|
|
45
49
|
source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
@@ -94,13 +98,13 @@ declare const VerificationSchema: z.ZodObject<{
|
|
|
94
98
|
};
|
|
95
99
|
}>;
|
|
96
100
|
declare const PrivacySchema: z.ZodObject<{
|
|
97
|
-
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks"]>;
|
|
101
|
+
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>;
|
|
98
102
|
mechanism: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
99
103
|
}, "strip", z.ZodTypeAny, {
|
|
100
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
104
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
101
105
|
mechanism: string | null;
|
|
102
106
|
}, {
|
|
103
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
107
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
104
108
|
mechanism?: string | null | undefined;
|
|
105
109
|
}>;
|
|
106
110
|
/** `AttemptOutcome` in receipt.rs. */
|
|
@@ -209,16 +213,20 @@ declare const TrustReceiptSchema: z.ZodObject<{
|
|
|
209
213
|
hash: z.ZodString;
|
|
210
214
|
stateRoot: z.ZodString;
|
|
211
215
|
finalized: z.ZodBoolean;
|
|
216
|
+
/** S6: the chain this block is on. Absent in receipts from engines before mainnet support. */
|
|
217
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
212
218
|
}, "strip", z.ZodTypeAny, {
|
|
213
219
|
number: number;
|
|
214
220
|
hash: string;
|
|
215
221
|
stateRoot: string;
|
|
216
222
|
finalized: boolean;
|
|
223
|
+
chainId?: number | undefined;
|
|
217
224
|
}, {
|
|
218
225
|
number: number;
|
|
219
226
|
hash: string;
|
|
220
227
|
stateRoot: string;
|
|
221
228
|
finalized: boolean;
|
|
229
|
+
chainId?: number | undefined;
|
|
222
230
|
}>;
|
|
223
231
|
verification: z.ZodObject<{
|
|
224
232
|
status: z.ZodEnum<["verified", "unverified", "unsupported"]>;
|
|
@@ -260,13 +268,13 @@ declare const TrustReceiptSchema: z.ZodObject<{
|
|
|
260
268
|
};
|
|
261
269
|
}>;
|
|
262
270
|
privacy: z.ZodObject<{
|
|
263
|
-
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks"]>;
|
|
271
|
+
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>;
|
|
264
272
|
mechanism: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
265
273
|
}, "strip", z.ZodTypeAny, {
|
|
266
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
274
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
267
275
|
mechanism: string | null;
|
|
268
276
|
}, {
|
|
269
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
277
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
270
278
|
mechanism?: string | null | undefined;
|
|
271
279
|
}>;
|
|
272
280
|
routing: z.ZodObject<{
|
|
@@ -345,6 +353,7 @@ declare const TrustReceiptSchema: z.ZodObject<{
|
|
|
345
353
|
hash: string;
|
|
346
354
|
stateRoot: string;
|
|
347
355
|
finalized: boolean;
|
|
356
|
+
chainId?: number | undefined;
|
|
348
357
|
};
|
|
349
358
|
verification: {
|
|
350
359
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -358,7 +367,7 @@ declare const TrustReceiptSchema: z.ZodObject<{
|
|
|
358
367
|
};
|
|
359
368
|
};
|
|
360
369
|
privacy: {
|
|
361
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
370
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
362
371
|
mechanism: string | null;
|
|
363
372
|
};
|
|
364
373
|
routing: {
|
|
@@ -393,6 +402,7 @@ declare const TrustReceiptSchema: z.ZodObject<{
|
|
|
393
402
|
hash: string;
|
|
394
403
|
stateRoot: string;
|
|
395
404
|
finalized: boolean;
|
|
405
|
+
chainId?: number | undefined;
|
|
396
406
|
};
|
|
397
407
|
verification: {
|
|
398
408
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -406,7 +416,7 @@ declare const TrustReceiptSchema: z.ZodObject<{
|
|
|
406
416
|
};
|
|
407
417
|
};
|
|
408
418
|
privacy: {
|
|
409
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
419
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
410
420
|
mechanism?: string | null | undefined;
|
|
411
421
|
};
|
|
412
422
|
routing: {
|
|
@@ -519,16 +529,20 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
519
529
|
hash: z.ZodString;
|
|
520
530
|
stateRoot: z.ZodString;
|
|
521
531
|
finalized: z.ZodBoolean;
|
|
532
|
+
/** S6: the chain this block is on. Absent in receipts from engines before mainnet support. */
|
|
533
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
522
534
|
}, "strip", z.ZodTypeAny, {
|
|
523
535
|
number: number;
|
|
524
536
|
hash: string;
|
|
525
537
|
stateRoot: string;
|
|
526
538
|
finalized: boolean;
|
|
539
|
+
chainId?: number | undefined;
|
|
527
540
|
}, {
|
|
528
541
|
number: number;
|
|
529
542
|
hash: string;
|
|
530
543
|
stateRoot: string;
|
|
531
544
|
finalized: boolean;
|
|
545
|
+
chainId?: number | undefined;
|
|
532
546
|
}>;
|
|
533
547
|
verification: z.ZodObject<{
|
|
534
548
|
status: z.ZodEnum<["verified", "unverified", "unsupported"]>;
|
|
@@ -570,13 +584,13 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
570
584
|
};
|
|
571
585
|
}>;
|
|
572
586
|
privacy: z.ZodObject<{
|
|
573
|
-
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks"]>;
|
|
587
|
+
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>;
|
|
574
588
|
mechanism: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
575
589
|
}, "strip", z.ZodTypeAny, {
|
|
576
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
590
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
577
591
|
mechanism: string | null;
|
|
578
592
|
}, {
|
|
579
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
593
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
580
594
|
mechanism?: string | null | undefined;
|
|
581
595
|
}>;
|
|
582
596
|
routing: z.ZodObject<{
|
|
@@ -655,6 +669,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
655
669
|
hash: string;
|
|
656
670
|
stateRoot: string;
|
|
657
671
|
finalized: boolean;
|
|
672
|
+
chainId?: number | undefined;
|
|
658
673
|
};
|
|
659
674
|
verification: {
|
|
660
675
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -668,7 +683,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
668
683
|
};
|
|
669
684
|
};
|
|
670
685
|
privacy: {
|
|
671
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
686
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
672
687
|
mechanism: string | null;
|
|
673
688
|
};
|
|
674
689
|
routing: {
|
|
@@ -703,6 +718,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
703
718
|
hash: string;
|
|
704
719
|
stateRoot: string;
|
|
705
720
|
finalized: boolean;
|
|
721
|
+
chainId?: number | undefined;
|
|
706
722
|
};
|
|
707
723
|
verification: {
|
|
708
724
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -716,7 +732,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
716
732
|
};
|
|
717
733
|
};
|
|
718
734
|
privacy: {
|
|
719
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
735
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
720
736
|
mechanism?: string | null | undefined;
|
|
721
737
|
};
|
|
722
738
|
routing: {
|
|
@@ -781,6 +797,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
781
797
|
hash: string;
|
|
782
798
|
stateRoot: string;
|
|
783
799
|
finalized: boolean;
|
|
800
|
+
chainId?: number | undefined;
|
|
784
801
|
};
|
|
785
802
|
verification: {
|
|
786
803
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -794,7 +811,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
794
811
|
};
|
|
795
812
|
};
|
|
796
813
|
privacy: {
|
|
797
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
814
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
798
815
|
mechanism: string | null;
|
|
799
816
|
};
|
|
800
817
|
routing: {
|
|
@@ -832,6 +849,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
832
849
|
hash: string;
|
|
833
850
|
stateRoot: string;
|
|
834
851
|
finalized: boolean;
|
|
852
|
+
chainId?: number | undefined;
|
|
835
853
|
};
|
|
836
854
|
verification: {
|
|
837
855
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -845,7 +863,7 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
845
863
|
};
|
|
846
864
|
};
|
|
847
865
|
privacy: {
|
|
848
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
866
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
849
867
|
mechanism?: string | null | undefined;
|
|
850
868
|
};
|
|
851
869
|
routing: {
|
|
@@ -871,6 +889,30 @@ declare const ReadResultSchema: z.ZodObject<{
|
|
|
871
889
|
};
|
|
872
890
|
attempts?: unknown[] | undefined;
|
|
873
891
|
}>;
|
|
892
|
+
/** `veriq_getRoot`: the finalized block the engine verifies against right now. */
|
|
893
|
+
declare const RootInfoSchema: z.ZodObject<{
|
|
894
|
+
number: z.ZodNumber;
|
|
895
|
+
hash: z.ZodString;
|
|
896
|
+
stateRoot: z.ZodString;
|
|
897
|
+
rootSource: z.ZodString;
|
|
898
|
+
verified: z.ZodBoolean;
|
|
899
|
+
/** S6: the engine's chain. Absent from older engines. */
|
|
900
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
901
|
+
}, "strip", z.ZodTypeAny, {
|
|
902
|
+
number: number;
|
|
903
|
+
verified: boolean;
|
|
904
|
+
hash: string;
|
|
905
|
+
stateRoot: string;
|
|
906
|
+
rootSource: string;
|
|
907
|
+
chainId?: number | undefined;
|
|
908
|
+
}, {
|
|
909
|
+
number: number;
|
|
910
|
+
verified: boolean;
|
|
911
|
+
hash: string;
|
|
912
|
+
stateRoot: string;
|
|
913
|
+
rootSource: string;
|
|
914
|
+
chainId?: number | undefined;
|
|
915
|
+
}>;
|
|
874
916
|
/** A stored receipt row (GET /receipts, GET /receipts/:id). Failed reads carry `error` instead of `receipt`. */
|
|
875
917
|
declare const ReceiptRecordSchema: z.ZodObject<{
|
|
876
918
|
id: z.ZodString;
|
|
@@ -910,16 +952,20 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
910
952
|
hash: z.ZodString;
|
|
911
953
|
stateRoot: z.ZodString;
|
|
912
954
|
finalized: z.ZodBoolean;
|
|
955
|
+
/** S6: the chain this block is on. Absent in receipts from engines before mainnet support. */
|
|
956
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
913
957
|
}, "strip", z.ZodTypeAny, {
|
|
914
958
|
number: number;
|
|
915
959
|
hash: string;
|
|
916
960
|
stateRoot: string;
|
|
917
961
|
finalized: boolean;
|
|
962
|
+
chainId?: number | undefined;
|
|
918
963
|
}, {
|
|
919
964
|
number: number;
|
|
920
965
|
hash: string;
|
|
921
966
|
stateRoot: string;
|
|
922
967
|
finalized: boolean;
|
|
968
|
+
chainId?: number | undefined;
|
|
923
969
|
}>;
|
|
924
970
|
verification: z.ZodObject<{
|
|
925
971
|
status: z.ZodEnum<["verified", "unverified", "unsupported"]>;
|
|
@@ -961,13 +1007,13 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
961
1007
|
};
|
|
962
1008
|
}>;
|
|
963
1009
|
privacy: z.ZodObject<{
|
|
964
|
-
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks"]>;
|
|
1010
|
+
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>;
|
|
965
1011
|
mechanism: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
966
1012
|
}, "strip", z.ZodTypeAny, {
|
|
967
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1013
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
968
1014
|
mechanism: string | null;
|
|
969
1015
|
}, {
|
|
970
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1016
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
971
1017
|
mechanism?: string | null | undefined;
|
|
972
1018
|
}>;
|
|
973
1019
|
routing: z.ZodObject<{
|
|
@@ -1046,6 +1092,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1046
1092
|
hash: string;
|
|
1047
1093
|
stateRoot: string;
|
|
1048
1094
|
finalized: boolean;
|
|
1095
|
+
chainId?: number | undefined;
|
|
1049
1096
|
};
|
|
1050
1097
|
verification: {
|
|
1051
1098
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1059,7 +1106,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1059
1106
|
};
|
|
1060
1107
|
};
|
|
1061
1108
|
privacy: {
|
|
1062
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1109
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1063
1110
|
mechanism: string | null;
|
|
1064
1111
|
};
|
|
1065
1112
|
routing: {
|
|
@@ -1094,6 +1141,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1094
1141
|
hash: string;
|
|
1095
1142
|
stateRoot: string;
|
|
1096
1143
|
finalized: boolean;
|
|
1144
|
+
chainId?: number | undefined;
|
|
1097
1145
|
};
|
|
1098
1146
|
verification: {
|
|
1099
1147
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1107,7 +1155,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1107
1155
|
};
|
|
1108
1156
|
};
|
|
1109
1157
|
privacy: {
|
|
1110
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1158
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1111
1159
|
mechanism?: string | null | undefined;
|
|
1112
1160
|
};
|
|
1113
1161
|
routing: {
|
|
@@ -1192,6 +1240,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1192
1240
|
hash: string;
|
|
1193
1241
|
stateRoot: string;
|
|
1194
1242
|
finalized: boolean;
|
|
1243
|
+
chainId?: number | undefined;
|
|
1195
1244
|
};
|
|
1196
1245
|
verification: {
|
|
1197
1246
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1205,7 +1254,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1205
1254
|
};
|
|
1206
1255
|
};
|
|
1207
1256
|
privacy: {
|
|
1208
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1257
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1209
1258
|
mechanism: string | null;
|
|
1210
1259
|
};
|
|
1211
1260
|
routing: {
|
|
@@ -1257,6 +1306,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1257
1306
|
hash: string;
|
|
1258
1307
|
stateRoot: string;
|
|
1259
1308
|
finalized: boolean;
|
|
1309
|
+
chainId?: number | undefined;
|
|
1260
1310
|
};
|
|
1261
1311
|
verification: {
|
|
1262
1312
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1270,7 +1320,7 @@ declare const ReceiptRecordSchema: z.ZodObject<{
|
|
|
1270
1320
|
};
|
|
1271
1321
|
};
|
|
1272
1322
|
privacy: {
|
|
1273
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1323
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1274
1324
|
mechanism?: string | null | undefined;
|
|
1275
1325
|
};
|
|
1276
1326
|
routing: {
|
|
@@ -1340,16 +1390,20 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1340
1390
|
hash: z.ZodString;
|
|
1341
1391
|
stateRoot: z.ZodString;
|
|
1342
1392
|
finalized: z.ZodBoolean;
|
|
1393
|
+
/** S6: the chain this block is on. Absent in receipts from engines before mainnet support. */
|
|
1394
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
1343
1395
|
}, "strip", z.ZodTypeAny, {
|
|
1344
1396
|
number: number;
|
|
1345
1397
|
hash: string;
|
|
1346
1398
|
stateRoot: string;
|
|
1347
1399
|
finalized: boolean;
|
|
1400
|
+
chainId?: number | undefined;
|
|
1348
1401
|
}, {
|
|
1349
1402
|
number: number;
|
|
1350
1403
|
hash: string;
|
|
1351
1404
|
stateRoot: string;
|
|
1352
1405
|
finalized: boolean;
|
|
1406
|
+
chainId?: number | undefined;
|
|
1353
1407
|
}>;
|
|
1354
1408
|
verification: z.ZodObject<{
|
|
1355
1409
|
status: z.ZodEnum<["verified", "unverified", "unsupported"]>;
|
|
@@ -1391,13 +1445,13 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1391
1445
|
};
|
|
1392
1446
|
}>;
|
|
1393
1447
|
privacy: z.ZodObject<{
|
|
1394
|
-
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks"]>;
|
|
1448
|
+
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>;
|
|
1395
1449
|
mechanism: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
1396
1450
|
}, "strip", z.ZodTypeAny, {
|
|
1397
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1451
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1398
1452
|
mechanism: string | null;
|
|
1399
1453
|
}, {
|
|
1400
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1454
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1401
1455
|
mechanism?: string | null | undefined;
|
|
1402
1456
|
}>;
|
|
1403
1457
|
routing: z.ZodObject<{
|
|
@@ -1476,6 +1530,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1476
1530
|
hash: string;
|
|
1477
1531
|
stateRoot: string;
|
|
1478
1532
|
finalized: boolean;
|
|
1533
|
+
chainId?: number | undefined;
|
|
1479
1534
|
};
|
|
1480
1535
|
verification: {
|
|
1481
1536
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1489,7 +1544,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1489
1544
|
};
|
|
1490
1545
|
};
|
|
1491
1546
|
privacy: {
|
|
1492
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1547
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1493
1548
|
mechanism: string | null;
|
|
1494
1549
|
};
|
|
1495
1550
|
routing: {
|
|
@@ -1524,6 +1579,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1524
1579
|
hash: string;
|
|
1525
1580
|
stateRoot: string;
|
|
1526
1581
|
finalized: boolean;
|
|
1582
|
+
chainId?: number | undefined;
|
|
1527
1583
|
};
|
|
1528
1584
|
verification: {
|
|
1529
1585
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1537,7 +1593,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1537
1593
|
};
|
|
1538
1594
|
};
|
|
1539
1595
|
privacy: {
|
|
1540
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1596
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1541
1597
|
mechanism?: string | null | undefined;
|
|
1542
1598
|
};
|
|
1543
1599
|
routing: {
|
|
@@ -1622,6 +1678,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1622
1678
|
hash: string;
|
|
1623
1679
|
stateRoot: string;
|
|
1624
1680
|
finalized: boolean;
|
|
1681
|
+
chainId?: number | undefined;
|
|
1625
1682
|
};
|
|
1626
1683
|
verification: {
|
|
1627
1684
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1635,7 +1692,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1635
1692
|
};
|
|
1636
1693
|
};
|
|
1637
1694
|
privacy: {
|
|
1638
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1695
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1639
1696
|
mechanism: string | null;
|
|
1640
1697
|
};
|
|
1641
1698
|
routing: {
|
|
@@ -1687,6 +1744,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1687
1744
|
hash: string;
|
|
1688
1745
|
stateRoot: string;
|
|
1689
1746
|
finalized: boolean;
|
|
1747
|
+
chainId?: number | undefined;
|
|
1690
1748
|
};
|
|
1691
1749
|
verification: {
|
|
1692
1750
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1700,7 +1758,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1700
1758
|
};
|
|
1701
1759
|
};
|
|
1702
1760
|
privacy: {
|
|
1703
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1761
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1704
1762
|
mechanism?: string | null | undefined;
|
|
1705
1763
|
};
|
|
1706
1764
|
routing: {
|
|
@@ -1759,6 +1817,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1759
1817
|
hash: string;
|
|
1760
1818
|
stateRoot: string;
|
|
1761
1819
|
finalized: boolean;
|
|
1820
|
+
chainId?: number | undefined;
|
|
1762
1821
|
};
|
|
1763
1822
|
verification: {
|
|
1764
1823
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1772,7 +1831,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1772
1831
|
};
|
|
1773
1832
|
};
|
|
1774
1833
|
privacy: {
|
|
1775
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1834
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1776
1835
|
mechanism: string | null;
|
|
1777
1836
|
};
|
|
1778
1837
|
routing: {
|
|
@@ -1826,6 +1885,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1826
1885
|
hash: string;
|
|
1827
1886
|
stateRoot: string;
|
|
1828
1887
|
finalized: boolean;
|
|
1888
|
+
chainId?: number | undefined;
|
|
1829
1889
|
};
|
|
1830
1890
|
verification: {
|
|
1831
1891
|
status: "verified" | "unverified" | "unsupported";
|
|
@@ -1839,7 +1899,7 @@ declare const ReceiptListSchema: z.ZodObject<{
|
|
|
1839
1899
|
};
|
|
1840
1900
|
};
|
|
1841
1901
|
privacy: {
|
|
1842
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1902
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1843
1903
|
mechanism?: string | null | undefined;
|
|
1844
1904
|
};
|
|
1845
1905
|
routing: {
|
|
@@ -1877,7 +1937,7 @@ declare const ProviderHealthSchema: z.ZodObject<{
|
|
|
1877
1937
|
chainOk: z.ZodBoolean;
|
|
1878
1938
|
proofSupport: z.ZodBoolean;
|
|
1879
1939
|
eip1898: z.ZodBoolean;
|
|
1880
|
-
transport: z.ZodDefault<z.ZodEnum<["direct", "ohttp", "anyone-socks"]>>;
|
|
1940
|
+
transport: z.ZodDefault<z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>>;
|
|
1881
1941
|
breaker: z.ZodObject<{
|
|
1882
1942
|
state: z.ZodEnum<["closed", "open", "half-open"]>;
|
|
1883
1943
|
cooldownUntil: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -1895,7 +1955,7 @@ declare const ProviderHealthSchema: z.ZodObject<{
|
|
|
1895
1955
|
lastError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1896
1956
|
}, "strip", z.ZodTypeAny, {
|
|
1897
1957
|
name: string;
|
|
1898
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
1958
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1899
1959
|
chainOk: boolean;
|
|
1900
1960
|
proofSupport: boolean;
|
|
1901
1961
|
eip1898: boolean;
|
|
@@ -1916,7 +1976,7 @@ declare const ProviderHealthSchema: z.ZodObject<{
|
|
|
1916
1976
|
reason?: string | null | undefined;
|
|
1917
1977
|
cooldownUntil?: number | null | undefined;
|
|
1918
1978
|
};
|
|
1919
|
-
transport?: "direct" | "ohttp" | "anyone-socks" | undefined;
|
|
1979
|
+
transport?: "direct" | "ohttp" | "anyone-socks" | "anon-rpc" | undefined;
|
|
1920
1980
|
successRate?: number | null | undefined;
|
|
1921
1981
|
lastError?: string | null | undefined;
|
|
1922
1982
|
}>;
|
|
@@ -1963,7 +2023,7 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1963
2023
|
chainOk: z.ZodBoolean;
|
|
1964
2024
|
proofSupport: z.ZodBoolean;
|
|
1965
2025
|
eip1898: z.ZodBoolean;
|
|
1966
|
-
transport: z.ZodDefault<z.ZodEnum<["direct", "ohttp", "anyone-socks"]>>;
|
|
2026
|
+
transport: z.ZodDefault<z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>>;
|
|
1967
2027
|
breaker: z.ZodObject<{
|
|
1968
2028
|
state: z.ZodEnum<["closed", "open", "half-open"]>;
|
|
1969
2029
|
cooldownUntil: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -1981,7 +2041,7 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1981
2041
|
lastError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1982
2042
|
}, "strip", z.ZodTypeAny, {
|
|
1983
2043
|
name: string;
|
|
1984
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
2044
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
1985
2045
|
chainOk: boolean;
|
|
1986
2046
|
proofSupport: boolean;
|
|
1987
2047
|
eip1898: boolean;
|
|
@@ -2002,7 +2062,7 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2002
2062
|
reason?: string | null | undefined;
|
|
2003
2063
|
cooldownUntil?: number | null | undefined;
|
|
2004
2064
|
};
|
|
2005
|
-
transport?: "direct" | "ohttp" | "anyone-socks" | undefined;
|
|
2065
|
+
transport?: "direct" | "ohttp" | "anyone-socks" | "anon-rpc" | undefined;
|
|
2006
2066
|
successRate?: number | null | undefined;
|
|
2007
2067
|
lastError?: string | null | undefined;
|
|
2008
2068
|
}>, "many">;
|
|
@@ -2052,7 +2112,7 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2052
2112
|
devMode: boolean;
|
|
2053
2113
|
providers: {
|
|
2054
2114
|
name: string;
|
|
2055
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
2115
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2056
2116
|
chainOk: boolean;
|
|
2057
2117
|
proofSupport: boolean;
|
|
2058
2118
|
eip1898: boolean;
|
|
@@ -2075,11 +2135,11 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2075
2135
|
lastUpdateUnix?: number | null | undefined;
|
|
2076
2136
|
headNumber?: number | null | undefined;
|
|
2077
2137
|
};
|
|
2138
|
+
chainId?: number | undefined;
|
|
2078
2139
|
error?: {
|
|
2079
2140
|
code: string;
|
|
2080
2141
|
message: string;
|
|
2081
2142
|
} | null | undefined;
|
|
2082
|
-
chainId?: number | undefined;
|
|
2083
2143
|
bind?: string | undefined;
|
|
2084
2144
|
}, {
|
|
2085
2145
|
rootSource: "local-light-client" | "fixture" | "untrusted-rpc" | null;
|
|
@@ -2093,7 +2153,7 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2093
2153
|
reason?: string | null | undefined;
|
|
2094
2154
|
cooldownUntil?: number | null | undefined;
|
|
2095
2155
|
};
|
|
2096
|
-
transport?: "direct" | "ohttp" | "anyone-socks" | undefined;
|
|
2156
|
+
transport?: "direct" | "ohttp" | "anyone-socks" | "anon-rpc" | undefined;
|
|
2097
2157
|
successRate?: number | null | undefined;
|
|
2098
2158
|
lastError?: string | null | undefined;
|
|
2099
2159
|
}[];
|
|
@@ -2108,12 +2168,12 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2108
2168
|
lastUpdateUnix?: number | null | undefined;
|
|
2109
2169
|
headNumber?: number | null | undefined;
|
|
2110
2170
|
};
|
|
2171
|
+
chainId?: number | undefined;
|
|
2111
2172
|
ok?: boolean | undefined;
|
|
2112
2173
|
error?: {
|
|
2113
2174
|
code: string;
|
|
2114
2175
|
message: string;
|
|
2115
2176
|
} | null | undefined;
|
|
2116
|
-
chainId?: number | undefined;
|
|
2117
2177
|
bind?: string | undefined;
|
|
2118
2178
|
devMode?: boolean | undefined;
|
|
2119
2179
|
}>, {
|
|
@@ -2122,7 +2182,7 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2122
2182
|
devMode: boolean;
|
|
2123
2183
|
providers: {
|
|
2124
2184
|
name: string;
|
|
2125
|
-
transport: "direct" | "ohttp" | "anyone-socks";
|
|
2185
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2126
2186
|
chainOk: boolean;
|
|
2127
2187
|
proofSupport: boolean;
|
|
2128
2188
|
eip1898: boolean;
|
|
@@ -2145,11 +2205,11 @@ declare const EngineHealthSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2145
2205
|
lastUpdateUnix?: number | null | undefined;
|
|
2146
2206
|
headNumber?: number | null | undefined;
|
|
2147
2207
|
};
|
|
2208
|
+
chainId?: number | undefined;
|
|
2148
2209
|
error?: {
|
|
2149
2210
|
code: string;
|
|
2150
2211
|
message: string;
|
|
2151
2212
|
} | null | undefined;
|
|
2152
|
-
chainId?: number | undefined;
|
|
2153
2213
|
bind?: string | undefined;
|
|
2154
2214
|
}, unknown>;
|
|
2155
2215
|
/** veriq_getCapabilities */
|
|
@@ -2169,6 +2229,428 @@ declare const CapabilitiesSchema: z.ZodObject<{
|
|
|
2169
2229
|
blockPolicies: z.ZodDefault<z.ZodArray<z.ZodEnum<["finalized", "latest"]>, "many">>;
|
|
2170
2230
|
privacy: z.ZodDefault<z.ZodBoolean>;
|
|
2171
2231
|
}, z.ZodTypeAny, "passthrough">>;
|
|
2232
|
+
declare const DelegationStatusSchema: z.ZodUnion<[z.ZodObject<{
|
|
2233
|
+
status: z.ZodEnum<["normal-eoa", "contract", "revoked", "invalid-designator"]>;
|
|
2234
|
+
}, "strip", z.ZodTypeAny, {
|
|
2235
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator";
|
|
2236
|
+
}, {
|
|
2237
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator";
|
|
2238
|
+
}>, z.ZodObject<{
|
|
2239
|
+
status: z.ZodLiteral<"delegated">;
|
|
2240
|
+
delegate: z.ZodString;
|
|
2241
|
+
}, "strip", z.ZodTypeAny, {
|
|
2242
|
+
status: "delegated";
|
|
2243
|
+
delegate: string;
|
|
2244
|
+
}, {
|
|
2245
|
+
status: "delegated";
|
|
2246
|
+
delegate: string;
|
|
2247
|
+
}>, z.ZodEnum<["normal-eoa", "delegated", "contract", "revoked", "invalid-designator"]>]>;
|
|
2248
|
+
declare const DelegationSecurityClassificationSchema: z.ZodEnum<["normal-eoa", "smart-contract", "delegation-detected", "delegation-revoked", "unverified-delegate", "delegate-code-verified", "potential-risk", "security-assessment-unavailable"]>;
|
|
2249
|
+
declare const DelegationResultSchema: z.ZodObject<{
|
|
2250
|
+
address: z.ZodString;
|
|
2251
|
+
status: z.ZodUnion<[z.ZodObject<{
|
|
2252
|
+
status: z.ZodEnum<["normal-eoa", "contract", "revoked", "invalid-designator"]>;
|
|
2253
|
+
}, "strip", z.ZodTypeAny, {
|
|
2254
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator";
|
|
2255
|
+
}, {
|
|
2256
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator";
|
|
2257
|
+
}>, z.ZodObject<{
|
|
2258
|
+
status: z.ZodLiteral<"delegated">;
|
|
2259
|
+
delegate: z.ZodString;
|
|
2260
|
+
}, "strip", z.ZodTypeAny, {
|
|
2261
|
+
status: "delegated";
|
|
2262
|
+
delegate: string;
|
|
2263
|
+
}, {
|
|
2264
|
+
status: "delegated";
|
|
2265
|
+
delegate: string;
|
|
2266
|
+
}>, z.ZodEnum<["normal-eoa", "delegated", "contract", "revoked", "invalid-designator"]>]>;
|
|
2267
|
+
isDelegated: z.ZodBoolean;
|
|
2268
|
+
delegateAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2269
|
+
codeHash: z.ZodString;
|
|
2270
|
+
delegateCodeHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2271
|
+
securityClassification: z.ZodEnum<["normal-eoa", "smart-contract", "delegation-detected", "delegation-revoked", "unverified-delegate", "delegate-code-verified", "potential-risk", "security-assessment-unavailable"]>;
|
|
2272
|
+
blockNumber: z.ZodOptional<z.ZodNumber>;
|
|
2273
|
+
verified: z.ZodDefault<z.ZodBoolean>;
|
|
2274
|
+
receipt: z.ZodObject<{
|
|
2275
|
+
identity: z.ZodObject<{
|
|
2276
|
+
requestId: z.ZodString;
|
|
2277
|
+
method: z.ZodString;
|
|
2278
|
+
requestBinding: z.ZodString;
|
|
2279
|
+
resultBinding: z.ZodString;
|
|
2280
|
+
}, "strip", z.ZodTypeAny, {
|
|
2281
|
+
requestId: string;
|
|
2282
|
+
method: string;
|
|
2283
|
+
requestBinding: string;
|
|
2284
|
+
resultBinding: string;
|
|
2285
|
+
}, {
|
|
2286
|
+
requestId: string;
|
|
2287
|
+
method: string;
|
|
2288
|
+
requestBinding: string;
|
|
2289
|
+
resultBinding: string;
|
|
2290
|
+
}>;
|
|
2291
|
+
block: z.ZodObject<{
|
|
2292
|
+
number: z.ZodNumber;
|
|
2293
|
+
hash: z.ZodString;
|
|
2294
|
+
stateRoot: z.ZodString;
|
|
2295
|
+
finalized: z.ZodBoolean;
|
|
2296
|
+
/** S6: the chain this block is on. Absent in receipts from engines before mainnet support. */
|
|
2297
|
+
chainId: z.ZodOptional<z.ZodNumber>;
|
|
2298
|
+
}, "strip", z.ZodTypeAny, {
|
|
2299
|
+
number: number;
|
|
2300
|
+
hash: string;
|
|
2301
|
+
stateRoot: string;
|
|
2302
|
+
finalized: boolean;
|
|
2303
|
+
chainId?: number | undefined;
|
|
2304
|
+
}, {
|
|
2305
|
+
number: number;
|
|
2306
|
+
hash: string;
|
|
2307
|
+
stateRoot: string;
|
|
2308
|
+
finalized: boolean;
|
|
2309
|
+
chainId?: number | undefined;
|
|
2310
|
+
}>;
|
|
2311
|
+
verification: z.ZodObject<{
|
|
2312
|
+
status: z.ZodEnum<["verified", "unverified", "unsupported"]>;
|
|
2313
|
+
rootSource: z.ZodEnum<["local-light-client", "fixture", "untrusted-rpc"]>;
|
|
2314
|
+
verifierLocation: z.ZodEnum<["local-engine", "remote-engine", "browser"]>;
|
|
2315
|
+
mechanisms: z.ZodArray<z.ZodEnum<["account-proof", "storage-proof", "code-hash"]>, "many">;
|
|
2316
|
+
bootstrap: z.ZodObject<{
|
|
2317
|
+
source: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
2318
|
+
checkpoint: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
2319
|
+
checkpointSource: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
2320
|
+
}, "strip", z.ZodTypeAny, {
|
|
2321
|
+
source: string | null;
|
|
2322
|
+
checkpoint: string | null;
|
|
2323
|
+
checkpointSource: string | null;
|
|
2324
|
+
}, {
|
|
2325
|
+
source?: string | null | undefined;
|
|
2326
|
+
checkpoint?: string | null | undefined;
|
|
2327
|
+
checkpointSource?: string | null | undefined;
|
|
2328
|
+
}>;
|
|
2329
|
+
}, "strip", z.ZodTypeAny, {
|
|
2330
|
+
status: "verified" | "unverified" | "unsupported";
|
|
2331
|
+
rootSource: "local-light-client" | "fixture" | "untrusted-rpc";
|
|
2332
|
+
verifierLocation: "local-engine" | "remote-engine" | "browser";
|
|
2333
|
+
mechanisms: ("account-proof" | "storage-proof" | "code-hash")[];
|
|
2334
|
+
bootstrap: {
|
|
2335
|
+
source: string | null;
|
|
2336
|
+
checkpoint: string | null;
|
|
2337
|
+
checkpointSource: string | null;
|
|
2338
|
+
};
|
|
2339
|
+
}, {
|
|
2340
|
+
status: "verified" | "unverified" | "unsupported";
|
|
2341
|
+
rootSource: "local-light-client" | "fixture" | "untrusted-rpc";
|
|
2342
|
+
verifierLocation: "local-engine" | "remote-engine" | "browser";
|
|
2343
|
+
mechanisms: ("account-proof" | "storage-proof" | "code-hash")[];
|
|
2344
|
+
bootstrap: {
|
|
2345
|
+
source?: string | null | undefined;
|
|
2346
|
+
checkpoint?: string | null | undefined;
|
|
2347
|
+
checkpointSource?: string | null | undefined;
|
|
2348
|
+
};
|
|
2349
|
+
}>;
|
|
2350
|
+
privacy: z.ZodObject<{
|
|
2351
|
+
transport: z.ZodEnum<["direct", "ohttp", "anyone-socks", "anon-rpc"]>;
|
|
2352
|
+
mechanism: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
2353
|
+
}, "strip", z.ZodTypeAny, {
|
|
2354
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2355
|
+
mechanism: string | null;
|
|
2356
|
+
}, {
|
|
2357
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2358
|
+
mechanism?: string | null | undefined;
|
|
2359
|
+
}>;
|
|
2360
|
+
routing: z.ZodObject<{
|
|
2361
|
+
comparison: z.ZodEnum<["not-run", "agree", "divergent"]>;
|
|
2362
|
+
providersTried: z.ZodNumber;
|
|
2363
|
+
providerLabel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
2364
|
+
attempts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2365
|
+
provider: z.ZodString;
|
|
2366
|
+
outcome: z.ZodEnum<["success", "transport-failure", "provider-error", "invalid-proof"]>;
|
|
2367
|
+
elapsedMs: z.ZodNumber;
|
|
2368
|
+
failureReason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2369
|
+
}, "strip", z.ZodTypeAny, {
|
|
2370
|
+
provider: string;
|
|
2371
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2372
|
+
elapsedMs: number;
|
|
2373
|
+
failureReason?: string | null | undefined;
|
|
2374
|
+
}, {
|
|
2375
|
+
provider: string;
|
|
2376
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2377
|
+
elapsedMs: number;
|
|
2378
|
+
failureReason?: string | null | undefined;
|
|
2379
|
+
}>, "many">>;
|
|
2380
|
+
}, "strip", z.ZodTypeAny, {
|
|
2381
|
+
comparison: "not-run" | "agree" | "divergent";
|
|
2382
|
+
providersTried: number;
|
|
2383
|
+
providerLabel: string | null;
|
|
2384
|
+
attempts: {
|
|
2385
|
+
provider: string;
|
|
2386
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2387
|
+
elapsedMs: number;
|
|
2388
|
+
failureReason?: string | null | undefined;
|
|
2389
|
+
}[];
|
|
2390
|
+
}, {
|
|
2391
|
+
comparison: "not-run" | "agree" | "divergent";
|
|
2392
|
+
providersTried: number;
|
|
2393
|
+
providerLabel?: string | null | undefined;
|
|
2394
|
+
attempts?: {
|
|
2395
|
+
provider: string;
|
|
2396
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2397
|
+
elapsedMs: number;
|
|
2398
|
+
failureReason?: string | null | undefined;
|
|
2399
|
+
}[] | undefined;
|
|
2400
|
+
}>;
|
|
2401
|
+
freshness: z.ZodObject<{
|
|
2402
|
+
observedAt: z.ZodNumber;
|
|
2403
|
+
ageSeconds: z.ZodNumber;
|
|
2404
|
+
pinned: z.ZodBoolean;
|
|
2405
|
+
}, "strip", z.ZodTypeAny, {
|
|
2406
|
+
observedAt: number;
|
|
2407
|
+
ageSeconds: number;
|
|
2408
|
+
pinned: boolean;
|
|
2409
|
+
}, {
|
|
2410
|
+
observedAt: number;
|
|
2411
|
+
ageSeconds: number;
|
|
2412
|
+
pinned: boolean;
|
|
2413
|
+
}>;
|
|
2414
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2415
|
+
code: z.ZodString;
|
|
2416
|
+
message: z.ZodString;
|
|
2417
|
+
}, "strip", z.ZodTypeAny, {
|
|
2418
|
+
code: string;
|
|
2419
|
+
message: string;
|
|
2420
|
+
}, {
|
|
2421
|
+
code: string;
|
|
2422
|
+
message: string;
|
|
2423
|
+
}>, "many">>;
|
|
2424
|
+
}, "strip", z.ZodTypeAny, {
|
|
2425
|
+
identity: {
|
|
2426
|
+
requestId: string;
|
|
2427
|
+
method: string;
|
|
2428
|
+
requestBinding: string;
|
|
2429
|
+
resultBinding: string;
|
|
2430
|
+
};
|
|
2431
|
+
block: {
|
|
2432
|
+
number: number;
|
|
2433
|
+
hash: string;
|
|
2434
|
+
stateRoot: string;
|
|
2435
|
+
finalized: boolean;
|
|
2436
|
+
chainId?: number | undefined;
|
|
2437
|
+
};
|
|
2438
|
+
verification: {
|
|
2439
|
+
status: "verified" | "unverified" | "unsupported";
|
|
2440
|
+
rootSource: "local-light-client" | "fixture" | "untrusted-rpc";
|
|
2441
|
+
verifierLocation: "local-engine" | "remote-engine" | "browser";
|
|
2442
|
+
mechanisms: ("account-proof" | "storage-proof" | "code-hash")[];
|
|
2443
|
+
bootstrap: {
|
|
2444
|
+
source: string | null;
|
|
2445
|
+
checkpoint: string | null;
|
|
2446
|
+
checkpointSource: string | null;
|
|
2447
|
+
};
|
|
2448
|
+
};
|
|
2449
|
+
privacy: {
|
|
2450
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2451
|
+
mechanism: string | null;
|
|
2452
|
+
};
|
|
2453
|
+
routing: {
|
|
2454
|
+
comparison: "not-run" | "agree" | "divergent";
|
|
2455
|
+
providersTried: number;
|
|
2456
|
+
providerLabel: string | null;
|
|
2457
|
+
attempts: {
|
|
2458
|
+
provider: string;
|
|
2459
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2460
|
+
elapsedMs: number;
|
|
2461
|
+
failureReason?: string | null | undefined;
|
|
2462
|
+
}[];
|
|
2463
|
+
};
|
|
2464
|
+
freshness: {
|
|
2465
|
+
observedAt: number;
|
|
2466
|
+
ageSeconds: number;
|
|
2467
|
+
pinned: boolean;
|
|
2468
|
+
};
|
|
2469
|
+
warnings: {
|
|
2470
|
+
code: string;
|
|
2471
|
+
message: string;
|
|
2472
|
+
}[];
|
|
2473
|
+
}, {
|
|
2474
|
+
identity: {
|
|
2475
|
+
requestId: string;
|
|
2476
|
+
method: string;
|
|
2477
|
+
requestBinding: string;
|
|
2478
|
+
resultBinding: string;
|
|
2479
|
+
};
|
|
2480
|
+
block: {
|
|
2481
|
+
number: number;
|
|
2482
|
+
hash: string;
|
|
2483
|
+
stateRoot: string;
|
|
2484
|
+
finalized: boolean;
|
|
2485
|
+
chainId?: number | undefined;
|
|
2486
|
+
};
|
|
2487
|
+
verification: {
|
|
2488
|
+
status: "verified" | "unverified" | "unsupported";
|
|
2489
|
+
rootSource: "local-light-client" | "fixture" | "untrusted-rpc";
|
|
2490
|
+
verifierLocation: "local-engine" | "remote-engine" | "browser";
|
|
2491
|
+
mechanisms: ("account-proof" | "storage-proof" | "code-hash")[];
|
|
2492
|
+
bootstrap: {
|
|
2493
|
+
source?: string | null | undefined;
|
|
2494
|
+
checkpoint?: string | null | undefined;
|
|
2495
|
+
checkpointSource?: string | null | undefined;
|
|
2496
|
+
};
|
|
2497
|
+
};
|
|
2498
|
+
privacy: {
|
|
2499
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2500
|
+
mechanism?: string | null | undefined;
|
|
2501
|
+
};
|
|
2502
|
+
routing: {
|
|
2503
|
+
comparison: "not-run" | "agree" | "divergent";
|
|
2504
|
+
providersTried: number;
|
|
2505
|
+
providerLabel?: string | null | undefined;
|
|
2506
|
+
attempts?: {
|
|
2507
|
+
provider: string;
|
|
2508
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2509
|
+
elapsedMs: number;
|
|
2510
|
+
failureReason?: string | null | undefined;
|
|
2511
|
+
}[] | undefined;
|
|
2512
|
+
};
|
|
2513
|
+
freshness: {
|
|
2514
|
+
observedAt: number;
|
|
2515
|
+
ageSeconds: number;
|
|
2516
|
+
pinned: boolean;
|
|
2517
|
+
};
|
|
2518
|
+
warnings?: {
|
|
2519
|
+
code: string;
|
|
2520
|
+
message: string;
|
|
2521
|
+
}[] | undefined;
|
|
2522
|
+
}>;
|
|
2523
|
+
}, "strip", z.ZodTypeAny, {
|
|
2524
|
+
verified: boolean;
|
|
2525
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator" | {
|
|
2526
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator";
|
|
2527
|
+
} | "delegated" | {
|
|
2528
|
+
status: "delegated";
|
|
2529
|
+
delegate: string;
|
|
2530
|
+
};
|
|
2531
|
+
receipt: {
|
|
2532
|
+
identity: {
|
|
2533
|
+
requestId: string;
|
|
2534
|
+
method: string;
|
|
2535
|
+
requestBinding: string;
|
|
2536
|
+
resultBinding: string;
|
|
2537
|
+
};
|
|
2538
|
+
block: {
|
|
2539
|
+
number: number;
|
|
2540
|
+
hash: string;
|
|
2541
|
+
stateRoot: string;
|
|
2542
|
+
finalized: boolean;
|
|
2543
|
+
chainId?: number | undefined;
|
|
2544
|
+
};
|
|
2545
|
+
verification: {
|
|
2546
|
+
status: "verified" | "unverified" | "unsupported";
|
|
2547
|
+
rootSource: "local-light-client" | "fixture" | "untrusted-rpc";
|
|
2548
|
+
verifierLocation: "local-engine" | "remote-engine" | "browser";
|
|
2549
|
+
mechanisms: ("account-proof" | "storage-proof" | "code-hash")[];
|
|
2550
|
+
bootstrap: {
|
|
2551
|
+
source: string | null;
|
|
2552
|
+
checkpoint: string | null;
|
|
2553
|
+
checkpointSource: string | null;
|
|
2554
|
+
};
|
|
2555
|
+
};
|
|
2556
|
+
privacy: {
|
|
2557
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2558
|
+
mechanism: string | null;
|
|
2559
|
+
};
|
|
2560
|
+
routing: {
|
|
2561
|
+
comparison: "not-run" | "agree" | "divergent";
|
|
2562
|
+
providersTried: number;
|
|
2563
|
+
providerLabel: string | null;
|
|
2564
|
+
attempts: {
|
|
2565
|
+
provider: string;
|
|
2566
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2567
|
+
elapsedMs: number;
|
|
2568
|
+
failureReason?: string | null | undefined;
|
|
2569
|
+
}[];
|
|
2570
|
+
};
|
|
2571
|
+
freshness: {
|
|
2572
|
+
observedAt: number;
|
|
2573
|
+
ageSeconds: number;
|
|
2574
|
+
pinned: boolean;
|
|
2575
|
+
};
|
|
2576
|
+
warnings: {
|
|
2577
|
+
code: string;
|
|
2578
|
+
message: string;
|
|
2579
|
+
}[];
|
|
2580
|
+
};
|
|
2581
|
+
address: string;
|
|
2582
|
+
isDelegated: boolean;
|
|
2583
|
+
codeHash: string;
|
|
2584
|
+
securityClassification: "normal-eoa" | "smart-contract" | "delegation-detected" | "delegation-revoked" | "unverified-delegate" | "delegate-code-verified" | "potential-risk" | "security-assessment-unavailable";
|
|
2585
|
+
blockNumber?: number | undefined;
|
|
2586
|
+
delegateAddress?: string | null | undefined;
|
|
2587
|
+
delegateCodeHash?: string | null | undefined;
|
|
2588
|
+
}, {
|
|
2589
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator" | {
|
|
2590
|
+
status: "normal-eoa" | "contract" | "revoked" | "invalid-designator";
|
|
2591
|
+
} | "delegated" | {
|
|
2592
|
+
status: "delegated";
|
|
2593
|
+
delegate: string;
|
|
2594
|
+
};
|
|
2595
|
+
receipt: {
|
|
2596
|
+
identity: {
|
|
2597
|
+
requestId: string;
|
|
2598
|
+
method: string;
|
|
2599
|
+
requestBinding: string;
|
|
2600
|
+
resultBinding: string;
|
|
2601
|
+
};
|
|
2602
|
+
block: {
|
|
2603
|
+
number: number;
|
|
2604
|
+
hash: string;
|
|
2605
|
+
stateRoot: string;
|
|
2606
|
+
finalized: boolean;
|
|
2607
|
+
chainId?: number | undefined;
|
|
2608
|
+
};
|
|
2609
|
+
verification: {
|
|
2610
|
+
status: "verified" | "unverified" | "unsupported";
|
|
2611
|
+
rootSource: "local-light-client" | "fixture" | "untrusted-rpc";
|
|
2612
|
+
verifierLocation: "local-engine" | "remote-engine" | "browser";
|
|
2613
|
+
mechanisms: ("account-proof" | "storage-proof" | "code-hash")[];
|
|
2614
|
+
bootstrap: {
|
|
2615
|
+
source?: string | null | undefined;
|
|
2616
|
+
checkpoint?: string | null | undefined;
|
|
2617
|
+
checkpointSource?: string | null | undefined;
|
|
2618
|
+
};
|
|
2619
|
+
};
|
|
2620
|
+
privacy: {
|
|
2621
|
+
transport: "direct" | "ohttp" | "anyone-socks" | "anon-rpc";
|
|
2622
|
+
mechanism?: string | null | undefined;
|
|
2623
|
+
};
|
|
2624
|
+
routing: {
|
|
2625
|
+
comparison: "not-run" | "agree" | "divergent";
|
|
2626
|
+
providersTried: number;
|
|
2627
|
+
providerLabel?: string | null | undefined;
|
|
2628
|
+
attempts?: {
|
|
2629
|
+
provider: string;
|
|
2630
|
+
outcome: "success" | "transport-failure" | "provider-error" | "invalid-proof";
|
|
2631
|
+
elapsedMs: number;
|
|
2632
|
+
failureReason?: string | null | undefined;
|
|
2633
|
+
}[] | undefined;
|
|
2634
|
+
};
|
|
2635
|
+
freshness: {
|
|
2636
|
+
observedAt: number;
|
|
2637
|
+
ageSeconds: number;
|
|
2638
|
+
pinned: boolean;
|
|
2639
|
+
};
|
|
2640
|
+
warnings?: {
|
|
2641
|
+
code: string;
|
|
2642
|
+
message: string;
|
|
2643
|
+
}[] | undefined;
|
|
2644
|
+
};
|
|
2645
|
+
address: string;
|
|
2646
|
+
isDelegated: boolean;
|
|
2647
|
+
codeHash: string;
|
|
2648
|
+
securityClassification: "normal-eoa" | "smart-contract" | "delegation-detected" | "delegation-revoked" | "unverified-delegate" | "delegate-code-verified" | "potential-risk" | "security-assessment-unavailable";
|
|
2649
|
+
verified?: boolean | undefined;
|
|
2650
|
+
blockNumber?: number | undefined;
|
|
2651
|
+
delegateAddress?: string | null | undefined;
|
|
2652
|
+
delegateCodeHash?: string | null | undefined;
|
|
2653
|
+
}>;
|
|
2172
2654
|
/** "receipt.block.stateRoot: expected 0x-hex, got undefined" */
|
|
2173
2655
|
declare function formatIssues(error: z.ZodError, input: unknown, root: string): string[];
|
|
2174
2656
|
|
|
@@ -2211,6 +2693,15 @@ interface VerifiedResult<T> {
|
|
|
2211
2693
|
/** Every provider attempt, including rejected ones. Empty if the engine didn't report them. */
|
|
2212
2694
|
attempts: Attempt[];
|
|
2213
2695
|
}
|
|
2696
|
+
/** EIP-7702 delegation detection result from the engine or local private verification. */
|
|
2697
|
+
type DelegationStatus = z.infer<typeof DelegationStatusSchema>;
|
|
2698
|
+
type DelegationSecurityClassification = z.infer<typeof DelegationSecurityClassificationSchema>;
|
|
2699
|
+
type DelegationResult = z.infer<typeof DelegationResultSchema>;
|
|
2700
|
+
interface DelegationOptions {
|
|
2701
|
+
address: string;
|
|
2702
|
+
policy?: Policy;
|
|
2703
|
+
signal?: AbortSignal;
|
|
2704
|
+
}
|
|
2214
2705
|
|
|
2215
2706
|
interface VeriqTransportOptions {
|
|
2216
2707
|
/** Policy for verified reads. Default: the client's policy. */
|
|
@@ -2220,7 +2711,7 @@ interface VeriqTransportOptions {
|
|
|
2220
2711
|
* Default: true when the policy requires verification.
|
|
2221
2712
|
*/
|
|
2222
2713
|
strict?: boolean;
|
|
2223
|
-
/** Called with every receipt from a verified read. */
|
|
2714
|
+
/** Called with every receipt from a verified read, including eth_getTransactionCount and eth_getCode. */
|
|
2224
2715
|
onReceipt?: (receipt: TrustReceipt) => void;
|
|
2225
2716
|
}
|
|
2226
2717
|
/** A viem Transport that also exposes the latest receipt. */
|
|
@@ -2274,6 +2765,13 @@ interface VeriqClient {
|
|
|
2274
2765
|
address: string;
|
|
2275
2766
|
slot: string;
|
|
2276
2767
|
} & ReadOptions): Promise<VerifiedResult<Hex>>;
|
|
2768
|
+
/**
|
|
2769
|
+
* Proven EIP-7702 delegation detection result and Trust Receipt.
|
|
2770
|
+
* @example const res = await veriq.getDelegation({ address: '0x…' })
|
|
2771
|
+
*/
|
|
2772
|
+
getDelegation(args: {
|
|
2773
|
+
address: string;
|
|
2774
|
+
} & ReadOptions): Promise<DelegationResult>;
|
|
2277
2775
|
/**
|
|
2278
2776
|
* A stored Trust Receipt by request id (veriq_getReceipt).
|
|
2279
2777
|
* @example const receipt = await veriq.getReceipt(result.receipt.identity.requestId)
|
|
@@ -2305,7 +2803,18 @@ interface VeriqClient {
|
|
|
2305
2803
|
*/
|
|
2306
2804
|
capabilities(): Promise<Capabilities>;
|
|
2307
2805
|
/**
|
|
2308
|
-
*
|
|
2806
|
+
* The finalized block the engine verifies against (veriq_getRoot). A client that fetches
|
|
2807
|
+
* its own proofs (Anon-RPC) asks the provider for exactly this block.
|
|
2808
|
+
* @example const { number, hash } = await veriq.getRoot()
|
|
2809
|
+
*/
|
|
2810
|
+
getRoot(): Promise<RootInfo>;
|
|
2811
|
+
/**
|
|
2812
|
+
* Verify an eth_getProof result the client fetched itself (veriq_verifyProof). Used by
|
|
2813
|
+
* `createPrivateReader`; the engine checks it against its own pinned root.
|
|
2814
|
+
*/
|
|
2815
|
+
verifyProof(input: ClientProofInput, policy?: Policy): Promise<VerifiedResult<Hex>>;
|
|
2816
|
+
/**
|
|
2817
|
+
* viem transport. eth_getBalance / eth_getStorageAt go through the verified path; every receipt lands in lastReceipt.
|
|
2309
2818
|
* @example createPublicClient({ chain: sepolia, transport: veriq.transport() })
|
|
2310
2819
|
*/
|
|
2311
2820
|
transport(opts?: VeriqTransportOptions): VeriqTransport;
|
|
@@ -2319,6 +2828,53 @@ interface VeriqClient {
|
|
|
2319
2828
|
* @example await veriq.request('eth_chainId')
|
|
2320
2829
|
*/
|
|
2321
2830
|
request(method: string, params?: unknown[]): Promise<unknown>;
|
|
2831
|
+
/**
|
|
2832
|
+
* Raw JSON-RPC call that also returns the Trust Receipt the engine attaches to
|
|
2833
|
+
* verified standard reads (eth_getBalance, eth_getStorageAt, eth_getTransactionCount,
|
|
2834
|
+
* eth_getCode at "finalized"). `receipt` is undefined for methods that carry none.
|
|
2835
|
+
* @example const { result, receipt } = await veriq.requestWithReceipt('eth_getCode', [address, 'finalized'])
|
|
2836
|
+
*/
|
|
2837
|
+
requestWithReceipt(method: string, params?: unknown[]): Promise<RawResult>;
|
|
2838
|
+
}
|
|
2839
|
+
/** veriq_getRoot result. */
|
|
2840
|
+
type RootInfo = z.output<typeof RootInfoSchema>;
|
|
2841
|
+
/** veriq_verifyProof input: a proof the client fetched (through Anon-RPC) at `blockHash`. */
|
|
2842
|
+
interface ClientProofInput {
|
|
2843
|
+
kind: 'balance' | 'nonce' | 'storage' | 'code';
|
|
2844
|
+
address: string;
|
|
2845
|
+
slot?: string;
|
|
2846
|
+
/** The block from `getRoot()` the proof was fetched for. */
|
|
2847
|
+
blockHash: string;
|
|
2848
|
+
/** The raw eth_getProof result. */
|
|
2849
|
+
proof: unknown;
|
|
2850
|
+
/** The raw eth_getCode result (kind `code`). */
|
|
2851
|
+
code?: unknown;
|
|
2852
|
+
/** Provider label (never a URL). */
|
|
2853
|
+
provider: string;
|
|
2854
|
+
/** Anonymizing network, e.g. `nox`. */
|
|
2855
|
+
network: string;
|
|
2856
|
+
elapsedMs?: number;
|
|
2857
|
+
/**
|
|
2858
|
+
* The same finalized block, as a light client in the browser reported it (S4.2). The engine
|
|
2859
|
+
* refuses the proof with ROOT_MISMATCH unless it is exactly its own pinned block.
|
|
2860
|
+
*/
|
|
2861
|
+
browserRoot?: BrowserRoot;
|
|
2862
|
+
/**
|
|
2863
|
+
* S5: `browser` when the client checked this proof itself first (the engine checks it again and
|
|
2864
|
+
* marks the receipt `verifierLocation: "browser"`); `unavailable` when its verifier did not load.
|
|
2865
|
+
*/
|
|
2866
|
+
verifier?: 'browser' | 'unavailable';
|
|
2867
|
+
}
|
|
2868
|
+
/** A finalized block from a light client running in the browser (e.g. Helios over Nox). */
|
|
2869
|
+
interface BrowserRoot {
|
|
2870
|
+
number: number;
|
|
2871
|
+
hash: string;
|
|
2872
|
+
stateRoot: string;
|
|
2873
|
+
}
|
|
2874
|
+
/** `requestWithReceipt` result: the JSON-RPC `result` and the validated receipt, if any. */
|
|
2875
|
+
interface RawResult {
|
|
2876
|
+
result: unknown;
|
|
2877
|
+
receipt: TrustReceipt | undefined;
|
|
2322
2878
|
}
|
|
2323
2879
|
/** Receipt attempts (receipt.rs) in the display form used by VerifiedResult and the components. */
|
|
2324
2880
|
declare function attemptsFromReceipt(receipt: TrustReceipt): Attempt[];
|
|
@@ -2349,6 +2905,7 @@ declare const ERROR_CODES: {
|
|
|
2349
2905
|
readonly POLICY_UNSATISFIABLE: -32014;
|
|
2350
2906
|
readonly PROVIDER_TIMEOUT: -32015;
|
|
2351
2907
|
readonly ALL_PROVIDERS_FAILED: -32016;
|
|
2908
|
+
readonly ROOT_MISMATCH: -32017;
|
|
2352
2909
|
readonly INVALID_REQUEST: -32602;
|
|
2353
2910
|
readonly INTERNAL_ERROR: -32603;
|
|
2354
2911
|
};
|
|
@@ -2356,6 +2913,7 @@ declare const ERROR_CODES: {
|
|
|
2356
2913
|
declare const CLIENT_CODES: {
|
|
2357
2914
|
readonly ENGINE_UNREACHABLE: -1;
|
|
2358
2915
|
readonly SCHEMA_MISMATCH: -2;
|
|
2916
|
+
readonly CHAIN_MISMATCH: -3;
|
|
2359
2917
|
};
|
|
2360
2918
|
type EngineErrorName = keyof typeof ERROR_CODES;
|
|
2361
2919
|
type VeriqErrorName = EngineErrorName | keyof typeof CLIENT_CODES | 'UNKNOWN';
|
|
@@ -2406,10 +2964,16 @@ declare class ProviderTimeoutError extends VeriqError {
|
|
|
2406
2964
|
}
|
|
2407
2965
|
declare class AllProvidersFailedError extends VeriqError {
|
|
2408
2966
|
}
|
|
2967
|
+
/** The browser light client and the engine disagree about the same finalized block. */
|
|
2968
|
+
declare class RootMismatchError extends VeriqError {
|
|
2969
|
+
}
|
|
2409
2970
|
declare class InvalidRequestError extends VeriqError {
|
|
2410
2971
|
}
|
|
2411
2972
|
declare class InternalError extends VeriqError {
|
|
2412
2973
|
}
|
|
2974
|
+
/** The engine serves another chain than the one this client reads (S6). Nothing was read. */
|
|
2975
|
+
declare class ChainMismatchError extends VeriqError {
|
|
2976
|
+
}
|
|
2413
2977
|
/** The engine could not be reached (network failure, nothing listening). */
|
|
2414
2978
|
declare class EngineUnreachableError extends VeriqError {
|
|
2415
2979
|
}
|
|
@@ -2436,6 +3000,208 @@ declare function errorFromRpc(err: {
|
|
|
2436
3000
|
*/
|
|
2437
3001
|
declare function isVeriqError(e: unknown): e is VeriqError;
|
|
2438
3002
|
|
|
3003
|
+
/**
|
|
3004
|
+
* The Veriq proof verifier compiled to WebAssembly (backend/crates/verifier-wasm), for checking
|
|
3005
|
+
* proofs in the browser (S5). It runs the same Rust code as the engine's own reads.
|
|
3006
|
+
*
|
|
3007
|
+
* The .wasm ships with this package as `veriq-client/verifier.wasm` (~205 KB, ~78 KB gzip).
|
|
3008
|
+
* Load it once, lazily:
|
|
3009
|
+
*
|
|
3010
|
+
* @example
|
|
3011
|
+
* import wasmUrl from 'veriq-client/verifier.wasm?url' // Vite; any URL or bytes work
|
|
3012
|
+
* const verifier = await loadVerifier(wasmUrl)
|
|
3013
|
+
* verifier.verifyRead({ stateRoot, address, kind: 'balance', proof }) // { ok: true, value: '0x…' }
|
|
3014
|
+
*/
|
|
3015
|
+
|
|
3016
|
+
/** The ABI this SDK speaks (crates/verifier-wasm `ABI_VERSION`). */
|
|
3017
|
+
declare const VERIFIER_ABI_VERSION = 2;
|
|
3018
|
+
interface VerifyReadInput {
|
|
3019
|
+
/** The trusted state root the proof must chain to. */
|
|
3020
|
+
stateRoot: string;
|
|
3021
|
+
address: string;
|
|
3022
|
+
kind: 'balance' | 'nonce' | 'storage' | 'code';
|
|
3023
|
+
slot?: string;
|
|
3024
|
+
/** The raw `eth_getProof` result. */
|
|
3025
|
+
proof: unknown;
|
|
3026
|
+
/** The raw `eth_getCode` result (kind `code`). */
|
|
3027
|
+
code?: unknown;
|
|
3028
|
+
}
|
|
3029
|
+
/** `value`: a `0x` quantity (balance, nonce, storage) or the bytecode (code). */
|
|
3030
|
+
type VerifyReadOutcome = {
|
|
3031
|
+
ok: true;
|
|
3032
|
+
value: string;
|
|
3033
|
+
} | {
|
|
3034
|
+
ok: false;
|
|
3035
|
+
code: 'INVALID_PROOF' | 'INVALID_REQUEST' | 'INTERNAL_ERROR' | string;
|
|
3036
|
+
error: string;
|
|
3037
|
+
};
|
|
3038
|
+
interface BrowserVerifier {
|
|
3039
|
+
/** Check one read exactly as the engine does. Never throws for a bad proof: see `ok`. */
|
|
3040
|
+
verifyRead(input: VerifyReadInput): VerifyReadOutcome;
|
|
3041
|
+
/** The engine's receipt binding: keccak256(method || canonical JSON), lowercase hex. */
|
|
3042
|
+
binding(method: string, value: unknown): string;
|
|
3043
|
+
readonly abiVersion: number;
|
|
3044
|
+
}
|
|
3045
|
+
/** Something the verifier can be loaded from. */
|
|
3046
|
+
type VerifierSource = string | URL | Response | ArrayBuffer | ArrayBufferView | WebAssembly.Module;
|
|
3047
|
+
/** The WebAssembly verifier could not be loaded or does not speak this SDK's ABI. */
|
|
3048
|
+
declare class VerifierUnavailableError extends VeriqError {
|
|
3049
|
+
constructor(message: string, cause?: unknown);
|
|
3050
|
+
}
|
|
3051
|
+
/** Load and check the verifier. Rejects with {@link VerifierUnavailableError}. */
|
|
3052
|
+
declare function loadVerifier(source: VerifierSource): Promise<BrowserVerifier>;
|
|
3053
|
+
|
|
3054
|
+
/**
|
|
3055
|
+
* Private reads: the provider request goes through a fetch you supply (Anon-RPC), the proof is
|
|
3056
|
+
* verified by the engine against its own Helios root. The engine never contacts the provider
|
|
3057
|
+
* for these reads, so the provider sees the anonymizing network's exit, not your IP.
|
|
3058
|
+
*
|
|
3059
|
+
* @example
|
|
3060
|
+
* import { AnonRpcWorker } from '@anon-rpc/browser-harness'
|
|
3061
|
+
* const nox = new AnonRpcWorker({ address: NOX_SEPOLIA, preExisting: { rpcProvider } })
|
|
3062
|
+
* const reader = createPrivateReader(veriq, {
|
|
3063
|
+
* fetch: nox.fetch,
|
|
3064
|
+
* network: 'nox',
|
|
3065
|
+
* providers: [{ label: 'publicnode', url: 'https://ethereum-sepolia-rpc.publicnode.com' }],
|
|
3066
|
+
* })
|
|
3067
|
+
* const { value, receipt } = await reader.readBalance({ address })
|
|
3068
|
+
* receipt.privacy.transport // 'anon-rpc'
|
|
3069
|
+
*/
|
|
3070
|
+
|
|
3071
|
+
/** A provider the private reader may ask, through the anonymizing fetch. */
|
|
3072
|
+
interface PrivateProvider {
|
|
3073
|
+
/** Shown in receipts and logs (1-64 of letters, digits, `_`, `-`, `.`). Never the URL. */
|
|
3074
|
+
label: string;
|
|
3075
|
+
/** HTTPS JSON-RPC endpoint. It must allow browser requests (CORS) and serve `eth_getProof`. */
|
|
3076
|
+
url: string;
|
|
3077
|
+
}
|
|
3078
|
+
interface PrivateReaderOptions {
|
|
3079
|
+
/** The anonymizing fetch, e.g. `AnonRpcWorker.fetch` from `@anon-rpc/browser-harness`. */
|
|
3080
|
+
fetch: (input: string, init?: RequestInit) => Promise<Response>;
|
|
3081
|
+
/** Network name recorded in the receipt (`privacy.mechanism`), e.g. `'nox'`. Same rules as a label. */
|
|
3082
|
+
network: string;
|
|
3083
|
+
/** Tried in order; the next one is used when a provider fails or sends a bad proof. */
|
|
3084
|
+
providers: PrivateProvider[];
|
|
3085
|
+
/** Per provider request. Default 30 s (mixnets add per-hop delay). */
|
|
3086
|
+
timeoutMs?: number;
|
|
3087
|
+
/** Tests only: allow `http://` to localhost / 127.0.0.1 / [::1]. Every other URL must be HTTPS. */
|
|
3088
|
+
allowInsecureLoopback?: boolean;
|
|
3089
|
+
/**
|
|
3090
|
+
* A light client in the browser (S4.2, e.g. Helios synced over Nox). When it is synced, the
|
|
3091
|
+
* read uses its finalized block and the engine's `veriq_getRoot` must be the very same block:
|
|
3092
|
+
* a different hash or state root for that number is a ROOT_MISMATCH and nothing is read.
|
|
3093
|
+
* While it is not synced (`null`), the engine's root is used alone and the receipt has no
|
|
3094
|
+
* BROWSER_LIGHT_CLIENT marker.
|
|
3095
|
+
*/
|
|
3096
|
+
lightClient?: BrowserLightClient;
|
|
3097
|
+
/**
|
|
3098
|
+
* How long the two light clients may disagree about *which* block is finalized (one is a
|
|
3099
|
+
* few seconds behind at an epoch boundary) before the read gives up. Default 30 s.
|
|
3100
|
+
*/
|
|
3101
|
+
alignTimeoutMs?: number;
|
|
3102
|
+
/**
|
|
3103
|
+
* S5: check every proof in the browser first (the WebAssembly build of the engine's verifier,
|
|
3104
|
+
* see `loadVerifier`). A proof that fails here never reaches the engine: the next provider is
|
|
3105
|
+
* asked. The engine still checks what it is sent and marks the receipt
|
|
3106
|
+
* `verifierLocation: "browser"`. A function is called once, on the first read (lazy load); if
|
|
3107
|
+
* it rejects, the engine verifies alone and the receipt carries BROWSER_VERIFIER_UNAVAILABLE.
|
|
3108
|
+
*
|
|
3109
|
+
* With a synced `lightClient` too, a read needs no engine at all: if the engine cannot be
|
|
3110
|
+
* reached, the value comes back with a receipt made in the browser (LOCAL_ONLY warning,
|
|
3111
|
+
* `identity.requestId` starting `local-`), which the engine never stored.
|
|
3112
|
+
*/
|
|
3113
|
+
verifier?: BrowserVerifier | (() => Promise<BrowserVerifier>);
|
|
3114
|
+
/**
|
|
3115
|
+
* S6: the chain this reader reads (1 mainnet, 11155111 Sepolia). When set, `network` must be
|
|
3116
|
+
* one that serves it ({@link PRIVATE_NETWORKS}: Nox on Sepolia, Nym or Tor on mainnet),
|
|
3117
|
+
* else createPrivateReader throws PrivacyUnavailableError; and an engine whose
|
|
3118
|
+
* `veriq_getRoot` names another chain fails the read with ChainMismatchError.
|
|
3119
|
+
*/
|
|
3120
|
+
chainId?: number;
|
|
3121
|
+
}
|
|
3122
|
+
/**
|
|
3123
|
+
* Which anonymizing networks may carry private reads for a chain. The network follows the
|
|
3124
|
+
* chain; a reader never falls back to another one (or to a direct request).
|
|
3125
|
+
*/
|
|
3126
|
+
declare const PRIVATE_NETWORKS: Readonly<Record<number, readonly string[]>>;
|
|
3127
|
+
/** Throws PrivacyUnavailableError unless `network` serves `chainId`. */
|
|
3128
|
+
declare function assertNetworkForChain(chainId: number, network: string): void;
|
|
3129
|
+
/** A light client running in the browser that reports its latest finalized block. */
|
|
3130
|
+
interface BrowserLightClient {
|
|
3131
|
+
/** The finalized block, or `null` while not synced (or stale, or failed). */
|
|
3132
|
+
finalized(): Promise<BrowserRoot | null>;
|
|
3133
|
+
}
|
|
3134
|
+
interface PrivateReader {
|
|
3135
|
+
readBalance(args: {
|
|
3136
|
+
address: string;
|
|
3137
|
+
policy?: Policy;
|
|
3138
|
+
}): Promise<VerifiedResult<bigint>>;
|
|
3139
|
+
readStorage(args: {
|
|
3140
|
+
address: string;
|
|
3141
|
+
slot: string;
|
|
3142
|
+
policy?: Policy;
|
|
3143
|
+
}): Promise<VerifiedResult<Hex>>;
|
|
3144
|
+
readNonce(args: {
|
|
3145
|
+
address: string;
|
|
3146
|
+
policy?: Policy;
|
|
3147
|
+
}): Promise<VerifiedResult<bigint>>;
|
|
3148
|
+
readCode(args: {
|
|
3149
|
+
address: string;
|
|
3150
|
+
policy?: Policy;
|
|
3151
|
+
}): Promise<VerifiedResult<Hex>>;
|
|
3152
|
+
getDelegation(args: {
|
|
3153
|
+
address: string;
|
|
3154
|
+
policy?: Policy;
|
|
3155
|
+
}): Promise<DelegationResult>;
|
|
3156
|
+
}
|
|
3157
|
+
declare function createPrivateReader(client: VeriqClient, opts: PrivateReaderOptions): PrivateReader;
|
|
3158
|
+
|
|
3159
|
+
/** The 3-byte EIP-7702 delegation prefix `0xef0100`. */
|
|
3160
|
+
declare const EIP7702_PREFIX = "0xef0100";
|
|
3161
|
+
/** Total byte length of a valid EIP-7702 delegation designator: 3 prefix + 20 address = 23 bytes. */
|
|
3162
|
+
declare const DESIGNATOR_BYTE_LENGTH = 23;
|
|
3163
|
+
/** Total length in hex chars including '0x' prefix: 2 + 46 = 48 chars. */
|
|
3164
|
+
declare const DESIGNATOR_HEX_LENGTH = 48;
|
|
3165
|
+
declare const ZERO_ADDRESS: Address;
|
|
3166
|
+
type DelegationCodeStatus = {
|
|
3167
|
+
status: 'normal-eoa';
|
|
3168
|
+
} | {
|
|
3169
|
+
status: 'delegated';
|
|
3170
|
+
delegate: Address;
|
|
3171
|
+
} | {
|
|
3172
|
+
status: 'contract';
|
|
3173
|
+
} | {
|
|
3174
|
+
status: 'revoked';
|
|
3175
|
+
} | {
|
|
3176
|
+
status: 'invalid-designator';
|
|
3177
|
+
};
|
|
3178
|
+
interface ParsedDesignator {
|
|
3179
|
+
isDesignator: boolean;
|
|
3180
|
+
delegate: Address | null;
|
|
3181
|
+
isRevoked: boolean;
|
|
3182
|
+
isMalformed: boolean;
|
|
3183
|
+
}
|
|
3184
|
+
/**
|
|
3185
|
+
* Parse an EIP-7702 delegation designator from hex-encoded bytecode.
|
|
3186
|
+
*
|
|
3187
|
+
* Rules:
|
|
3188
|
+
* - Empty code (`0x` or `""`) is not a designator.
|
|
3189
|
+
* - Bytecode starting with `0xef0100`:
|
|
3190
|
+
* - Exactly 23 bytes (48 hex chars including `0x`): valid designator.
|
|
3191
|
+
* If delegate is 0x00..00, it is a revoked/cleared delegation.
|
|
3192
|
+
* - Any other length: malformed designator.
|
|
3193
|
+
* - Any other non-empty bytecode: not a designator (standard contract code).
|
|
3194
|
+
*/
|
|
3195
|
+
declare function parseDelegationDesignator(code: string): ParsedDesignator;
|
|
3196
|
+
/**
|
|
3197
|
+
* Classify account code according to EIP-7702.
|
|
3198
|
+
*/
|
|
3199
|
+
declare function classifyAccountCode(code: string): {
|
|
3200
|
+
status: DelegationCodeStatus;
|
|
3201
|
+
isDelegated: boolean;
|
|
3202
|
+
delegateAddress: Address | null;
|
|
3203
|
+
};
|
|
3204
|
+
|
|
2439
3205
|
/**
|
|
2440
3206
|
* Only proven answers, pinned to finalized blocks. The default.
|
|
2441
3207
|
* @example createVeriq({ policy: verifiedFinalized })
|
|
@@ -2562,4 +3328,4 @@ declare function prettyHealth(health: EngineHealth, opts?: PrettyOptions): strin
|
|
|
2562
3328
|
*/
|
|
2563
3329
|
declare function prettyError(err: VeriqError, opts?: PrettyOptions): string;
|
|
2564
3330
|
|
|
2565
|
-
export { type Address, AllProvidersFailedError, type Attempt, type AttemptOutcome, AttemptOutcomeSchema, AttemptSchema, BlockPolicySchema, BlockSchema, BootstrapSchema, type BreakerState, BreakerStateSchema, CLIENT_CODES, type Capabilities, CapabilitiesSchema, type Comparison, ComparisonSchema, DEFAULT_ENGINE_URL, ERROR_CLASSES, ERROR_CODES, ERROR_HINTS, ERROR_MEANINGS, type EngineErrorName, type EngineHealth, EngineHealthSchema, EngineUnreachableError, FreshnessSchema, type Hex, Hex32Schema, IdentitySchema, InternalError, InvalidProofError, InvalidRequestError, type LightClientStatus, LightClientStatusSchema, type Mechanism, MechanismSchema, OUTCOME_LABEL, type Policy, PolicySchema, PolicyUnsatisfiableError, type PresetName, type PrettyOptions, PrivacySchema, PrivacyUnavailableError, type ProviderHealth, ProviderHealthSchema, ProviderTimeoutError, type ReadOptions, ReadResultSchema, type ReceiptInput, ReceiptListSchema, type ReceiptRecord, ReceiptRecordSchema, type ReceiptRow, type RootSource, RootSourceSchema, RootUnavailableError, type RoutingAttempt, RoutingAttemptSchema, RoutingSchema, type RowTone, type RpcErrorObject, RpcErrorSchema, type TransportKind, TransportKindSchema, type TrustReceipt, TrustReceiptSchema, UnsupportedVerificationError, VerificationPolicySchema, VerificationSchema, type VerificationStatus, VerificationStatusSchema, type VerifiedResult, type VerifierLocation, VerifierLocationSchema, type VeriqClient, VeriqError, type VeriqErrorName, type VeriqErrorOptions, type VeriqOptions, VeriqSchemaError, type VeriqTransport, type VeriqTransportOptions, WarningSchema, assertAddress, assertPolicy, assertSlot, attemptsFromReceipt, createTransport, createVeriq, devUnverified, errorFromRpc, errorNameForCode, formatEth, formatIssues, formatNumber, formatReceipt, healthRows, isVeriqError, presets, prettyError, prettyHealth, prettyReceipt, privateVerified, receiptRows, rootSourceLabel, shortHash, statusTone, supportsColor, verifiedCompare, verifiedFinalized };
|
|
3331
|
+
export { type Address, AllProvidersFailedError, type Attempt, type AttemptOutcome, AttemptOutcomeSchema, AttemptSchema, BlockPolicySchema, BlockSchema, BootstrapSchema, type BreakerState, BreakerStateSchema, type BrowserLightClient, type BrowserRoot, type BrowserVerifier, CLIENT_CODES, type Capabilities, CapabilitiesSchema, ChainMismatchError, type ClientProofInput, type Comparison, ComparisonSchema, DEFAULT_ENGINE_URL, DESIGNATOR_BYTE_LENGTH, DESIGNATOR_HEX_LENGTH, type DelegationCodeStatus, type DelegationOptions, type DelegationResult, DelegationResultSchema, type DelegationSecurityClassification, DelegationSecurityClassificationSchema, type DelegationStatus, DelegationStatusSchema, EIP7702_PREFIX, ERROR_CLASSES, ERROR_CODES, ERROR_HINTS, ERROR_MEANINGS, type EngineErrorName, type EngineHealth, EngineHealthSchema, EngineUnreachableError, FreshnessSchema, type Hex, Hex32Schema, IdentitySchema, InternalError, InvalidProofError, InvalidRequestError, type LightClientStatus, LightClientStatusSchema, type Mechanism, MechanismSchema, OUTCOME_LABEL, PRIVATE_NETWORKS, type ParsedDesignator, type Policy, PolicySchema, PolicyUnsatisfiableError, type PresetName, type PrettyOptions, PrivacySchema, PrivacyUnavailableError, type PrivateProvider, type PrivateReader, type PrivateReaderOptions, type ProviderHealth, ProviderHealthSchema, ProviderTimeoutError, type RawResult, type ReadOptions, ReadResultSchema, type ReceiptInput, ReceiptListSchema, type ReceiptRecord, ReceiptRecordSchema, type ReceiptRow, type RootInfo, RootInfoSchema, RootMismatchError, type RootSource, RootSourceSchema, RootUnavailableError, type RoutingAttempt, RoutingAttemptSchema, RoutingSchema, type RowTone, type RpcErrorObject, RpcErrorSchema, type TransportKind, TransportKindSchema, type TrustReceipt, TrustReceiptSchema, UnsupportedVerificationError, VERIFIER_ABI_VERSION, VerificationPolicySchema, VerificationSchema, type VerificationStatus, VerificationStatusSchema, type VerifiedResult, type VerifierLocation, VerifierLocationSchema, type VerifierSource, VerifierUnavailableError, type VerifyReadInput, type VerifyReadOutcome, type VeriqClient, VeriqError, type VeriqErrorName, type VeriqErrorOptions, type VeriqOptions, VeriqSchemaError, type VeriqTransport, type VeriqTransportOptions, WarningSchema, ZERO_ADDRESS, assertAddress, assertNetworkForChain, assertPolicy, assertSlot, attemptsFromReceipt, classifyAccountCode, createPrivateReader, createTransport, createVeriq, devUnverified, errorFromRpc, errorNameForCode, formatEth, formatIssues, formatNumber, formatReceipt, healthRows, isVeriqError, loadVerifier, parseDelegationDesignator, presets, prettyError, prettyHealth, prettyReceipt, privateVerified, receiptRows, rootSourceLabel, shortHash, statusTone, supportsColor, verifiedCompare, verifiedFinalized };
|