@ensnode/ensnode-sdk 0.0.0-next-20260303174208 → 0.0.0-next-20260303202314
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 +388 -342
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -56
- package/dist/index.d.ts +100 -56
- package/dist/index.js +342 -296
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -177,13 +177,18 @@ __export(index_exports, {
|
|
|
177
177
|
getNameHierarchy: () => getNameHierarchy,
|
|
178
178
|
getNameTokenOwnership: () => getNameTokenOwnership,
|
|
179
179
|
getNameWrapperAccounts: () => getNameWrapperAccounts,
|
|
180
|
+
getNamespaceSpecificValue: () => getNamespaceSpecificValue,
|
|
180
181
|
getOmnichainIndexingCursor: () => getOmnichainIndexingCursor,
|
|
181
182
|
getOmnichainIndexingStatus: () => getOmnichainIndexingStatus,
|
|
182
183
|
getParentNameFQDN: () => getParentNameFQDN,
|
|
183
184
|
getResolvePrimaryNameChainIdParam: () => getResolvePrimaryNameChainIdParam,
|
|
184
185
|
getTimestampForHighestOmnichainKnownBlock: () => getTimestampForHighestOmnichainKnownBlock,
|
|
185
186
|
getTimestampForLowestOmnichainStartBlock: () => getTimestampForLowestOmnichainStartBlock,
|
|
187
|
+
hasGraphqlApiConfigSupport: () => hasGraphqlApiConfigSupport,
|
|
186
188
|
hasNullByte: () => hasNullByte,
|
|
189
|
+
hasRegistrarActionsConfigSupport: () => hasRegistrarActionsConfigSupport,
|
|
190
|
+
hasRegistrarActionsIndexingStatusSupport: () => hasRegistrarActionsIndexingStatusSupport,
|
|
191
|
+
hasSubgraphApiConfigSupport: () => hasSubgraphApiConfigSupport,
|
|
187
192
|
interpretAddress: () => interpretAddress,
|
|
188
193
|
interpretAddressRecordValue: () => interpretAddressRecordValue,
|
|
189
194
|
interpretNameRecordValue: () => interpretNameRecordValue,
|
|
@@ -254,7 +259,6 @@ __export(index_exports, {
|
|
|
254
259
|
priceEth: () => priceEth,
|
|
255
260
|
priceUsdc: () => priceUsdc,
|
|
256
261
|
registrarActionsFilter: () => registrarActionsFilter,
|
|
257
|
-
registrarActionsPrerequisites: () => registrarActionsPrerequisites,
|
|
258
262
|
reverseName: () => reverseName,
|
|
259
263
|
scaleBigintByNumber: () => scaleBigintByNumber,
|
|
260
264
|
scalePrice: () => scalePrice,
|
|
@@ -527,16 +531,16 @@ var uint256ToHex32 = (num) => (0, import_viem6.toHex)(num, { size: 32 });
|
|
|
527
531
|
var import_datasources = require("@ensnode/datasources");
|
|
528
532
|
|
|
529
533
|
// src/ensapi/config/deserialize.ts
|
|
530
|
-
var
|
|
534
|
+
var import_v47 = require("zod/v4");
|
|
531
535
|
|
|
532
536
|
// src/ensindexer/config/deserialize.ts
|
|
533
|
-
var
|
|
537
|
+
var import_v44 = require("zod/v4");
|
|
534
538
|
|
|
535
539
|
// src/ensindexer/config/zod-schemas.ts
|
|
536
|
-
var
|
|
540
|
+
var import_v43 = require("zod/v4");
|
|
537
541
|
|
|
538
|
-
// src/
|
|
539
|
-
var
|
|
542
|
+
// src/ensrainbow/zod-schemas/config.ts
|
|
543
|
+
var import_v42 = require("zod/v4");
|
|
540
544
|
|
|
541
545
|
// src/shared/zod-schemas.ts
|
|
542
546
|
var import_caip = require("caip");
|
|
@@ -819,6 +823,29 @@ var makeReinterpretedNameSchema = (valueLabel = "Reinterpreted Name") => import_
|
|
|
819
823
|
}
|
|
820
824
|
}).transform(reinterpretName);
|
|
821
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
|
+
|
|
822
849
|
// src/ensindexer/config/is-subgraph-compatible.ts
|
|
823
850
|
var import_datasources3 = require("@ensnode/datasources");
|
|
824
851
|
|
|
@@ -844,6 +871,35 @@ function isSubgraphCompatible(config) {
|
|
|
844
871
|
return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
|
|
845
872
|
}
|
|
846
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
|
+
|
|
847
903
|
// src/ensindexer/config/validations.ts
|
|
848
904
|
function invariant_ensDbVersionIsSameAsEnsIndexerVersion(ctx) {
|
|
849
905
|
const versionInfo = ctx.value;
|
|
@@ -857,32 +913,24 @@ function invariant_ensDbVersionIsSameAsEnsIndexerVersion(ctx) {
|
|
|
857
913
|
}
|
|
858
914
|
|
|
859
915
|
// src/ensindexer/config/zod-schemas.ts
|
|
860
|
-
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, {
|
|
861
917
|
error: `${valueLabel} must be a set with at least one chain ID.`
|
|
862
918
|
});
|
|
863
|
-
var makeSerializedIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") =>
|
|
919
|
+
var makeSerializedIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => import_v43.z.array(makeChainIdSchema(valueLabel), {
|
|
864
920
|
error: `${valueLabel} must be an array.`
|
|
865
921
|
}).min(1, {
|
|
866
922
|
error: `${valueLabel} must be an array with at least one chain ID.`
|
|
867
923
|
});
|
|
868
|
-
var makePluginsListSchema = (valueLabel = "Plugins") =>
|
|
924
|
+
var makePluginsListSchema = (valueLabel = "Plugins") => import_v43.z.array(import_v43.z.string(), {
|
|
869
925
|
error: `${valueLabel} must be a list of strings.`
|
|
870
926
|
}).min(1, {
|
|
871
927
|
error: `${valueLabel} must be a list of strings with at least one string value`
|
|
872
928
|
}).refine((arr) => arr.length === uniq(arr).length, {
|
|
873
929
|
error: `${valueLabel} cannot contain duplicate values.`
|
|
874
930
|
});
|
|
875
|
-
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({
|
|
876
932
|
error: `${valueLabel} is required and must be a non-empty string.`
|
|
877
933
|
});
|
|
878
|
-
var makeLabelSetIdSchema = (valueLabel) => {
|
|
879
|
-
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-]+$/, {
|
|
880
|
-
error: `${valueLabel} can only contain lowercase letters (a-z) and hyphens (-)`
|
|
881
|
-
});
|
|
882
|
-
};
|
|
883
|
-
var makeLabelSetVersionSchema = (valueLabel) => {
|
|
884
|
-
return import_v42.z.coerce.number({ error: `${valueLabel} must be an integer.` }).pipe(makeNonNegativeIntegerSchema(valueLabel));
|
|
885
|
-
};
|
|
886
934
|
var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
|
|
887
935
|
let valueLabelLabelSetId = valueLabel;
|
|
888
936
|
let valueLabelLabelSetVersion = valueLabel;
|
|
@@ -893,21 +941,19 @@ var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
|
|
|
893
941
|
valueLabelLabelSetId = `${valueLabel}.labelSetId`;
|
|
894
942
|
valueLabelLabelSetVersion = `${valueLabel}.labelSetVersion`;
|
|
895
943
|
}
|
|
896
|
-
return
|
|
944
|
+
return import_v43.z.object({
|
|
897
945
|
labelSetId: makeLabelSetIdSchema(valueLabelLabelSetId),
|
|
898
946
|
labelSetVersion: makeLabelSetVersionSchema(valueLabelLabelSetVersion)
|
|
899
947
|
});
|
|
900
948
|
};
|
|
901
|
-
var makeNonEmptyStringSchema = (valueLabel = "Value") =>
|
|
902
|
-
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(
|
|
903
951
|
{
|
|
904
952
|
nodejs: makeNonEmptyStringSchema(),
|
|
905
953
|
ponder: makeNonEmptyStringSchema(),
|
|
906
954
|
ensDb: makeNonEmptyStringSchema(),
|
|
907
955
|
ensIndexer: makeNonEmptyStringSchema(),
|
|
908
|
-
ensNormalize: makeNonEmptyStringSchema()
|
|
909
|
-
ensRainbow: makeNonEmptyStringSchema(),
|
|
910
|
-
ensRainbowSchema: makePositiveIntegerSchema()
|
|
956
|
+
ensNormalize: makeNonEmptyStringSchema()
|
|
911
957
|
},
|
|
912
958
|
{
|
|
913
959
|
error: `${valueLabel} must be a valid ENSIndexerVersionInfo object.`
|
|
@@ -923,26 +969,46 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
923
969
|
});
|
|
924
970
|
}
|
|
925
971
|
}
|
|
926
|
-
|
|
927
|
-
|
|
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
|
+
),
|
|
928
991
|
indexedChainIds: makeIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
|
|
929
|
-
isSubgraphCompatible:
|
|
992
|
+
isSubgraphCompatible: import_v43.z.boolean({
|
|
930
993
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
931
994
|
}),
|
|
995
|
+
labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
|
|
932
996
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
933
997
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
934
|
-
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
935
998
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
936
|
-
}).check(invariant_isSubgraphCompatibleRequirements);
|
|
937
|
-
var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIndexerPublicConfig") =>
|
|
938
|
-
|
|
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
|
+
),
|
|
939
1005
|
indexedChainIds: makeSerializedIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
|
|
940
|
-
isSubgraphCompatible:
|
|
1006
|
+
isSubgraphCompatible: import_v43.z.boolean({
|
|
941
1007
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
942
1008
|
}),
|
|
1009
|
+
labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
|
|
943
1010
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
944
1011
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
945
|
-
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
946
1012
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
947
1013
|
});
|
|
948
1014
|
|
|
@@ -957,7 +1023,7 @@ function deserializeEnsIndexerPublicConfig(maybePublicConfig, valueLabel) {
|
|
|
957
1023
|
const parsed = makeSerializedEnsIndexerPublicConfigSchema(valueLabel).transform(buildUnvalidatedEnsIndexerPublicConfig).pipe(makeEnsIndexerPublicConfigSchema(valueLabel)).safeParse(maybePublicConfig);
|
|
958
1024
|
if (parsed.error) {
|
|
959
1025
|
throw new Error(`Cannot deserialize EnsIndexerPublicConfig:
|
|
960
|
-
${(0,
|
|
1026
|
+
${(0, import_v44.prettifyError)(parsed.error)}
|
|
961
1027
|
`);
|
|
962
1028
|
}
|
|
963
1029
|
return parsed.data;
|
|
@@ -965,22 +1031,22 @@ ${(0, import_v43.prettifyError)(parsed.error)}
|
|
|
965
1031
|
var deserializeENSIndexerPublicConfig = deserializeEnsIndexerPublicConfig;
|
|
966
1032
|
|
|
967
1033
|
// src/ensapi/config/zod-schemas.ts
|
|
968
|
-
var
|
|
1034
|
+
var import_v46 = require("zod/v4");
|
|
969
1035
|
|
|
970
1036
|
// src/shared/config/thegraph.ts
|
|
971
|
-
var
|
|
972
|
-
var TheGraphCannotFallbackReasonSchema =
|
|
1037
|
+
var import_v45 = require("zod/v4");
|
|
1038
|
+
var TheGraphCannotFallbackReasonSchema = import_v45.z.enum({
|
|
973
1039
|
NotSubgraphCompatible: "not-subgraph-compatible",
|
|
974
1040
|
NoApiKey: "no-api-key",
|
|
975
1041
|
NoSubgraphUrl: "no-subgraph-url"
|
|
976
1042
|
});
|
|
977
|
-
var TheGraphFallbackSchema =
|
|
978
|
-
|
|
979
|
-
canFallback:
|
|
980
|
-
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()
|
|
981
1047
|
}),
|
|
982
|
-
|
|
983
|
-
canFallback:
|
|
1048
|
+
import_v45.z.strictObject({
|
|
1049
|
+
canFallback: import_v45.z.literal(false),
|
|
984
1050
|
reason: TheGraphCannotFallbackReasonSchema
|
|
985
1051
|
})
|
|
986
1052
|
]);
|
|
@@ -988,8 +1054,8 @@ var TheGraphFallbackSchema = import_v44.z.discriminatedUnion("canFallback", [
|
|
|
988
1054
|
// src/ensapi/config/zod-schemas.ts
|
|
989
1055
|
function makeEnsApiPublicConfigSchema(valueLabel) {
|
|
990
1056
|
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
991
|
-
return
|
|
992
|
-
version:
|
|
1057
|
+
return import_v46.z.object({
|
|
1058
|
+
version: import_v46.z.string().min(1, `${label}.version must be a non-empty string`),
|
|
993
1059
|
theGraphFallback: TheGraphFallbackSchema,
|
|
994
1060
|
ensIndexerPublicConfig: makeEnsIndexerPublicConfigSchema(`${label}.ensIndexerPublicConfig`)
|
|
995
1061
|
});
|
|
@@ -997,8 +1063,8 @@ function makeEnsApiPublicConfigSchema(valueLabel) {
|
|
|
997
1063
|
var makeENSApiPublicConfigSchema = makeEnsApiPublicConfigSchema;
|
|
998
1064
|
function makeSerializedEnsApiPublicConfigSchema(valueLabel) {
|
|
999
1065
|
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
1000
|
-
return
|
|
1001
|
-
version:
|
|
1066
|
+
return import_v46.z.object({
|
|
1067
|
+
version: import_v46.z.string().min(1, `${label}.version must be a non-empty string`),
|
|
1002
1068
|
theGraphFallback: TheGraphFallbackSchema,
|
|
1003
1069
|
ensIndexerPublicConfig: makeSerializedEnsIndexerPublicConfigSchema(
|
|
1004
1070
|
`${label}.ensIndexerPublicConfig`
|
|
@@ -1019,7 +1085,7 @@ function deserializeEnsApiPublicConfig(maybePublicConfig, valueLabel) {
|
|
|
1019
1085
|
const parsed = makeSerializedEnsApiPublicConfigSchema(valueLabel).transform(buildUnvalidatedEnsApiPublicConfig).pipe(makeEnsApiPublicConfigSchema(valueLabel)).safeParse(maybePublicConfig);
|
|
1020
1086
|
if (parsed.error) {
|
|
1021
1087
|
throw new Error(`Cannot deserialize EnsApiPublicConfig:
|
|
1022
|
-
${(0,
|
|
1088
|
+
${(0, import_v47.prettifyError)(parsed.error)}
|
|
1023
1089
|
`);
|
|
1024
1090
|
}
|
|
1025
1091
|
return parsed.data;
|
|
@@ -1038,19 +1104,21 @@ function serializeIndexedChainIds(indexedChainIds) {
|
|
|
1038
1104
|
}
|
|
1039
1105
|
function serializeEnsIndexerPublicConfig(config) {
|
|
1040
1106
|
const {
|
|
1041
|
-
labelSet,
|
|
1042
|
-
indexedChainIds,
|
|
1043
1107
|
databaseSchemaName,
|
|
1108
|
+
ensRainbowPublicConfig,
|
|
1109
|
+
indexedChainIds,
|
|
1044
1110
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
1111
|
+
labelSet,
|
|
1045
1112
|
namespace,
|
|
1046
1113
|
plugins,
|
|
1047
1114
|
versionInfo
|
|
1048
1115
|
} = config;
|
|
1049
1116
|
return {
|
|
1050
|
-
labelSet,
|
|
1051
|
-
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
1052
1117
|
databaseSchemaName,
|
|
1118
|
+
ensRainbowPublicConfig,
|
|
1119
|
+
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
1053
1120
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
1121
|
+
labelSet,
|
|
1054
1122
|
namespace,
|
|
1055
1123
|
plugins,
|
|
1056
1124
|
versionInfo
|
|
@@ -1076,16 +1144,16 @@ function serializeEnsApiConfigResponse(response) {
|
|
|
1076
1144
|
var serializeConfigResponse = serializeEnsApiConfigResponse;
|
|
1077
1145
|
|
|
1078
1146
|
// src/ensapi/api/indexing-status/deserialize.ts
|
|
1079
|
-
var
|
|
1147
|
+
var import_v418 = require("zod/v4");
|
|
1080
1148
|
|
|
1081
1149
|
// src/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
1082
|
-
var
|
|
1150
|
+
var import_v416 = require("zod/v4");
|
|
1083
1151
|
|
|
1084
1152
|
// src/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
1085
|
-
var
|
|
1153
|
+
var import_v413 = require("zod/v4");
|
|
1086
1154
|
|
|
1087
1155
|
// src/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
|
|
1088
|
-
var
|
|
1156
|
+
var import_v412 = require("zod/v4");
|
|
1089
1157
|
|
|
1090
1158
|
// src/shared/block-ref.ts
|
|
1091
1159
|
function isBefore(blockA, blockB) {
|
|
@@ -1265,13 +1333,13 @@ function sortChainStatusesByStartBlockAsc(chains) {
|
|
|
1265
1333
|
}
|
|
1266
1334
|
|
|
1267
1335
|
// src/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
|
|
1268
|
-
var
|
|
1336
|
+
var import_v48 = require("zod/v4");
|
|
1269
1337
|
function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1270
1338
|
const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
|
|
1271
1339
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1272
1340
|
if (parsed.error) {
|
|
1273
1341
|
throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
|
|
1274
|
-
${(0,
|
|
1342
|
+
${(0, import_v48.prettifyError)(parsed.error)}
|
|
1275
1343
|
`);
|
|
1276
1344
|
}
|
|
1277
1345
|
return parsed.data;
|
|
@@ -1315,16 +1383,16 @@ function buildCrossChainIndexingStatusSnapshotOmnichain(omnichainSnapshot, snaps
|
|
|
1315
1383
|
}
|
|
1316
1384
|
|
|
1317
1385
|
// src/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1318
|
-
var
|
|
1386
|
+
var import_v411 = require("zod/v4");
|
|
1319
1387
|
|
|
1320
1388
|
// src/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
1321
|
-
var
|
|
1389
|
+
var import_v49 = require("zod/v4");
|
|
1322
1390
|
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1323
1391
|
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
1324
1392
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1325
1393
|
if (parsed.error) {
|
|
1326
1394
|
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
1327
|
-
${(0,
|
|
1395
|
+
${(0, import_v49.prettifyError)(parsed.error)}
|
|
1328
1396
|
`);
|
|
1329
1397
|
}
|
|
1330
1398
|
return parsed.data;
|
|
@@ -1454,7 +1522,7 @@ function buildOmnichainIndexingStatusSnapshot(chainStatusSnapshots) {
|
|
|
1454
1522
|
}
|
|
1455
1523
|
|
|
1456
1524
|
// src/indexing-status/zod-schema/chain-indexing-status-snapshot.ts
|
|
1457
|
-
var
|
|
1525
|
+
var import_v410 = require("zod/v4");
|
|
1458
1526
|
function invariant_chainSnapshotQueuedBlocks(ctx) {
|
|
1459
1527
|
const { config } = ctx.value;
|
|
1460
1528
|
if (config.rangeType === RangeTypeIds.LeftBounded) {
|
|
@@ -1529,29 +1597,29 @@ function invariant_chainSnapshotFollowingBlocks(ctx) {
|
|
|
1529
1597
|
});
|
|
1530
1598
|
}
|
|
1531
1599
|
}
|
|
1532
|
-
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") =>
|
|
1533
|
-
chainStatus:
|
|
1534
|
-
config:
|
|
1535
|
-
|
|
1536
|
-
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),
|
|
1537
1605
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1538
1606
|
}),
|
|
1539
|
-
|
|
1540
|
-
rangeType:
|
|
1607
|
+
import_v410.z.object({
|
|
1608
|
+
rangeType: import_v410.z.literal(RangeTypeIds.Bounded),
|
|
1541
1609
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1542
1610
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1543
1611
|
})
|
|
1544
1612
|
])
|
|
1545
1613
|
}).check(invariant_chainSnapshotQueuedBlocks);
|
|
1546
|
-
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") =>
|
|
1547
|
-
chainStatus:
|
|
1548
|
-
config:
|
|
1549
|
-
|
|
1550
|
-
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),
|
|
1551
1619
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1552
1620
|
}),
|
|
1553
|
-
|
|
1554
|
-
rangeType:
|
|
1621
|
+
import_v410.z.object({
|
|
1622
|
+
rangeType: import_v410.z.literal(RangeTypeIds.Bounded),
|
|
1555
1623
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1556
1624
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1557
1625
|
})
|
|
@@ -1559,25 +1627,25 @@ var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => im
|
|
|
1559
1627
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1560
1628
|
backfillEndBlock: makeBlockRefSchema(valueLabel)
|
|
1561
1629
|
}).check(invariant_chainSnapshotBackfillBlocks);
|
|
1562
|
-
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") =>
|
|
1563
|
-
chainStatus:
|
|
1564
|
-
config:
|
|
1565
|
-
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),
|
|
1566
1634
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1567
1635
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1568
1636
|
}),
|
|
1569
1637
|
latestIndexedBlock: makeBlockRefSchema(valueLabel)
|
|
1570
1638
|
}).check(invariant_chainSnapshotCompletedBlocks);
|
|
1571
|
-
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") =>
|
|
1572
|
-
chainStatus:
|
|
1573
|
-
config:
|
|
1574
|
-
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),
|
|
1575
1643
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1576
1644
|
}),
|
|
1577
1645
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1578
1646
|
latestKnownBlock: makeBlockRefSchema(valueLabel)
|
|
1579
1647
|
}).check(invariant_chainSnapshotFollowingBlocks);
|
|
1580
|
-
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1648
|
+
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v410.z.discriminatedUnion("chainStatus", [
|
|
1581
1649
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1582
1650
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1583
1651
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1706,11 +1774,11 @@ function invariant_omnichainStatusSnapshotFollowingHasValidChains(ctx) {
|
|
|
1706
1774
|
});
|
|
1707
1775
|
}
|
|
1708
1776
|
}
|
|
1709
|
-
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1710
|
-
omnichainStatus:
|
|
1711
|
-
chains:
|
|
1777
|
+
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v411.z.object({
|
|
1778
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1779
|
+
chains: import_v411.z.map(
|
|
1712
1780
|
makeChainIdSchema(),
|
|
1713
|
-
|
|
1781
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1714
1782
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1715
1783
|
]),
|
|
1716
1784
|
{
|
|
@@ -1719,11 +1787,11 @@ var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_
|
|
|
1719
1787
|
),
|
|
1720
1788
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1721
1789
|
}).check(invariant_omnichainSnapshotUnstartedHasValidChains);
|
|
1722
|
-
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1723
|
-
omnichainStatus:
|
|
1724
|
-
chains:
|
|
1790
|
+
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v411.z.object({
|
|
1791
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1792
|
+
chains: import_v411.z.map(
|
|
1725
1793
|
makeChainIdSchema(),
|
|
1726
|
-
|
|
1794
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1727
1795
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1728
1796
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1729
1797
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1734,11 +1802,11 @@ var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v
|
|
|
1734
1802
|
),
|
|
1735
1803
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1736
1804
|
}).check(invariant_omnichainStatusSnapshotBackfillHasValidChains);
|
|
1737
|
-
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1738
|
-
omnichainStatus:
|
|
1739
|
-
chains:
|
|
1805
|
+
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v411.z.object({
|
|
1806
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1807
|
+
chains: import_v411.z.map(
|
|
1740
1808
|
makeChainIdSchema(),
|
|
1741
|
-
|
|
1809
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1742
1810
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1743
1811
|
]),
|
|
1744
1812
|
{
|
|
@@ -1747,11 +1815,11 @@ var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_
|
|
|
1747
1815
|
),
|
|
1748
1816
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1749
1817
|
}).check(invariant_omnichainStatusSnapshotCompletedHasValidChains);
|
|
1750
|
-
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1751
|
-
omnichainStatus:
|
|
1752
|
-
chains:
|
|
1818
|
+
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v411.z.object({
|
|
1819
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1820
|
+
chains: import_v411.z.map(
|
|
1753
1821
|
makeChainIdSchema(),
|
|
1754
|
-
|
|
1822
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1755
1823
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1756
1824
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1757
1825
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1763,7 +1831,7 @@ var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_
|
|
|
1763
1831
|
),
|
|
1764
1832
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1765
1833
|
}).check(invariant_omnichainStatusSnapshotFollowingHasValidChains);
|
|
1766
|
-
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") =>
|
|
1834
|
+
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v411.z.discriminatedUnion("omnichainStatus", [
|
|
1767
1835
|
makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1768
1836
|
makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1769
1837
|
makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1771,21 +1839,21 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
|
|
|
1771
1839
|
]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
|
|
1772
1840
|
invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
|
|
1773
1841
|
).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
|
|
1774
|
-
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1775
|
-
omnichainStatus:
|
|
1776
|
-
chains:
|
|
1842
|
+
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v411.z.object({
|
|
1843
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1844
|
+
chains: import_v411.z.record(
|
|
1777
1845
|
makeChainIdStringSchema(),
|
|
1778
|
-
|
|
1846
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1779
1847
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1780
1848
|
])
|
|
1781
1849
|
),
|
|
1782
1850
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1783
1851
|
});
|
|
1784
|
-
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1785
|
-
omnichainStatus:
|
|
1786
|
-
chains:
|
|
1852
|
+
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v411.z.object({
|
|
1853
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1854
|
+
chains: import_v411.z.record(
|
|
1787
1855
|
makeChainIdStringSchema(),
|
|
1788
|
-
|
|
1856
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1789
1857
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1790
1858
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1791
1859
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1793,21 +1861,21 @@ var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =
|
|
|
1793
1861
|
),
|
|
1794
1862
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1795
1863
|
});
|
|
1796
|
-
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1797
|
-
omnichainStatus:
|
|
1798
|
-
chains:
|
|
1864
|
+
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v411.z.object({
|
|
1865
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1866
|
+
chains: import_v411.z.record(
|
|
1799
1867
|
makeChainIdStringSchema(),
|
|
1800
|
-
|
|
1868
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1801
1869
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1802
1870
|
])
|
|
1803
1871
|
),
|
|
1804
1872
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1805
1873
|
});
|
|
1806
|
-
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1807
|
-
omnichainStatus:
|
|
1808
|
-
chains:
|
|
1874
|
+
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v411.z.object({
|
|
1875
|
+
omnichainStatus: import_v411.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1876
|
+
chains: import_v411.z.record(
|
|
1809
1877
|
makeChainIdStringSchema(),
|
|
1810
|
-
|
|
1878
|
+
import_v411.z.discriminatedUnion("chainStatus", [
|
|
1811
1879
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1812
1880
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1813
1881
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1816,7 +1884,7 @@ var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel)
|
|
|
1816
1884
|
),
|
|
1817
1885
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1818
1886
|
});
|
|
1819
|
-
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1887
|
+
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v411.z.discriminatedUnion("omnichainStatus", [
|
|
1820
1888
|
makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1821
1889
|
makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1822
1890
|
makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1856,17 +1924,17 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1856
1924
|
});
|
|
1857
1925
|
}
|
|
1858
1926
|
}
|
|
1859
|
-
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") =>
|
|
1860
|
-
strategy:
|
|
1927
|
+
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v412.z.object({
|
|
1928
|
+
strategy: import_v412.z.literal(CrossChainIndexingStrategyIds.Omnichain),
|
|
1861
1929
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1862
1930
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1863
1931
|
omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1864
1932
|
}).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
|
|
1865
|
-
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") =>
|
|
1933
|
+
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v412.z.discriminatedUnion("strategy", [
|
|
1866
1934
|
makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
|
|
1867
1935
|
]);
|
|
1868
|
-
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") =>
|
|
1869
|
-
strategy:
|
|
1936
|
+
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") => import_v412.z.object({
|
|
1937
|
+
strategy: import_v412.z.enum(CrossChainIndexingStrategyIds),
|
|
1870
1938
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1871
1939
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1872
1940
|
omnichainSnapshot: makeSerializedOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
@@ -1896,22 +1964,22 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
|
|
|
1896
1964
|
});
|
|
1897
1965
|
}
|
|
1898
1966
|
}
|
|
1899
|
-
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") =>
|
|
1967
|
+
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v413.z.object({
|
|
1900
1968
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1901
1969
|
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1902
1970
|
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
1903
1971
|
}).check(invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime).check(invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect);
|
|
1904
|
-
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") =>
|
|
1972
|
+
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") => import_v413.z.object({
|
|
1905
1973
|
snapshot: makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel),
|
|
1906
1974
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1907
1975
|
worstCaseDistance: makeDurationSchema(valueLabel)
|
|
1908
1976
|
});
|
|
1909
1977
|
|
|
1910
1978
|
// src/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1911
|
-
var
|
|
1979
|
+
var import_v415 = require("zod/v4");
|
|
1912
1980
|
|
|
1913
1981
|
// src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
|
|
1914
|
-
var
|
|
1982
|
+
var import_v414 = require("zod/v4");
|
|
1915
1983
|
function buildUnvalidatedOmnichainIndexingStatusSnapshot(serializedSnapshot) {
|
|
1916
1984
|
const chains = /* @__PURE__ */ new Map();
|
|
1917
1985
|
for (const [chainIdString, chainIndexingStatusSnapshot] of Object.entries(
|
|
@@ -1932,7 +2000,7 @@ function deserializeOmnichainIndexingStatusSnapshot(data, valueLabel) {
|
|
|
1932
2000
|
if (parsed.error) {
|
|
1933
2001
|
throw new Error(
|
|
1934
2002
|
`Cannot deserialize into OmnichainIndexingStatusSnapshot:
|
|
1935
|
-
${(0,
|
|
2003
|
+
${(0, import_v414.prettifyError)(parsed.error)}
|
|
1936
2004
|
`
|
|
1937
2005
|
);
|
|
1938
2006
|
}
|
|
@@ -1954,7 +2022,7 @@ function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel)
|
|
|
1954
2022
|
if (parsed.error) {
|
|
1955
2023
|
throw new Error(
|
|
1956
2024
|
`Cannot deserialize into CrossChainIndexingStatusSnapshot:
|
|
1957
|
-
${(0,
|
|
2025
|
+
${(0, import_v415.prettifyError)(parsed.error)}
|
|
1958
2026
|
`
|
|
1959
2027
|
);
|
|
1960
2028
|
}
|
|
@@ -1974,7 +2042,7 @@ function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel
|
|
|
1974
2042
|
if (parsed.error) {
|
|
1975
2043
|
throw new Error(
|
|
1976
2044
|
`Cannot deserialize into RealtimeIndexingStatusProjection:
|
|
1977
|
-
${(0,
|
|
2045
|
+
${(0, import_v416.prettifyError)(parsed.error)}
|
|
1978
2046
|
`
|
|
1979
2047
|
);
|
|
1980
2048
|
}
|
|
@@ -1995,23 +2063,23 @@ var EnsApiIndexingStatusResponseCodes = {
|
|
|
1995
2063
|
var IndexingStatusResponseCodes = EnsApiIndexingStatusResponseCodes;
|
|
1996
2064
|
|
|
1997
2065
|
// src/ensapi/api/indexing-status/zod-schemas.ts
|
|
1998
|
-
var
|
|
1999
|
-
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
2000
|
-
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),
|
|
2001
2069
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
2002
2070
|
});
|
|
2003
|
-
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
2004
|
-
responseCode:
|
|
2071
|
+
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v417.z.strictObject({
|
|
2072
|
+
responseCode: import_v417.z.literal(EnsApiIndexingStatusResponseCodes.Error)
|
|
2005
2073
|
});
|
|
2006
|
-
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
2074
|
+
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v417.z.discriminatedUnion("responseCode", [
|
|
2007
2075
|
makeEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2008
2076
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2009
2077
|
]);
|
|
2010
|
-
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
2011
|
-
responseCode:
|
|
2078
|
+
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v417.z.strictObject({
|
|
2079
|
+
responseCode: import_v417.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2012
2080
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
2013
2081
|
});
|
|
2014
|
-
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
2082
|
+
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v417.z.discriminatedUnion("responseCode", [
|
|
2015
2083
|
makeSerializedEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2016
2084
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2017
2085
|
]);
|
|
@@ -2033,7 +2101,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
2033
2101
|
if (parsed.error) {
|
|
2034
2102
|
throw new Error(
|
|
2035
2103
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
2036
|
-
${(0,
|
|
2104
|
+
${(0, import_v418.prettifyError)(parsed.error)}
|
|
2037
2105
|
`
|
|
2038
2106
|
);
|
|
2039
2107
|
}
|
|
@@ -2170,11 +2238,11 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2170
2238
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2171
2239
|
|
|
2172
2240
|
// src/ensapi/api/name-tokens/deserialize.ts
|
|
2173
|
-
var
|
|
2241
|
+
var import_v423 = require("zod/v4");
|
|
2174
2242
|
|
|
2175
2243
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2176
2244
|
var import_viem14 = require("viem");
|
|
2177
|
-
var
|
|
2245
|
+
var import_v422 = require("zod/v4");
|
|
2178
2246
|
|
|
2179
2247
|
// src/tokenscope/name-token.ts
|
|
2180
2248
|
var import_viem13 = require("viem");
|
|
@@ -2214,12 +2282,12 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2214
2282
|
|
|
2215
2283
|
// src/tokenscope/assets.ts
|
|
2216
2284
|
var import_viem12 = require("viem");
|
|
2217
|
-
var
|
|
2285
|
+
var import_v420 = require("zod/v4");
|
|
2218
2286
|
|
|
2219
2287
|
// src/tokenscope/zod-schemas.ts
|
|
2220
2288
|
var import_caip3 = require("caip");
|
|
2221
2289
|
var import_viem11 = require("viem");
|
|
2222
|
-
var
|
|
2290
|
+
var import_v419 = require("zod/v4");
|
|
2223
2291
|
|
|
2224
2292
|
// src/shared/types.ts
|
|
2225
2293
|
var AssetNamespaces = {
|
|
@@ -2228,10 +2296,10 @@ var AssetNamespaces = {
|
|
|
2228
2296
|
};
|
|
2229
2297
|
|
|
2230
2298
|
// src/tokenscope/zod-schemas.ts
|
|
2231
|
-
var tokenIdSchemaSerializable =
|
|
2232
|
-
var tokenIdSchemaNative =
|
|
2299
|
+
var tokenIdSchemaSerializable = import_v419.z.string();
|
|
2300
|
+
var tokenIdSchemaNative = import_v419.z.preprocess(
|
|
2233
2301
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2234
|
-
|
|
2302
|
+
import_v419.z.bigint().positive()
|
|
2235
2303
|
);
|
|
2236
2304
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2237
2305
|
if (serializable) {
|
|
@@ -2241,13 +2309,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2241
2309
|
}
|
|
2242
2310
|
}
|
|
2243
2311
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2244
|
-
return
|
|
2245
|
-
assetNamespace:
|
|
2312
|
+
return import_v419.z.object({
|
|
2313
|
+
assetNamespace: import_v419.z.enum(AssetNamespaces),
|
|
2246
2314
|
contract: makeAccountIdSchema(valueLabel),
|
|
2247
2315
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2248
2316
|
});
|
|
2249
2317
|
};
|
|
2250
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2318
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v419.z.preprocess((v) => {
|
|
2251
2319
|
if (typeof v === "string") {
|
|
2252
2320
|
const result = new import_caip3.AssetId(v);
|
|
2253
2321
|
return {
|
|
@@ -2271,20 +2339,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2271
2339
|
});
|
|
2272
2340
|
}
|
|
2273
2341
|
}
|
|
2274
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2275
|
-
ownershipType:
|
|
2342
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v419.z.object({
|
|
2343
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2276
2344
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2277
2345
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2278
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2279
|
-
ownershipType:
|
|
2346
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v419.z.object({
|
|
2347
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2280
2348
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2281
2349
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2282
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2283
|
-
ownershipType:
|
|
2350
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v419.z.object({
|
|
2351
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2284
2352
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2285
2353
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2286
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2287
|
-
ownershipType:
|
|
2354
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v419.z.object({
|
|
2355
|
+
ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2288
2356
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2289
2357
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2290
2358
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2297,16 +2365,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2297
2365
|
});
|
|
2298
2366
|
}
|
|
2299
2367
|
}
|
|
2300
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2368
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v419.z.discriminatedUnion("ownershipType", [
|
|
2301
2369
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2302
2370
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2303
2371
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2304
2372
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2305
2373
|
]);
|
|
2306
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2374
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v419.z.object({
|
|
2307
2375
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2308
2376
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2309
|
-
mintStatus:
|
|
2377
|
+
mintStatus: import_v419.z.enum(NFTMintStatuses)
|
|
2310
2378
|
});
|
|
2311
2379
|
|
|
2312
2380
|
// src/tokenscope/assets.ts
|
|
@@ -2322,7 +2390,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2322
2390
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2323
2391
|
if (parsed.error) {
|
|
2324
2392
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2325
|
-
${(0,
|
|
2393
|
+
${(0, import_v420.prettifyError)(parsed.error)}
|
|
2326
2394
|
`);
|
|
2327
2395
|
}
|
|
2328
2396
|
return parsed.data;
|
|
@@ -2332,7 +2400,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2332
2400
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2333
2401
|
if (parsed.error) {
|
|
2334
2402
|
throw new RangeError(`Cannot parse AssetId:
|
|
2335
|
-
${(0,
|
|
2403
|
+
${(0, import_v420.prettifyError)(parsed.error)}
|
|
2336
2404
|
`);
|
|
2337
2405
|
}
|
|
2338
2406
|
return parsed.data;
|
|
@@ -2632,10 +2700,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2632
2700
|
}
|
|
2633
2701
|
|
|
2634
2702
|
// src/ensapi/api/shared/errors/zod-schemas.ts
|
|
2635
|
-
var
|
|
2636
|
-
var ErrorResponseSchema =
|
|
2637
|
-
message:
|
|
2638
|
-
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())
|
|
2639
2707
|
});
|
|
2640
2708
|
|
|
2641
2709
|
// src/ensapi/api/name-tokens/response.ts
|
|
@@ -2674,10 +2742,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2674
2742
|
};
|
|
2675
2743
|
|
|
2676
2744
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2677
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2745
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v422.z.object({
|
|
2678
2746
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2679
2747
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2680
|
-
tokens:
|
|
2748
|
+
tokens: import_v422.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2681
2749
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2682
2750
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2683
2751
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2719,32 +2787,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2719
2787
|
});
|
|
2720
2788
|
}
|
|
2721
2789
|
});
|
|
2722
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2723
|
-
responseCode:
|
|
2790
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v422.z.strictObject({
|
|
2791
|
+
responseCode: import_v422.z.literal(NameTokensResponseCodes.Ok),
|
|
2724
2792
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2725
2793
|
});
|
|
2726
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2727
|
-
responseCode:
|
|
2728
|
-
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),
|
|
2729
2797
|
error: ErrorResponseSchema
|
|
2730
2798
|
});
|
|
2731
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2732
|
-
responseCode:
|
|
2733
|
-
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),
|
|
2734
2802
|
error: ErrorResponseSchema
|
|
2735
2803
|
});
|
|
2736
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2737
|
-
responseCode:
|
|
2738
|
-
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),
|
|
2739
2807
|
error: ErrorResponseSchema
|
|
2740
2808
|
});
|
|
2741
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
2809
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v422.z.discriminatedUnion("errorCode", [
|
|
2742
2810
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2743
2811
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2744
2812
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2745
2813
|
]);
|
|
2746
2814
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2747
|
-
return
|
|
2815
|
+
return import_v422.z.discriminatedUnion("responseCode", [
|
|
2748
2816
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2749
2817
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2750
2818
|
]);
|
|
@@ -2757,7 +2825,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2757
2825
|
);
|
|
2758
2826
|
if (parsed.error) {
|
|
2759
2827
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2760
|
-
${(0,
|
|
2828
|
+
${(0, import_v423.prettifyError)(parsed.error)}
|
|
2761
2829
|
`);
|
|
2762
2830
|
}
|
|
2763
2831
|
return parsed.data;
|
|
@@ -2831,14 +2899,14 @@ function serializeNameTokensResponse(response) {
|
|
|
2831
2899
|
}
|
|
2832
2900
|
|
|
2833
2901
|
// src/ensapi/api/registrar-actions/deserialize.ts
|
|
2834
|
-
var
|
|
2902
|
+
var import_v427 = require("zod/v4");
|
|
2835
2903
|
|
|
2836
2904
|
// src/ensapi/api/registrar-actions/zod-schemas.ts
|
|
2837
2905
|
var import_ens7 = require("viem/ens");
|
|
2838
|
-
var
|
|
2906
|
+
var import_v426 = require("zod/v4");
|
|
2839
2907
|
|
|
2840
2908
|
// src/registrars/zod-schemas.ts
|
|
2841
|
-
var
|
|
2909
|
+
var import_v424 = require("zod/v4");
|
|
2842
2910
|
|
|
2843
2911
|
// src/registrars/encoded-referrer.ts
|
|
2844
2912
|
var import_viem15 = require("viem");
|
|
@@ -2913,11 +2981,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
2913
2981
|
}
|
|
2914
2982
|
|
|
2915
2983
|
// src/registrars/zod-schemas.ts
|
|
2916
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
2984
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v424.z.object({
|
|
2917
2985
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
2918
2986
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
2919
2987
|
});
|
|
2920
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
2988
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v424.z.object({
|
|
2921
2989
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
2922
2990
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
2923
2991
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -2933,18 +3001,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
2933
3001
|
});
|
|
2934
3002
|
}
|
|
2935
3003
|
}
|
|
2936
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
3004
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v424.z.union([
|
|
2937
3005
|
// pricing available
|
|
2938
|
-
|
|
3006
|
+
import_v424.z.object({
|
|
2939
3007
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
2940
3008
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
2941
3009
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
2942
3010
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
2943
3011
|
// pricing unknown
|
|
2944
|
-
|
|
2945
|
-
baseCost:
|
|
2946
|
-
premium:
|
|
2947
|
-
total:
|
|
3012
|
+
import_v424.z.object({
|
|
3013
|
+
baseCost: import_v424.z.null(),
|
|
3014
|
+
premium: import_v424.z.null(),
|
|
3015
|
+
total: import_v424.z.null()
|
|
2948
3016
|
}).transform((v) => v)
|
|
2949
3017
|
]);
|
|
2950
3018
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -2967,9 +3035,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
2967
3035
|
});
|
|
2968
3036
|
}
|
|
2969
3037
|
}
|
|
2970
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
3038
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v424.z.union([
|
|
2971
3039
|
// referral available
|
|
2972
|
-
|
|
3040
|
+
import_v424.z.object({
|
|
2973
3041
|
encodedReferrer: makeHexStringSchema(
|
|
2974
3042
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
2975
3043
|
`${valueLabel} Encoded Referrer`
|
|
@@ -2977,9 +3045,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
2977
3045
|
decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
2978
3046
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
2979
3047
|
// referral not applicable
|
|
2980
|
-
|
|
2981
|
-
encodedReferrer:
|
|
2982
|
-
decodedReferrer:
|
|
3048
|
+
import_v424.z.object({
|
|
3049
|
+
encodedReferrer: import_v424.z.null(),
|
|
3050
|
+
decodedReferrer: import_v424.z.null()
|
|
2983
3051
|
})
|
|
2984
3052
|
]);
|
|
2985
3053
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -2992,9 +3060,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
2992
3060
|
});
|
|
2993
3061
|
}
|
|
2994
3062
|
}
|
|
2995
|
-
var EventIdSchema =
|
|
2996
|
-
var EventIdsSchema =
|
|
2997
|
-
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({
|
|
2998
3066
|
id: EventIdSchema,
|
|
2999
3067
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
3000
3068
|
registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -3008,38 +3076,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
|
|
|
3008
3076
|
eventIds: EventIdsSchema
|
|
3009
3077
|
}).check(invariant_eventIdsInitialElementIsTheActionId);
|
|
3010
3078
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3011
|
-
type:
|
|
3079
|
+
type: import_v424.z.literal(RegistrarActionTypes.Registration)
|
|
3012
3080
|
});
|
|
3013
3081
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3014
|
-
type:
|
|
3082
|
+
type: import_v424.z.literal(RegistrarActionTypes.Renewal)
|
|
3015
3083
|
});
|
|
3016
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
3084
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v424.z.discriminatedUnion("type", [
|
|
3017
3085
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
3018
3086
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
3019
3087
|
]);
|
|
3020
3088
|
|
|
3021
3089
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
3022
|
-
var
|
|
3090
|
+
var import_v425 = require("zod/v4");
|
|
3023
3091
|
|
|
3024
3092
|
// src/ensapi/api/shared/pagination/request.ts
|
|
3025
3093
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
3026
3094
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
3027
3095
|
|
|
3028
3096
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
3029
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3097
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v425.z.object({
|
|
3030
3098
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
3031
3099
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
3032
3100
|
RECORDS_PER_PAGE_MAX,
|
|
3033
3101
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
3034
3102
|
)
|
|
3035
3103
|
});
|
|
3036
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
3037
|
-
totalRecords:
|
|
3038
|
-
totalPages:
|
|
3039
|
-
hasNext:
|
|
3040
|
-
hasPrev:
|
|
3041
|
-
startIndex:
|
|
3042
|
-
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()
|
|
3043
3111
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
3044
3112
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
3045
3113
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -3074,15 +3142,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
3074
3142
|
});
|
|
3075
3143
|
}
|
|
3076
3144
|
}
|
|
3077
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3145
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v425.z.object({
|
|
3078
3146
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3079
3147
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3080
|
-
hasNext:
|
|
3081
|
-
hasPrev:
|
|
3148
|
+
hasNext: import_v425.z.boolean(),
|
|
3149
|
+
hasPrev: import_v425.z.boolean(),
|
|
3082
3150
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
3083
3151
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
3084
3152
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
3085
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3153
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v425.z.union([
|
|
3086
3154
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
3087
3155
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
3088
3156
|
]);
|
|
@@ -3112,21 +3180,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3112
3180
|
});
|
|
3113
3181
|
}
|
|
3114
3182
|
}
|
|
3115
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3183
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v426.z.object({
|
|
3116
3184
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3117
3185
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3118
3186
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3119
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3120
|
-
responseCode:
|
|
3121
|
-
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)),
|
|
3122
3190
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3123
3191
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
|
|
3124
3192
|
});
|
|
3125
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3126
|
-
responseCode:
|
|
3193
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v426.z.strictObject({
|
|
3194
|
+
responseCode: import_v426.z.literal(RegistrarActionsResponseCodes.Error),
|
|
3127
3195
|
error: ErrorResponseSchema
|
|
3128
3196
|
});
|
|
3129
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3197
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v426.z.discriminatedUnion("responseCode", [
|
|
3130
3198
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3131
3199
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3132
3200
|
]);
|
|
@@ -3137,7 +3205,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3137
3205
|
if (parsed.error) {
|
|
3138
3206
|
throw new Error(
|
|
3139
3207
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3140
|
-
${(0,
|
|
3208
|
+
${(0, import_v427.prettifyError)(parsed.error)}
|
|
3141
3209
|
`
|
|
3142
3210
|
);
|
|
3143
3211
|
}
|
|
@@ -3210,54 +3278,36 @@ var registrarActionsFilter = {
|
|
|
3210
3278
|
};
|
|
3211
3279
|
|
|
3212
3280
|
// src/ensapi/api/registrar-actions/prerequisites.ts
|
|
3213
|
-
var
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
)
|
|
3241
|
-
}
|
|
3242
|
-
|
|
3243
|
-
* Required Indexing Status IDs
|
|
3244
|
-
*
|
|
3245
|
-
* Database indexes are created by the time the omnichain indexing status
|
|
3246
|
-
* is either `completed` or `following`.
|
|
3247
|
-
*/
|
|
3248
|
-
supportedIndexingStatusIds: [
|
|
3249
|
-
OmnichainIndexingStatusIds.Completed,
|
|
3250
|
-
OmnichainIndexingStatusIds.Following
|
|
3251
|
-
],
|
|
3252
|
-
/**
|
|
3253
|
-
* Check if provided indexing status supports the Registrar Actions API.
|
|
3254
|
-
*/
|
|
3255
|
-
hasIndexingStatusSupport(omnichainIndexingStatusId) {
|
|
3256
|
-
return registrarActionsPrerequisites.supportedIndexingStatusIds.some(
|
|
3257
|
-
(supportedIndexingStatusId) => supportedIndexingStatusId === omnichainIndexingStatusId
|
|
3258
|
-
);
|
|
3259
|
-
}
|
|
3260
|
-
});
|
|
3281
|
+
var registrarActionsRequiredPlugins = [
|
|
3282
|
+
"subgraph" /* Subgraph */,
|
|
3283
|
+
"basenames" /* Basenames */,
|
|
3284
|
+
"lineanames" /* Lineanames */,
|
|
3285
|
+
"registrars" /* Registrars */
|
|
3286
|
+
];
|
|
3287
|
+
function hasRegistrarActionsConfigSupport(config) {
|
|
3288
|
+
const supported = registrarActionsRequiredPlugins.every(
|
|
3289
|
+
(plugin) => config.plugins.includes(plugin)
|
|
3290
|
+
);
|
|
3291
|
+
if (supported) return { supported };
|
|
3292
|
+
return {
|
|
3293
|
+
supported: false,
|
|
3294
|
+
reason: `The Registrar Actions API requires all of the following plugins to be activated in the connected ENSNode's Config: ${registrarActionsRequiredPlugins.map((plugin) => `'${plugin}'`).join(", ")}.`
|
|
3295
|
+
};
|
|
3296
|
+
}
|
|
3297
|
+
var registrarActionsSupportedIndexingStatusIds = [
|
|
3298
|
+
OmnichainIndexingStatusIds.Completed,
|
|
3299
|
+
OmnichainIndexingStatusIds.Following
|
|
3300
|
+
];
|
|
3301
|
+
function hasRegistrarActionsIndexingStatusSupport(omnichainIndexingStatusId) {
|
|
3302
|
+
const supported = registrarActionsSupportedIndexingStatusIds.some(
|
|
3303
|
+
(supportedIndexingStatusId) => supportedIndexingStatusId === omnichainIndexingStatusId
|
|
3304
|
+
);
|
|
3305
|
+
if (supported) return { supported };
|
|
3306
|
+
return {
|
|
3307
|
+
supported: false,
|
|
3308
|
+
reason: `The Registrar Actions API requires the connected ENSNode's Indexing Status to be one of the following: ${registrarActionsSupportedIndexingStatusIds.join(", ")}.`
|
|
3309
|
+
};
|
|
3310
|
+
}
|
|
3261
3311
|
|
|
3262
3312
|
// src/ensapi/api/registrar-actions/serialize.ts
|
|
3263
3313
|
function serializeNamedRegistrarAction({
|
|
@@ -3284,12 +3334,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3284
3334
|
}
|
|
3285
3335
|
|
|
3286
3336
|
// src/ensapi/api/shared/errors/deserialize.ts
|
|
3287
|
-
var
|
|
3337
|
+
var import_v428 = require("zod/v4");
|
|
3288
3338
|
function deserializeErrorResponse(maybeErrorResponse) {
|
|
3289
3339
|
const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
|
|
3290
3340
|
if (parsed.error) {
|
|
3291
3341
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3292
|
-
${(0,
|
|
3342
|
+
${(0, import_v428.prettifyError)(parsed.error)}
|
|
3293
3343
|
`);
|
|
3294
3344
|
}
|
|
3295
3345
|
return parsed.data;
|
|
@@ -3849,7 +3899,7 @@ function serializeEnsIndexerConfigResponse(response) {
|
|
|
3849
3899
|
}
|
|
3850
3900
|
|
|
3851
3901
|
// src/ensindexer/api/indexing-status/deserialize.ts
|
|
3852
|
-
var
|
|
3902
|
+
var import_v430 = require("zod/v4");
|
|
3853
3903
|
|
|
3854
3904
|
// src/ensindexer/api/indexing-status/response.ts
|
|
3855
3905
|
var EnsIndexerIndexingStatusResponseCodes = {
|
|
@@ -3864,23 +3914,23 @@ var EnsIndexerIndexingStatusResponseCodes = {
|
|
|
3864
3914
|
};
|
|
3865
3915
|
|
|
3866
3916
|
// src/ensindexer/api/indexing-status/zod-schemas.ts
|
|
3867
|
-
var
|
|
3868
|
-
var makeEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
3869
|
-
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),
|
|
3870
3920
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3871
3921
|
});
|
|
3872
|
-
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
3873
|
-
responseCode:
|
|
3922
|
+
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v429.z.strictObject({
|
|
3923
|
+
responseCode: import_v429.z.literal(EnsIndexerIndexingStatusResponseCodes.Error)
|
|
3874
3924
|
});
|
|
3875
|
-
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
3925
|
+
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v429.z.discriminatedUnion("responseCode", [
|
|
3876
3926
|
makeEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3877
3927
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3878
3928
|
]);
|
|
3879
|
-
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
3880
|
-
responseCode:
|
|
3929
|
+
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v429.z.strictObject({
|
|
3930
|
+
responseCode: import_v429.z.literal(EnsIndexerIndexingStatusResponseCodes.Ok),
|
|
3881
3931
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3882
3932
|
});
|
|
3883
|
-
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
3933
|
+
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v429.z.discriminatedUnion("responseCode", [
|
|
3884
3934
|
makeSerializedEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3885
3935
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3886
3936
|
]);
|
|
@@ -3902,7 +3952,7 @@ function deserializeEnsIndexerIndexingStatusResponse(maybeResponse) {
|
|
|
3902
3952
|
if (parsed.error) {
|
|
3903
3953
|
throw new Error(
|
|
3904
3954
|
`Cannot deserialize EnsIndexerIndexingStatusResponse:
|
|
3905
|
-
${(0,
|
|
3955
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
3906
3956
|
`
|
|
3907
3957
|
);
|
|
3908
3958
|
}
|
|
@@ -3923,13 +3973,13 @@ function serializeEnsIndexerIndexingStatusResponse(response) {
|
|
|
3923
3973
|
}
|
|
3924
3974
|
|
|
3925
3975
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
3926
|
-
var
|
|
3976
|
+
var import_v432 = require("zod/v4");
|
|
3927
3977
|
|
|
3928
3978
|
// src/ensindexer/api/shared/errors/zod-schemas.ts
|
|
3929
|
-
var
|
|
3930
|
-
var ErrorResponseSchema2 =
|
|
3931
|
-
message:
|
|
3932
|
-
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())
|
|
3933
3983
|
});
|
|
3934
3984
|
|
|
3935
3985
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
@@ -3937,7 +3987,7 @@ function deserializeErrorResponse2(maybeErrorResponse) {
|
|
|
3937
3987
|
const parsed = ErrorResponseSchema2.safeParse(maybeErrorResponse);
|
|
3938
3988
|
if (parsed.error) {
|
|
3939
3989
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3940
|
-
${(0,
|
|
3990
|
+
${(0, import_v432.prettifyError)(parsed.error)}
|
|
3941
3991
|
`);
|
|
3942
3992
|
}
|
|
3943
3993
|
return parsed.data;
|
|
@@ -4101,35 +4151,6 @@ function labelHashToBytes(labelHash) {
|
|
|
4101
4151
|
}
|
|
4102
4152
|
}
|
|
4103
4153
|
|
|
4104
|
-
// src/ensindexer/config/labelset-utils.ts
|
|
4105
|
-
function buildLabelSetId(maybeLabelSetId) {
|
|
4106
|
-
return makeLabelSetIdSchema("LabelSetId").parse(maybeLabelSetId);
|
|
4107
|
-
}
|
|
4108
|
-
function buildLabelSetVersion(maybeLabelSetVersion) {
|
|
4109
|
-
return makeLabelSetVersionSchema("LabelSetVersion").parse(maybeLabelSetVersion);
|
|
4110
|
-
}
|
|
4111
|
-
function buildEnsRainbowClientLabelSet(labelSetId, labelSetVersion) {
|
|
4112
|
-
if (labelSetVersion !== void 0 && labelSetId === void 0) {
|
|
4113
|
-
throw new Error("When a labelSetVersion is defined, labelSetId must also be defined.");
|
|
4114
|
-
}
|
|
4115
|
-
return { labelSetId, labelSetVersion };
|
|
4116
|
-
}
|
|
4117
|
-
function validateSupportedLabelSetAndVersion(serverSet, clientSet) {
|
|
4118
|
-
if (clientSet.labelSetId === void 0) {
|
|
4119
|
-
return;
|
|
4120
|
-
}
|
|
4121
|
-
if (serverSet.labelSetId !== clientSet.labelSetId) {
|
|
4122
|
-
throw new Error(
|
|
4123
|
-
`Server label set ID "${serverSet.labelSetId}" does not match client's requested label set ID "${clientSet.labelSetId}".`
|
|
4124
|
-
);
|
|
4125
|
-
}
|
|
4126
|
-
if (clientSet.labelSetVersion !== void 0 && serverSet.highestLabelSetVersion < clientSet.labelSetVersion) {
|
|
4127
|
-
throw new Error(
|
|
4128
|
-
`Server highest label set version ${serverSet.highestLabelSetVersion} is less than client's requested version ${clientSet.labelSetVersion} for label set ID "${clientSet.labelSetId}".`
|
|
4129
|
-
);
|
|
4130
|
-
}
|
|
4131
|
-
}
|
|
4132
|
-
|
|
4133
4154
|
// src/ensindexer/config/parsing.ts
|
|
4134
4155
|
function parseNonNegativeInteger(maybeNumber) {
|
|
4135
4156
|
const trimmed = maybeNumber.trim();
|
|
@@ -4177,6 +4198,16 @@ var makeResolverRecordsId = (resolver, node) => `${makeResolverId(resolver)}/${n
|
|
|
4177
4198
|
var makeRegistrationId = (domainId, index) => `${domainId}/${index}`;
|
|
4178
4199
|
var makeRenewalId = (domainId, registrationIndex, index) => `${makeRegistrationId(domainId, registrationIndex)}/${index}`;
|
|
4179
4200
|
|
|
4201
|
+
// src/graphql-api/prerequisites.ts
|
|
4202
|
+
function hasGraphqlApiConfigSupport(config) {
|
|
4203
|
+
const supported = config.plugins.includes("ensv2" /* ENSv2 */);
|
|
4204
|
+
if (supported) return { supported };
|
|
4205
|
+
return {
|
|
4206
|
+
supported: false,
|
|
4207
|
+
reason: `The connected ENSNode's Config must have the '${"ensv2" /* ENSv2 */}' plugin enabled.`
|
|
4208
|
+
};
|
|
4209
|
+
}
|
|
4210
|
+
|
|
4180
4211
|
// src/identity/identity.ts
|
|
4181
4212
|
var import_datasources7 = require("@ensnode/datasources");
|
|
4182
4213
|
|
|
@@ -4214,14 +4245,14 @@ function isResolvedIdentity(identity) {
|
|
|
4214
4245
|
}
|
|
4215
4246
|
|
|
4216
4247
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
4217
|
-
var
|
|
4248
|
+
var import_v433 = require("zod/v4");
|
|
4218
4249
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
4219
4250
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4220
4251
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
4221
4252
|
if (parsed.error) {
|
|
4222
4253
|
throw new Error(
|
|
4223
4254
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
4224
|
-
${(0,
|
|
4255
|
+
${(0, import_v433.prettifyError)(parsed.error)}
|
|
4225
4256
|
`
|
|
4226
4257
|
);
|
|
4227
4258
|
}
|
|
@@ -4239,26 +4270,26 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
4239
4270
|
}
|
|
4240
4271
|
|
|
4241
4272
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
4242
|
-
var
|
|
4273
|
+
var import_v434 = require("zod/v4");
|
|
4243
4274
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4244
4275
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4245
4276
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4246
4277
|
if (parsed.error) {
|
|
4247
4278
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
4248
|
-
${(0,
|
|
4279
|
+
${(0, import_v434.prettifyError)(parsed.error)}
|
|
4249
4280
|
`);
|
|
4250
4281
|
}
|
|
4251
4282
|
return parsed.data;
|
|
4252
4283
|
}
|
|
4253
4284
|
|
|
4254
4285
|
// src/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
4255
|
-
var
|
|
4286
|
+
var import_v435 = require("zod/v4");
|
|
4256
4287
|
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
4257
4288
|
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
4258
4289
|
const parsed = schema.safeParse(unvalidatedProjection);
|
|
4259
4290
|
if (parsed.error) {
|
|
4260
4291
|
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
4261
|
-
${(0,
|
|
4292
|
+
${(0, import_v435.prettifyError)(parsed.error)}
|
|
4262
4293
|
`);
|
|
4263
4294
|
}
|
|
4264
4295
|
return parsed.data;
|
|
@@ -4436,13 +4467,13 @@ var import_getUnixTime2 = require("date-fns/getUnixTime");
|
|
|
4436
4467
|
var import_getUnixTime = require("date-fns/getUnixTime");
|
|
4437
4468
|
|
|
4438
4469
|
// src/shared/deserialize.ts
|
|
4439
|
-
var
|
|
4470
|
+
var import_v436 = __toESM(require("zod/v4"), 1);
|
|
4440
4471
|
function deserializeChainId(maybeChainId, valueLabel) {
|
|
4441
4472
|
const schema = makeChainIdStringSchema(valueLabel);
|
|
4442
4473
|
const parsed = schema.safeParse(maybeChainId);
|
|
4443
4474
|
if (parsed.error) {
|
|
4444
4475
|
throw new Error(`Cannot deserialize ChainId:
|
|
4445
|
-
${(0,
|
|
4476
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4446
4477
|
`);
|
|
4447
4478
|
}
|
|
4448
4479
|
return parsed.data;
|
|
@@ -4452,7 +4483,7 @@ function deserializeDatetime(maybeDatetime, valueLabel) {
|
|
|
4452
4483
|
const parsed = schema.safeParse(maybeDatetime);
|
|
4453
4484
|
if (parsed.error) {
|
|
4454
4485
|
throw new Error(`Cannot deserialize Datetime:
|
|
4455
|
-
${(0,
|
|
4486
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4456
4487
|
`);
|
|
4457
4488
|
}
|
|
4458
4489
|
return parsed.data;
|
|
@@ -4462,7 +4493,7 @@ function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
|
|
|
4462
4493
|
const parsed = schema.safeParse(maybeTimestamp);
|
|
4463
4494
|
if (parsed.error) {
|
|
4464
4495
|
throw new Error(`Cannot deserialize Unix Timestamp:
|
|
4465
|
-
${(0,
|
|
4496
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4466
4497
|
`);
|
|
4467
4498
|
}
|
|
4468
4499
|
return parsed.data;
|
|
@@ -4472,7 +4503,7 @@ function deserializeUrl(maybeUrl, valueLabel) {
|
|
|
4472
4503
|
const parsed = schema.safeParse(maybeUrl);
|
|
4473
4504
|
if (parsed.error) {
|
|
4474
4505
|
throw new Error(`Cannot deserialize URL:
|
|
4475
|
-
${(0,
|
|
4506
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4476
4507
|
`);
|
|
4477
4508
|
}
|
|
4478
4509
|
return parsed.data;
|
|
@@ -4482,7 +4513,7 @@ function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
|
|
|
4482
4513
|
const parsed = schema.safeParse(maybeBlockNumber);
|
|
4483
4514
|
if (parsed.error) {
|
|
4484
4515
|
throw new Error(`Cannot deserialize BlockNumber:
|
|
4485
|
-
${(0,
|
|
4516
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4486
4517
|
`);
|
|
4487
4518
|
}
|
|
4488
4519
|
return parsed.data;
|
|
@@ -4492,17 +4523,17 @@ function deserializeBlockRef(maybeBlockRef, valueLabel) {
|
|
|
4492
4523
|
const parsed = schema.safeParse(maybeBlockRef);
|
|
4493
4524
|
if (parsed.error) {
|
|
4494
4525
|
throw new Error(`Cannot deserialize BlockRef:
|
|
4495
|
-
${(0,
|
|
4526
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4496
4527
|
`);
|
|
4497
4528
|
}
|
|
4498
4529
|
return parsed.data;
|
|
4499
4530
|
}
|
|
4500
4531
|
function deserializeDuration(maybeDuration, valueLabel) {
|
|
4501
|
-
const schema =
|
|
4532
|
+
const schema = import_v436.default.coerce.number().pipe(makeDurationSchema(valueLabel));
|
|
4502
4533
|
const parsed = schema.safeParse(maybeDuration);
|
|
4503
4534
|
if (parsed.error) {
|
|
4504
4535
|
throw new RangeError(`Cannot deserialize Duration:
|
|
4505
|
-
${(0,
|
|
4536
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4506
4537
|
`);
|
|
4507
4538
|
}
|
|
4508
4539
|
return parsed.data;
|
|
@@ -4512,7 +4543,7 @@ function parseAccountId(maybeAccountId, valueLabel) {
|
|
|
4512
4543
|
const parsed = schema.safeParse(maybeAccountId);
|
|
4513
4544
|
if (parsed.error) {
|
|
4514
4545
|
throw new RangeError(`Cannot deserialize AccountId:
|
|
4515
|
-
${(0,
|
|
4546
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4516
4547
|
`);
|
|
4517
4548
|
}
|
|
4518
4549
|
return parsed.data;
|
|
@@ -4522,7 +4553,7 @@ function deserializePriceEth(maybePrice, valueLabel) {
|
|
|
4522
4553
|
const parsed = schema.safeParse(maybePrice);
|
|
4523
4554
|
if (parsed.error) {
|
|
4524
4555
|
throw new Error(`Cannot deserialize PriceEth:
|
|
4525
|
-
${(0,
|
|
4556
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4526
4557
|
`);
|
|
4527
4558
|
}
|
|
4528
4559
|
return parsed.data;
|
|
@@ -4532,7 +4563,7 @@ function deserializePriceUsdc(maybePrice, valueLabel) {
|
|
|
4532
4563
|
const parsed = schema.safeParse(maybePrice);
|
|
4533
4564
|
if (parsed.error) {
|
|
4534
4565
|
throw new Error(`Cannot deserialize PriceUsdc:
|
|
4535
|
-
${(0,
|
|
4566
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4536
4567
|
`);
|
|
4537
4568
|
}
|
|
4538
4569
|
return parsed.data;
|
|
@@ -4542,7 +4573,7 @@ function deserializePriceDai(maybePrice, valueLabel) {
|
|
|
4542
4573
|
const parsed = schema.safeParse(maybePrice);
|
|
4543
4574
|
if (parsed.error) {
|
|
4544
4575
|
throw new Error(`Cannot deserialize PriceDai:
|
|
4545
|
-
${(0,
|
|
4576
|
+
${(0, import_v436.prettifyError)(parsed.error)}
|
|
4546
4577
|
`);
|
|
4547
4578
|
}
|
|
4548
4579
|
return parsed.data;
|
|
@@ -4841,6 +4872,11 @@ ${JSON.stringify(concrete)}`
|
|
|
4841
4872
|
return { concrete, partial };
|
|
4842
4873
|
}
|
|
4843
4874
|
|
|
4875
|
+
// src/shared/namespace-specific-value.ts
|
|
4876
|
+
function getNamespaceSpecificValue(namespace, value) {
|
|
4877
|
+
return value[namespace] ?? value.default;
|
|
4878
|
+
}
|
|
4879
|
+
|
|
4844
4880
|
// src/shared/root-registry.ts
|
|
4845
4881
|
var import_datasources13 = require("@ensnode/datasources");
|
|
4846
4882
|
var getENSv1Registry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
@@ -4857,6 +4893,16 @@ function isWebSocketProtocol(url) {
|
|
|
4857
4893
|
return ["ws:", "wss:"].includes(url.protocol);
|
|
4858
4894
|
}
|
|
4859
4895
|
|
|
4896
|
+
// src/subgraph-api/prerequisites.ts
|
|
4897
|
+
function hasSubgraphApiConfigSupport(config) {
|
|
4898
|
+
const supported = config.plugins.includes("subgraph" /* Subgraph */);
|
|
4899
|
+
if (supported) return { supported };
|
|
4900
|
+
return {
|
|
4901
|
+
supported: false,
|
|
4902
|
+
reason: `The connected ENSNode's Config must have the '${"subgraph" /* Subgraph */}' plugin enabled.`
|
|
4903
|
+
};
|
|
4904
|
+
}
|
|
4905
|
+
|
|
4860
4906
|
// src/tracing/ens-protocol-tracing.ts
|
|
4861
4907
|
var PROTOCOL_ATTRIBUTE_PREFIX = "ens";
|
|
4862
4908
|
var ATTR_PROTOCOL_NAME = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol`;
|