@ensnode/ensnode-sdk 1.3.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -10
- package/dist/index.cjs +807 -334
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +575 -139
- package/dist/index.d.ts +575 -139
- package/dist/index.js +732 -257
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { prettifyError as prettifyError2, ZodError } from "zod/v4";
|
|
3
3
|
|
|
4
4
|
// src/ensapi/config/zod-schemas.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z4 } from "zod/v4";
|
|
6
6
|
|
|
7
7
|
// src/ensindexer/config/zod-schemas.ts
|
|
8
|
-
import z2 from "zod/v4";
|
|
8
|
+
import { z as z2 } from "zod/v4";
|
|
9
9
|
|
|
10
10
|
// src/shared/account-id.ts
|
|
11
11
|
import { isAddressEqual } from "viem";
|
|
@@ -77,7 +77,7 @@ import { prettifyError } from "zod/v4";
|
|
|
77
77
|
// src/shared/zod-schemas.ts
|
|
78
78
|
import { AccountId as CaipAccountId } from "caip";
|
|
79
79
|
import { isAddress as isAddress2, isHex as isHex2, size } from "viem";
|
|
80
|
-
import z from "zod/v4";
|
|
80
|
+
import { z } from "zod/v4";
|
|
81
81
|
|
|
82
82
|
// src/ens/index.ts
|
|
83
83
|
import { getENSRootChainId } from "@ensnode/datasources";
|
|
@@ -106,12 +106,14 @@ var bigintToCoinType = (value) => {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
// src/ens/constants.ts
|
|
109
|
-
import { namehash } from "viem";
|
|
109
|
+
import { namehash, zeroHash } from "viem";
|
|
110
110
|
var ROOT_NODE = namehash("");
|
|
111
111
|
var ETH_NODE = namehash("eth");
|
|
112
112
|
var BASENAMES_NODE = namehash("base.eth");
|
|
113
113
|
var LINEANAMES_NODE = namehash("linea.eth");
|
|
114
114
|
var ADDR_REVERSE_NODE = namehash("addr.reverse");
|
|
115
|
+
var NODE_ANY = zeroHash;
|
|
116
|
+
var ROOT_RESOURCE = 0n;
|
|
115
117
|
|
|
116
118
|
// src/ens/dns-encoded-name.ts
|
|
117
119
|
import { bytesToString, hexToBytes } from "viem";
|
|
@@ -160,6 +162,10 @@ function isEncodedLabelHash(maybeEncodedLabelHash) {
|
|
|
160
162
|
return expectedFormatting && includesLabelHash;
|
|
161
163
|
}
|
|
162
164
|
|
|
165
|
+
// src/ens/fuses.ts
|
|
166
|
+
var PARENT_CANNOT_CONTROL = 65536;
|
|
167
|
+
var isPccFuseSet = (fuses) => (fuses & PARENT_CANNOT_CONTROL) === PARENT_CANNOT_CONTROL;
|
|
168
|
+
|
|
163
169
|
// src/ens/is-normalized.ts
|
|
164
170
|
import { normalize } from "viem/ens";
|
|
165
171
|
function isNormalizedName(name) {
|
|
@@ -330,7 +336,7 @@ function addPrices(...prices) {
|
|
|
330
336
|
);
|
|
331
337
|
}
|
|
332
338
|
|
|
333
|
-
// src/shared/reinterpretation.ts
|
|
339
|
+
// src/shared/interpretation/reinterpretation.ts
|
|
334
340
|
import { labelhash as labelToLabelHash } from "viem";
|
|
335
341
|
function reinterpretLabel(label) {
|
|
336
342
|
if (label === "") {
|
|
@@ -706,7 +712,9 @@ var TtlCache = class {
|
|
|
706
712
|
var uniq = (arr) => [...new Set(arr)];
|
|
707
713
|
|
|
708
714
|
// src/shared/datasource-contract.ts
|
|
709
|
-
import {
|
|
715
|
+
import {
|
|
716
|
+
maybeGetDatasource
|
|
717
|
+
} from "@ensnode/datasources";
|
|
710
718
|
var maybeGetDatasourceContract = (namespaceId, datasourceName, contractName) => {
|
|
711
719
|
const datasource = maybeGetDatasource(namespaceId, datasourceName);
|
|
712
720
|
if (!datasource) return void 0;
|
|
@@ -726,12 +734,60 @@ var getDatasourceContract = (namespaceId, datasourceName, contractName) => {
|
|
|
726
734
|
}
|
|
727
735
|
return contract;
|
|
728
736
|
};
|
|
737
|
+
var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
738
|
+
const a = maybeGetDatasourceContract(namespace, datasourceName, contractName);
|
|
739
|
+
return a && accountIdEqual(a, b);
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
// src/shared/interpretation/interpret-address.ts
|
|
743
|
+
import { isAddressEqual as isAddressEqual2, zeroAddress } from "viem";
|
|
744
|
+
var interpretAddress = (owner) => isAddressEqual2(zeroAddress, owner) ? null : owner;
|
|
745
|
+
|
|
746
|
+
// src/shared/interpretation/interpret-record-values.ts
|
|
747
|
+
import { isAddress as isAddress3, isAddressEqual as isAddressEqual3, zeroAddress as zeroAddress2 } from "viem";
|
|
748
|
+
|
|
749
|
+
// src/shared/null-bytes.ts
|
|
750
|
+
var hasNullByte = (value) => value.indexOf("\0") !== -1;
|
|
751
|
+
var stripNullBytes = (value) => value.replaceAll("\0", "");
|
|
752
|
+
|
|
753
|
+
// src/shared/interpretation/interpret-record-values.ts
|
|
754
|
+
function interpretNameRecordValue(value) {
|
|
755
|
+
if (value === "") return null;
|
|
756
|
+
if (!isNormalizedName(value)) return null;
|
|
757
|
+
return value;
|
|
758
|
+
}
|
|
759
|
+
function interpretAddressRecordValue(value) {
|
|
760
|
+
if (hasNullByte(value)) return null;
|
|
761
|
+
if (value === "") return null;
|
|
762
|
+
if (value === "0x") return null;
|
|
763
|
+
if (!isAddress3(value)) return value;
|
|
764
|
+
if (isAddressEqual3(value, zeroAddress2)) return null;
|
|
765
|
+
return asLowerCaseAddress(value);
|
|
766
|
+
}
|
|
767
|
+
function interpretTextRecordKey(key) {
|
|
768
|
+
if (hasNullByte(key)) return null;
|
|
769
|
+
if (key === "") return null;
|
|
770
|
+
return key;
|
|
771
|
+
}
|
|
772
|
+
function interpretTextRecordValue(value) {
|
|
773
|
+
if (hasNullByte(value)) return null;
|
|
774
|
+
if (value === "") return null;
|
|
775
|
+
return value;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
// src/shared/interpretation/interpret-tokenid.ts
|
|
779
|
+
var interpretTokenIdAsLabelHash = (tokenId) => uint256ToHex32(tokenId);
|
|
780
|
+
var interpretTokenIdAsNode = (tokenId) => uint256ToHex32(tokenId);
|
|
781
|
+
|
|
782
|
+
// src/shared/interpretation/interpreted-names-and-labels.ts
|
|
783
|
+
import { isHex as isHex3 } from "viem";
|
|
784
|
+
import { labelhash } from "viem/ens";
|
|
729
785
|
|
|
730
786
|
// src/shared/labelhash.ts
|
|
731
787
|
import { keccak256 as keccak2562, stringToBytes } from "viem";
|
|
732
788
|
var labelhashLiteralLabel = (label) => keccak2562(stringToBytes(label));
|
|
733
789
|
|
|
734
|
-
// src/shared/interpretation.ts
|
|
790
|
+
// src/shared/interpretation/interpreted-names-and-labels.ts
|
|
735
791
|
function literalLabelToInterpretedLabel(label) {
|
|
736
792
|
if (isNormalizedLabel(label)) return label;
|
|
737
793
|
return encodeLabelHash(labelhashLiteralLabel(label));
|
|
@@ -745,10 +801,39 @@ function interpretedLabelsToInterpretedName(labels) {
|
|
|
745
801
|
function literalLabelsToLiteralName(labels) {
|
|
746
802
|
return labels.join(".");
|
|
747
803
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
804
|
+
function interpretedNameToInterpretedLabels(name) {
|
|
805
|
+
return name.split(".");
|
|
806
|
+
}
|
|
807
|
+
function encodedLabelToLabelhash(label) {
|
|
808
|
+
if (label.length !== 66) return null;
|
|
809
|
+
if (label.indexOf("[") !== 0) return null;
|
|
810
|
+
if (label.indexOf("]") !== 65) return null;
|
|
811
|
+
const hash = `0x${label.slice(1, 65)}`;
|
|
812
|
+
if (!isHex3(hash)) return null;
|
|
813
|
+
return hash;
|
|
814
|
+
}
|
|
815
|
+
function isInterpetedLabel(label) {
|
|
816
|
+
if (label.startsWith("[")) {
|
|
817
|
+
const labelHash = encodedLabelToLabelhash(label);
|
|
818
|
+
if (labelHash === null) return false;
|
|
819
|
+
}
|
|
820
|
+
return isNormalizedLabel(label);
|
|
821
|
+
}
|
|
822
|
+
function isInterpretedName(name) {
|
|
823
|
+
return name.split(".").every(isInterpetedLabel);
|
|
824
|
+
}
|
|
825
|
+
function interpretedNameToLabelHashPath(name) {
|
|
826
|
+
return interpretedNameToInterpretedLabels(name).map((label) => {
|
|
827
|
+
if (!isInterpetedLabel(label)) {
|
|
828
|
+
throw new Error(
|
|
829
|
+
`Invariant(interpretedNameToLabelHashPath): Expected InterpretedLabel, received '${label}'.`
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
const maybeLabelHash = encodedLabelToLabelhash(label);
|
|
833
|
+
if (maybeLabelHash !== null) return maybeLabelHash;
|
|
834
|
+
return labelhash(label);
|
|
835
|
+
}).toReversed();
|
|
836
|
+
}
|
|
752
837
|
|
|
753
838
|
// src/shared/numbers.ts
|
|
754
839
|
function bigIntToNumber(n) {
|
|
@@ -765,8 +850,16 @@ function bigIntToNumber(n) {
|
|
|
765
850
|
return Number(n);
|
|
766
851
|
}
|
|
767
852
|
|
|
853
|
+
// src/shared/root-registry.ts
|
|
854
|
+
import { DatasourceNames } from "@ensnode/datasources";
|
|
855
|
+
var getENSv1Registry = (namespace) => getDatasourceContract(namespace, DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
856
|
+
var isENSv1Registry = (namespace, contract) => accountIdEqual(getENSv1Registry(namespace), contract);
|
|
857
|
+
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace, DatasourceNames.ENSRoot, "RootRegistry");
|
|
858
|
+
var getENSv2RootRegistryId = (namespace) => makeRegistryId(getENSv2RootRegistry(namespace));
|
|
859
|
+
var isENSv2RootRegistry = (namespace, contract) => accountIdEqual(getENSv2RootRegistry(namespace), contract);
|
|
860
|
+
|
|
768
861
|
// src/shared/serialize.ts
|
|
769
|
-
import { AccountId as CaipAccountId2 } from "caip";
|
|
862
|
+
import { AccountId as CaipAccountId2, AssetId as CaipAssetId } from "caip";
|
|
770
863
|
function serializeChainId(chainId) {
|
|
771
864
|
return chainId.toString();
|
|
772
865
|
}
|
|
@@ -791,6 +884,23 @@ function formatAccountId(accountId) {
|
|
|
791
884
|
address: accountId.address
|
|
792
885
|
}).toLowerCase();
|
|
793
886
|
}
|
|
887
|
+
function formatAssetId({
|
|
888
|
+
assetNamespace,
|
|
889
|
+
contract: { chainId, address },
|
|
890
|
+
tokenId
|
|
891
|
+
}) {
|
|
892
|
+
return CaipAssetId.format({
|
|
893
|
+
chainId: { namespace: "eip155", reference: chainId.toString() },
|
|
894
|
+
assetName: { namespace: assetNamespace, reference: address },
|
|
895
|
+
tokenId: uint256ToHex32(tokenId)
|
|
896
|
+
}).toLowerCase();
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
// src/shared/types.ts
|
|
900
|
+
var AssetNamespaces = {
|
|
901
|
+
ERC721: "erc721",
|
|
902
|
+
ERC1155: "erc1155"
|
|
903
|
+
};
|
|
794
904
|
|
|
795
905
|
// src/shared/url.ts
|
|
796
906
|
function isHttpProtocol(url) {
|
|
@@ -812,6 +922,7 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
|
812
922
|
PluginName2["ProtocolAcceleration"] = "protocol-acceleration";
|
|
813
923
|
PluginName2["Registrars"] = "registrars";
|
|
814
924
|
PluginName2["TokenScope"] = "tokenscope";
|
|
925
|
+
PluginName2["ENSv2"] = "ensv2";
|
|
815
926
|
return PluginName2;
|
|
816
927
|
})(PluginName || {});
|
|
817
928
|
|
|
@@ -908,20 +1019,29 @@ var makeENSIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") =
|
|
|
908
1019
|
versionInfo: makeENSIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
909
1020
|
}).check(invariant_isSubgraphCompatibleRequirements);
|
|
910
1021
|
|
|
911
|
-
// src/
|
|
1022
|
+
// src/shared/config/thegraph.ts
|
|
1023
|
+
import { z as z3 } from "zod/v4";
|
|
912
1024
|
var TheGraphCannotFallbackReasonSchema = z3.enum({
|
|
913
1025
|
NotSubgraphCompatible: "not-subgraph-compatible",
|
|
914
1026
|
NoApiKey: "no-api-key",
|
|
915
1027
|
NoSubgraphUrl: "no-subgraph-url"
|
|
916
1028
|
});
|
|
917
|
-
var TheGraphFallbackSchema = z3.
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1029
|
+
var TheGraphFallbackSchema = z3.discriminatedUnion("canFallback", [
|
|
1030
|
+
z3.strictObject({
|
|
1031
|
+
canFallback: z3.literal(true),
|
|
1032
|
+
url: z3.string()
|
|
1033
|
+
}),
|
|
1034
|
+
z3.strictObject({
|
|
1035
|
+
canFallback: z3.literal(false),
|
|
1036
|
+
reason: TheGraphCannotFallbackReasonSchema
|
|
1037
|
+
})
|
|
1038
|
+
]);
|
|
1039
|
+
|
|
1040
|
+
// src/ensapi/config/zod-schemas.ts
|
|
921
1041
|
function makeENSApiPublicConfigSchema(valueLabel) {
|
|
922
1042
|
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
923
|
-
return
|
|
924
|
-
version:
|
|
1043
|
+
return z4.strictObject({
|
|
1044
|
+
version: z4.string().min(1, `${label}.version must be a non-empty string`),
|
|
925
1045
|
theGraphFallback: TheGraphFallbackSchema,
|
|
926
1046
|
ensIndexerPublicConfig: makeENSIndexerPublicConfigSchema(`${label}.ensIndexerPublicConfig`)
|
|
927
1047
|
});
|
|
@@ -1064,7 +1184,7 @@ function serializeENSIndexerPublicConfig(config) {
|
|
|
1064
1184
|
import { prettifyError as prettifyError4 } from "zod/v4";
|
|
1065
1185
|
|
|
1066
1186
|
// src/ensindexer/indexing-status/zod-schemas.ts
|
|
1067
|
-
import
|
|
1187
|
+
import { z as z5 } from "zod/v4";
|
|
1068
1188
|
|
|
1069
1189
|
// src/ensindexer/indexing-status/types.ts
|
|
1070
1190
|
var ChainIndexingConfigTypeIds = {
|
|
@@ -1490,7 +1610,7 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1490
1610
|
ctx.issues.push({
|
|
1491
1611
|
code: "custom",
|
|
1492
1612
|
input: ctx.value,
|
|
1493
|
-
message: `'snapshotTime' must be greater than or equal to
|
|
1613
|
+
message: `'snapshotTime' (${snapshotTime}) must be greater than or equal to the "highest known block timestamp" (${highestKnownBlockTimestamp})`
|
|
1494
1614
|
});
|
|
1495
1615
|
}
|
|
1496
1616
|
}
|
|
@@ -1520,52 +1640,52 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
|
|
|
1520
1640
|
}
|
|
1521
1641
|
|
|
1522
1642
|
// src/ensindexer/indexing-status/zod-schemas.ts
|
|
1523
|
-
var makeChainIndexingConfigSchema = (valueLabel = "Value") =>
|
|
1524
|
-
|
|
1525
|
-
configType:
|
|
1643
|
+
var makeChainIndexingConfigSchema = (valueLabel = "Value") => z5.discriminatedUnion("configType", [
|
|
1644
|
+
z5.strictObject({
|
|
1645
|
+
configType: z5.literal(ChainIndexingConfigTypeIds.Indefinite),
|
|
1526
1646
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1527
1647
|
}),
|
|
1528
|
-
|
|
1529
|
-
configType:
|
|
1648
|
+
z5.strictObject({
|
|
1649
|
+
configType: z5.literal(ChainIndexingConfigTypeIds.Definite),
|
|
1530
1650
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1531
1651
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1532
1652
|
})
|
|
1533
1653
|
]);
|
|
1534
|
-
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") =>
|
|
1535
|
-
chainStatus:
|
|
1654
|
+
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => z5.strictObject({
|
|
1655
|
+
chainStatus: z5.literal(ChainIndexingStatusIds.Queued),
|
|
1536
1656
|
config: makeChainIndexingConfigSchema(valueLabel)
|
|
1537
1657
|
}).check(invariant_chainSnapshotQueuedBlocks);
|
|
1538
|
-
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") =>
|
|
1539
|
-
chainStatus:
|
|
1658
|
+
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => z5.strictObject({
|
|
1659
|
+
chainStatus: z5.literal(ChainIndexingStatusIds.Backfill),
|
|
1540
1660
|
config: makeChainIndexingConfigSchema(valueLabel),
|
|
1541
1661
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1542
1662
|
backfillEndBlock: makeBlockRefSchema(valueLabel)
|
|
1543
1663
|
}).check(invariant_chainSnapshotBackfillBlocks);
|
|
1544
|
-
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") =>
|
|
1545
|
-
chainStatus:
|
|
1546
|
-
config:
|
|
1547
|
-
configType:
|
|
1664
|
+
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => z5.strictObject({
|
|
1665
|
+
chainStatus: z5.literal(ChainIndexingStatusIds.Completed),
|
|
1666
|
+
config: z5.strictObject({
|
|
1667
|
+
configType: z5.literal(ChainIndexingConfigTypeIds.Definite),
|
|
1548
1668
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1549
1669
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1550
1670
|
}),
|
|
1551
1671
|
latestIndexedBlock: makeBlockRefSchema(valueLabel)
|
|
1552
1672
|
}).check(invariant_chainSnapshotCompletedBlocks);
|
|
1553
|
-
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") =>
|
|
1554
|
-
chainStatus:
|
|
1555
|
-
config:
|
|
1556
|
-
configType:
|
|
1673
|
+
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") => z5.strictObject({
|
|
1674
|
+
chainStatus: z5.literal(ChainIndexingStatusIds.Following),
|
|
1675
|
+
config: z5.strictObject({
|
|
1676
|
+
configType: z5.literal(ChainIndexingConfigTypeIds.Indefinite),
|
|
1557
1677
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1558
1678
|
}),
|
|
1559
1679
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1560
1680
|
latestKnownBlock: makeBlockRefSchema(valueLabel)
|
|
1561
1681
|
}).check(invariant_chainSnapshotFollowingBlocks);
|
|
1562
|
-
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1682
|
+
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => z5.discriminatedUnion("chainStatus", [
|
|
1563
1683
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1564
1684
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1565
1685
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
1566
1686
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel)
|
|
1567
1687
|
]);
|
|
1568
|
-
var makeChainIndexingStatusesSchema = (valueLabel = "Value") =>
|
|
1688
|
+
var makeChainIndexingStatusesSchema = (valueLabel = "Value") => z5.record(makeChainIdStringSchema(), makeChainIndexingStatusSnapshotSchema(valueLabel), {
|
|
1569
1689
|
error: "Chains indexing statuses must be an object mapping valid chain IDs to their indexing status snapshots."
|
|
1570
1690
|
}).transform((serializedChainsIndexingStatus) => {
|
|
1571
1691
|
const chainsIndexingStatus = /* @__PURE__ */ new Map();
|
|
@@ -1574,29 +1694,29 @@ var makeChainIndexingStatusesSchema = (valueLabel = "Value") => z4.record(makeCh
|
|
|
1574
1694
|
}
|
|
1575
1695
|
return chainsIndexingStatus;
|
|
1576
1696
|
});
|
|
1577
|
-
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1578
|
-
omnichainStatus:
|
|
1697
|
+
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => z5.strictObject({
|
|
1698
|
+
omnichainStatus: z5.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1579
1699
|
chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainSnapshotUnstartedHasValidChains).transform((chains) => chains),
|
|
1580
1700
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1581
1701
|
});
|
|
1582
|
-
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1583
|
-
omnichainStatus:
|
|
1702
|
+
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => z5.strictObject({
|
|
1703
|
+
omnichainStatus: z5.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1584
1704
|
chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotBackfillHasValidChains).transform(
|
|
1585
1705
|
(chains) => chains
|
|
1586
1706
|
),
|
|
1587
1707
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1588
1708
|
});
|
|
1589
|
-
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1590
|
-
omnichainStatus:
|
|
1709
|
+
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => z5.strictObject({
|
|
1710
|
+
omnichainStatus: z5.literal(OmnichainIndexingStatusIds.Completed),
|
|
1591
1711
|
chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotCompletedHasValidChains).transform((chains) => chains),
|
|
1592
1712
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1593
1713
|
});
|
|
1594
|
-
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1595
|
-
omnichainStatus:
|
|
1714
|
+
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => z5.strictObject({
|
|
1715
|
+
omnichainStatus: z5.literal(OmnichainIndexingStatusIds.Following),
|
|
1596
1716
|
chains: makeChainIndexingStatusesSchema(valueLabel),
|
|
1597
1717
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1598
1718
|
});
|
|
1599
|
-
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") =>
|
|
1719
|
+
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => z5.discriminatedUnion("omnichainStatus", [
|
|
1600
1720
|
makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1601
1721
|
makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1602
1722
|
makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1604,16 +1724,16 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
|
|
|
1604
1724
|
]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
|
|
1605
1725
|
invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
|
|
1606
1726
|
).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
|
|
1607
|
-
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") =>
|
|
1608
|
-
strategy:
|
|
1727
|
+
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => z5.strictObject({
|
|
1728
|
+
strategy: z5.literal(CrossChainIndexingStrategyIds.Omnichain),
|
|
1609
1729
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1610
1730
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1611
1731
|
omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1612
1732
|
}).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
|
|
1613
|
-
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") =>
|
|
1733
|
+
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => z5.discriminatedUnion("strategy", [
|
|
1614
1734
|
makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
|
|
1615
1735
|
]);
|
|
1616
|
-
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") =>
|
|
1736
|
+
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => z5.strictObject({
|
|
1617
1737
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1618
1738
|
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1619
1739
|
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
@@ -1761,7 +1881,7 @@ function serializeConfigResponse(response) {
|
|
|
1761
1881
|
import { prettifyError as prettifyError5 } from "zod/v4";
|
|
1762
1882
|
|
|
1763
1883
|
// src/api/indexing-status/zod-schemas.ts
|
|
1764
|
-
import
|
|
1884
|
+
import z6 from "zod/v4";
|
|
1765
1885
|
|
|
1766
1886
|
// src/api/indexing-status/response.ts
|
|
1767
1887
|
var IndexingStatusResponseCodes = {
|
|
@@ -1776,14 +1896,14 @@ var IndexingStatusResponseCodes = {
|
|
|
1776
1896
|
};
|
|
1777
1897
|
|
|
1778
1898
|
// src/api/indexing-status/zod-schemas.ts
|
|
1779
|
-
var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
1780
|
-
responseCode:
|
|
1899
|
+
var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => z6.strictObject({
|
|
1900
|
+
responseCode: z6.literal(IndexingStatusResponseCodes.Ok),
|
|
1781
1901
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
1782
1902
|
});
|
|
1783
|
-
var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
1784
|
-
responseCode:
|
|
1903
|
+
var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => z6.strictObject({
|
|
1904
|
+
responseCode: z6.literal(IndexingStatusResponseCodes.Error)
|
|
1785
1905
|
});
|
|
1786
|
-
var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
1906
|
+
var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => z6.discriminatedUnion("responseCode", [
|
|
1787
1907
|
makeIndexingStatusResponseOkSchema(valueLabel),
|
|
1788
1908
|
makeIndexingStatusResponseErrorSchema(valueLabel)
|
|
1789
1909
|
]);
|
|
@@ -1817,21 +1937,20 @@ import { prettifyError as prettifyError7 } from "zod/v4";
|
|
|
1817
1937
|
|
|
1818
1938
|
// src/api/name-tokens/zod-schemas.ts
|
|
1819
1939
|
import { namehash as namehash2 } from "viem";
|
|
1820
|
-
import
|
|
1940
|
+
import z9 from "zod/v4";
|
|
1821
1941
|
|
|
1822
1942
|
// src/tokenscope/assets.ts
|
|
1823
|
-
import {
|
|
1824
|
-
import { isAddressEqual as isAddressEqual3, zeroAddress as zeroAddress3 } from "viem";
|
|
1943
|
+
import { isAddressEqual as isAddressEqual5, zeroAddress as zeroAddress5 } from "viem";
|
|
1825
1944
|
import { prettifyError as prettifyError6 } from "zod/v4";
|
|
1826
1945
|
|
|
1827
1946
|
// src/tokenscope/zod-schemas.ts
|
|
1828
|
-
import { AssetId as
|
|
1829
|
-
import { zeroAddress as
|
|
1830
|
-
import
|
|
1947
|
+
import { AssetId as CaipAssetId2 } from "caip";
|
|
1948
|
+
import { zeroAddress as zeroAddress4 } from "viem";
|
|
1949
|
+
import z7 from "zod/v4";
|
|
1831
1950
|
|
|
1832
1951
|
// src/tokenscope/name-token.ts
|
|
1833
|
-
import { isAddressEqual as
|
|
1834
|
-
import { DatasourceNames } from "@ensnode/datasources";
|
|
1952
|
+
import { isAddressEqual as isAddressEqual4, zeroAddress as zeroAddress3 } from "viem";
|
|
1953
|
+
import { DatasourceNames as DatasourceNames2 } from "@ensnode/datasources";
|
|
1835
1954
|
var NameTokenOwnershipTypes = {
|
|
1836
1955
|
/**
|
|
1837
1956
|
* Name Token is owned by NameWrapper account.
|
|
@@ -1862,12 +1981,12 @@ function serializeNameToken(nameToken) {
|
|
|
1862
1981
|
function getNameWrapperAccounts(namespaceId) {
|
|
1863
1982
|
const ethnamesNameWrapperAccount = getDatasourceContract(
|
|
1864
1983
|
namespaceId,
|
|
1865
|
-
|
|
1984
|
+
DatasourceNames2.ENSRoot,
|
|
1866
1985
|
"NameWrapper"
|
|
1867
1986
|
);
|
|
1868
1987
|
const lineanamesNameWrapperAccount = maybeGetDatasourceContract(
|
|
1869
1988
|
namespaceId,
|
|
1870
|
-
|
|
1989
|
+
DatasourceNames2.Lineanames,
|
|
1871
1990
|
"NameWrapper"
|
|
1872
1991
|
);
|
|
1873
1992
|
const nameWrapperAccounts = [
|
|
@@ -1890,7 +2009,7 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
1890
2009
|
owner
|
|
1891
2010
|
};
|
|
1892
2011
|
}
|
|
1893
|
-
if (
|
|
2012
|
+
if (isAddressEqual4(owner.address, zeroAddress3)) {
|
|
1894
2013
|
return {
|
|
1895
2014
|
ownershipType: NameTokenOwnershipTypes.Burned,
|
|
1896
2015
|
owner
|
|
@@ -1910,14 +2029,28 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
1910
2029
|
}
|
|
1911
2030
|
|
|
1912
2031
|
// src/tokenscope/zod-schemas.ts
|
|
1913
|
-
var
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
2032
|
+
var tokenIdSchemaSerializable = z7.string();
|
|
2033
|
+
var tokenIdSchemaNative = z7.preprocess(
|
|
2034
|
+
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2035
|
+
z7.bigint().positive()
|
|
2036
|
+
);
|
|
2037
|
+
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2038
|
+
if (serializable) {
|
|
2039
|
+
return tokenIdSchemaSerializable;
|
|
2040
|
+
} else {
|
|
2041
|
+
return tokenIdSchemaNative;
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2045
|
+
return z7.object({
|
|
2046
|
+
assetNamespace: z7.enum(AssetNamespaces),
|
|
2047
|
+
contract: makeAccountIdSchema(valueLabel),
|
|
2048
|
+
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2049
|
+
});
|
|
2050
|
+
};
|
|
2051
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => z7.preprocess((v) => {
|
|
1919
2052
|
if (typeof v === "string") {
|
|
1920
|
-
const result = new
|
|
2053
|
+
const result = new CaipAssetId2(v);
|
|
1921
2054
|
return {
|
|
1922
2055
|
assetNamespace: result.assetName.namespace,
|
|
1923
2056
|
contract: {
|
|
@@ -1931,7 +2064,7 @@ var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => z6.prep
|
|
|
1931
2064
|
}, makeAssetIdSchema(valueLabel));
|
|
1932
2065
|
function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
1933
2066
|
const ownership = ctx.value;
|
|
1934
|
-
if (ctx.value.owner.address ===
|
|
2067
|
+
if (ctx.value.owner.address === zeroAddress4) {
|
|
1935
2068
|
ctx.issues.push({
|
|
1936
2069
|
code: "custom",
|
|
1937
2070
|
input: ctx.value,
|
|
@@ -1939,25 +2072,25 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
1939
2072
|
});
|
|
1940
2073
|
}
|
|
1941
2074
|
}
|
|
1942
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
1943
|
-
ownershipType:
|
|
2075
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => z7.object({
|
|
2076
|
+
ownershipType: z7.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
1944
2077
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
1945
2078
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
1946
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
1947
|
-
ownershipType:
|
|
2079
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => z7.object({
|
|
2080
|
+
ownershipType: z7.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
1948
2081
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
1949
2082
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
1950
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
1951
|
-
ownershipType:
|
|
2083
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => z7.object({
|
|
2084
|
+
ownershipType: z7.literal(NameTokenOwnershipTypes.Burned),
|
|
1952
2085
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
1953
2086
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
1954
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
1955
|
-
ownershipType:
|
|
2087
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => z7.object({
|
|
2088
|
+
ownershipType: z7.literal(NameTokenOwnershipTypes.Unknown),
|
|
1956
2089
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
1957
2090
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
1958
2091
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
1959
2092
|
const ownership = ctx.value;
|
|
1960
|
-
if (ctx.value.owner.address !==
|
|
2093
|
+
if (ctx.value.owner.address !== zeroAddress4) {
|
|
1961
2094
|
ctx.issues.push({
|
|
1962
2095
|
code: "custom",
|
|
1963
2096
|
input: ctx.value,
|
|
@@ -1965,23 +2098,19 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
1965
2098
|
});
|
|
1966
2099
|
}
|
|
1967
2100
|
}
|
|
1968
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2101
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => z7.discriminatedUnion("ownershipType", [
|
|
1969
2102
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
1970
2103
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
1971
2104
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
1972
2105
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
1973
2106
|
]);
|
|
1974
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema") =>
|
|
1975
|
-
token: makeAssetIdSchema(`${valueLabel}.token
|
|
2107
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => z7.object({
|
|
2108
|
+
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
1976
2109
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
1977
|
-
mintStatus:
|
|
2110
|
+
mintStatus: z7.enum(NFTMintStatuses)
|
|
1978
2111
|
});
|
|
1979
2112
|
|
|
1980
2113
|
// src/tokenscope/assets.ts
|
|
1981
|
-
var AssetNamespaces = {
|
|
1982
|
-
ERC721: "erc721",
|
|
1983
|
-
ERC1155: "erc1155"
|
|
1984
|
-
};
|
|
1985
2114
|
function serializeAssetId(assetId) {
|
|
1986
2115
|
return {
|
|
1987
2116
|
assetNamespace: assetId.assetNamespace,
|
|
@@ -1999,14 +2128,6 @@ ${prettifyError6(parsed.error)}
|
|
|
1999
2128
|
}
|
|
2000
2129
|
return parsed.data;
|
|
2001
2130
|
}
|
|
2002
|
-
function formatAssetId(assetId) {
|
|
2003
|
-
const { assetNamespace, contract, tokenId } = serializeAssetId(assetId);
|
|
2004
|
-
return CaipAssetId2.format({
|
|
2005
|
-
chainId: { namespace: "eip155", reference: contract.chainId.toString() },
|
|
2006
|
-
assetName: { namespace: assetNamespace, reference: contract.address },
|
|
2007
|
-
tokenId
|
|
2008
|
-
}).toLowerCase();
|
|
2009
|
-
}
|
|
2010
2131
|
function parseAssetId(maybeAssetId, valueLabel) {
|
|
2011
2132
|
const schema = makeAssetIdStringSchema(valueLabel);
|
|
2012
2133
|
const parsed = schema.safeParse(maybeAssetId);
|
|
@@ -2035,13 +2156,13 @@ var NFTMintStatuses = {
|
|
|
2035
2156
|
Burned: "burned"
|
|
2036
2157
|
};
|
|
2037
2158
|
var formatNFTTransferEventMetadata = (metadata) => {
|
|
2038
|
-
const
|
|
2159
|
+
const assetIdString = formatAssetId(metadata.nft);
|
|
2039
2160
|
return [
|
|
2040
2161
|
`Event: ${metadata.eventHandlerName}`,
|
|
2041
2162
|
`Chain ID: ${metadata.chainId}`,
|
|
2042
2163
|
`Block Number: ${metadata.blockNumber}`,
|
|
2043
2164
|
`Transaction Hash: ${metadata.transactionHash}`,
|
|
2044
|
-
`NFT: ${
|
|
2165
|
+
`NFT: ${assetIdString}`
|
|
2045
2166
|
].map((line) => ` - ${line}`).join("\n");
|
|
2046
2167
|
};
|
|
2047
2168
|
var NFTTransferTypes = {
|
|
@@ -2147,11 +2268,11 @@ var NFTTransferTypes = {
|
|
|
2147
2268
|
};
|
|
2148
2269
|
var getNFTTransferType = (from, to, allowMintedRemint, metadata, currentlyIndexedOwner) => {
|
|
2149
2270
|
const isIndexed = currentlyIndexedOwner !== void 0;
|
|
2150
|
-
const isIndexedAsMinted = isIndexed && !
|
|
2151
|
-
const isMint =
|
|
2152
|
-
const isBurn =
|
|
2153
|
-
const isSelfTransfer =
|
|
2154
|
-
if (isIndexed && !
|
|
2271
|
+
const isIndexedAsMinted = isIndexed && !isAddressEqual5(currentlyIndexedOwner, zeroAddress5);
|
|
2272
|
+
const isMint = isAddressEqual5(from, zeroAddress5);
|
|
2273
|
+
const isBurn = isAddressEqual5(to, zeroAddress5);
|
|
2274
|
+
const isSelfTransfer = isAddressEqual5(from, to);
|
|
2275
|
+
if (isIndexed && !isAddressEqual5(currentlyIndexedOwner, from)) {
|
|
2155
2276
|
if (isMint && allowMintedRemint) {
|
|
2156
2277
|
} else {
|
|
2157
2278
|
throw new Error(
|
|
@@ -2234,10 +2355,10 @@ ${formatNFTTransferEventMetadata(metadata)}`
|
|
|
2234
2355
|
};
|
|
2235
2356
|
|
|
2236
2357
|
// src/api/shared/errors/zod-schemas.ts
|
|
2237
|
-
import
|
|
2238
|
-
var ErrorResponseSchema =
|
|
2239
|
-
message:
|
|
2240
|
-
details:
|
|
2358
|
+
import z8 from "zod/v4";
|
|
2359
|
+
var ErrorResponseSchema = z8.object({
|
|
2360
|
+
message: z8.string(),
|
|
2361
|
+
details: z8.optional(z8.unknown())
|
|
2241
2362
|
});
|
|
2242
2363
|
|
|
2243
2364
|
// src/api/name-tokens/response.ts
|
|
@@ -2276,7 +2397,13 @@ var NameTokensResponseErrorCodes = {
|
|
|
2276
2397
|
};
|
|
2277
2398
|
|
|
2278
2399
|
// src/api/name-tokens/zod-schemas.ts
|
|
2279
|
-
|
|
2400
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => z9.object({
|
|
2401
|
+
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2402
|
+
name: makeReinterpretedNameSchema(valueLabel),
|
|
2403
|
+
tokens: z9.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2404
|
+
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2405
|
+
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2406
|
+
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
2280
2407
|
const { name, domainId } = ctx.value;
|
|
2281
2408
|
if (namehash2(name) !== domainId) {
|
|
2282
2409
|
ctx.issues.push({
|
|
@@ -2285,24 +2412,24 @@ function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
|
2285
2412
|
message: `'name' must be associated with 'domainId': ${domainId}`
|
|
2286
2413
|
});
|
|
2287
2414
|
}
|
|
2288
|
-
}
|
|
2289
|
-
function invariant_nameTokensOwnershipTypeNameWrapperRequiresOwnershipTypeFullyOnchainOrUnknown(ctx) {
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2415
|
+
}).check(
|
|
2416
|
+
function invariant_nameTokensOwnershipTypeNameWrapperRequiresOwnershipTypeFullyOnchainOrUnknown(ctx) {
|
|
2417
|
+
const { tokens } = ctx.value;
|
|
2418
|
+
const containsOwnershipNameWrapper = tokens.some(
|
|
2419
|
+
(t) => t.ownership.ownershipType === NameTokenOwnershipTypes.NameWrapper
|
|
2420
|
+
);
|
|
2421
|
+
const containsOwnershipFullyOnchainOrUnknown = tokens.some(
|
|
2422
|
+
(t) => t.ownership.ownershipType === NameTokenOwnershipTypes.FullyOnchain || t.ownership.ownershipType === NameTokenOwnershipTypes.Unknown
|
|
2423
|
+
);
|
|
2424
|
+
if (containsOwnershipNameWrapper && !containsOwnershipFullyOnchainOrUnknown) {
|
|
2425
|
+
ctx.issues.push({
|
|
2426
|
+
code: "custom",
|
|
2427
|
+
input: ctx.value,
|
|
2428
|
+
message: `'tokens' must contain name token with ownership type 'fully-onchain' or 'unknown' when name token with ownership type 'namewrapper' in listed`
|
|
2429
|
+
});
|
|
2430
|
+
}
|
|
2303
2431
|
}
|
|
2304
|
-
|
|
2305
|
-
function invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective(ctx) {
|
|
2432
|
+
).check(function invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective(ctx) {
|
|
2306
2433
|
const { tokens } = ctx.value;
|
|
2307
2434
|
const tokensCountWithOwnershipFullyOnchain = tokens.filter(
|
|
2308
2435
|
(t) => t.ownership.ownershipType === NameTokenOwnershipTypes.FullyOnchain
|
|
@@ -2314,46 +2441,43 @@ function invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective(ctx) {
|
|
|
2314
2441
|
message: `'tokens' must contain at most one name token with ownership type 'fully-onchain', current count: ${tokensCountWithOwnershipFullyOnchain}`
|
|
2315
2442
|
});
|
|
2316
2443
|
}
|
|
2317
|
-
}
|
|
2318
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token") => z8.object({
|
|
2319
|
-
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2320
|
-
name: makeReinterpretedNameSchema(valueLabel),
|
|
2321
|
-
tokens: z8.array(makeNameTokenSchema(`${valueLabel}.tokens`)).nonempty(),
|
|
2322
|
-
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2323
|
-
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2324
|
-
}).check(invariant_nameIsAssociatedWithDomainId).check(invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective).check(invariant_nameTokensOwnershipTypeNameWrapperRequiresOwnershipTypeFullyOnchainOrUnknown);
|
|
2325
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK") => z8.strictObject({
|
|
2326
|
-
responseCode: z8.literal(NameTokensResponseCodes.Ok),
|
|
2327
|
-
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`)
|
|
2328
2444
|
});
|
|
2329
|
-
var
|
|
2330
|
-
responseCode:
|
|
2331
|
-
|
|
2445
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => z9.strictObject({
|
|
2446
|
+
responseCode: z9.literal(NameTokensResponseCodes.Ok),
|
|
2447
|
+
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2448
|
+
});
|
|
2449
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => z9.strictObject({
|
|
2450
|
+
responseCode: z9.literal(NameTokensResponseCodes.Error),
|
|
2451
|
+
errorCode: z9.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2332
2452
|
error: ErrorResponseSchema
|
|
2333
2453
|
});
|
|
2334
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2335
|
-
responseCode:
|
|
2336
|
-
errorCode:
|
|
2454
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => z9.strictObject({
|
|
2455
|
+
responseCode: z9.literal(NameTokensResponseCodes.Error),
|
|
2456
|
+
errorCode: z9.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2337
2457
|
error: ErrorResponseSchema
|
|
2338
2458
|
});
|
|
2339
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2340
|
-
responseCode:
|
|
2341
|
-
errorCode:
|
|
2459
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => z9.strictObject({
|
|
2460
|
+
responseCode: z9.literal(NameTokensResponseCodes.Error),
|
|
2461
|
+
errorCode: z9.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2342
2462
|
error: ErrorResponseSchema
|
|
2343
2463
|
});
|
|
2344
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
2464
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => z9.discriminatedUnion("errorCode", [
|
|
2345
2465
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2346
2466
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2347
2467
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2348
2468
|
]);
|
|
2349
|
-
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response") =>
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2469
|
+
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2470
|
+
return z9.discriminatedUnion("responseCode", [
|
|
2471
|
+
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2472
|
+
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2473
|
+
]);
|
|
2474
|
+
};
|
|
2353
2475
|
|
|
2354
2476
|
// src/api/name-tokens/deserialize.ts
|
|
2355
2477
|
function deserializedNameTokensResponse(maybeResponse) {
|
|
2356
|
-
const parsed = makeNameTokensResponseSchema().safeParse(
|
|
2478
|
+
const parsed = makeNameTokensResponseSchema("Name Tokens Response", false).safeParse(
|
|
2479
|
+
maybeResponse
|
|
2480
|
+
);
|
|
2357
2481
|
if (parsed.error) {
|
|
2358
2482
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2359
2483
|
${prettifyError7(parsed.error)}
|
|
@@ -2434,13 +2558,13 @@ import { prettifyError as prettifyError8 } from "zod/v4";
|
|
|
2434
2558
|
|
|
2435
2559
|
// src/api/registrar-actions/zod-schemas.ts
|
|
2436
2560
|
import { namehash as namehash3 } from "viem/ens";
|
|
2437
|
-
import
|
|
2561
|
+
import z12 from "zod/v4";
|
|
2438
2562
|
|
|
2439
2563
|
// ../ens-referrals/src/address.ts
|
|
2440
|
-
import { isAddress as
|
|
2564
|
+
import { isAddress as isAddress4 } from "viem";
|
|
2441
2565
|
|
|
2442
2566
|
// ../ens-referrals/src/encoding.ts
|
|
2443
|
-
import { getAddress, pad, size as size2, slice, zeroAddress as
|
|
2567
|
+
import { getAddress, pad, size as size2, slice, zeroAddress as zeroAddress6 } from "viem";
|
|
2444
2568
|
var ENCODED_REFERRER_BYTE_OFFSET = 12;
|
|
2445
2569
|
var ENCODED_REFERRER_BYTE_LENGTH = 32;
|
|
2446
2570
|
var EXPECTED_ENCODED_REFERRER_PADDING = pad("0x", {
|
|
@@ -2459,7 +2583,7 @@ function decodeEncodedReferrer(encodedReferrer) {
|
|
|
2459
2583
|
}
|
|
2460
2584
|
const padding = slice(encodedReferrer, 0, ENCODED_REFERRER_BYTE_OFFSET);
|
|
2461
2585
|
if (padding !== EXPECTED_ENCODED_REFERRER_PADDING) {
|
|
2462
|
-
return
|
|
2586
|
+
return zeroAddress6;
|
|
2463
2587
|
}
|
|
2464
2588
|
const decodedReferrer = slice(encodedReferrer, ENCODED_REFERRER_BYTE_OFFSET);
|
|
2465
2589
|
try {
|
|
@@ -2488,7 +2612,7 @@ var ReferrerDetailTypeIds = {
|
|
|
2488
2612
|
};
|
|
2489
2613
|
|
|
2490
2614
|
// src/registrars/zod-schemas.ts
|
|
2491
|
-
import
|
|
2615
|
+
import { z as z10 } from "zod/v4";
|
|
2492
2616
|
|
|
2493
2617
|
// src/registrars/registrar-action.ts
|
|
2494
2618
|
var RegistrarActionTypes = {
|
|
@@ -2529,11 +2653,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
2529
2653
|
}
|
|
2530
2654
|
|
|
2531
2655
|
// src/registrars/zod-schemas.ts
|
|
2532
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
2656
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => z10.object({
|
|
2533
2657
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
2534
2658
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
2535
2659
|
});
|
|
2536
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
2660
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => z10.object({
|
|
2537
2661
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
2538
2662
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
2539
2663
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -2549,18 +2673,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
2549
2673
|
});
|
|
2550
2674
|
}
|
|
2551
2675
|
}
|
|
2552
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
2676
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => z10.union([
|
|
2553
2677
|
// pricing available
|
|
2554
|
-
|
|
2678
|
+
z10.object({
|
|
2555
2679
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
2556
2680
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
2557
2681
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
2558
2682
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
2559
2683
|
// pricing unknown
|
|
2560
|
-
|
|
2561
|
-
baseCost:
|
|
2562
|
-
premium:
|
|
2563
|
-
total:
|
|
2684
|
+
z10.object({
|
|
2685
|
+
baseCost: z10.null(),
|
|
2686
|
+
premium: z10.null(),
|
|
2687
|
+
total: z10.null()
|
|
2564
2688
|
}).transform((v) => v)
|
|
2565
2689
|
]);
|
|
2566
2690
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -2583,9 +2707,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
2583
2707
|
});
|
|
2584
2708
|
}
|
|
2585
2709
|
}
|
|
2586
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
2710
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => z10.union([
|
|
2587
2711
|
// referral available
|
|
2588
|
-
|
|
2712
|
+
z10.object({
|
|
2589
2713
|
encodedReferrer: makeHexStringSchema(
|
|
2590
2714
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
2591
2715
|
`${valueLabel} Encoded Referrer`
|
|
@@ -2593,9 +2717,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
2593
2717
|
decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
2594
2718
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
2595
2719
|
// referral not applicable
|
|
2596
|
-
|
|
2597
|
-
encodedReferrer:
|
|
2598
|
-
decodedReferrer:
|
|
2720
|
+
z10.object({
|
|
2721
|
+
encodedReferrer: z10.null(),
|
|
2722
|
+
decodedReferrer: z10.null()
|
|
2599
2723
|
})
|
|
2600
2724
|
]);
|
|
2601
2725
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -2608,9 +2732,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
2608
2732
|
});
|
|
2609
2733
|
}
|
|
2610
2734
|
}
|
|
2611
|
-
var EventIdSchema =
|
|
2612
|
-
var EventIdsSchema =
|
|
2613
|
-
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") =>
|
|
2735
|
+
var EventIdSchema = z10.string().nonempty();
|
|
2736
|
+
var EventIdsSchema = z10.array(EventIdSchema).min(1).transform((v) => v);
|
|
2737
|
+
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => z10.object({
|
|
2614
2738
|
id: EventIdSchema,
|
|
2615
2739
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
2616
2740
|
registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -2624,38 +2748,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => z9
|
|
|
2624
2748
|
eventIds: EventIdsSchema
|
|
2625
2749
|
}).check(invariant_eventIdsInitialElementIsTheActionId);
|
|
2626
2750
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2627
|
-
type:
|
|
2751
|
+
type: z10.literal(RegistrarActionTypes.Registration)
|
|
2628
2752
|
});
|
|
2629
2753
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2630
|
-
type:
|
|
2754
|
+
type: z10.literal(RegistrarActionTypes.Renewal)
|
|
2631
2755
|
});
|
|
2632
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
2756
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => z10.discriminatedUnion("type", [
|
|
2633
2757
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
2634
2758
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
2635
2759
|
]);
|
|
2636
2760
|
|
|
2637
2761
|
// src/api/shared/pagination/zod-schemas.ts
|
|
2638
|
-
import
|
|
2762
|
+
import z11 from "zod/v4";
|
|
2639
2763
|
|
|
2640
2764
|
// src/api/shared/pagination/request.ts
|
|
2641
2765
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
2642
2766
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
2643
2767
|
|
|
2644
2768
|
// src/api/shared/pagination/zod-schemas.ts
|
|
2645
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
2769
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => z11.object({
|
|
2646
2770
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
2647
2771
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
2648
2772
|
RECORDS_PER_PAGE_MAX,
|
|
2649
2773
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
2650
2774
|
)
|
|
2651
2775
|
});
|
|
2652
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
2653
|
-
totalRecords:
|
|
2654
|
-
totalPages:
|
|
2655
|
-
hasNext:
|
|
2656
|
-
hasPrev:
|
|
2657
|
-
startIndex:
|
|
2658
|
-
endIndex:
|
|
2776
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => z11.object({
|
|
2777
|
+
totalRecords: z11.literal(0),
|
|
2778
|
+
totalPages: z11.literal(1),
|
|
2779
|
+
hasNext: z11.literal(false),
|
|
2780
|
+
hasPrev: z11.literal(false),
|
|
2781
|
+
startIndex: z11.undefined(),
|
|
2782
|
+
endIndex: z11.undefined()
|
|
2659
2783
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
2660
2784
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
2661
2785
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -2690,15 +2814,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
2690
2814
|
});
|
|
2691
2815
|
}
|
|
2692
2816
|
}
|
|
2693
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
2817
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => z11.object({
|
|
2694
2818
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
2695
2819
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
2696
|
-
hasNext:
|
|
2697
|
-
hasPrev:
|
|
2820
|
+
hasNext: z11.boolean(),
|
|
2821
|
+
hasPrev: z11.boolean(),
|
|
2698
2822
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
2699
2823
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
2700
2824
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
2701
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
2825
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => z11.union([
|
|
2702
2826
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
2703
2827
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
2704
2828
|
]);
|
|
@@ -2728,20 +2852,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
2728
2852
|
});
|
|
2729
2853
|
}
|
|
2730
2854
|
}
|
|
2731
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
2855
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => z12.object({
|
|
2732
2856
|
action: makeRegistrarActionSchema(valueLabel),
|
|
2733
2857
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
2734
2858
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
2735
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
2736
|
-
responseCode:
|
|
2737
|
-
registrarActions:
|
|
2738
|
-
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`)
|
|
2859
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => z12.object({
|
|
2860
|
+
responseCode: z12.literal(RegistrarActionsResponseCodes.Ok),
|
|
2861
|
+
registrarActions: z12.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
2862
|
+
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
2863
|
+
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
|
|
2739
2864
|
});
|
|
2740
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
2741
|
-
responseCode:
|
|
2865
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => z12.strictObject({
|
|
2866
|
+
responseCode: z12.literal(RegistrarActionsResponseCodes.Error),
|
|
2742
2867
|
error: ErrorResponseSchema
|
|
2743
2868
|
});
|
|
2744
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
2869
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => z12.discriminatedUnion("responseCode", [
|
|
2745
2870
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
2746
2871
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
2747
2872
|
]);
|
|
@@ -2763,7 +2888,9 @@ ${prettifyError8(parsed.error)}
|
|
|
2763
2888
|
var RegistrarActionsFilterTypes = {
|
|
2764
2889
|
BySubregistryNode: "bySubregistryNode",
|
|
2765
2890
|
WithEncodedReferral: "withEncodedReferral",
|
|
2766
|
-
ByDecodedReferrer: "byDecodedReferrer"
|
|
2891
|
+
ByDecodedReferrer: "byDecodedReferrer",
|
|
2892
|
+
BeginTimestamp: "beginTimestamp",
|
|
2893
|
+
EndTimestamp: "endTimestamp"
|
|
2767
2894
|
};
|
|
2768
2895
|
var RegistrarActionsOrders = {
|
|
2769
2896
|
LatestRegistrarActions: "orderBy[timestamp]=desc"
|
|
@@ -2796,10 +2923,30 @@ function byDecodedReferrer(decodedReferrer) {
|
|
|
2796
2923
|
value: decodedReferrer
|
|
2797
2924
|
};
|
|
2798
2925
|
}
|
|
2926
|
+
function beginTimestamp(timestamp) {
|
|
2927
|
+
if (typeof timestamp === "undefined") {
|
|
2928
|
+
return void 0;
|
|
2929
|
+
}
|
|
2930
|
+
return {
|
|
2931
|
+
filterType: RegistrarActionsFilterTypes.BeginTimestamp,
|
|
2932
|
+
value: timestamp
|
|
2933
|
+
};
|
|
2934
|
+
}
|
|
2935
|
+
function endTimestamp(timestamp) {
|
|
2936
|
+
if (typeof timestamp === "undefined") {
|
|
2937
|
+
return void 0;
|
|
2938
|
+
}
|
|
2939
|
+
return {
|
|
2940
|
+
filterType: RegistrarActionsFilterTypes.EndTimestamp,
|
|
2941
|
+
value: timestamp
|
|
2942
|
+
};
|
|
2943
|
+
}
|
|
2799
2944
|
var registrarActionsFilter = {
|
|
2800
2945
|
byParentNode,
|
|
2801
2946
|
withReferral,
|
|
2802
|
-
byDecodedReferrer
|
|
2947
|
+
byDecodedReferrer,
|
|
2948
|
+
beginTimestamp,
|
|
2949
|
+
endTimestamp
|
|
2803
2950
|
};
|
|
2804
2951
|
|
|
2805
2952
|
// src/api/registrar-actions/prerequisites.ts
|
|
@@ -2854,14 +3001,14 @@ var registrarActionsPrerequisites = Object.freeze({
|
|
|
2854
3001
|
|
|
2855
3002
|
// src/registrars/basenames-subregistry.ts
|
|
2856
3003
|
import {
|
|
2857
|
-
DatasourceNames as
|
|
3004
|
+
DatasourceNames as DatasourceNames3,
|
|
2858
3005
|
ENSNamespaceIds as ENSNamespaceIds3,
|
|
2859
3006
|
maybeGetDatasource as maybeGetDatasource2
|
|
2860
3007
|
} from "@ensnode/datasources";
|
|
2861
3008
|
function getBasenamesSubregistryId(namespace) {
|
|
2862
|
-
const datasource = maybeGetDatasource2(namespace,
|
|
3009
|
+
const datasource = maybeGetDatasource2(namespace, DatasourceNames3.Basenames);
|
|
2863
3010
|
if (!datasource) {
|
|
2864
|
-
throw new Error(`Datasource not found for ${namespace} ${
|
|
3011
|
+
throw new Error(`Datasource not found for ${namespace} ${DatasourceNames3.Basenames}`);
|
|
2865
3012
|
}
|
|
2866
3013
|
const address = datasource.contracts.BaseRegistrar?.address;
|
|
2867
3014
|
if (address === void 0 || Array.isArray(address)) {
|
|
@@ -2878,7 +3025,6 @@ function getBasenamesSubregistryManagedName(namespaceId) {
|
|
|
2878
3025
|
return "base.eth";
|
|
2879
3026
|
case ENSNamespaceIds3.Sepolia:
|
|
2880
3027
|
return "basetest.eth";
|
|
2881
|
-
case ENSNamespaceIds3.Holesky:
|
|
2882
3028
|
case ENSNamespaceIds3.EnsTestEnv:
|
|
2883
3029
|
throw new Error(
|
|
2884
3030
|
`No registrar managed name is known for the 'basenames' subregistry within the "${namespaceId}" namespace.`
|
|
@@ -2888,14 +3034,14 @@ function getBasenamesSubregistryManagedName(namespaceId) {
|
|
|
2888
3034
|
|
|
2889
3035
|
// src/registrars/ethnames-subregistry.ts
|
|
2890
3036
|
import {
|
|
2891
|
-
DatasourceNames as
|
|
3037
|
+
DatasourceNames as DatasourceNames4,
|
|
2892
3038
|
ENSNamespaceIds as ENSNamespaceIds4,
|
|
2893
3039
|
maybeGetDatasource as maybeGetDatasource3
|
|
2894
3040
|
} from "@ensnode/datasources";
|
|
2895
3041
|
function getEthnamesSubregistryId(namespace) {
|
|
2896
|
-
const datasource = maybeGetDatasource3(namespace,
|
|
3042
|
+
const datasource = maybeGetDatasource3(namespace, DatasourceNames4.ENSRoot);
|
|
2897
3043
|
if (!datasource) {
|
|
2898
|
-
throw new Error(`Datasource not found for ${namespace} ${
|
|
3044
|
+
throw new Error(`Datasource not found for ${namespace} ${DatasourceNames4.ENSRoot}`);
|
|
2899
3045
|
}
|
|
2900
3046
|
const address = datasource.contracts.BaseRegistrar?.address;
|
|
2901
3047
|
if (address === void 0 || Array.isArray(address)) {
|
|
@@ -2910,7 +3056,6 @@ function getEthnamesSubregistryManagedName(namespaceId) {
|
|
|
2910
3056
|
switch (namespaceId) {
|
|
2911
3057
|
case ENSNamespaceIds4.Mainnet:
|
|
2912
3058
|
case ENSNamespaceIds4.Sepolia:
|
|
2913
|
-
case ENSNamespaceIds4.Holesky:
|
|
2914
3059
|
case ENSNamespaceIds4.EnsTestEnv:
|
|
2915
3060
|
return "eth";
|
|
2916
3061
|
}
|
|
@@ -2918,14 +3063,14 @@ function getEthnamesSubregistryManagedName(namespaceId) {
|
|
|
2918
3063
|
|
|
2919
3064
|
// src/registrars/lineanames-subregistry.ts
|
|
2920
3065
|
import {
|
|
2921
|
-
DatasourceNames as
|
|
3066
|
+
DatasourceNames as DatasourceNames5,
|
|
2922
3067
|
ENSNamespaceIds as ENSNamespaceIds5,
|
|
2923
3068
|
maybeGetDatasource as maybeGetDatasource4
|
|
2924
3069
|
} from "@ensnode/datasources";
|
|
2925
3070
|
function getLineanamesSubregistryId(namespace) {
|
|
2926
|
-
const datasource = maybeGetDatasource4(namespace,
|
|
3071
|
+
const datasource = maybeGetDatasource4(namespace, DatasourceNames5.Lineanames);
|
|
2927
3072
|
if (!datasource) {
|
|
2928
|
-
throw new Error(`Datasource not found for ${namespace} ${
|
|
3073
|
+
throw new Error(`Datasource not found for ${namespace} ${DatasourceNames5.Lineanames}`);
|
|
2929
3074
|
}
|
|
2930
3075
|
const address = datasource.contracts.BaseRegistrar?.address;
|
|
2931
3076
|
if (address === void 0 || Array.isArray(address)) {
|
|
@@ -2942,7 +3087,6 @@ function getLineanamesSubregistryManagedName(namespaceId) {
|
|
|
2942
3087
|
return "linea.eth";
|
|
2943
3088
|
case ENSNamespaceIds5.Sepolia:
|
|
2944
3089
|
return "linea-sepolia.eth";
|
|
2945
|
-
case ENSNamespaceIds5.Holesky:
|
|
2946
3090
|
case ENSNamespaceIds5.EnsTestEnv:
|
|
2947
3091
|
throw new Error(
|
|
2948
3092
|
`No registrar managed name is known for the 'Lineanames' subregistry within the "${namespaceId}" namespace.`
|
|
@@ -2950,6 +3094,21 @@ function getLineanamesSubregistryManagedName(namespaceId) {
|
|
|
2950
3094
|
}
|
|
2951
3095
|
}
|
|
2952
3096
|
|
|
3097
|
+
// src/registrars/registration-expiration.ts
|
|
3098
|
+
function isRegistrationExpired(info, now) {
|
|
3099
|
+
if (info.expiry == null) return false;
|
|
3100
|
+
return info.expiry <= now;
|
|
3101
|
+
}
|
|
3102
|
+
function isRegistrationFullyExpired(info, now) {
|
|
3103
|
+
if (info.expiry == null) return false;
|
|
3104
|
+
return now >= info.expiry + (info.gracePeriod ?? 0n);
|
|
3105
|
+
}
|
|
3106
|
+
function isRegistrationInGracePeriod(info, now) {
|
|
3107
|
+
if (info.expiry == null) return false;
|
|
3108
|
+
if (info.gracePeriod == null) return false;
|
|
3109
|
+
return info.expiry <= now && info.expiry + info.gracePeriod > now;
|
|
3110
|
+
}
|
|
3111
|
+
|
|
2953
3112
|
// src/api/registrar-actions/serialize.ts
|
|
2954
3113
|
function serializeNamedRegistrarAction({
|
|
2955
3114
|
action,
|
|
@@ -2966,7 +3125,8 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
2966
3125
|
return {
|
|
2967
3126
|
responseCode: response.responseCode,
|
|
2968
3127
|
registrarActions: response.registrarActions.map(serializeNamedRegistrarAction),
|
|
2969
|
-
pageContext: response.pageContext
|
|
3128
|
+
pageContext: response.pageContext,
|
|
3129
|
+
accurateAsOf: response.accurateAsOf
|
|
2970
3130
|
};
|
|
2971
3131
|
case RegistrarActionsResponseCodes.Error:
|
|
2972
3132
|
return response;
|
|
@@ -3037,7 +3197,7 @@ var ClientError = class _ClientError extends Error {
|
|
|
3037
3197
|
import { prettifyError as prettifyError10 } from "zod/v4";
|
|
3038
3198
|
|
|
3039
3199
|
// src/ensanalytics/zod-schemas.ts
|
|
3040
|
-
import
|
|
3200
|
+
import z13 from "zod/v4";
|
|
3041
3201
|
|
|
3042
3202
|
// src/ensanalytics/types.ts
|
|
3043
3203
|
var ReferrerLeaderboardPageResponseCodes = {
|
|
@@ -3062,20 +3222,28 @@ var ReferrerDetailResponseCodes = {
|
|
|
3062
3222
|
};
|
|
3063
3223
|
|
|
3064
3224
|
// src/ensanalytics/zod-schemas.ts
|
|
3065
|
-
var
|
|
3225
|
+
var makeRevenueContributionSchema = (valueLabel = "RevenueContribution") => z13.coerce.bigint({
|
|
3226
|
+
error: `${valueLabel} must represent a bigint.`
|
|
3227
|
+
}).nonnegative({
|
|
3228
|
+
error: `${valueLabel} must not be negative.`
|
|
3229
|
+
});
|
|
3230
|
+
var makeReferralProgramRulesSchema = (valueLabel = "ReferralProgramRules") => z13.object({
|
|
3066
3231
|
totalAwardPoolValue: makeFiniteNonNegativeNumberSchema(`${valueLabel}.totalAwardPoolValue`),
|
|
3067
3232
|
maxQualifiedReferrers: makeNonNegativeIntegerSchema(`${valueLabel}.maxQualifiedReferrers`),
|
|
3068
3233
|
startTime: makeUnixTimestampSchema(`${valueLabel}.startTime`),
|
|
3069
3234
|
endTime: makeUnixTimestampSchema(`${valueLabel}.endTime`),
|
|
3070
3235
|
subregistryId: makeAccountIdSchema(`${valueLabel}.subregistryId`)
|
|
3071
3236
|
});
|
|
3072
|
-
var makeAwardedReferrerMetricsSchema = (valueLabel = "AwardedReferrerMetrics") =>
|
|
3237
|
+
var makeAwardedReferrerMetricsSchema = (valueLabel = "AwardedReferrerMetrics") => z13.object({
|
|
3073
3238
|
referrer: makeLowercaseAddressSchema(`${valueLabel}.referrer`),
|
|
3074
3239
|
totalReferrals: makeNonNegativeIntegerSchema(`${valueLabel}.totalReferrals`),
|
|
3075
3240
|
totalIncrementalDuration: makeDurationSchema(`${valueLabel}.totalIncrementalDuration`),
|
|
3241
|
+
totalRevenueContribution: makeRevenueContributionSchema(
|
|
3242
|
+
`${valueLabel}.totalRevenueContribution`
|
|
3243
|
+
),
|
|
3076
3244
|
score: makeFiniteNonNegativeNumberSchema(`${valueLabel}.score`),
|
|
3077
3245
|
rank: makePositiveIntegerSchema(`${valueLabel}.rank`),
|
|
3078
|
-
isQualified:
|
|
3246
|
+
isQualified: z13.boolean(),
|
|
3079
3247
|
finalScoreBoost: makeFiniteNonNegativeNumberSchema(`${valueLabel}.finalScoreBoost`).max(
|
|
3080
3248
|
1,
|
|
3081
3249
|
`${valueLabel}.finalScoreBoost must be <= 1`
|
|
@@ -3087,13 +3255,16 @@ var makeAwardedReferrerMetricsSchema = (valueLabel = "AwardedReferrerMetrics") =
|
|
|
3087
3255
|
),
|
|
3088
3256
|
awardPoolApproxValue: makeFiniteNonNegativeNumberSchema(`${valueLabel}.awardPoolApproxValue`)
|
|
3089
3257
|
});
|
|
3090
|
-
var makeUnrankedReferrerMetricsSchema = (valueLabel = "UnrankedReferrerMetrics") =>
|
|
3258
|
+
var makeUnrankedReferrerMetricsSchema = (valueLabel = "UnrankedReferrerMetrics") => z13.object({
|
|
3091
3259
|
referrer: makeLowercaseAddressSchema(`${valueLabel}.referrer`),
|
|
3092
3260
|
totalReferrals: makeNonNegativeIntegerSchema(`${valueLabel}.totalReferrals`),
|
|
3093
3261
|
totalIncrementalDuration: makeDurationSchema(`${valueLabel}.totalIncrementalDuration`),
|
|
3262
|
+
totalRevenueContribution: makeRevenueContributionSchema(
|
|
3263
|
+
`${valueLabel}.totalRevenueContribution`
|
|
3264
|
+
),
|
|
3094
3265
|
score: makeFiniteNonNegativeNumberSchema(`${valueLabel}.score`),
|
|
3095
|
-
rank:
|
|
3096
|
-
isQualified:
|
|
3266
|
+
rank: z13.null(),
|
|
3267
|
+
isQualified: z13.literal(false),
|
|
3097
3268
|
finalScoreBoost: makeFiniteNonNegativeNumberSchema(`${valueLabel}.finalScoreBoost`).max(
|
|
3098
3269
|
1,
|
|
3099
3270
|
`${valueLabel}.finalScoreBoost must be <= 1`
|
|
@@ -3105,11 +3276,14 @@ var makeUnrankedReferrerMetricsSchema = (valueLabel = "UnrankedReferrerMetrics")
|
|
|
3105
3276
|
),
|
|
3106
3277
|
awardPoolApproxValue: makeFiniteNonNegativeNumberSchema(`${valueLabel}.awardPoolApproxValue`)
|
|
3107
3278
|
});
|
|
3108
|
-
var makeAggregatedReferrerMetricsSchema = (valueLabel = "AggregatedReferrerMetrics") =>
|
|
3279
|
+
var makeAggregatedReferrerMetricsSchema = (valueLabel = "AggregatedReferrerMetrics") => z13.object({
|
|
3109
3280
|
grandTotalReferrals: makeNonNegativeIntegerSchema(`${valueLabel}.grandTotalReferrals`),
|
|
3110
3281
|
grandTotalIncrementalDuration: makeDurationSchema(
|
|
3111
3282
|
`${valueLabel}.grandTotalIncrementalDuration`
|
|
3112
3283
|
),
|
|
3284
|
+
grandTotalRevenueContribution: makeRevenueContributionSchema(
|
|
3285
|
+
`${valueLabel}.grandTotalRevenueContribution`
|
|
3286
|
+
),
|
|
3113
3287
|
grandTotalQualifiedReferrersFinalScore: makeFiniteNonNegativeNumberSchema(
|
|
3114
3288
|
`${valueLabel}.grandTotalQualifiedReferrersFinalScore`
|
|
3115
3289
|
),
|
|
@@ -3117,7 +3291,7 @@ var makeAggregatedReferrerMetricsSchema = (valueLabel = "AggregatedReferrerMetri
|
|
|
3117
3291
|
`${valueLabel}.minFinalScoreToQualify`
|
|
3118
3292
|
)
|
|
3119
3293
|
});
|
|
3120
|
-
var makeReferrerLeaderboardPageContextSchema = (valueLabel = "ReferrerLeaderboardPageContext") =>
|
|
3294
|
+
var makeReferrerLeaderboardPageContextSchema = (valueLabel = "ReferrerLeaderboardPageContext") => z13.object({
|
|
3121
3295
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
3122
3296
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
3123
3297
|
REFERRERS_PER_LEADERBOARD_PAGE_MAX,
|
|
@@ -3125,66 +3299,153 @@ var makeReferrerLeaderboardPageContextSchema = (valueLabel = "ReferrerLeaderboar
|
|
|
3125
3299
|
),
|
|
3126
3300
|
totalRecords: makeNonNegativeIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3127
3301
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3128
|
-
hasNext:
|
|
3129
|
-
hasPrev:
|
|
3130
|
-
startIndex:
|
|
3131
|
-
endIndex:
|
|
3302
|
+
hasNext: z13.boolean(),
|
|
3303
|
+
hasPrev: z13.boolean(),
|
|
3304
|
+
startIndex: z13.optional(makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`)),
|
|
3305
|
+
endIndex: z13.optional(makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`))
|
|
3132
3306
|
});
|
|
3133
|
-
var makeReferrerLeaderboardPageSchema = (valueLabel = "ReferrerLeaderboardPage") =>
|
|
3307
|
+
var makeReferrerLeaderboardPageSchema = (valueLabel = "ReferrerLeaderboardPage") => z13.object({
|
|
3134
3308
|
rules: makeReferralProgramRulesSchema(`${valueLabel}.rules`),
|
|
3135
|
-
referrers:
|
|
3309
|
+
referrers: z13.array(makeAwardedReferrerMetricsSchema(`${valueLabel}.referrers[record]`)),
|
|
3136
3310
|
aggregatedMetrics: makeAggregatedReferrerMetricsSchema(`${valueLabel}.aggregatedMetrics`),
|
|
3137
3311
|
pageContext: makeReferrerLeaderboardPageContextSchema(`${valueLabel}.pageContext`),
|
|
3138
3312
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3139
3313
|
});
|
|
3140
|
-
var makeReferrerLeaderboardPageResponseOkSchema = (valueLabel = "ReferrerLeaderboardPageResponseOk") =>
|
|
3141
|
-
responseCode:
|
|
3314
|
+
var makeReferrerLeaderboardPageResponseOkSchema = (valueLabel = "ReferrerLeaderboardPageResponseOk") => z13.object({
|
|
3315
|
+
responseCode: z13.literal(ReferrerLeaderboardPageResponseCodes.Ok),
|
|
3142
3316
|
data: makeReferrerLeaderboardPageSchema(`${valueLabel}.data`)
|
|
3143
3317
|
});
|
|
3144
|
-
var makeReferrerLeaderboardPageResponseErrorSchema = (_valueLabel = "ReferrerLeaderboardPageResponseError") =>
|
|
3145
|
-
responseCode:
|
|
3146
|
-
error:
|
|
3147
|
-
errorMessage:
|
|
3318
|
+
var makeReferrerLeaderboardPageResponseErrorSchema = (_valueLabel = "ReferrerLeaderboardPageResponseError") => z13.object({
|
|
3319
|
+
responseCode: z13.literal(ReferrerLeaderboardPageResponseCodes.Error),
|
|
3320
|
+
error: z13.string(),
|
|
3321
|
+
errorMessage: z13.string()
|
|
3148
3322
|
});
|
|
3149
|
-
var makeReferrerLeaderboardPageResponseSchema = (valueLabel = "ReferrerLeaderboardPageResponse") =>
|
|
3323
|
+
var makeReferrerLeaderboardPageResponseSchema = (valueLabel = "ReferrerLeaderboardPageResponse") => z13.union([
|
|
3150
3324
|
makeReferrerLeaderboardPageResponseOkSchema(valueLabel),
|
|
3151
3325
|
makeReferrerLeaderboardPageResponseErrorSchema(valueLabel)
|
|
3152
3326
|
]);
|
|
3153
|
-
var makeReferrerDetailRankedSchema = (valueLabel = "ReferrerDetailRanked") =>
|
|
3154
|
-
type:
|
|
3327
|
+
var makeReferrerDetailRankedSchema = (valueLabel = "ReferrerDetailRanked") => z13.object({
|
|
3328
|
+
type: z13.literal(ReferrerDetailTypeIds.Ranked),
|
|
3155
3329
|
rules: makeReferralProgramRulesSchema(`${valueLabel}.rules`),
|
|
3156
3330
|
referrer: makeAwardedReferrerMetricsSchema(`${valueLabel}.referrer`),
|
|
3157
3331
|
aggregatedMetrics: makeAggregatedReferrerMetricsSchema(`${valueLabel}.aggregatedMetrics`),
|
|
3158
3332
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3159
3333
|
});
|
|
3160
|
-
var makeReferrerDetailUnrankedSchema = (valueLabel = "ReferrerDetailUnranked") =>
|
|
3161
|
-
type:
|
|
3334
|
+
var makeReferrerDetailUnrankedSchema = (valueLabel = "ReferrerDetailUnranked") => z13.object({
|
|
3335
|
+
type: z13.literal(ReferrerDetailTypeIds.Unranked),
|
|
3162
3336
|
rules: makeReferralProgramRulesSchema(`${valueLabel}.rules`),
|
|
3163
3337
|
referrer: makeUnrankedReferrerMetricsSchema(`${valueLabel}.referrer`),
|
|
3164
3338
|
aggregatedMetrics: makeAggregatedReferrerMetricsSchema(`${valueLabel}.aggregatedMetrics`),
|
|
3165
3339
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3166
3340
|
});
|
|
3167
|
-
var makeReferrerDetailResponseOkSchema = (valueLabel = "ReferrerDetailResponse") =>
|
|
3168
|
-
responseCode:
|
|
3169
|
-
data:
|
|
3341
|
+
var makeReferrerDetailResponseOkSchema = (valueLabel = "ReferrerDetailResponse") => z13.object({
|
|
3342
|
+
responseCode: z13.literal(ReferrerDetailResponseCodes.Ok),
|
|
3343
|
+
data: z13.union([
|
|
3170
3344
|
makeReferrerDetailRankedSchema(`${valueLabel}.data`),
|
|
3171
3345
|
makeReferrerDetailUnrankedSchema(`${valueLabel}.data`)
|
|
3172
3346
|
])
|
|
3173
3347
|
});
|
|
3174
|
-
var makeReferrerDetailResponseErrorSchema = (_valueLabel = "ReferrerDetailResponse") =>
|
|
3175
|
-
responseCode:
|
|
3176
|
-
error:
|
|
3177
|
-
errorMessage:
|
|
3348
|
+
var makeReferrerDetailResponseErrorSchema = (_valueLabel = "ReferrerDetailResponse") => z13.object({
|
|
3349
|
+
responseCode: z13.literal(ReferrerDetailResponseCodes.Error),
|
|
3350
|
+
error: z13.string(),
|
|
3351
|
+
errorMessage: z13.string()
|
|
3178
3352
|
});
|
|
3179
|
-
var makeReferrerDetailResponseSchema = (valueLabel = "ReferrerDetailResponse") =>
|
|
3353
|
+
var makeReferrerDetailResponseSchema = (valueLabel = "ReferrerDetailResponse") => z13.union([
|
|
3180
3354
|
makeReferrerDetailResponseOkSchema(valueLabel),
|
|
3181
3355
|
makeReferrerDetailResponseErrorSchema(valueLabel)
|
|
3182
3356
|
]);
|
|
3183
3357
|
|
|
3184
3358
|
// src/ensanalytics/deserialize.ts
|
|
3359
|
+
function deserializeRevenueContribution(value) {
|
|
3360
|
+
return BigInt(value);
|
|
3361
|
+
}
|
|
3362
|
+
function deserializeReferralProgramRules(rules) {
|
|
3363
|
+
return rules;
|
|
3364
|
+
}
|
|
3365
|
+
function deserializeAwardedReferrerMetrics(metrics) {
|
|
3366
|
+
return {
|
|
3367
|
+
referrer: metrics.referrer,
|
|
3368
|
+
totalReferrals: metrics.totalReferrals,
|
|
3369
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3370
|
+
totalRevenueContribution: deserializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3371
|
+
score: metrics.score,
|
|
3372
|
+
rank: metrics.rank,
|
|
3373
|
+
isQualified: metrics.isQualified,
|
|
3374
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3375
|
+
finalScore: metrics.finalScore,
|
|
3376
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3377
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3378
|
+
};
|
|
3379
|
+
}
|
|
3380
|
+
function deserializeUnrankedReferrerMetrics(metrics) {
|
|
3381
|
+
return {
|
|
3382
|
+
referrer: metrics.referrer,
|
|
3383
|
+
totalReferrals: metrics.totalReferrals,
|
|
3384
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3385
|
+
totalRevenueContribution: deserializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3386
|
+
score: metrics.score,
|
|
3387
|
+
rank: metrics.rank,
|
|
3388
|
+
isQualified: metrics.isQualified,
|
|
3389
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3390
|
+
finalScore: metrics.finalScore,
|
|
3391
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3392
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3393
|
+
};
|
|
3394
|
+
}
|
|
3395
|
+
function deserializeAggregatedReferrerMetrics(metrics) {
|
|
3396
|
+
return {
|
|
3397
|
+
grandTotalReferrals: metrics.grandTotalReferrals,
|
|
3398
|
+
grandTotalIncrementalDuration: metrics.grandTotalIncrementalDuration,
|
|
3399
|
+
grandTotalRevenueContribution: deserializeRevenueContribution(
|
|
3400
|
+
metrics.grandTotalRevenueContribution
|
|
3401
|
+
),
|
|
3402
|
+
grandTotalQualifiedReferrersFinalScore: metrics.grandTotalQualifiedReferrersFinalScore,
|
|
3403
|
+
minFinalScoreToQualify: metrics.minFinalScoreToQualify
|
|
3404
|
+
};
|
|
3405
|
+
}
|
|
3406
|
+
function deserializeReferrerLeaderboardPage(page) {
|
|
3407
|
+
return {
|
|
3408
|
+
rules: deserializeReferralProgramRules(page.rules),
|
|
3409
|
+
referrers: page.referrers.map(deserializeAwardedReferrerMetrics),
|
|
3410
|
+
aggregatedMetrics: deserializeAggregatedReferrerMetrics(page.aggregatedMetrics),
|
|
3411
|
+
pageContext: page.pageContext,
|
|
3412
|
+
accurateAsOf: page.accurateAsOf
|
|
3413
|
+
};
|
|
3414
|
+
}
|
|
3415
|
+
function deserializeReferrerDetailRanked(detail) {
|
|
3416
|
+
return {
|
|
3417
|
+
type: detail.type,
|
|
3418
|
+
rules: deserializeReferralProgramRules(detail.rules),
|
|
3419
|
+
referrer: deserializeAwardedReferrerMetrics(detail.referrer),
|
|
3420
|
+
aggregatedMetrics: deserializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3421
|
+
accurateAsOf: detail.accurateAsOf
|
|
3422
|
+
};
|
|
3423
|
+
}
|
|
3424
|
+
function deserializeReferrerDetailUnranked(detail) {
|
|
3425
|
+
return {
|
|
3426
|
+
type: detail.type,
|
|
3427
|
+
rules: deserializeReferralProgramRules(detail.rules),
|
|
3428
|
+
referrer: deserializeUnrankedReferrerMetrics(detail.referrer),
|
|
3429
|
+
aggregatedMetrics: deserializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3430
|
+
accurateAsOf: detail.accurateAsOf
|
|
3431
|
+
};
|
|
3432
|
+
}
|
|
3185
3433
|
function deserializeReferrerLeaderboardPageResponse(maybeResponse, valueLabel) {
|
|
3434
|
+
let deserialized;
|
|
3435
|
+
switch (maybeResponse.responseCode) {
|
|
3436
|
+
case "ok": {
|
|
3437
|
+
deserialized = {
|
|
3438
|
+
responseCode: maybeResponse.responseCode,
|
|
3439
|
+
data: deserializeReferrerLeaderboardPage(maybeResponse.data)
|
|
3440
|
+
};
|
|
3441
|
+
break;
|
|
3442
|
+
}
|
|
3443
|
+
case "error":
|
|
3444
|
+
deserialized = maybeResponse;
|
|
3445
|
+
break;
|
|
3446
|
+
}
|
|
3186
3447
|
const schema = makeReferrerLeaderboardPageResponseSchema(valueLabel);
|
|
3187
|
-
const parsed = schema.safeParse(
|
|
3448
|
+
const parsed = schema.safeParse(deserialized);
|
|
3188
3449
|
if (parsed.error) {
|
|
3189
3450
|
throw new Error(
|
|
3190
3451
|
`Cannot deserialize SerializedReferrerLeaderboardPageResponse:
|
|
@@ -3195,8 +3456,31 @@ ${prettifyError10(parsed.error)}
|
|
|
3195
3456
|
return parsed.data;
|
|
3196
3457
|
}
|
|
3197
3458
|
function deserializeReferrerDetailResponse(maybeResponse, valueLabel) {
|
|
3459
|
+
let deserialized;
|
|
3460
|
+
switch (maybeResponse.responseCode) {
|
|
3461
|
+
case "ok": {
|
|
3462
|
+
switch (maybeResponse.data.type) {
|
|
3463
|
+
case "ranked":
|
|
3464
|
+
deserialized = {
|
|
3465
|
+
responseCode: maybeResponse.responseCode,
|
|
3466
|
+
data: deserializeReferrerDetailRanked(maybeResponse.data)
|
|
3467
|
+
};
|
|
3468
|
+
break;
|
|
3469
|
+
case "unranked":
|
|
3470
|
+
deserialized = {
|
|
3471
|
+
responseCode: maybeResponse.responseCode,
|
|
3472
|
+
data: deserializeReferrerDetailUnranked(maybeResponse.data)
|
|
3473
|
+
};
|
|
3474
|
+
break;
|
|
3475
|
+
}
|
|
3476
|
+
break;
|
|
3477
|
+
}
|
|
3478
|
+
case "error":
|
|
3479
|
+
deserialized = maybeResponse;
|
|
3480
|
+
break;
|
|
3481
|
+
}
|
|
3198
3482
|
const schema = makeReferrerDetailResponseSchema(valueLabel);
|
|
3199
|
-
const parsed = schema.safeParse(
|
|
3483
|
+
const parsed = schema.safeParse(deserialized);
|
|
3200
3484
|
if (parsed.error) {
|
|
3201
3485
|
throw new Error(`Cannot deserialize ReferrerDetailResponse:
|
|
3202
3486
|
${prettifyError10(parsed.error)}
|
|
@@ -3206,10 +3490,87 @@ ${prettifyError10(parsed.error)}
|
|
|
3206
3490
|
}
|
|
3207
3491
|
|
|
3208
3492
|
// src/ensanalytics/serialize.ts
|
|
3493
|
+
function serializeRevenueContribution(revenueContribution) {
|
|
3494
|
+
return revenueContribution.toString();
|
|
3495
|
+
}
|
|
3496
|
+
function serializeReferralProgramRules(rules) {
|
|
3497
|
+
return rules;
|
|
3498
|
+
}
|
|
3499
|
+
function serializeAwardedReferrerMetrics(metrics) {
|
|
3500
|
+
return {
|
|
3501
|
+
referrer: metrics.referrer,
|
|
3502
|
+
totalReferrals: metrics.totalReferrals,
|
|
3503
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3504
|
+
totalRevenueContribution: serializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3505
|
+
score: metrics.score,
|
|
3506
|
+
rank: metrics.rank,
|
|
3507
|
+
isQualified: metrics.isQualified,
|
|
3508
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3509
|
+
finalScore: metrics.finalScore,
|
|
3510
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3511
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3512
|
+
};
|
|
3513
|
+
}
|
|
3514
|
+
function serializeUnrankedReferrerMetrics(metrics) {
|
|
3515
|
+
return {
|
|
3516
|
+
referrer: metrics.referrer,
|
|
3517
|
+
totalReferrals: metrics.totalReferrals,
|
|
3518
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3519
|
+
totalRevenueContribution: serializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3520
|
+
score: metrics.score,
|
|
3521
|
+
rank: metrics.rank,
|
|
3522
|
+
isQualified: metrics.isQualified,
|
|
3523
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3524
|
+
finalScore: metrics.finalScore,
|
|
3525
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3526
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3527
|
+
};
|
|
3528
|
+
}
|
|
3529
|
+
function serializeAggregatedReferrerMetrics(metrics) {
|
|
3530
|
+
return {
|
|
3531
|
+
grandTotalReferrals: metrics.grandTotalReferrals,
|
|
3532
|
+
grandTotalIncrementalDuration: metrics.grandTotalIncrementalDuration,
|
|
3533
|
+
grandTotalRevenueContribution: serializeRevenueContribution(
|
|
3534
|
+
metrics.grandTotalRevenueContribution
|
|
3535
|
+
),
|
|
3536
|
+
grandTotalQualifiedReferrersFinalScore: metrics.grandTotalQualifiedReferrersFinalScore,
|
|
3537
|
+
minFinalScoreToQualify: metrics.minFinalScoreToQualify
|
|
3538
|
+
};
|
|
3539
|
+
}
|
|
3540
|
+
function serializeReferrerLeaderboardPage(page) {
|
|
3541
|
+
return {
|
|
3542
|
+
rules: serializeReferralProgramRules(page.rules),
|
|
3543
|
+
referrers: page.referrers.map(serializeAwardedReferrerMetrics),
|
|
3544
|
+
aggregatedMetrics: serializeAggregatedReferrerMetrics(page.aggregatedMetrics),
|
|
3545
|
+
pageContext: page.pageContext,
|
|
3546
|
+
accurateAsOf: page.accurateAsOf
|
|
3547
|
+
};
|
|
3548
|
+
}
|
|
3549
|
+
function serializeReferrerDetailRanked(detail) {
|
|
3550
|
+
return {
|
|
3551
|
+
type: detail.type,
|
|
3552
|
+
rules: serializeReferralProgramRules(detail.rules),
|
|
3553
|
+
referrer: serializeAwardedReferrerMetrics(detail.referrer),
|
|
3554
|
+
aggregatedMetrics: serializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3555
|
+
accurateAsOf: detail.accurateAsOf
|
|
3556
|
+
};
|
|
3557
|
+
}
|
|
3558
|
+
function serializeReferrerDetailUnranked(detail) {
|
|
3559
|
+
return {
|
|
3560
|
+
type: detail.type,
|
|
3561
|
+
rules: serializeReferralProgramRules(detail.rules),
|
|
3562
|
+
referrer: serializeUnrankedReferrerMetrics(detail.referrer),
|
|
3563
|
+
aggregatedMetrics: serializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3564
|
+
accurateAsOf: detail.accurateAsOf
|
|
3565
|
+
};
|
|
3566
|
+
}
|
|
3209
3567
|
function serializeReferrerLeaderboardPageResponse(response) {
|
|
3210
3568
|
switch (response.responseCode) {
|
|
3211
3569
|
case ReferrerLeaderboardPageResponseCodes.Ok:
|
|
3212
|
-
return
|
|
3570
|
+
return {
|
|
3571
|
+
responseCode: response.responseCode,
|
|
3572
|
+
data: serializeReferrerLeaderboardPage(response.data)
|
|
3573
|
+
};
|
|
3213
3574
|
case ReferrerLeaderboardPageResponseCodes.Error:
|
|
3214
3575
|
return response;
|
|
3215
3576
|
}
|
|
@@ -3217,7 +3578,19 @@ function serializeReferrerLeaderboardPageResponse(response) {
|
|
|
3217
3578
|
function serializeReferrerDetailResponse(response) {
|
|
3218
3579
|
switch (response.responseCode) {
|
|
3219
3580
|
case ReferrerDetailResponseCodes.Ok:
|
|
3220
|
-
|
|
3581
|
+
switch (response.data.type) {
|
|
3582
|
+
case "ranked":
|
|
3583
|
+
return {
|
|
3584
|
+
responseCode: response.responseCode,
|
|
3585
|
+
data: serializeReferrerDetailRanked(response.data)
|
|
3586
|
+
};
|
|
3587
|
+
case "unranked":
|
|
3588
|
+
return {
|
|
3589
|
+
responseCode: response.responseCode,
|
|
3590
|
+
data: serializeReferrerDetailUnranked(response.data)
|
|
3591
|
+
};
|
|
3592
|
+
}
|
|
3593
|
+
break;
|
|
3221
3594
|
case ReferrerDetailResponseCodes.Error:
|
|
3222
3595
|
return response;
|
|
3223
3596
|
}
|
|
@@ -3649,6 +4022,7 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
3649
4022
|
* const { registrarActions, pageContext } = response;
|
|
3650
4023
|
* console.log(registrarActions);
|
|
3651
4024
|
* console.log(`Page ${pageContext.page} of ${pageContext.totalPages}`);
|
|
4025
|
+
* console.log(`Accurate as of: ${response.accurateAsOf}`);
|
|
3652
4026
|
* }
|
|
3653
4027
|
*
|
|
3654
4028
|
* // Get second page with 25 records per page
|
|
@@ -3679,6 +4053,26 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
3679
4053
|
* filters: [registrarActionsFilter.byParentNode(namehash('base.eth'))],
|
|
3680
4054
|
* recordsPerPage: 10
|
|
3681
4055
|
* });
|
|
4056
|
+
*
|
|
4057
|
+
* // get registrar actions within a specific time range
|
|
4058
|
+
* const beginTimestamp = 1764547200; // Dec 1, 2025, 00:00:00 UTC
|
|
4059
|
+
* const endTimestamp = 1767225600; // Jan 1, 2026, 00:00:00 UTC
|
|
4060
|
+
* await client.registrarActions({
|
|
4061
|
+
* filters: [
|
|
4062
|
+
* registrarActionsFilter.beginTimestamp(beginTimestamp),
|
|
4063
|
+
* registrarActionsFilter.endTimestamp(endTimestamp),
|
|
4064
|
+
* ],
|
|
4065
|
+
* });
|
|
4066
|
+
*
|
|
4067
|
+
* // get registrar actions from a specific timestamp onwards
|
|
4068
|
+
* await client.registrarActions({
|
|
4069
|
+
* filters: [registrarActionsFilter.beginTimestamp(1764547200)],
|
|
4070
|
+
* });
|
|
4071
|
+
*
|
|
4072
|
+
* // get registrar actions up to a specific timestamp
|
|
4073
|
+
* await client.registrarActions({
|
|
4074
|
+
* filters: [registrarActionsFilter.endTimestamp(1767225600)],
|
|
4075
|
+
* });
|
|
3682
4076
|
* ```
|
|
3683
4077
|
*/
|
|
3684
4078
|
async registrarActions(request = {}) {
|
|
@@ -3700,6 +4094,18 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
3700
4094
|
);
|
|
3701
4095
|
return decodedReferrerFilter ? { key: "decodedReferrer", value: decodedReferrerFilter.value } : null;
|
|
3702
4096
|
};
|
|
4097
|
+
const buildBeginTimestampArg = (filters) => {
|
|
4098
|
+
const beginTimestampFilter = filters?.find(
|
|
4099
|
+
(f) => f.filterType === RegistrarActionsFilterTypes.BeginTimestamp
|
|
4100
|
+
);
|
|
4101
|
+
return beginTimestampFilter ? { key: "beginTimestamp", value: beginTimestampFilter.value.toString() } : null;
|
|
4102
|
+
};
|
|
4103
|
+
const buildEndTimestampArg = (filters) => {
|
|
4104
|
+
const endTimestampFilter = filters?.find(
|
|
4105
|
+
(f) => f.filterType === RegistrarActionsFilterTypes.EndTimestamp
|
|
4106
|
+
);
|
|
4107
|
+
return endTimestampFilter ? { key: "endTimestamp", value: endTimestampFilter.value.toString() } : null;
|
|
4108
|
+
};
|
|
3703
4109
|
const buildOrderArg = (order) => {
|
|
3704
4110
|
switch (order) {
|
|
3705
4111
|
case RegistrarActionsOrders.LatestRegistrarActions: {
|
|
@@ -3730,6 +4136,14 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
3730
4136
|
if (decodedReferrerArg) {
|
|
3731
4137
|
url.searchParams.set(decodedReferrerArg.key, decodedReferrerArg.value);
|
|
3732
4138
|
}
|
|
4139
|
+
const beginTimestampArg = buildBeginTimestampArg(request.filters);
|
|
4140
|
+
if (beginTimestampArg) {
|
|
4141
|
+
url.searchParams.set(beginTimestampArg.key, beginTimestampArg.value);
|
|
4142
|
+
}
|
|
4143
|
+
const endTimestampArg = buildEndTimestampArg(request.filters);
|
|
4144
|
+
if (endTimestampArg) {
|
|
4145
|
+
url.searchParams.set(endTimestampArg.key, endTimestampArg.value);
|
|
4146
|
+
}
|
|
3733
4147
|
const response = await fetch(url);
|
|
3734
4148
|
let responseData;
|
|
3735
4149
|
try {
|
|
@@ -3783,7 +4197,7 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
3783
4197
|
const url = new URL(`/api/name-tokens`, this.options.url);
|
|
3784
4198
|
if (request.name !== void 0) {
|
|
3785
4199
|
url.searchParams.set("name", request.name);
|
|
3786
|
-
} else {
|
|
4200
|
+
} else if (request.domainId !== void 0) {
|
|
3787
4201
|
url.searchParams.set("domainId", request.domainId);
|
|
3788
4202
|
}
|
|
3789
4203
|
const response = await fetch(url);
|
|
@@ -3808,6 +4222,30 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
3808
4222
|
}
|
|
3809
4223
|
};
|
|
3810
4224
|
|
|
4225
|
+
// src/ensv2/ids-lib.ts
|
|
4226
|
+
import { hexToBigInt as hexToBigInt2 } from "viem";
|
|
4227
|
+
var makeRegistryId = (accountId) => formatAccountId(accountId);
|
|
4228
|
+
var makeENSv1DomainId = (node) => node;
|
|
4229
|
+
var makeENSv2DomainId = (registry, canonicalId) => formatAssetId({
|
|
4230
|
+
assetNamespace: AssetNamespaces.ERC1155,
|
|
4231
|
+
contract: registry,
|
|
4232
|
+
tokenId: canonicalId
|
|
4233
|
+
});
|
|
4234
|
+
var maskLower32Bits = (num) => num ^ num & 0xffffffffn;
|
|
4235
|
+
var getCanonicalId = (input) => {
|
|
4236
|
+
if (typeof input === "bigint") return maskLower32Bits(input);
|
|
4237
|
+
return getCanonicalId(hexToBigInt2(input));
|
|
4238
|
+
};
|
|
4239
|
+
var makePermissionsId = (contract) => formatAccountId(contract);
|
|
4240
|
+
var makePermissionsResourceId = (contract, resource) => `${makePermissionsId(contract)}/${resource}`;
|
|
4241
|
+
var makePermissionsUserId = (contract, resource, user) => `${makePermissionsId(contract)}/${resource}/${user}`;
|
|
4242
|
+
var makeResolverId = (contract) => formatAccountId(contract);
|
|
4243
|
+
var makeResolverRecordsId = (resolver, node) => `${makeResolverId(resolver)}/${node}`;
|
|
4244
|
+
var makeLatestRegistrationId = (domainId) => `${domainId}/latest`;
|
|
4245
|
+
var makeRegistrationId = (domainId, index = 0) => `${domainId}/${index}`;
|
|
4246
|
+
var makeLatestRenewalId = (domainId, registrationIndex) => `${makeRegistrationId(domainId, registrationIndex)}/latest`;
|
|
4247
|
+
var makeRenewalId = (domainId, registrationIndex, index = 0) => `${makeRegistrationId(domainId, registrationIndex)}/${index}`;
|
|
4248
|
+
|
|
3811
4249
|
// src/identity/identity.ts
|
|
3812
4250
|
import { getENSRootChainId as getENSRootChainId2 } from "@ensnode/datasources";
|
|
3813
4251
|
|
|
@@ -3912,6 +4350,7 @@ export {
|
|
|
3912
4350
|
LruCache,
|
|
3913
4351
|
NFTMintStatuses,
|
|
3914
4352
|
NFTTransferTypes,
|
|
4353
|
+
NODE_ANY,
|
|
3915
4354
|
NameTokenOwnershipTypes,
|
|
3916
4355
|
NameTokensResponseCodes,
|
|
3917
4356
|
NameTokensResponseErrorCodes,
|
|
@@ -3921,6 +4360,7 @@ export {
|
|
|
3921
4360
|
RECORDS_PER_PAGE_DEFAULT,
|
|
3922
4361
|
RECORDS_PER_PAGE_MAX,
|
|
3923
4362
|
ROOT_NODE,
|
|
4363
|
+
ROOT_RESOURCE,
|
|
3924
4364
|
ReferrerDetailResponseCodes,
|
|
3925
4365
|
ReferrerLeaderboardPageResponseCodes,
|
|
3926
4366
|
RegistrarActionTypes,
|
|
@@ -3984,15 +4424,20 @@ export {
|
|
|
3984
4424
|
deserializedNameTokensResponse,
|
|
3985
4425
|
durationBetween,
|
|
3986
4426
|
encodeLabelHash,
|
|
4427
|
+
encodedLabelToLabelhash,
|
|
3987
4428
|
evmChainIdToCoinType,
|
|
3988
4429
|
formatAccountId,
|
|
3989
4430
|
formatAssetId,
|
|
3990
4431
|
formatNFTTransferEventMetadata,
|
|
3991
4432
|
getBasenamesSubregistryId,
|
|
3992
4433
|
getBasenamesSubregistryManagedName,
|
|
4434
|
+
getCanonicalId,
|
|
3993
4435
|
getCurrencyInfo,
|
|
3994
4436
|
getDatasourceContract,
|
|
3995
4437
|
getENSRootChainId,
|
|
4438
|
+
getENSv1Registry,
|
|
4439
|
+
getENSv2RootRegistry,
|
|
4440
|
+
getENSv2RootRegistryId,
|
|
3996
4441
|
getEthnamesSubregistryId,
|
|
3997
4442
|
getEthnamesSubregistryManagedName,
|
|
3998
4443
|
getLatestIndexedBlockRef,
|
|
@@ -4009,16 +4454,33 @@ export {
|
|
|
4009
4454
|
getTimestampForHighestOmnichainKnownBlock,
|
|
4010
4455
|
getTimestampForLowestOmnichainStartBlock,
|
|
4011
4456
|
hasNullByte,
|
|
4457
|
+
interpretAddress,
|
|
4458
|
+
interpretAddressRecordValue,
|
|
4459
|
+
interpretNameRecordValue,
|
|
4460
|
+
interpretTextRecordKey,
|
|
4461
|
+
interpretTextRecordValue,
|
|
4462
|
+
interpretTokenIdAsLabelHash,
|
|
4463
|
+
interpretTokenIdAsNode,
|
|
4012
4464
|
interpretedLabelsToInterpretedName,
|
|
4465
|
+
interpretedNameToInterpretedLabels,
|
|
4466
|
+
interpretedNameToLabelHashPath,
|
|
4467
|
+
isENSv1Registry,
|
|
4468
|
+
isENSv2RootRegistry,
|
|
4013
4469
|
isEncodedLabelHash,
|
|
4014
4470
|
isHttpProtocol,
|
|
4471
|
+
isInterpetedLabel,
|
|
4472
|
+
isInterpretedName,
|
|
4015
4473
|
isLabelHash,
|
|
4016
4474
|
isNormalizedLabel,
|
|
4017
4475
|
isNormalizedName,
|
|
4476
|
+
isPccFuseSet,
|
|
4018
4477
|
isPriceCurrencyEqual,
|
|
4019
4478
|
isPriceEqual,
|
|
4020
4479
|
isRegistrarActionPricingAvailable,
|
|
4021
4480
|
isRegistrarActionReferralAvailable,
|
|
4481
|
+
isRegistrationExpired,
|
|
4482
|
+
isRegistrationFullyExpired,
|
|
4483
|
+
isRegistrationInGracePeriod,
|
|
4022
4484
|
isResolvedIdentity,
|
|
4023
4485
|
isSelectionEmpty,
|
|
4024
4486
|
isSubgraphCompatible,
|
|
@@ -4028,7 +4490,20 @@ export {
|
|
|
4028
4490
|
literalLabelToInterpretedLabel,
|
|
4029
4491
|
literalLabelsToInterpretedName,
|
|
4030
4492
|
literalLabelsToLiteralName,
|
|
4493
|
+
makeContractMatcher,
|
|
4031
4494
|
makeENSApiPublicConfigSchema,
|
|
4495
|
+
makeENSv1DomainId,
|
|
4496
|
+
makeENSv2DomainId,
|
|
4497
|
+
makeLatestRegistrationId,
|
|
4498
|
+
makeLatestRenewalId,
|
|
4499
|
+
makePermissionsId,
|
|
4500
|
+
makePermissionsResourceId,
|
|
4501
|
+
makePermissionsUserId,
|
|
4502
|
+
makeRegistrationId,
|
|
4503
|
+
makeRegistryId,
|
|
4504
|
+
makeRenewalId,
|
|
4505
|
+
makeResolverId,
|
|
4506
|
+
makeResolverRecordsId,
|
|
4032
4507
|
makeSubdomainNode,
|
|
4033
4508
|
maybeGetDatasourceContract,
|
|
4034
4509
|
nameTokensPrerequisites,
|