@ensnode/ensnode-sdk 0.0.0-next-20260303184716 → 0.0.0-next-20260304002121
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/dist/index.cjs +328 -293
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -24
- package/dist/index.d.ts +55 -24
- package/dist/index.js +282 -247
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -531,16 +531,16 @@ var uint256ToHex32 = (num) => (0, import_viem6.toHex)(num, { size: 32 });
|
|
|
531
531
|
var import_datasources = require("@ensnode/datasources");
|
|
532
532
|
|
|
533
533
|
// src/ensapi/config/deserialize.ts
|
|
534
|
-
var
|
|
534
|
+
var import_v47 = require("zod/v4");
|
|
535
535
|
|
|
536
536
|
// src/ensindexer/config/deserialize.ts
|
|
537
|
-
var
|
|
537
|
+
var import_v44 = require("zod/v4");
|
|
538
538
|
|
|
539
539
|
// src/ensindexer/config/zod-schemas.ts
|
|
540
|
-
var
|
|
540
|
+
var import_v43 = require("zod/v4");
|
|
541
541
|
|
|
542
|
-
// src/
|
|
543
|
-
var
|
|
542
|
+
// src/ensrainbow/zod-schemas/config.ts
|
|
543
|
+
var import_v42 = require("zod/v4");
|
|
544
544
|
|
|
545
545
|
// src/shared/zod-schemas.ts
|
|
546
546
|
var import_caip = require("caip");
|
|
@@ -823,6 +823,29 @@ var makeReinterpretedNameSchema = (valueLabel = "Reinterpreted Name") => import_
|
|
|
823
823
|
}
|
|
824
824
|
}).transform(reinterpretName);
|
|
825
825
|
|
|
826
|
+
// src/ensrainbow/zod-schemas/config.ts
|
|
827
|
+
var makeLabelSetIdSchema = (valueLabel = "Label set ID") => {
|
|
828
|
+
return import_v42.z.string({ error: `${valueLabel} must be a string` }).min(1, { error: `${valueLabel} must be 1-50 characters long` }).max(50, { error: `${valueLabel} must be 1-50 characters long` }).regex(/^[a-z-]+$/, {
|
|
829
|
+
error: `${valueLabel} can only contain lowercase letters (a-z) and hyphens (-)`
|
|
830
|
+
});
|
|
831
|
+
};
|
|
832
|
+
var makeLabelSetVersionSchema = (valueLabel = "Label set version") => {
|
|
833
|
+
return import_v42.z.coerce.number({ error: `${valueLabel} must be an integer.` }).pipe(makeNonNegativeIntegerSchema(valueLabel));
|
|
834
|
+
};
|
|
835
|
+
var makeEnsRainbowPublicConfigSchema = (valueLabel = "EnsRainbowPublicConfig") => import_v42.z.object({
|
|
836
|
+
version: import_v42.z.string().nonempty({ error: `${valueLabel}.version must be a non-empty string.` }),
|
|
837
|
+
labelSet: import_v42.z.object({
|
|
838
|
+
labelSetId: makeLabelSetIdSchema(`${valueLabel}.labelSet.labelSetId`),
|
|
839
|
+
highestLabelSetVersion: makeLabelSetVersionSchema(
|
|
840
|
+
`${valueLabel}.labelSet.highestLabelSetVersion`
|
|
841
|
+
)
|
|
842
|
+
}),
|
|
843
|
+
recordsCount: makeNonNegativeIntegerSchema(`${valueLabel}.recordsCount`)
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
// src/shared/collections.ts
|
|
847
|
+
var uniq = (arr) => [...new Set(arr)];
|
|
848
|
+
|
|
826
849
|
// src/ensindexer/config/is-subgraph-compatible.ts
|
|
827
850
|
var import_datasources3 = require("@ensnode/datasources");
|
|
828
851
|
|
|
@@ -848,6 +871,35 @@ function isSubgraphCompatible(config) {
|
|
|
848
871
|
return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
|
|
849
872
|
}
|
|
850
873
|
|
|
874
|
+
// src/ensindexer/config/labelset-utils.ts
|
|
875
|
+
function buildLabelSetId(maybeLabelSetId) {
|
|
876
|
+
return makeLabelSetIdSchema("LabelSetId").parse(maybeLabelSetId);
|
|
877
|
+
}
|
|
878
|
+
function buildLabelSetVersion(maybeLabelSetVersion) {
|
|
879
|
+
return makeLabelSetVersionSchema("LabelSetVersion").parse(maybeLabelSetVersion);
|
|
880
|
+
}
|
|
881
|
+
function buildEnsRainbowClientLabelSet(labelSetId, labelSetVersion) {
|
|
882
|
+
if (labelSetVersion !== void 0 && labelSetId === void 0) {
|
|
883
|
+
throw new Error("When a labelSetVersion is defined, labelSetId must also be defined.");
|
|
884
|
+
}
|
|
885
|
+
return { labelSetId, labelSetVersion };
|
|
886
|
+
}
|
|
887
|
+
function validateSupportedLabelSetAndVersion(serverSet, clientSet) {
|
|
888
|
+
if (clientSet.labelSetId === void 0) {
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
if (serverSet.labelSetId !== clientSet.labelSetId) {
|
|
892
|
+
throw new Error(
|
|
893
|
+
`Server label set ID "${serverSet.labelSetId}" does not match client's requested label set ID "${clientSet.labelSetId}".`
|
|
894
|
+
);
|
|
895
|
+
}
|
|
896
|
+
if (clientSet.labelSetVersion !== void 0 && serverSet.highestLabelSetVersion < clientSet.labelSetVersion) {
|
|
897
|
+
throw new Error(
|
|
898
|
+
`Server highest label set version ${serverSet.highestLabelSetVersion} is less than client's requested version ${clientSet.labelSetVersion} for label set ID "${clientSet.labelSetId}".`
|
|
899
|
+
);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
851
903
|
// src/ensindexer/config/validations.ts
|
|
852
904
|
function invariant_ensDbVersionIsSameAsEnsIndexerVersion(ctx) {
|
|
853
905
|
const versionInfo = ctx.value;
|
|
@@ -861,32 +913,24 @@ function invariant_ensDbVersionIsSameAsEnsIndexerVersion(ctx) {
|
|
|
861
913
|
}
|
|
862
914
|
|
|
863
915
|
// src/ensindexer/config/zod-schemas.ts
|
|
864
|
-
var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") =>
|
|
916
|
+
var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => import_v43.z.set(makeChainIdSchema(valueLabel), { error: `${valueLabel} must be a set` }).min(1, {
|
|
865
917
|
error: `${valueLabel} must be a set with at least one chain ID.`
|
|
866
918
|
});
|
|
867
|
-
var makeSerializedIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") =>
|
|
919
|
+
var makeSerializedIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => import_v43.z.array(makeChainIdSchema(valueLabel), {
|
|
868
920
|
error: `${valueLabel} must be an array.`
|
|
869
921
|
}).min(1, {
|
|
870
922
|
error: `${valueLabel} must be an array with at least one chain ID.`
|
|
871
923
|
});
|
|
872
|
-
var makePluginsListSchema = (valueLabel = "Plugins") =>
|
|
924
|
+
var makePluginsListSchema = (valueLabel = "Plugins") => import_v43.z.array(import_v43.z.string(), {
|
|
873
925
|
error: `${valueLabel} must be a list of strings.`
|
|
874
926
|
}).min(1, {
|
|
875
927
|
error: `${valueLabel} must be a list of strings with at least one string value`
|
|
876
928
|
}).refine((arr) => arr.length === uniq(arr).length, {
|
|
877
929
|
error: `${valueLabel} cannot contain duplicate values.`
|
|
878
930
|
});
|
|
879
|
-
var makeDatabaseSchemaNameSchema = (valueLabel = "Database schema name") =>
|
|
931
|
+
var makeDatabaseSchemaNameSchema = (valueLabel = "Database schema name") => import_v43.z.string({ error: `${valueLabel} must be a string` }).trim().nonempty({
|
|
880
932
|
error: `${valueLabel} is required and must be a non-empty string.`
|
|
881
933
|
});
|
|
882
|
-
var makeLabelSetIdSchema = (valueLabel) => {
|
|
883
|
-
return import_v42.z.string({ error: `${valueLabel} must be a string` }).min(1, { error: `${valueLabel} must be 1-50 characters long` }).max(50, { error: `${valueLabel} must be 1-50 characters long` }).regex(/^[a-z-]+$/, {
|
|
884
|
-
error: `${valueLabel} can only contain lowercase letters (a-z) and hyphens (-)`
|
|
885
|
-
});
|
|
886
|
-
};
|
|
887
|
-
var makeLabelSetVersionSchema = (valueLabel) => {
|
|
888
|
-
return import_v42.z.coerce.number({ error: `${valueLabel} must be an integer.` }).pipe(makeNonNegativeIntegerSchema(valueLabel));
|
|
889
|
-
};
|
|
890
934
|
var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
|
|
891
935
|
let valueLabelLabelSetId = valueLabel;
|
|
892
936
|
let valueLabelLabelSetVersion = valueLabel;
|
|
@@ -897,21 +941,19 @@ var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
|
|
|
897
941
|
valueLabelLabelSetId = `${valueLabel}.labelSetId`;
|
|
898
942
|
valueLabelLabelSetVersion = `${valueLabel}.labelSetVersion`;
|
|
899
943
|
}
|
|
900
|
-
return
|
|
944
|
+
return import_v43.z.object({
|
|
901
945
|
labelSetId: makeLabelSetIdSchema(valueLabelLabelSetId),
|
|
902
946
|
labelSetVersion: makeLabelSetVersionSchema(valueLabelLabelSetVersion)
|
|
903
947
|
});
|
|
904
948
|
};
|
|
905
|
-
var makeNonEmptyStringSchema = (valueLabel = "Value") =>
|
|
906
|
-
var makeEnsIndexerVersionInfoSchema = (valueLabel = "Value") =>
|
|
949
|
+
var makeNonEmptyStringSchema = (valueLabel = "Value") => import_v43.z.string().nonempty({ error: `${valueLabel} must be a non-empty string.` });
|
|
950
|
+
var makeEnsIndexerVersionInfoSchema = (valueLabel = "Value") => import_v43.z.object(
|
|
907
951
|
{
|
|
908
952
|
nodejs: makeNonEmptyStringSchema(),
|
|
909
953
|
ponder: makeNonEmptyStringSchema(),
|
|
910
954
|
ensDb: makeNonEmptyStringSchema(),
|
|
911
955
|
ensIndexer: makeNonEmptyStringSchema(),
|
|
912
|
-
ensNormalize: makeNonEmptyStringSchema()
|
|
913
|
-
ensRainbow: makeNonEmptyStringSchema(),
|
|
914
|
-
ensRainbowSchema: makePositiveIntegerSchema()
|
|
956
|
+
ensNormalize: makeNonEmptyStringSchema()
|
|
915
957
|
},
|
|
916
958
|
{
|
|
917
959
|
error: `${valueLabel} must be a valid ENSIndexerVersionInfo object.`
|
|
@@ -927,26 +969,46 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
927
969
|
});
|
|
928
970
|
}
|
|
929
971
|
}
|
|
930
|
-
|
|
931
|
-
|
|
972
|
+
function invariant_ensRainbowSupportedLabelSetAndVersion(ctx) {
|
|
973
|
+
const clientLabelSet = ctx.value.labelSet;
|
|
974
|
+
const serverLabelSet = ctx.value.ensRainbowPublicConfig.labelSet;
|
|
975
|
+
try {
|
|
976
|
+
validateSupportedLabelSetAndVersion(serverLabelSet, clientLabelSet);
|
|
977
|
+
} catch (error) {
|
|
978
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
979
|
+
ctx.issues.push({
|
|
980
|
+
code: "custom",
|
|
981
|
+
input: ctx.value,
|
|
982
|
+
message: `The ENSRainbow label set and version specified in the config are not supported by the ENSRainbow version specified in ensRainbowPublicConfig. Cause: ${errorMessage}`
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
var makeEnsIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") => import_v43.z.object({
|
|
987
|
+
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
988
|
+
ensRainbowPublicConfig: makeEnsRainbowPublicConfigSchema(
|
|
989
|
+
`${valueLabel}.ensRainbowPublicConfig`
|
|
990
|
+
),
|
|
932
991
|
indexedChainIds: makeIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
|
|
933
|
-
isSubgraphCompatible:
|
|
992
|
+
isSubgraphCompatible: import_v43.z.boolean({
|
|
934
993
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
935
994
|
}),
|
|
995
|
+
labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
|
|
936
996
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
937
997
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
938
|
-
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
939
998
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
940
|
-
}).check(invariant_isSubgraphCompatibleRequirements);
|
|
941
|
-
var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIndexerPublicConfig") =>
|
|
942
|
-
|
|
999
|
+
}).check(invariant_isSubgraphCompatibleRequirements).check(invariant_ensRainbowSupportedLabelSetAndVersion);
|
|
1000
|
+
var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIndexerPublicConfig") => import_v43.z.object({
|
|
1001
|
+
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
1002
|
+
ensRainbowPublicConfig: makeEnsRainbowPublicConfigSchema(
|
|
1003
|
+
`${valueLabel}.ensRainbowPublicConfig`
|
|
1004
|
+
),
|
|
943
1005
|
indexedChainIds: makeSerializedIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
|
|
944
|
-
isSubgraphCompatible:
|
|
1006
|
+
isSubgraphCompatible: import_v43.z.boolean({
|
|
945
1007
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
946
1008
|
}),
|
|
1009
|
+
labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
|
|
947
1010
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
948
1011
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
949
|
-
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
950
1012
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
951
1013
|
});
|
|
952
1014
|
|
|
@@ -961,7 +1023,7 @@ function deserializeEnsIndexerPublicConfig(maybePublicConfig, valueLabel) {
|
|
|
961
1023
|
const parsed = makeSerializedEnsIndexerPublicConfigSchema(valueLabel).transform(buildUnvalidatedEnsIndexerPublicConfig).pipe(makeEnsIndexerPublicConfigSchema(valueLabel)).safeParse(maybePublicConfig);
|
|
962
1024
|
if (parsed.error) {
|
|
963
1025
|
throw new Error(`Cannot deserialize EnsIndexerPublicConfig:
|
|
964
|
-
${(0,
|
|
1026
|
+
${(0, import_v44.prettifyError)(parsed.error)}
|
|
965
1027
|
`);
|
|
966
1028
|
}
|
|
967
1029
|
return parsed.data;
|
|
@@ -969,22 +1031,22 @@ ${(0, import_v43.prettifyError)(parsed.error)}
|
|
|
969
1031
|
var deserializeENSIndexerPublicConfig = deserializeEnsIndexerPublicConfig;
|
|
970
1032
|
|
|
971
1033
|
// src/ensapi/config/zod-schemas.ts
|
|
972
|
-
var
|
|
1034
|
+
var import_v46 = require("zod/v4");
|
|
973
1035
|
|
|
974
1036
|
// src/shared/config/thegraph.ts
|
|
975
|
-
var
|
|
976
|
-
var TheGraphCannotFallbackReasonSchema =
|
|
1037
|
+
var import_v45 = require("zod/v4");
|
|
1038
|
+
var TheGraphCannotFallbackReasonSchema = import_v45.z.enum({
|
|
977
1039
|
NotSubgraphCompatible: "not-subgraph-compatible",
|
|
978
1040
|
NoApiKey: "no-api-key",
|
|
979
1041
|
NoSubgraphUrl: "no-subgraph-url"
|
|
980
1042
|
});
|
|
981
|
-
var TheGraphFallbackSchema =
|
|
982
|
-
|
|
983
|
-
canFallback:
|
|
984
|
-
url:
|
|
1043
|
+
var TheGraphFallbackSchema = import_v45.z.discriminatedUnion("canFallback", [
|
|
1044
|
+
import_v45.z.strictObject({
|
|
1045
|
+
canFallback: import_v45.z.literal(true),
|
|
1046
|
+
url: import_v45.z.string()
|
|
985
1047
|
}),
|
|
986
|
-
|
|
987
|
-
canFallback:
|
|
1048
|
+
import_v45.z.strictObject({
|
|
1049
|
+
canFallback: import_v45.z.literal(false),
|
|
988
1050
|
reason: TheGraphCannotFallbackReasonSchema
|
|
989
1051
|
})
|
|
990
1052
|
]);
|
|
@@ -992,8 +1054,8 @@ var TheGraphFallbackSchema = import_v44.z.discriminatedUnion("canFallback", [
|
|
|
992
1054
|
// src/ensapi/config/zod-schemas.ts
|
|
993
1055
|
function makeEnsApiPublicConfigSchema(valueLabel) {
|
|
994
1056
|
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
995
|
-
return
|
|
996
|
-
version:
|
|
1057
|
+
return import_v46.z.object({
|
|
1058
|
+
version: import_v46.z.string().min(1, `${label}.version must be a non-empty string`),
|
|
997
1059
|
theGraphFallback: TheGraphFallbackSchema,
|
|
998
1060
|
ensIndexerPublicConfig: makeEnsIndexerPublicConfigSchema(`${label}.ensIndexerPublicConfig`)
|
|
999
1061
|
});
|
|
@@ -1001,8 +1063,8 @@ function makeEnsApiPublicConfigSchema(valueLabel) {
|
|
|
1001
1063
|
var makeENSApiPublicConfigSchema = makeEnsApiPublicConfigSchema;
|
|
1002
1064
|
function makeSerializedEnsApiPublicConfigSchema(valueLabel) {
|
|
1003
1065
|
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
1004
|
-
return
|
|
1005
|
-
version:
|
|
1066
|
+
return import_v46.z.object({
|
|
1067
|
+
version: import_v46.z.string().min(1, `${label}.version must be a non-empty string`),
|
|
1006
1068
|
theGraphFallback: TheGraphFallbackSchema,
|
|
1007
1069
|
ensIndexerPublicConfig: makeSerializedEnsIndexerPublicConfigSchema(
|
|
1008
1070
|
`${label}.ensIndexerPublicConfig`
|
|
@@ -1023,7 +1085,7 @@ function deserializeEnsApiPublicConfig(maybePublicConfig, valueLabel) {
|
|
|
1023
1085
|
const parsed = makeSerializedEnsApiPublicConfigSchema(valueLabel).transform(buildUnvalidatedEnsApiPublicConfig).pipe(makeEnsApiPublicConfigSchema(valueLabel)).safeParse(maybePublicConfig);
|
|
1024
1086
|
if (parsed.error) {
|
|
1025
1087
|
throw new Error(`Cannot deserialize EnsApiPublicConfig:
|
|
1026
|
-
${(0,
|
|
1088
|
+
${(0, import_v47.prettifyError)(parsed.error)}
|
|
1027
1089
|
`);
|
|
1028
1090
|
}
|
|
1029
1091
|
return parsed.data;
|
|
@@ -1042,19 +1104,21 @@ function serializeIndexedChainIds(indexedChainIds) {
|
|
|
1042
1104
|
}
|
|
1043
1105
|
function serializeEnsIndexerPublicConfig(config) {
|
|
1044
1106
|
const {
|
|
1045
|
-
labelSet,
|
|
1046
|
-
indexedChainIds,
|
|
1047
1107
|
databaseSchemaName,
|
|
1108
|
+
ensRainbowPublicConfig,
|
|
1109
|
+
indexedChainIds,
|
|
1048
1110
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
1111
|
+
labelSet,
|
|
1049
1112
|
namespace,
|
|
1050
1113
|
plugins,
|
|
1051
1114
|
versionInfo
|
|
1052
1115
|
} = config;
|
|
1053
1116
|
return {
|
|
1054
|
-
labelSet,
|
|
1055
|
-
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
1056
1117
|
databaseSchemaName,
|
|
1118
|
+
ensRainbowPublicConfig,
|
|
1119
|
+
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
1057
1120
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
1121
|
+
labelSet,
|
|
1058
1122
|
namespace,
|
|
1059
1123
|
plugins,
|
|
1060
1124
|
versionInfo
|
|
@@ -1080,16 +1144,16 @@ function serializeEnsApiConfigResponse(response) {
|
|
|
1080
1144
|
var serializeConfigResponse = serializeEnsApiConfigResponse;
|
|
1081
1145
|
|
|
1082
1146
|
// src/ensapi/api/indexing-status/deserialize.ts
|
|
1083
|
-
var
|
|
1147
|
+
var import_v418 = require("zod/v4");
|
|
1084
1148
|
|
|
1085
1149
|
// src/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
1086
|
-
var
|
|
1150
|
+
var import_v416 = require("zod/v4");
|
|
1087
1151
|
|
|
1088
1152
|
// src/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
1089
|
-
var
|
|
1153
|
+
var import_v413 = require("zod/v4");
|
|
1090
1154
|
|
|
1091
1155
|
// src/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
|
|
1092
|
-
var
|
|
1156
|
+
var import_v412 = require("zod/v4");
|
|
1093
1157
|
|
|
1094
1158
|
// src/shared/block-ref.ts
|
|
1095
1159
|
function isBefore(blockA, blockB) {
|
|
@@ -1269,13 +1333,13 @@ function sortChainStatusesByStartBlockAsc(chains) {
|
|
|
1269
1333
|
}
|
|
1270
1334
|
|
|
1271
1335
|
// src/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
|
|
1272
|
-
var
|
|
1336
|
+
var import_v48 = require("zod/v4");
|
|
1273
1337
|
function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1274
1338
|
const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
|
|
1275
1339
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1276
1340
|
if (parsed.error) {
|
|
1277
1341
|
throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
|
|
1278
|
-
${(0,
|
|
1342
|
+
${(0, import_v48.prettifyError)(parsed.error)}
|
|
1279
1343
|
`);
|
|
1280
1344
|
}
|
|
1281
1345
|
return parsed.data;
|
|
@@ -1319,16 +1383,16 @@ function buildCrossChainIndexingStatusSnapshotOmnichain(omnichainSnapshot, snaps
|
|
|
1319
1383
|
}
|
|
1320
1384
|
|
|
1321
1385
|
// src/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1322
|
-
var
|
|
1386
|
+
var import_v411 = require("zod/v4");
|
|
1323
1387
|
|
|
1324
1388
|
// src/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
1325
|
-
var
|
|
1389
|
+
var import_v49 = require("zod/v4");
|
|
1326
1390
|
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1327
1391
|
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
1328
1392
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1329
1393
|
if (parsed.error) {
|
|
1330
1394
|
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
1331
|
-
${(0,
|
|
1395
|
+
${(0, import_v49.prettifyError)(parsed.error)}
|
|
1332
1396
|
`);
|
|
1333
1397
|
}
|
|
1334
1398
|
return parsed.data;
|
|
@@ -1458,7 +1522,7 @@ function buildOmnichainIndexingStatusSnapshot(chainStatusSnapshots) {
|
|
|
1458
1522
|
}
|
|
1459
1523
|
|
|
1460
1524
|
// src/indexing-status/zod-schema/chain-indexing-status-snapshot.ts
|
|
1461
|
-
var
|
|
1525
|
+
var import_v410 = require("zod/v4");
|
|
1462
1526
|
function invariant_chainSnapshotQueuedBlocks(ctx) {
|
|
1463
1527
|
const { config } = ctx.value;
|
|
1464
1528
|
if (config.rangeType === RangeTypeIds.LeftBounded) {
|
|
@@ -1533,29 +1597,29 @@ function invariant_chainSnapshotFollowingBlocks(ctx) {
|
|
|
1533
1597
|
});
|
|
1534
1598
|
}
|
|
1535
1599
|
}
|
|
1536
|
-
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") =>
|
|
1537
|
-
chainStatus:
|
|
1538
|
-
config:
|
|
1539
|
-
|
|
1540
|
-
rangeType:
|
|
1600
|
+
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => import_v410.z.object({
|
|
1601
|
+
chainStatus: import_v410.z.literal(ChainIndexingStatusIds.Queued),
|
|
1602
|
+
config: import_v410.z.discriminatedUnion("rangeType", [
|
|
1603
|
+
import_v410.z.object({
|
|
1604
|
+
rangeType: import_v410.z.literal(RangeTypeIds.LeftBounded),
|
|
1541
1605
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1542
1606
|
}),
|
|
1543
|
-
|
|
1544
|
-
rangeType:
|
|
1607
|
+
import_v410.z.object({
|
|
1608
|
+
rangeType: import_v410.z.literal(RangeTypeIds.Bounded),
|
|
1545
1609
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1546
1610
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1547
1611
|
})
|
|
1548
1612
|
])
|
|
1549
1613
|
}).check(invariant_chainSnapshotQueuedBlocks);
|
|
1550
|
-
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") =>
|
|
1551
|
-
chainStatus:
|
|
1552
|
-
config:
|
|
1553
|
-
|
|
1554
|
-
rangeType:
|
|
1614
|
+
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => import_v410.z.object({
|
|
1615
|
+
chainStatus: import_v410.z.literal(ChainIndexingStatusIds.Backfill),
|
|
1616
|
+
config: import_v410.z.discriminatedUnion("rangeType", [
|
|
1617
|
+
import_v410.z.object({
|
|
1618
|
+
rangeType: import_v410.z.literal(RangeTypeIds.LeftBounded),
|
|
1555
1619
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1556
1620
|
}),
|
|
1557
|
-
|
|
1558
|
-
rangeType:
|
|
1621
|
+
import_v410.z.object({
|
|
1622
|
+
rangeType: import_v410.z.literal(RangeTypeIds.Bounded),
|
|
1559
1623
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1560
1624
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1561
1625
|
})
|
|
@@ -1563,25 +1627,25 @@ var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => im
|
|
|
1563
1627
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1564
1628
|
backfillEndBlock: makeBlockRefSchema(valueLabel)
|
|
1565
1629
|
}).check(invariant_chainSnapshotBackfillBlocks);
|
|
1566
|
-
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") =>
|
|
1567
|
-
chainStatus:
|
|
1568
|
-
config:
|
|
1569
|
-
rangeType:
|
|
1630
|
+
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => import_v410.z.object({
|
|
1631
|
+
chainStatus: import_v410.z.literal(ChainIndexingStatusIds.Completed),
|
|
1632
|
+
config: import_v410.z.object({
|
|
1633
|
+
rangeType: import_v410.z.literal(RangeTypeIds.Bounded),
|
|
1570
1634
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1571
1635
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1572
1636
|
}),
|
|
1573
1637
|
latestIndexedBlock: makeBlockRefSchema(valueLabel)
|
|
1574
1638
|
}).check(invariant_chainSnapshotCompletedBlocks);
|
|
1575
|
-
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") =>
|
|
1576
|
-
chainStatus:
|
|
1577
|
-
config:
|
|
1578
|
-
rangeType:
|
|
1639
|
+
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") => import_v410.z.object({
|
|
1640
|
+
chainStatus: import_v410.z.literal(ChainIndexingStatusIds.Following),
|
|
1641
|
+
config: import_v410.z.object({
|
|
1642
|
+
rangeType: import_v410.z.literal(RangeTypeIds.LeftBounded),
|
|
1579
1643
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1580
1644
|
}),
|
|
1581
1645
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1582
1646
|
latestKnownBlock: makeBlockRefSchema(valueLabel)
|
|
1583
1647
|
}).check(invariant_chainSnapshotFollowingBlocks);
|
|
1584
|
-
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1648
|
+
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v410.z.discriminatedUnion("chainStatus", [
|
|
1585
1649
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1586
1650
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1587
1651
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1710,11 +1774,11 @@ function invariant_omnichainStatusSnapshotFollowingHasValidChains(ctx) {
|
|
|
1710
1774
|
});
|
|
1711
1775
|
}
|
|
1712
1776
|
}
|
|
1713
|
-
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1714
|
-
omnichainStatus:
|
|
1715
|
-
chains:
|
|
1777
|
+
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v411.z.object({
|
|
1778
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1779
|
+
chains: import_v411.z.map(
|
|
1716
1780
|
makeChainIdSchema(),
|
|
1717
|
-
|
|
1781
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1718
1782
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1719
1783
|
]),
|
|
1720
1784
|
{
|
|
@@ -1723,11 +1787,11 @@ var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_
|
|
|
1723
1787
|
),
|
|
1724
1788
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1725
1789
|
}).check(invariant_omnichainSnapshotUnstartedHasValidChains);
|
|
1726
|
-
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1727
|
-
omnichainStatus:
|
|
1728
|
-
chains:
|
|
1790
|
+
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v411.z.object({
|
|
1791
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1792
|
+
chains: import_v411.z.map(
|
|
1729
1793
|
makeChainIdSchema(),
|
|
1730
|
-
|
|
1794
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1731
1795
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1732
1796
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1733
1797
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1738,11 +1802,11 @@ var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v
|
|
|
1738
1802
|
),
|
|
1739
1803
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1740
1804
|
}).check(invariant_omnichainStatusSnapshotBackfillHasValidChains);
|
|
1741
|
-
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1742
|
-
omnichainStatus:
|
|
1743
|
-
chains:
|
|
1805
|
+
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v411.z.object({
|
|
1806
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1807
|
+
chains: import_v411.z.map(
|
|
1744
1808
|
makeChainIdSchema(),
|
|
1745
|
-
|
|
1809
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1746
1810
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1747
1811
|
]),
|
|
1748
1812
|
{
|
|
@@ -1751,11 +1815,11 @@ var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_
|
|
|
1751
1815
|
),
|
|
1752
1816
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1753
1817
|
}).check(invariant_omnichainStatusSnapshotCompletedHasValidChains);
|
|
1754
|
-
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1755
|
-
omnichainStatus:
|
|
1756
|
-
chains:
|
|
1818
|
+
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v411.z.object({
|
|
1819
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1820
|
+
chains: import_v411.z.map(
|
|
1757
1821
|
makeChainIdSchema(),
|
|
1758
|
-
|
|
1822
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1759
1823
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1760
1824
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1761
1825
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1767,7 +1831,7 @@ var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_
|
|
|
1767
1831
|
),
|
|
1768
1832
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1769
1833
|
}).check(invariant_omnichainStatusSnapshotFollowingHasValidChains);
|
|
1770
|
-
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") =>
|
|
1834
|
+
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v411.z.discriminatedUnion("omnichainStatus", [
|
|
1771
1835
|
makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1772
1836
|
makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1773
1837
|
makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1775,21 +1839,21 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
|
|
|
1775
1839
|
]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
|
|
1776
1840
|
invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
|
|
1777
1841
|
).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
|
|
1778
|
-
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1779
|
-
omnichainStatus:
|
|
1780
|
-
chains:
|
|
1842
|
+
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v411.z.object({
|
|
1843
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1844
|
+
chains: import_v411.z.record(
|
|
1781
1845
|
makeChainIdStringSchema(),
|
|
1782
|
-
|
|
1846
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1783
1847
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1784
1848
|
])
|
|
1785
1849
|
),
|
|
1786
1850
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1787
1851
|
});
|
|
1788
|
-
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1789
|
-
omnichainStatus:
|
|
1790
|
-
chains:
|
|
1852
|
+
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v411.z.object({
|
|
1853
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1854
|
+
chains: import_v411.z.record(
|
|
1791
1855
|
makeChainIdStringSchema(),
|
|
1792
|
-
|
|
1856
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1793
1857
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1794
1858
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1795
1859
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1797,21 +1861,21 @@ var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =
|
|
|
1797
1861
|
),
|
|
1798
1862
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1799
1863
|
});
|
|
1800
|
-
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1801
|
-
omnichainStatus:
|
|
1802
|
-
chains:
|
|
1864
|
+
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v411.z.object({
|
|
1865
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1866
|
+
chains: import_v411.z.record(
|
|
1803
1867
|
makeChainIdStringSchema(),
|
|
1804
|
-
|
|
1868
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1805
1869
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1806
1870
|
])
|
|
1807
1871
|
),
|
|
1808
1872
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1809
1873
|
});
|
|
1810
|
-
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1811
|
-
omnichainStatus:
|
|
1812
|
-
chains:
|
|
1874
|
+
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v411.z.object({
|
|
1875
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1876
|
+
chains: import_v411.z.record(
|
|
1813
1877
|
makeChainIdStringSchema(),
|
|
1814
|
-
|
|
1878
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1815
1879
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1816
1880
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1817
1881
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1820,7 +1884,7 @@ var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel)
|
|
|
1820
1884
|
),
|
|
1821
1885
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1822
1886
|
});
|
|
1823
|
-
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1887
|
+
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v411.z.discriminatedUnion("omnichainStatus", [
|
|
1824
1888
|
makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1825
1889
|
makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1826
1890
|
makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1860,17 +1924,17 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1860
1924
|
});
|
|
1861
1925
|
}
|
|
1862
1926
|
}
|
|
1863
|
-
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") =>
|
|
1864
|
-
strategy:
|
|
1927
|
+
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v412.z.object({
|
|
1928
|
+
strategy: import_v412.z.literal(CrossChainIndexingStrategyIds.Omnichain),
|
|
1865
1929
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1866
1930
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1867
1931
|
omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1868
1932
|
}).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
|
|
1869
|
-
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") =>
|
|
1933
|
+
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v412.z.discriminatedUnion("strategy", [
|
|
1870
1934
|
makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
|
|
1871
1935
|
]);
|
|
1872
|
-
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") =>
|
|
1873
|
-
strategy:
|
|
1936
|
+
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") => import_v412.z.object({
|
|
1937
|
+
strategy: import_v412.z.enum(CrossChainIndexingStrategyIds),
|
|
1874
1938
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1875
1939
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1876
1940
|
omnichainSnapshot: makeSerializedOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
@@ -1900,22 +1964,22 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
|
|
|
1900
1964
|
});
|
|
1901
1965
|
}
|
|
1902
1966
|
}
|
|
1903
|
-
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") =>
|
|
1967
|
+
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v413.z.object({
|
|
1904
1968
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1905
1969
|
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1906
1970
|
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
1907
1971
|
}).check(invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime).check(invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect);
|
|
1908
|
-
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") =>
|
|
1972
|
+
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") => import_v413.z.object({
|
|
1909
1973
|
snapshot: makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel),
|
|
1910
1974
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1911
1975
|
worstCaseDistance: makeDurationSchema(valueLabel)
|
|
1912
1976
|
});
|
|
1913
1977
|
|
|
1914
1978
|
// src/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1915
|
-
var
|
|
1979
|
+
var import_v415 = require("zod/v4");
|
|
1916
1980
|
|
|
1917
1981
|
// src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
|
|
1918
|
-
var
|
|
1982
|
+
var import_v414 = require("zod/v4");
|
|
1919
1983
|
function buildUnvalidatedOmnichainIndexingStatusSnapshot(serializedSnapshot) {
|
|
1920
1984
|
const chains = /* @__PURE__ */ new Map();
|
|
1921
1985
|
for (const [chainIdString, chainIndexingStatusSnapshot] of Object.entries(
|
|
@@ -1936,7 +2000,7 @@ function deserializeOmnichainIndexingStatusSnapshot(data, valueLabel) {
|
|
|
1936
2000
|
if (parsed.error) {
|
|
1937
2001
|
throw new Error(
|
|
1938
2002
|
`Cannot deserialize into OmnichainIndexingStatusSnapshot:
|
|
1939
|
-
${(0,
|
|
2003
|
+
${(0, import_v414.prettifyError)(parsed.error)}
|
|
1940
2004
|
`
|
|
1941
2005
|
);
|
|
1942
2006
|
}
|
|
@@ -1958,7 +2022,7 @@ function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel)
|
|
|
1958
2022
|
if (parsed.error) {
|
|
1959
2023
|
throw new Error(
|
|
1960
2024
|
`Cannot deserialize into CrossChainIndexingStatusSnapshot:
|
|
1961
|
-
${(0,
|
|
2025
|
+
${(0, import_v415.prettifyError)(parsed.error)}
|
|
1962
2026
|
`
|
|
1963
2027
|
);
|
|
1964
2028
|
}
|
|
@@ -1978,7 +2042,7 @@ function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel
|
|
|
1978
2042
|
if (parsed.error) {
|
|
1979
2043
|
throw new Error(
|
|
1980
2044
|
`Cannot deserialize into RealtimeIndexingStatusProjection:
|
|
1981
|
-
${(0,
|
|
2045
|
+
${(0, import_v416.prettifyError)(parsed.error)}
|
|
1982
2046
|
`
|
|
1983
2047
|
);
|
|
1984
2048
|
}
|
|
@@ -1999,23 +2063,23 @@ var EnsApiIndexingStatusResponseCodes = {
|
|
|
1999
2063
|
var IndexingStatusResponseCodes = EnsApiIndexingStatusResponseCodes;
|
|
2000
2064
|
|
|
2001
2065
|
// src/ensapi/api/indexing-status/zod-schemas.ts
|
|
2002
|
-
var
|
|
2003
|
-
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
2004
|
-
responseCode:
|
|
2066
|
+
var import_v417 = require("zod/v4");
|
|
2067
|
+
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v417.z.strictObject({
|
|
2068
|
+
responseCode: import_v417.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2005
2069
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
2006
2070
|
});
|
|
2007
|
-
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
2008
|
-
responseCode:
|
|
2071
|
+
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v417.z.strictObject({
|
|
2072
|
+
responseCode: import_v417.z.literal(EnsApiIndexingStatusResponseCodes.Error)
|
|
2009
2073
|
});
|
|
2010
|
-
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
2074
|
+
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v417.z.discriminatedUnion("responseCode", [
|
|
2011
2075
|
makeEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2012
2076
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2013
2077
|
]);
|
|
2014
|
-
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
2015
|
-
responseCode:
|
|
2078
|
+
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v417.z.strictObject({
|
|
2079
|
+
responseCode: import_v417.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2016
2080
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
2017
2081
|
});
|
|
2018
|
-
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
2082
|
+
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v417.z.discriminatedUnion("responseCode", [
|
|
2019
2083
|
makeSerializedEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2020
2084
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2021
2085
|
]);
|
|
@@ -2037,7 +2101,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
2037
2101
|
if (parsed.error) {
|
|
2038
2102
|
throw new Error(
|
|
2039
2103
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
2040
|
-
${(0,
|
|
2104
|
+
${(0, import_v418.prettifyError)(parsed.error)}
|
|
2041
2105
|
`
|
|
2042
2106
|
);
|
|
2043
2107
|
}
|
|
@@ -2174,11 +2238,11 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2174
2238
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2175
2239
|
|
|
2176
2240
|
// src/ensapi/api/name-tokens/deserialize.ts
|
|
2177
|
-
var
|
|
2241
|
+
var import_v423 = require("zod/v4");
|
|
2178
2242
|
|
|
2179
2243
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2180
2244
|
var import_viem14 = require("viem");
|
|
2181
|
-
var
|
|
2245
|
+
var import_v422 = require("zod/v4");
|
|
2182
2246
|
|
|
2183
2247
|
// src/tokenscope/name-token.ts
|
|
2184
2248
|
var import_viem13 = require("viem");
|
|
@@ -2218,12 +2282,12 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2218
2282
|
|
|
2219
2283
|
// src/tokenscope/assets.ts
|
|
2220
2284
|
var import_viem12 = require("viem");
|
|
2221
|
-
var
|
|
2285
|
+
var import_v420 = require("zod/v4");
|
|
2222
2286
|
|
|
2223
2287
|
// src/tokenscope/zod-schemas.ts
|
|
2224
2288
|
var import_caip3 = require("caip");
|
|
2225
2289
|
var import_viem11 = require("viem");
|
|
2226
|
-
var
|
|
2290
|
+
var import_v419 = require("zod/v4");
|
|
2227
2291
|
|
|
2228
2292
|
// src/shared/types.ts
|
|
2229
2293
|
var AssetNamespaces = {
|
|
@@ -2232,10 +2296,10 @@ var AssetNamespaces = {
|
|
|
2232
2296
|
};
|
|
2233
2297
|
|
|
2234
2298
|
// src/tokenscope/zod-schemas.ts
|
|
2235
|
-
var tokenIdSchemaSerializable =
|
|
2236
|
-
var tokenIdSchemaNative =
|
|
2299
|
+
var tokenIdSchemaSerializable = import_v419.z.string();
|
|
2300
|
+
var tokenIdSchemaNative = import_v419.z.preprocess(
|
|
2237
2301
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2238
|
-
|
|
2302
|
+
import_v419.z.bigint().positive()
|
|
2239
2303
|
);
|
|
2240
2304
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2241
2305
|
if (serializable) {
|
|
@@ -2245,13 +2309,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2245
2309
|
}
|
|
2246
2310
|
}
|
|
2247
2311
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2248
|
-
return
|
|
2249
|
-
assetNamespace:
|
|
2312
|
+
return import_v419.z.object({
|
|
2313
|
+
assetNamespace: import_v419.z.enum(AssetNamespaces),
|
|
2250
2314
|
contract: makeAccountIdSchema(valueLabel),
|
|
2251
2315
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2252
2316
|
});
|
|
2253
2317
|
};
|
|
2254
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2318
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v419.z.preprocess((v) => {
|
|
2255
2319
|
if (typeof v === "string") {
|
|
2256
2320
|
const result = new import_caip3.AssetId(v);
|
|
2257
2321
|
return {
|
|
@@ -2275,20 +2339,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2275
2339
|
});
|
|
2276
2340
|
}
|
|
2277
2341
|
}
|
|
2278
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2279
|
-
ownershipType:
|
|
2342
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v419.z.object({
|
|
2343
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2280
2344
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2281
2345
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2282
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2283
|
-
ownershipType:
|
|
2346
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v419.z.object({
|
|
2347
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2284
2348
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2285
2349
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2286
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2287
|
-
ownershipType:
|
|
2350
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v419.z.object({
|
|
2351
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2288
2352
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2289
2353
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2290
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2291
|
-
ownershipType:
|
|
2354
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v419.z.object({
|
|
2355
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2292
2356
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2293
2357
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2294
2358
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2301,16 +2365,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2301
2365
|
});
|
|
2302
2366
|
}
|
|
2303
2367
|
}
|
|
2304
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2368
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v419.z.discriminatedUnion("ownershipType", [
|
|
2305
2369
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2306
2370
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2307
2371
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2308
2372
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2309
2373
|
]);
|
|
2310
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2374
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v419.z.object({
|
|
2311
2375
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2312
2376
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2313
|
-
mintStatus:
|
|
2377
|
+
mintStatus: import_v419.z.enum(NFTMintStatuses)
|
|
2314
2378
|
});
|
|
2315
2379
|
|
|
2316
2380
|
// src/tokenscope/assets.ts
|
|
@@ -2326,7 +2390,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2326
2390
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2327
2391
|
if (parsed.error) {
|
|
2328
2392
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2329
|
-
${(0,
|
|
2393
|
+
${(0, import_v420.prettifyError)(parsed.error)}
|
|
2330
2394
|
`);
|
|
2331
2395
|
}
|
|
2332
2396
|
return parsed.data;
|
|
@@ -2336,7 +2400,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2336
2400
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2337
2401
|
if (parsed.error) {
|
|
2338
2402
|
throw new RangeError(`Cannot parse AssetId:
|
|
2339
|
-
${(0,
|
|
2403
|
+
${(0, import_v420.prettifyError)(parsed.error)}
|
|
2340
2404
|
`);
|
|
2341
2405
|
}
|
|
2342
2406
|
return parsed.data;
|
|
@@ -2636,10 +2700,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2636
2700
|
}
|
|
2637
2701
|
|
|
2638
2702
|
// src/ensapi/api/shared/errors/zod-schemas.ts
|
|
2639
|
-
var
|
|
2640
|
-
var ErrorResponseSchema =
|
|
2641
|
-
message:
|
|
2642
|
-
details:
|
|
2703
|
+
var import_v421 = require("zod/v4");
|
|
2704
|
+
var ErrorResponseSchema = import_v421.z.object({
|
|
2705
|
+
message: import_v421.z.string(),
|
|
2706
|
+
details: import_v421.z.optional(import_v421.z.unknown())
|
|
2643
2707
|
});
|
|
2644
2708
|
|
|
2645
2709
|
// src/ensapi/api/name-tokens/response.ts
|
|
@@ -2678,10 +2742,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2678
2742
|
};
|
|
2679
2743
|
|
|
2680
2744
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2681
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2745
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v422.z.object({
|
|
2682
2746
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2683
2747
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2684
|
-
tokens:
|
|
2748
|
+
tokens: import_v422.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2685
2749
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2686
2750
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2687
2751
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2723,32 +2787,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2723
2787
|
});
|
|
2724
2788
|
}
|
|
2725
2789
|
});
|
|
2726
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2727
|
-
responseCode:
|
|
2790
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v422.z.strictObject({
|
|
2791
|
+
responseCode: import_v422.z.literal(NameTokensResponseCodes.Ok),
|
|
2728
2792
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2729
2793
|
});
|
|
2730
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2731
|
-
responseCode:
|
|
2732
|
-
errorCode:
|
|
2794
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v422.z.strictObject({
|
|
2795
|
+
responseCode: import_v422.z.literal(NameTokensResponseCodes.Error),
|
|
2796
|
+
errorCode: import_v422.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2733
2797
|
error: ErrorResponseSchema
|
|
2734
2798
|
});
|
|
2735
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2736
|
-
responseCode:
|
|
2737
|
-
errorCode:
|
|
2799
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v422.z.strictObject({
|
|
2800
|
+
responseCode: import_v422.z.literal(NameTokensResponseCodes.Error),
|
|
2801
|
+
errorCode: import_v422.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2738
2802
|
error: ErrorResponseSchema
|
|
2739
2803
|
});
|
|
2740
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2741
|
-
responseCode:
|
|
2742
|
-
errorCode:
|
|
2804
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v422.z.strictObject({
|
|
2805
|
+
responseCode: import_v422.z.literal(NameTokensResponseCodes.Error),
|
|
2806
|
+
errorCode: import_v422.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2743
2807
|
error: ErrorResponseSchema
|
|
2744
2808
|
});
|
|
2745
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
2809
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v422.z.discriminatedUnion("errorCode", [
|
|
2746
2810
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2747
2811
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2748
2812
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2749
2813
|
]);
|
|
2750
2814
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2751
|
-
return
|
|
2815
|
+
return import_v422.z.discriminatedUnion("responseCode", [
|
|
2752
2816
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2753
2817
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2754
2818
|
]);
|
|
@@ -2761,7 +2825,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2761
2825
|
);
|
|
2762
2826
|
if (parsed.error) {
|
|
2763
2827
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2764
|
-
${(0,
|
|
2828
|
+
${(0, import_v423.prettifyError)(parsed.error)}
|
|
2765
2829
|
`);
|
|
2766
2830
|
}
|
|
2767
2831
|
return parsed.data;
|
|
@@ -2835,14 +2899,14 @@ function serializeNameTokensResponse(response) {
|
|
|
2835
2899
|
}
|
|
2836
2900
|
|
|
2837
2901
|
// src/ensapi/api/registrar-actions/deserialize.ts
|
|
2838
|
-
var
|
|
2902
|
+
var import_v427 = require("zod/v4");
|
|
2839
2903
|
|
|
2840
2904
|
// src/ensapi/api/registrar-actions/zod-schemas.ts
|
|
2841
2905
|
var import_ens7 = require("viem/ens");
|
|
2842
|
-
var
|
|
2906
|
+
var import_v426 = require("zod/v4");
|
|
2843
2907
|
|
|
2844
2908
|
// src/registrars/zod-schemas.ts
|
|
2845
|
-
var
|
|
2909
|
+
var import_v424 = require("zod/v4");
|
|
2846
2910
|
|
|
2847
2911
|
// src/registrars/encoded-referrer.ts
|
|
2848
2912
|
var import_viem15 = require("viem");
|
|
@@ -2917,11 +2981,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
2917
2981
|
}
|
|
2918
2982
|
|
|
2919
2983
|
// src/registrars/zod-schemas.ts
|
|
2920
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
2984
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v424.z.object({
|
|
2921
2985
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
2922
2986
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
2923
2987
|
});
|
|
2924
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
2988
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v424.z.object({
|
|
2925
2989
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
2926
2990
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
2927
2991
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -2937,18 +3001,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
2937
3001
|
});
|
|
2938
3002
|
}
|
|
2939
3003
|
}
|
|
2940
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
3004
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v424.z.union([
|
|
2941
3005
|
// pricing available
|
|
2942
|
-
|
|
3006
|
+
import_v424.z.object({
|
|
2943
3007
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
2944
3008
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
2945
3009
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
2946
3010
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
2947
3011
|
// pricing unknown
|
|
2948
|
-
|
|
2949
|
-
baseCost:
|
|
2950
|
-
premium:
|
|
2951
|
-
total:
|
|
3012
|
+
import_v424.z.object({
|
|
3013
|
+
baseCost: import_v424.z.null(),
|
|
3014
|
+
premium: import_v424.z.null(),
|
|
3015
|
+
total: import_v424.z.null()
|
|
2952
3016
|
}).transform((v) => v)
|
|
2953
3017
|
]);
|
|
2954
3018
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -2971,9 +3035,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
2971
3035
|
});
|
|
2972
3036
|
}
|
|
2973
3037
|
}
|
|
2974
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
3038
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v424.z.union([
|
|
2975
3039
|
// referral available
|
|
2976
|
-
|
|
3040
|
+
import_v424.z.object({
|
|
2977
3041
|
encodedReferrer: makeHexStringSchema(
|
|
2978
3042
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
2979
3043
|
`${valueLabel} Encoded Referrer`
|
|
@@ -2981,9 +3045,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
2981
3045
|
decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
2982
3046
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
2983
3047
|
// referral not applicable
|
|
2984
|
-
|
|
2985
|
-
encodedReferrer:
|
|
2986
|
-
decodedReferrer:
|
|
3048
|
+
import_v424.z.object({
|
|
3049
|
+
encodedReferrer: import_v424.z.null(),
|
|
3050
|
+
decodedReferrer: import_v424.z.null()
|
|
2987
3051
|
})
|
|
2988
3052
|
]);
|
|
2989
3053
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -2996,9 +3060,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
2996
3060
|
});
|
|
2997
3061
|
}
|
|
2998
3062
|
}
|
|
2999
|
-
var EventIdSchema =
|
|
3000
|
-
var EventIdsSchema =
|
|
3001
|
-
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") =>
|
|
3063
|
+
var EventIdSchema = import_v424.z.string().nonempty();
|
|
3064
|
+
var EventIdsSchema = import_v424.z.array(EventIdSchema).min(1).transform((v) => v);
|
|
3065
|
+
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v424.z.object({
|
|
3002
3066
|
id: EventIdSchema,
|
|
3003
3067
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
3004
3068
|
registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -3012,38 +3076,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
|
|
|
3012
3076
|
eventIds: EventIdsSchema
|
|
3013
3077
|
}).check(invariant_eventIdsInitialElementIsTheActionId);
|
|
3014
3078
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3015
|
-
type:
|
|
3079
|
+
type: import_v424.z.literal(RegistrarActionTypes.Registration)
|
|
3016
3080
|
});
|
|
3017
3081
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3018
|
-
type:
|
|
3082
|
+
type: import_v424.z.literal(RegistrarActionTypes.Renewal)
|
|
3019
3083
|
});
|
|
3020
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
3084
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v424.z.discriminatedUnion("type", [
|
|
3021
3085
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
3022
3086
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
3023
3087
|
]);
|
|
3024
3088
|
|
|
3025
3089
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
3026
|
-
var
|
|
3090
|
+
var import_v425 = require("zod/v4");
|
|
3027
3091
|
|
|
3028
3092
|
// src/ensapi/api/shared/pagination/request.ts
|
|
3029
3093
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
3030
3094
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
3031
3095
|
|
|
3032
3096
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
3033
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3097
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v425.z.object({
|
|
3034
3098
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
3035
3099
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
3036
3100
|
RECORDS_PER_PAGE_MAX,
|
|
3037
3101
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
3038
3102
|
)
|
|
3039
3103
|
});
|
|
3040
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
3041
|
-
totalRecords:
|
|
3042
|
-
totalPages:
|
|
3043
|
-
hasNext:
|
|
3044
|
-
hasPrev:
|
|
3045
|
-
startIndex:
|
|
3046
|
-
endIndex:
|
|
3104
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v425.z.object({
|
|
3105
|
+
totalRecords: import_v425.z.literal(0),
|
|
3106
|
+
totalPages: import_v425.z.literal(1),
|
|
3107
|
+
hasNext: import_v425.z.literal(false),
|
|
3108
|
+
hasPrev: import_v425.z.literal(false),
|
|
3109
|
+
startIndex: import_v425.z.undefined(),
|
|
3110
|
+
endIndex: import_v425.z.undefined()
|
|
3047
3111
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
3048
3112
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
3049
3113
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -3078,15 +3142,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
3078
3142
|
});
|
|
3079
3143
|
}
|
|
3080
3144
|
}
|
|
3081
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3145
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v425.z.object({
|
|
3082
3146
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3083
3147
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3084
|
-
hasNext:
|
|
3085
|
-
hasPrev:
|
|
3148
|
+
hasNext: import_v425.z.boolean(),
|
|
3149
|
+
hasPrev: import_v425.z.boolean(),
|
|
3086
3150
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
3087
3151
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
3088
3152
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
3089
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3153
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v425.z.union([
|
|
3090
3154
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
3091
3155
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
3092
3156
|
]);
|
|
@@ -3116,21 +3180,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3116
3180
|
});
|
|
3117
3181
|
}
|
|
3118
3182
|
}
|
|
3119
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3183
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v426.z.object({
|
|
3120
3184
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3121
3185
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3122
3186
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3123
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3124
|
-
responseCode:
|
|
3125
|
-
registrarActions:
|
|
3187
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v426.z.object({
|
|
3188
|
+
responseCode: import_v426.z.literal(RegistrarActionsResponseCodes.Ok),
|
|
3189
|
+
registrarActions: import_v426.z.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
3126
3190
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3127
3191
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
|
|
3128
3192
|
});
|
|
3129
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3130
|
-
responseCode:
|
|
3193
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v426.z.strictObject({
|
|
3194
|
+
responseCode: import_v426.z.literal(RegistrarActionsResponseCodes.Error),
|
|
3131
3195
|
error: ErrorResponseSchema
|
|
3132
3196
|
});
|
|
3133
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3197
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v426.z.discriminatedUnion("responseCode", [
|
|
3134
3198
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3135
3199
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3136
3200
|
]);
|
|
@@ -3141,7 +3205,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3141
3205
|
if (parsed.error) {
|
|
3142
3206
|
throw new Error(
|
|
3143
3207
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3144
|
-
${(0,
|
|
3208
|
+
${(0, import_v427.prettifyError)(parsed.error)}
|
|
3145
3209
|
`
|
|
3146
3210
|
);
|
|
3147
3211
|
}
|
|
@@ -3270,12 +3334,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3270
3334
|
}
|
|
3271
3335
|
|
|
3272
3336
|
// src/ensapi/api/shared/errors/deserialize.ts
|
|
3273
|
-
var
|
|
3337
|
+
var import_v428 = require("zod/v4");
|
|
3274
3338
|
function deserializeErrorResponse(maybeErrorResponse) {
|
|
3275
3339
|
const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
|
|
3276
3340
|
if (parsed.error) {
|
|
3277
3341
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3278
|
-
${(0,
|
|
3342
|
+
${(0, import_v428.prettifyError)(parsed.error)}
|
|
3279
3343
|
`);
|
|
3280
3344
|
}
|
|
3281
3345
|
return parsed.data;
|
|
@@ -3835,7 +3899,7 @@ function serializeEnsIndexerConfigResponse(response) {
|
|
|
3835
3899
|
}
|
|
3836
3900
|
|
|
3837
3901
|
// src/ensindexer/api/indexing-status/deserialize.ts
|
|
3838
|
-
var
|
|
3902
|
+
var import_v430 = require("zod/v4");
|
|
3839
3903
|
|
|
3840
3904
|
// src/ensindexer/api/indexing-status/response.ts
|
|
3841
3905
|
var EnsIndexerIndexingStatusResponseCodes = {
|
|
@@ -3850,23 +3914,23 @@ var EnsIndexerIndexingStatusResponseCodes = {
|
|
|
3850
3914
|
};
|
|
3851
3915
|
|
|
3852
3916
|
// src/ensindexer/api/indexing-status/zod-schemas.ts
|
|
3853
|
-
var
|
|
3854
|
-
var makeEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
3855
|
-
responseCode:
|
|
3917
|
+
var import_v429 = require("zod/v4");
|
|
3918
|
+
var makeEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v429.z.strictObject({
|
|
3919
|
+
responseCode: import_v429.z.literal(EnsIndexerIndexingStatusResponseCodes.Ok),
|
|
3856
3920
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3857
3921
|
});
|
|
3858
|
-
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
3859
|
-
responseCode:
|
|
3922
|
+
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v429.z.strictObject({
|
|
3923
|
+
responseCode: import_v429.z.literal(EnsIndexerIndexingStatusResponseCodes.Error)
|
|
3860
3924
|
});
|
|
3861
|
-
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
3925
|
+
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v429.z.discriminatedUnion("responseCode", [
|
|
3862
3926
|
makeEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3863
3927
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3864
3928
|
]);
|
|
3865
|
-
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
3866
|
-
responseCode:
|
|
3929
|
+
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v429.z.strictObject({
|
|
3930
|
+
responseCode: import_v429.z.literal(EnsIndexerIndexingStatusResponseCodes.Ok),
|
|
3867
3931
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3868
3932
|
});
|
|
3869
|
-
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
3933
|
+
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v429.z.discriminatedUnion("responseCode", [
|
|
3870
3934
|
makeSerializedEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3871
3935
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3872
3936
|
]);
|
|
@@ -3888,7 +3952,7 @@ function deserializeEnsIndexerIndexingStatusResponse(maybeResponse) {
|
|
|
3888
3952
|
if (parsed.error) {
|
|
3889
3953
|
throw new Error(
|
|
3890
3954
|
`Cannot deserialize EnsIndexerIndexingStatusResponse:
|
|
3891
|
-
${(0,
|
|
3955
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
3892
3956
|
`
|
|
3893
3957
|
);
|
|
3894
3958
|
}
|
|
@@ -3909,13 +3973,13 @@ function serializeEnsIndexerIndexingStatusResponse(response) {
|
|
|
3909
3973
|
}
|
|
3910
3974
|
|
|
3911
3975
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
3912
|
-
var
|
|
3976
|
+
var import_v432 = require("zod/v4");
|
|
3913
3977
|
|
|
3914
3978
|
// src/ensindexer/api/shared/errors/zod-schemas.ts
|
|
3915
|
-
var
|
|
3916
|
-
var ErrorResponseSchema2 =
|
|
3917
|
-
message:
|
|
3918
|
-
details:
|
|
3979
|
+
var import_v431 = require("zod/v4");
|
|
3980
|
+
var ErrorResponseSchema2 = import_v431.z.object({
|
|
3981
|
+
message: import_v431.z.string(),
|
|
3982
|
+
details: import_v431.z.optional(import_v431.z.unknown())
|
|
3919
3983
|
});
|
|
3920
3984
|
|
|
3921
3985
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
@@ -3923,7 +3987,7 @@ function deserializeErrorResponse2(maybeErrorResponse) {
|
|
|
3923
3987
|
const parsed = ErrorResponseSchema2.safeParse(maybeErrorResponse);
|
|
3924
3988
|
if (parsed.error) {
|
|
3925
3989
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3926
|
-
${(0,
|
|
3990
|
+
${(0, import_v432.prettifyError)(parsed.error)}
|
|
3927
3991
|
`);
|
|
3928
3992
|
}
|
|
3929
3993
|
return parsed.data;
|
|
@@ -4087,35 +4151,6 @@ function labelHashToBytes(labelHash) {
|
|
|
4087
4151
|
}
|
|
4088
4152
|
}
|
|
4089
4153
|
|
|
4090
|
-
// src/ensindexer/config/labelset-utils.ts
|
|
4091
|
-
function buildLabelSetId(maybeLabelSetId) {
|
|
4092
|
-
return makeLabelSetIdSchema("LabelSetId").parse(maybeLabelSetId);
|
|
4093
|
-
}
|
|
4094
|
-
function buildLabelSetVersion(maybeLabelSetVersion) {
|
|
4095
|
-
return makeLabelSetVersionSchema("LabelSetVersion").parse(maybeLabelSetVersion);
|
|
4096
|
-
}
|
|
4097
|
-
function buildEnsRainbowClientLabelSet(labelSetId, labelSetVersion) {
|
|
4098
|
-
if (labelSetVersion !== void 0 && labelSetId === void 0) {
|
|
4099
|
-
throw new Error("When a labelSetVersion is defined, labelSetId must also be defined.");
|
|
4100
|
-
}
|
|
4101
|
-
return { labelSetId, labelSetVersion };
|
|
4102
|
-
}
|
|
4103
|
-
function validateSupportedLabelSetAndVersion(serverSet, clientSet) {
|
|
4104
|
-
if (clientSet.labelSetId === void 0) {
|
|
4105
|
-
return;
|
|
4106
|
-
}
|
|
4107
|
-
if (serverSet.labelSetId !== clientSet.labelSetId) {
|
|
4108
|
-
throw new Error(
|
|
4109
|
-
`Server label set ID "${serverSet.labelSetId}" does not match client's requested label set ID "${clientSet.labelSetId}".`
|
|
4110
|
-
);
|
|
4111
|
-
}
|
|
4112
|
-
if (clientSet.labelSetVersion !== void 0 && serverSet.highestLabelSetVersion < clientSet.labelSetVersion) {
|
|
4113
|
-
throw new Error(
|
|
4114
|
-
`Server highest label set version ${serverSet.highestLabelSetVersion} is less than client's requested version ${clientSet.labelSetVersion} for label set ID "${clientSet.labelSetId}".`
|
|
4115
|
-
);
|
|
4116
|
-
}
|
|
4117
|
-
}
|
|
4118
|
-
|
|
4119
4154
|
// src/ensindexer/config/parsing.ts
|
|
4120
4155
|
function parseNonNegativeInteger(maybeNumber) {
|
|
4121
4156
|
const trimmed = maybeNumber.trim();
|
|
@@ -4210,14 +4245,14 @@ function isResolvedIdentity(identity) {
|
|
|
4210
4245
|
}
|
|
4211
4246
|
|
|
4212
4247
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
4213
|
-
var
|
|
4248
|
+
var import_v433 = require("zod/v4");
|
|
4214
4249
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
4215
4250
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4216
4251
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
4217
4252
|
if (parsed.error) {
|
|
4218
4253
|
throw new Error(
|
|
4219
4254
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
4220
|
-
${(0,
|
|
4255
|
+
${(0, import_v433.prettifyError)(parsed.error)}
|
|
4221
4256
|
`
|
|
4222
4257
|
);
|
|
4223
4258
|
}
|
|
@@ -4235,26 +4270,26 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
4235
4270
|
}
|
|
4236
4271
|
|
|
4237
4272
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
4238
|
-
var
|
|
4273
|
+
var import_v434 = require("zod/v4");
|
|
4239
4274
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4240
4275
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4241
4276
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4242
4277
|
if (parsed.error) {
|
|
4243
4278
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
4244
|
-
${(0,
|
|
4279
|
+
${(0, import_v434.prettifyError)(parsed.error)}
|
|
4245
4280
|
`);
|
|
4246
4281
|
}
|
|
4247
4282
|
return parsed.data;
|
|
4248
4283
|
}
|
|
4249
4284
|
|
|
4250
4285
|
// src/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
4251
|
-
var
|
|
4286
|
+
var import_v435 = require("zod/v4");
|
|
4252
4287
|
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
4253
4288
|
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
4254
4289
|
const parsed = schema.safeParse(unvalidatedProjection);
|
|
4255
4290
|
if (parsed.error) {
|
|
4256
4291
|
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
4257
|
-
${(0,
|
|
4292
|
+
${(0, import_v435.prettifyError)(parsed.error)}
|
|
4258
4293
|
`);
|
|
4259
4294
|
}
|
|
4260
4295
|
return parsed.data;
|
|
@@ -4432,13 +4467,13 @@ var import_getUnixTime2 = require("date-fns/getUnixTime");
|
|
|
4432
4467
|
var import_getUnixTime = require("date-fns/getUnixTime");
|
|
4433
4468
|
|
|
4434
4469
|
// src/shared/deserialize.ts
|
|
4435
|
-
var
|
|
4470
|
+
var import_v436 = __toESM(require("zod/v4"), 1);
|
|
4436
4471
|
function deserializeChainId(maybeChainId, valueLabel) {
|
|
4437
4472
|
const schema = makeChainIdStringSchema(valueLabel);
|
|
4438
4473
|
const parsed = schema.safeParse(maybeChainId);
|
|
4439
4474
|
if (parsed.error) {
|
|
4440
4475
|
throw new Error(`Cannot deserialize ChainId:
|
|
4441
|
-
${(0,
|
|
4476
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4442
4477
|
`);
|
|
4443
4478
|
}
|
|
4444
4479
|
return parsed.data;
|
|
@@ -4448,7 +4483,7 @@ function deserializeDatetime(maybeDatetime, valueLabel) {
|
|
|
4448
4483
|
const parsed = schema.safeParse(maybeDatetime);
|
|
4449
4484
|
if (parsed.error) {
|
|
4450
4485
|
throw new Error(`Cannot deserialize Datetime:
|
|
4451
|
-
${(0,
|
|
4486
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4452
4487
|
`);
|
|
4453
4488
|
}
|
|
4454
4489
|
return parsed.data;
|
|
@@ -4458,7 +4493,7 @@ function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
|
|
|
4458
4493
|
const parsed = schema.safeParse(maybeTimestamp);
|
|
4459
4494
|
if (parsed.error) {
|
|
4460
4495
|
throw new Error(`Cannot deserialize Unix Timestamp:
|
|
4461
|
-
${(0,
|
|
4496
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4462
4497
|
`);
|
|
4463
4498
|
}
|
|
4464
4499
|
return parsed.data;
|
|
@@ -4468,7 +4503,7 @@ function deserializeUrl(maybeUrl, valueLabel) {
|
|
|
4468
4503
|
const parsed = schema.safeParse(maybeUrl);
|
|
4469
4504
|
if (parsed.error) {
|
|
4470
4505
|
throw new Error(`Cannot deserialize URL:
|
|
4471
|
-
${(0,
|
|
4506
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4472
4507
|
`);
|
|
4473
4508
|
}
|
|
4474
4509
|
return parsed.data;
|
|
@@ -4478,7 +4513,7 @@ function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
|
|
|
4478
4513
|
const parsed = schema.safeParse(maybeBlockNumber);
|
|
4479
4514
|
if (parsed.error) {
|
|
4480
4515
|
throw new Error(`Cannot deserialize BlockNumber:
|
|
4481
|
-
${(0,
|
|
4516
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4482
4517
|
`);
|
|
4483
4518
|
}
|
|
4484
4519
|
return parsed.data;
|
|
@@ -4488,17 +4523,17 @@ function deserializeBlockRef(maybeBlockRef, valueLabel) {
|
|
|
4488
4523
|
const parsed = schema.safeParse(maybeBlockRef);
|
|
4489
4524
|
if (parsed.error) {
|
|
4490
4525
|
throw new Error(`Cannot deserialize BlockRef:
|
|
4491
|
-
${(0,
|
|
4526
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4492
4527
|
`);
|
|
4493
4528
|
}
|
|
4494
4529
|
return parsed.data;
|
|
4495
4530
|
}
|
|
4496
4531
|
function deserializeDuration(maybeDuration, valueLabel) {
|
|
4497
|
-
const schema =
|
|
4532
|
+
const schema = import_v436.default.coerce.number().pipe(makeDurationSchema(valueLabel));
|
|
4498
4533
|
const parsed = schema.safeParse(maybeDuration);
|
|
4499
4534
|
if (parsed.error) {
|
|
4500
4535
|
throw new RangeError(`Cannot deserialize Duration:
|
|
4501
|
-
${(0,
|
|
4536
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4502
4537
|
`);
|
|
4503
4538
|
}
|
|
4504
4539
|
return parsed.data;
|
|
@@ -4508,7 +4543,7 @@ function parseAccountId(maybeAccountId, valueLabel) {
|
|
|
4508
4543
|
const parsed = schema.safeParse(maybeAccountId);
|
|
4509
4544
|
if (parsed.error) {
|
|
4510
4545
|
throw new RangeError(`Cannot deserialize AccountId:
|
|
4511
|
-
${(0,
|
|
4546
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4512
4547
|
`);
|
|
4513
4548
|
}
|
|
4514
4549
|
return parsed.data;
|
|
@@ -4518,7 +4553,7 @@ function deserializePriceEth(maybePrice, valueLabel) {
|
|
|
4518
4553
|
const parsed = schema.safeParse(maybePrice);
|
|
4519
4554
|
if (parsed.error) {
|
|
4520
4555
|
throw new Error(`Cannot deserialize PriceEth:
|
|
4521
|
-
${(0,
|
|
4556
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4522
4557
|
`);
|
|
4523
4558
|
}
|
|
4524
4559
|
return parsed.data;
|
|
@@ -4528,7 +4563,7 @@ function deserializePriceUsdc(maybePrice, valueLabel) {
|
|
|
4528
4563
|
const parsed = schema.safeParse(maybePrice);
|
|
4529
4564
|
if (parsed.error) {
|
|
4530
4565
|
throw new Error(`Cannot deserialize PriceUsdc:
|
|
4531
|
-
${(0,
|
|
4566
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4532
4567
|
`);
|
|
4533
4568
|
}
|
|
4534
4569
|
return parsed.data;
|
|
@@ -4538,7 +4573,7 @@ function deserializePriceDai(maybePrice, valueLabel) {
|
|
|
4538
4573
|
const parsed = schema.safeParse(maybePrice);
|
|
4539
4574
|
if (parsed.error) {
|
|
4540
4575
|
throw new Error(`Cannot deserialize PriceDai:
|
|
4541
|
-
${(0,
|
|
4576
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4542
4577
|
`);
|
|
4543
4578
|
}
|
|
4544
4579
|
return parsed.data;
|