From faa8b617c6b931514a8abc80aea981a3588681a5 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 31 Mar 2026 16:39:07 -0500 Subject: [PATCH 1/8] refactor canonical id to storage id Rename getCanonicalId to getStorageId and CanonicalId type to StorageId across ensindexer, ensapi, and ensnode-sdk. Remove the canonicalId field from the ENSv2Domain GraphQL type. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/ensapi/src/graphql-api/schema/domain.ts | 12 +----- .../schema/query.integration.test.ts | 4 +- apps/ensapi/src/graphql-api/yoga.ts | 1 - .../ensv2/handlers/ensv2/ENSv2Registry.ts | 38 +++++++++---------- .../ensv2/handlers/ensv2/ETHRegistrar.ts | 10 ++--- .../handlers/ENSv2Registry.ts | 6 +-- packages/ensnode-sdk/src/ensv2/ids-lib.ts | 14 +++---- .../src/omnigraph/generated/graphql-env.d.ts | 2 +- .../src/omnigraph/generated/schema.graphql | 3 -- 9 files changed, 38 insertions(+), 52 deletions(-) diff --git a/apps/ensapi/src/graphql-api/schema/domain.ts b/apps/ensapi/src/graphql-api/schema/domain.ts index d218faabf4..72a3694468 100644 --- a/apps/ensapi/src/graphql-api/schema/domain.ts +++ b/apps/ensapi/src/graphql-api/schema/domain.ts @@ -5,7 +5,7 @@ import { type DomainId, type ENSv1DomainId, type ENSv2DomainId, - getCanonicalId, + getStorageId, interpretedLabelsToInterpretedName, } from "@ensnode/ensnode-sdk"; @@ -309,16 +309,6 @@ ENSv2DomainRef.implement({ interfaces: [DomainInterfaceRef], isTypeOf: (domain) => !isENSv1Domain(domain as Domain), fields: (t) => ({ - ////////////////////// - // Domain.canonicalId - ////////////////////// - canonicalId: t.field({ - description: "The ENSv2Domain's Canonical Id.", - type: "BigInt", - nullable: false, - resolve: (parent) => getCanonicalId(parent.tokenId), - }), - ////////////////////// // Domain.tokenId ////////////////////// diff --git a/apps/ensapi/src/graphql-api/schema/query.integration.test.ts b/apps/ensapi/src/graphql-api/schema/query.integration.test.ts index 11300b5cd8..aa44b2aa7e 100644 --- a/apps/ensapi/src/graphql-api/schema/query.integration.test.ts +++ b/apps/ensapi/src/graphql-api/schema/query.integration.test.ts @@ -4,9 +4,9 @@ import { describe, expect, it } from "vitest"; import { DatasourceNames } from "@ensnode/datasources"; import { type DomainId, - getCanonicalId, getDatasourceContract, getENSv2RootRegistryId, + getStorageId, type InterpretedLabel, makeENSv1DomainId, makeENSv2DomainId, @@ -37,7 +37,7 @@ const V2_ROOT_REGISTRY = getDatasourceContract( const V1_ETH_DOMAIN_ID = makeENSv1DomainId(namehash("eth")); -const V2_ETH_CANONICAL_ID = getCanonicalId(labelhash("eth")); +const V2_ETH_CANONICAL_ID = getStorageId(labelhash("eth")); const V2_ETH_DOMAIN_ID = makeENSv2DomainId(V2_ROOT_REGISTRY, V2_ETH_CANONICAL_ID); describe("Query.root", () => { diff --git a/apps/ensapi/src/graphql-api/yoga.ts b/apps/ensapi/src/graphql-api/yoga.ts index 7bc2841c51..7ac1e447fb 100644 --- a/apps/ensapi/src/graphql-api/yoga.ts +++ b/apps/ensapi/src/graphql-api/yoga.ts @@ -28,7 +28,6 @@ export const yoga = createYoga({ parent { label } } ... on ENSv2Domain { - canonicalId registry { contract {chainId address}} } } diff --git a/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ENSv2Registry.ts b/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ENSv2Registry.ts index 5e64789640..9e4adff730 100644 --- a/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ENSv2Registry.ts +++ b/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ENSv2Registry.ts @@ -2,7 +2,7 @@ import { type Address, hexToBigInt, labelhash } from "viem"; import { type AccountId, - getCanonicalId, + getStorageId, interpretAddress, isRegistrationFullyExpired, type LabelHash, @@ -57,18 +57,18 @@ export default function () { const registry = getThisAccountId(context, event); const registryId = makeRegistryId(registry); - const canonicalId = getCanonicalId(tokenId); - const domainId = makeENSv2DomainId(registry, canonicalId); + const storageId = getStorageId(tokenId); + const domainId = makeENSv2DomainId(registry, storageId); // Sanity Check: LabelHash must match Label if (labelHash !== labelhash(label)) { throw new Error(`Sanity Check: labelHash !== labelhash(label)\n${toJson(event.args)}`); } - // Sanity Check: CanonicalId must match LabelHash - if (canonicalId !== getCanonicalId(hexToBigInt(labelHash))) { + // Sanity Check: StorageId must match LabelHash + if (storageId !== getStorageId(hexToBigInt(labelHash))) { throw new Error( - `Sanity Check: canonicalId !== getCanonicalId(hexToBigInt(labelHash))\n${toJson(event.args)}`, + `Sanity Check: storageId !== getStorageId(hexToBigInt(labelHash))\n${toJson(event.args)}`, ); } @@ -160,8 +160,8 @@ export default function () { const { tokenId, sender: unregistrant } = event.args; const registry = getThisAccountId(context, event); - const canonicalId = getCanonicalId(tokenId); - const domainId = makeENSv2DomainId(registry, canonicalId); + const storageId = getStorageId(tokenId); + const domainId = makeENSv2DomainId(registry, storageId); const registration = await getLatestRegistration(context, domainId); @@ -210,8 +210,8 @@ export default function () { const { tokenId, newExpiry: expiry, sender } = event.args; const registry = getThisAccountId(context, event); - const canonicalId = getCanonicalId(tokenId); - const domainId = makeENSv2DomainId(registry, canonicalId); + const storageId = getStorageId(tokenId); + const domainId = makeENSv2DomainId(registry, storageId); const registration = await getLatestRegistration(context, domainId); @@ -253,8 +253,8 @@ export default function () { const subregistry = interpretAddress(_subregistry); const registryAccountId = getThisAccountId(context, event); - const canonicalId = getCanonicalId(tokenId); - const domainId = makeENSv2DomainId(registryAccountId, canonicalId); + const storageId = getStorageId(tokenId); + const domainId = makeENSv2DomainId(registryAccountId, storageId); // update domain's subregistry if (subregistry === null) { @@ -307,14 +307,14 @@ export default function () { }) => { const { oldTokenId, newTokenId } = event.args; - // Invariant: CanonicalIds must match - if (getCanonicalId(oldTokenId) !== getCanonicalId(newTokenId)) { - throw new Error(`Invariant(ENSv2Registry:TokenRegenerated): Canonical ID Malformed.`); + // Invariant: StorageIds must match + if (getStorageId(oldTokenId) !== getStorageId(newTokenId)) { + throw new Error(`Invariant(ENSv2Registry:TokenRegenerated): Storage Id Malformed.`); } - const canonicalId = getCanonicalId(oldTokenId); + const storageId = getStorageId(oldTokenId); const registryAccountId = getThisAccountId(context, event); - const domainId = makeENSv2DomainId(registryAccountId, canonicalId); + const domainId = makeENSv2DomainId(registryAccountId, storageId); await context.ensDb .update(ensIndexerSchema.v2Domain, { id: domainId }) @@ -334,9 +334,9 @@ export default function () { }) { const { id: tokenId, to: owner } = event.args; - const canonicalId = getCanonicalId(tokenId); + const storageId = getStorageId(tokenId); const registry = getThisAccountId(context, event); - const domainId = makeENSv2DomainId(registry, canonicalId); + const domainId = makeENSv2DomainId(registry, storageId); // TODO(signals): remove this invariant, since we'll only be indexing Registry contracts const registryId = makeRegistryId(registry); diff --git a/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.ts b/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.ts index 0d4c54657e..e411eda02d 100644 --- a/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.ts +++ b/apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.ts @@ -3,7 +3,7 @@ import type { Address } from "viem"; import { type AccountId, type EncodedReferrer, - getCanonicalId, + getStorageId, interpretAddress, isRegistrationFullyExpired, makeENSv2DomainId, @@ -70,8 +70,8 @@ export default function () { // _before_ this event. This event upserts the latest Registration with payment info. const { registrar, registry } = await getRegistrarAndRegistry(context, event); - const canonicalId = getCanonicalId(tokenId); - const domainId = makeENSv2DomainId(registry, canonicalId); + const storageId = getStorageId(tokenId); + const domainId = makeENSv2DomainId(registry, storageId); const registration = await getLatestRegistration(context, domainId); @@ -145,8 +145,8 @@ export default function () { // update Registration.expiry, it just needs to update the latest Renewal const { registry } = await getRegistrarAndRegistry(context, event); - const canonicalId = getCanonicalId(tokenId); - const domainId = makeENSv2DomainId(registry, canonicalId); + const storageId = getStorageId(tokenId); + const domainId = makeENSv2DomainId(registry, storageId); const registration = await getLatestRegistration(context, domainId); diff --git a/apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv2Registry.ts b/apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv2Registry.ts index 69d8f60d4c..4b791b721f 100644 --- a/apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv2Registry.ts +++ b/apps/ensindexer/src/plugins/protocol-acceleration/handlers/ENSv2Registry.ts @@ -1,6 +1,6 @@ import type { Address } from "viem"; -import { getCanonicalId, makeENSv2DomainId, PluginName } from "@ensnode/ensnode-sdk"; +import { getStorageId, makeENSv2DomainId, PluginName } from "@ensnode/ensnode-sdk"; import { getThisAccountId } from "@/lib/get-this-account-id"; import { addOnchainEventListener, type IndexingEngineContext } from "@/lib/indexing-engines/ponder"; @@ -26,8 +26,8 @@ export default function () { const { tokenId, resolver } = event.args; const registry = getThisAccountId(context, event); - const canonicalId = getCanonicalId(tokenId); - const domainId = makeENSv2DomainId(registry, canonicalId); + const storageId = getStorageId(tokenId); + const domainId = makeENSv2DomainId(registry, storageId); await ensureDomainResolverRelation(context, registry, domainId, resolver); }, diff --git a/packages/ensnode-sdk/src/ensv2/ids-lib.ts b/packages/ensnode-sdk/src/ensv2/ids-lib.ts index fe98dfe5e7..e5b260c47e 100644 --- a/packages/ensnode-sdk/src/ensv2/ids-lib.ts +++ b/packages/ensnode-sdk/src/ensv2/ids-lib.ts @@ -10,7 +10,6 @@ import { } from "@ensnode/ensnode-sdk"; import type { - CanonicalId, DomainId, ENSv1DomainId, ENSv2DomainId, @@ -22,6 +21,7 @@ import type { RenewalId, ResolverId, ResolverRecordsId, + StorageId, } from "./ids"; /** @@ -35,13 +35,13 @@ export const makeRegistryId = (accountId: AccountId) => formatAccountId(accountI export const makeENSv1DomainId = (node: Node) => node as ENSv1DomainId; /** - * Makes an ENSv2 Domain Id given the parent `registry` and the domain's `canonicalId`. + * Makes an ENSv2 Domain Id given the parent `registry` and the domain's `storageId`. */ -export const makeENSv2DomainId = (registry: AccountId, canonicalId: CanonicalId) => +export const makeENSv2DomainId = (registry: AccountId, storageId: StorageId) => formatAssetId({ assetNamespace: AssetNamespaces.ERC1155, contract: registry, - tokenId: canonicalId, + tokenId: storageId, }) as ENSv2DomainId; /** @@ -50,11 +50,11 @@ export const makeENSv2DomainId = (registry: AccountId, canonicalId: CanonicalId) const maskLower32Bits = (num: bigint) => num ^ (num & 0xffffffffn); /** - * Computes a Domain's {@link CanonicalId} given its tokenId or LabelHash as `input`. + * Computes a Label's {@link StorageId} given its tokenId or LabelHash as `input`. */ -export const getCanonicalId = (input: bigint | LabelHash): CanonicalId => { +export const getStorageId = (input: bigint | LabelHash): StorageId => { if (typeof input === "bigint") return maskLower32Bits(input); - return getCanonicalId(hexToBigInt(input)); + return getStorageId(hexToBigInt(input)); }; /** diff --git a/packages/enssdk/src/omnigraph/generated/graphql-env.d.ts b/packages/enssdk/src/omnigraph/generated/graphql-env.d.ts index 68dc4c8e32..0e932636f1 100644 --- a/packages/enssdk/src/omnigraph/generated/graphql-env.d.ts +++ b/packages/enssdk/src/omnigraph/generated/graphql-env.d.ts @@ -37,7 +37,7 @@ export type introspection_types = { 'DomainsOrderInput': { kind: 'INPUT_OBJECT'; name: 'DomainsOrderInput'; isOneOf: false; inputFields: [{ name: 'by'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'DomainsOrderBy'; ofType: null; }; }; defaultValue: null }, { name: 'dir'; type: { kind: 'ENUM'; name: 'OrderDirection'; ofType: null; }; defaultValue: "ASC" }]; }; 'DomainsWhereInput': { kind: 'INPUT_OBJECT'; name: 'DomainsWhereInput'; isOneOf: false; inputFields: [{ name: 'canonical'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: "false" }, { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }]; }; 'ENSv1Domain': { kind: 'OBJECT'; name: 'ENSv1Domain'; fields: { 'events': { name: 'events'; type: { kind: 'OBJECT'; name: 'DomainEventsConnection'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DomainId'; ofType: null; }; } }; 'label': { name: 'label'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Label'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'Name'; ofType: null; } }; 'owner': { name: 'owner'; type: { kind: 'OBJECT'; name: 'Account'; ofType: null; } }; 'parent': { name: 'parent'; type: { kind: 'OBJECT'; name: 'ENSv1Domain'; ofType: null; } }; 'path': { name: 'path'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INTERFACE'; name: 'Domain'; ofType: null; }; }; } }; 'registration': { name: 'registration'; type: { kind: 'INTERFACE'; name: 'Registration'; ofType: null; } }; 'registrations': { name: 'registrations'; type: { kind: 'OBJECT'; name: 'DomainRegistrationsConnection'; ofType: null; } }; 'resolver': { name: 'resolver'; type: { kind: 'OBJECT'; name: 'Resolver'; ofType: null; } }; 'rootRegistryOwner': { name: 'rootRegistryOwner'; type: { kind: 'OBJECT'; name: 'Account'; ofType: null; } }; 'subdomains': { name: 'subdomains'; type: { kind: 'OBJECT'; name: 'DomainSubdomainsConnection'; ofType: null; } }; }; }; - 'ENSv2Domain': { kind: 'OBJECT'; name: 'ENSv2Domain'; fields: { 'canonicalId': { name: 'canonicalId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; } }; 'events': { name: 'events'; type: { kind: 'OBJECT'; name: 'DomainEventsConnection'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DomainId'; ofType: null; }; } }; 'label': { name: 'label'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Label'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'Name'; ofType: null; } }; 'owner': { name: 'owner'; type: { kind: 'OBJECT'; name: 'Account'; ofType: null; } }; 'path': { name: 'path'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INTERFACE'; name: 'Domain'; ofType: null; }; }; } }; 'permissions': { name: 'permissions'; type: { kind: 'OBJECT'; name: 'ENSv2DomainPermissionsConnection'; ofType: null; } }; 'registration': { name: 'registration'; type: { kind: 'INTERFACE'; name: 'Registration'; ofType: null; } }; 'registrations': { name: 'registrations'; type: { kind: 'OBJECT'; name: 'DomainRegistrationsConnection'; ofType: null; } }; 'registry': { name: 'registry'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Registry'; ofType: null; }; } }; 'resolver': { name: 'resolver'; type: { kind: 'OBJECT'; name: 'Resolver'; ofType: null; } }; 'subdomains': { name: 'subdomains'; type: { kind: 'OBJECT'; name: 'DomainSubdomainsConnection'; ofType: null; } }; 'subregistry': { name: 'subregistry'; type: { kind: 'OBJECT'; name: 'Registry'; ofType: null; } }; 'tokenId': { name: 'tokenId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; } }; }; }; + 'ENSv2Domain': { kind: 'OBJECT'; name: 'ENSv2Domain'; fields: { 'events': { name: 'events'; type: { kind: 'OBJECT'; name: 'DomainEventsConnection'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DomainId'; ofType: null; }; } }; 'label': { name: 'label'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Label'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'SCALAR'; name: 'Name'; ofType: null; } }; 'owner': { name: 'owner'; type: { kind: 'OBJECT'; name: 'Account'; ofType: null; } }; 'path': { name: 'path'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INTERFACE'; name: 'Domain'; ofType: null; }; }; } }; 'permissions': { name: 'permissions'; type: { kind: 'OBJECT'; name: 'ENSv2DomainPermissionsConnection'; ofType: null; } }; 'registration': { name: 'registration'; type: { kind: 'INTERFACE'; name: 'Registration'; ofType: null; } }; 'registrations': { name: 'registrations'; type: { kind: 'OBJECT'; name: 'DomainRegistrationsConnection'; ofType: null; } }; 'registry': { name: 'registry'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Registry'; ofType: null; }; } }; 'resolver': { name: 'resolver'; type: { kind: 'OBJECT'; name: 'Resolver'; ofType: null; } }; 'subdomains': { name: 'subdomains'; type: { kind: 'OBJECT'; name: 'DomainSubdomainsConnection'; ofType: null; } }; 'subregistry': { name: 'subregistry'; type: { kind: 'OBJECT'; name: 'Registry'; ofType: null; } }; 'tokenId': { name: 'tokenId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; } }; }; }; 'ENSv2DomainPermissionsConnection': { kind: 'OBJECT'; name: 'ENSv2DomainPermissionsConnection'; fields: { 'edges': { name: 'edges'; type: { kind: 'LIST'; name: never; ofType: { kind: 'OBJECT'; name: 'ENSv2DomainPermissionsConnectionEdge'; ofType: null; }; } }; 'pageInfo': { name: 'pageInfo'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'PageInfo'; ofType: null; }; } }; 'totalCount': { name: 'totalCount'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; }; }; 'ENSv2DomainPermissionsConnectionEdge': { kind: 'OBJECT'; name: 'ENSv2DomainPermissionsConnectionEdge'; fields: { 'cursor': { name: 'cursor'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'node': { name: 'node'; type: { kind: 'OBJECT'; name: 'PermissionsUser'; ofType: null; } }; }; }; 'ENSv2RegistryRegistration': { kind: 'OBJECT'; name: 'ENSv2RegistryRegistration'; fields: { 'domain': { name: 'domain'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INTERFACE'; name: 'Domain'; ofType: null; }; } }; 'event': { name: 'event'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Event'; ofType: null; }; } }; 'expired': { name: 'expired'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'expiry': { name: 'expiry'; type: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'RegistrationId'; ofType: null; }; } }; 'referrer': { name: 'referrer'; type: { kind: 'SCALAR'; name: 'Hex'; ofType: null; } }; 'registrant': { name: 'registrant'; type: { kind: 'OBJECT'; name: 'Account'; ofType: null; } }; 'registrar': { name: 'registrar'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'AccountId'; ofType: null; }; } }; 'renewals': { name: 'renewals'; type: { kind: 'OBJECT'; name: 'RegistrationRenewalsConnection'; ofType: null; } }; 'start': { name: 'start'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'BigInt'; ofType: null; }; } }; 'unregistrant': { name: 'unregistrant'; type: { kind: 'OBJECT'; name: 'Account'; ofType: null; } }; }; }; diff --git a/packages/enssdk/src/omnigraph/generated/schema.graphql b/packages/enssdk/src/omnigraph/generated/schema.graphql index c80de6e7c1..7a59f7bd9c 100644 --- a/packages/enssdk/src/omnigraph/generated/schema.graphql +++ b/packages/enssdk/src/omnigraph/generated/schema.graphql @@ -361,9 +361,6 @@ type ENSv1Domain implements Domain { """An ENSv2Domain represents an ENSv2 Domain.""" type ENSv2Domain implements Domain { - """The ENSv2Domain's Canonical Id.""" - canonicalId: BigInt! - """All Events associated with this Domain.""" events(after: String, before: String, first: Int, last: Int, where: EventsWhereInput): DomainEventsConnection From 991eb47bf7b5a1a2b8400d832e768f909c873cac Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 31 Mar 2026 16:52:27 -0500 Subject: [PATCH 2/8] refactor: move semantic types to enssdk and use in omnigraph client --- apps/ensapi/package.json | 1 + apps/ensapi/src/graphql-api/builder.ts | 5 +- apps/ensapi/src/graphql-api/schema/domain.ts | 1 - packages/ensnode-sdk/package.json | 1 + packages/ensnode-sdk/src/ens/coin-type.ts | 10 +-- packages/ensnode-sdk/src/ens/constants.ts | 3 +- .../src/ens/dns-encoded-name.test.ts | 2 +- .../ensnode-sdk/src/ens/dns-encoded-name.ts | 3 +- .../ensnode-sdk/src/ens/encode-labelhash.ts | 3 +- packages/ensnode-sdk/src/ens/index.ts | 6 +- packages/ensnode-sdk/src/ens/is-normalized.ts | 3 +- packages/ensnode-sdk/src/ens/labelhash.ts | 3 +- packages/ensnode-sdk/src/ens/names.test.ts | 2 +- packages/ensnode-sdk/src/ens/names.ts | 2 +- .../ensnode-sdk/src/ens/parse-labelhash.ts | 3 +- .../ensnode-sdk/src/ens/parse-reverse-name.ts | 4 +- packages/ensnode-sdk/src/ens/reverse-name.ts | 4 +- .../ensnode-sdk/src/ens/subname-helpers.ts | 3 +- .../src/ensapi/api/name-tokens/request.ts | 2 +- .../src/ensapi/api/name-tokens/response.ts | 3 +- .../api/name-tokens/zod-schemas.test.ts | 3 +- .../ensapi/api/registrar-actions/filters.ts | 2 +- .../ensapi/api/registrar-actions/request.ts | 2 +- .../ensapi/api/registrar-actions/response.ts | 3 +- .../api/registrar-actions/zod-schemas.test.ts | 2 +- .../src/ensindexer/config/label-utils.ts | 3 +- .../src/ensindexer/config/serialize.ts | 3 +- .../src/ensindexer/config/serialized-types.ts | 3 +- .../src/ensindexer/config/types.ts | 3 +- packages/ensnode-sdk/src/ensv2/ids-lib.ts | 20 +++--- packages/ensnode-sdk/src/ensv2/index.ts | 1 - packages/ensnode-sdk/src/identity/identity.ts | 2 +- packages/ensnode-sdk/src/identity/types.ts | 4 +- packages/ensnode-sdk/src/index.ts | 6 +- .../chain-indexing-status-snapshot.ts | 4 +- .../cross-chain-indexing-status-snapshot.ts | 4 +- .../omnichain-indexing-status-snapshot.ts | 3 +- .../omnichain-indexing-status-snapshot.ts | 4 +- .../chain-indexing-status-snapshot.ts | 4 +- .../omnichain-indexing-status-snapshot.ts | 3 +- .../src/registrars/basenames-subregistry.ts | 5 +- .../src/registrars/ethnames-subregistry.ts | 5 +- .../src/registrars/lineanames-subregistry.ts | 5 +- .../src/registrars/registration-lifecycle.ts | 3 +- .../ensnode-sdk/src/registrars/subregistry.ts | 3 +- .../src/resolution/ensip19-chainid.ts | 2 +- .../resolution/resolver-records-response.ts | 3 +- .../resolution/resolver-records-selection.ts | 2 +- packages/ensnode-sdk/src/resolution/types.ts | 3 +- .../ensnode-sdk/src/shared/account-id.test.ts | 2 +- packages/ensnode-sdk/src/shared/account-id.ts | 3 +- .../src/shared/config/build-rpc-urls.test.ts | 2 +- .../shared/config/indexed-blockranges.test.ts | 2 +- .../src/shared/config/indexed-blockranges.ts | 3 +- .../src/shared/config/rpc-configs-from-env.ts | 3 +- .../ensnode-sdk/src/shared/config/types.ts | 3 +- .../src/shared/config/zod-schemas.ts | 2 +- .../src/shared/datasource-contract.ts | 4 +- .../ensnode-sdk/src/shared/deserialize.ts | 4 +- .../interpretation/interpret-record-values.ts | 3 +- .../interpretation/interpret-tokenid.ts | 4 +- .../interpreted-names-and-labels.ts | 23 ++++--- .../shared/interpretation/reinterpretation.ts | 9 +-- packages/ensnode-sdk/src/shared/labelhash.ts | 3 +- .../ensnode-sdk/src/shared/root-registry.ts | 3 +- packages/ensnode-sdk/src/shared/serialize.ts | 19 +++--- packages/ensnode-sdk/src/shared/types.ts | 64 ------------------- .../ensnode-sdk/src/shared/zod-schemas.ts | 21 +++--- packages/ensnode-sdk/src/tokenscope/assets.ts | 13 +++- .../src/tokenscope/name-token.test.ts | 3 +- .../ensnode-sdk/src/tokenscope/name-token.ts | 4 +- .../src/tokenscope/zod-schemas.test.ts | 3 +- .../ensnode-sdk/src/tokenscope/zod-schemas.ts | 2 +- packages/enssdk/package.json | 9 ++- packages/enssdk/src/index.ts | 1 + packages/enssdk/src/lib/types/coin-type.ts | 1 + .../types.ts => enssdk/src/lib/types/ens.ts} | 13 ---- .../ids.ts => enssdk/src/lib/types/ensv2.ts} | 19 ++++-- packages/enssdk/src/lib/types/evm.ts | 61 ++++++++++++++++++ packages/enssdk/src/lib/types/index.ts | 5 ++ .../src/lib/types/shared.ts} | 2 - packages/enssdk/src/omnigraph/graphql.ts | 44 ++++++++++--- packages/enssdk/tsup.config.ts | 1 + pnpm-lock.yaml | 12 ++++ 84 files changed, 295 insertions(+), 249 deletions(-) create mode 100644 packages/enssdk/src/index.ts create mode 100644 packages/enssdk/src/lib/types/coin-type.ts rename packages/{ensnode-sdk/src/ens/types.ts => enssdk/src/lib/types/ens.ts} (95%) rename packages/{ensnode-sdk/src/ensv2/ids.ts => enssdk/src/lib/types/ensv2.ts} (65%) create mode 100644 packages/enssdk/src/lib/types/evm.ts create mode 100644 packages/enssdk/src/lib/types/index.ts rename packages/{ensnode-sdk/src/shared/serialized-types.ts => enssdk/src/lib/types/shared.ts} (95%) diff --git a/apps/ensapi/package.json b/apps/ensapi/package.json index db942274f5..6495829925 100644 --- a/apps/ensapi/package.json +++ b/apps/ensapi/package.json @@ -50,6 +50,7 @@ "dataloader": "^2.2.3", "date-fns": "catalog:", "drizzle-orm": "catalog:", + "enssdk": "workspace:*", "graphql": "^16.11.0", "graphql-yoga": "^5.16.0", "hono": "catalog:", diff --git a/apps/ensapi/src/graphql-api/builder.ts b/apps/ensapi/src/graphql-api/builder.ts index 183277edd5..214406f016 100644 --- a/apps/ensapi/src/graphql-api/builder.ts +++ b/apps/ensapi/src/graphql-api/builder.ts @@ -1,8 +1,6 @@ import SchemaBuilder, { type MaybePromise } from "@pothos/core"; import DataloaderPlugin from "@pothos/plugin-dataloader"; import RelayPlugin from "@pothos/plugin-relay"; -import type { Address, Hex } from "viem"; - import type { ChainId, CoinType, @@ -17,7 +15,8 @@ import type { RenewalId, ResolverId, ResolverRecordsId, -} from "@ensnode/ensnode-sdk"; +} from "enssdk"; +import type { Address, Hex } from "viem"; import type { context } from "@/graphql-api/context"; diff --git a/apps/ensapi/src/graphql-api/schema/domain.ts b/apps/ensapi/src/graphql-api/schema/domain.ts index 72a3694468..fcc81e849e 100644 --- a/apps/ensapi/src/graphql-api/schema/domain.ts +++ b/apps/ensapi/src/graphql-api/schema/domain.ts @@ -5,7 +5,6 @@ import { type DomainId, type ENSv1DomainId, type ENSv2DomainId, - getStorageId, interpretedLabelsToInterpretedName, } from "@ensnode/ensnode-sdk"; diff --git a/packages/ensnode-sdk/package.json b/packages/ensnode-sdk/package.json index bdb5692854..f1af3dc109 100644 --- a/packages/ensnode-sdk/package.json +++ b/packages/ensnode-sdk/package.json @@ -64,6 +64,7 @@ "@ensnode/datasources": "workspace:*", "caip": "catalog:", "date-fns": "catalog:", + "enssdk": "workspace:*", "zod": "catalog:" } } diff --git a/packages/ensnode-sdk/src/ens/coin-type.ts b/packages/ensnode-sdk/src/ens/coin-type.ts index c18ee9b0ce..deb1cf47a2 100644 --- a/packages/ensnode-sdk/src/ens/coin-type.ts +++ b/packages/ensnode-sdk/src/ens/coin-type.ts @@ -1,14 +1,8 @@ -import type { CoinType, EvmCoinType } from "@ensdomains/address-encoder"; import { coinTypeToEvmChainId as _coinTypeToEvmChainId, evmChainIdToCoinType as _evmChainIdToCoinType, } from "@ensdomains/address-encoder/utils"; - -import type { ChainId } from "../shared/types"; - -// re-export CoinType and EvmCoinType from @ensdomains/address-encoder -// so consumers don't need it as a dependency -export type { CoinType, EvmCoinType } from "@ensdomains/address-encoder"; +import type { ChainId, CoinType, EvmCoinType } from "enssdk"; /** * The ETH coinType. @@ -38,7 +32,7 @@ export const DEFAULT_EVM_COIN_TYPE = 0x8000_0000 as EvmCoinType; * NOTE: for whatever reason @ensdomains/address-encoder#coinTypeToEvmChainId doesn't handle the * mainnet case so we implement that here * - * @see https://docs.ens.domains/ensip/11/ + * @see https://docs.ens.domains/ensip/11 */ export const coinTypeToEvmChainId = (coinType: CoinType): ChainId => { if (coinType === ETH_COIN_TYPE) return 1; diff --git a/packages/ensnode-sdk/src/ens/constants.ts b/packages/ensnode-sdk/src/ens/constants.ts index 491fd2ea7e..f89742fc51 100644 --- a/packages/ensnode-sdk/src/ens/constants.ts +++ b/packages/ensnode-sdk/src/ens/constants.ts @@ -1,7 +1,6 @@ +import type { Node } from "enssdk"; import { namehash, zeroHash } from "viem"; -import type { Node } from "./types"; - export const ROOT_NODE: Node = namehash(""); export const ETH_NODE: Node = namehash("eth"); export const BASENAMES_NODE: Node = namehash("base.eth"); diff --git a/packages/ensnode-sdk/src/ens/dns-encoded-name.test.ts b/packages/ensnode-sdk/src/ens/dns-encoded-name.test.ts index ed70a378cd..5a4811c814 100644 --- a/packages/ensnode-sdk/src/ens/dns-encoded-name.test.ts +++ b/packages/ensnode-sdk/src/ens/dns-encoded-name.test.ts @@ -1,3 +1,4 @@ +import type { DNSEncodedName, LiteralLabel } from "enssdk"; import { bytesToHex, stringToHex } from "viem"; import { packetToBytes } from "viem/ens"; import { describe, expect, it } from "vitest"; @@ -5,7 +6,6 @@ import { describe, expect, it } from "vitest"; import { labelhashLiteralLabel } from "../shared/labelhash"; import { decodeDNSEncodedName } from "./dns-encoded-name"; import { encodeLabelHash } from "./encode-labelhash"; -import type { DNSEncodedName, LiteralLabel } from "./types"; const MULTI_BYTE_UNICODE_NAMES = ["👩🏼‍❤‍💋‍👨🏼.eth"]; diff --git a/packages/ensnode-sdk/src/ens/dns-encoded-name.ts b/packages/ensnode-sdk/src/ens/dns-encoded-name.ts index c1d6e7c11b..9f93a0d5da 100644 --- a/packages/ensnode-sdk/src/ens/dns-encoded-name.ts +++ b/packages/ensnode-sdk/src/ens/dns-encoded-name.ts @@ -1,7 +1,6 @@ +import type { DNSEncodedLiteralName, DNSEncodedName, LiteralLabel } from "enssdk"; import { bytesToString, hexToBytes } from "viem"; -import type { DNSEncodedLiteralName, DNSEncodedName, LiteralLabel } from "./types"; - /** * Decodes a DNS-Encoded name consisting of Literal Labels into an ordered list of Literal Labels. * diff --git a/packages/ensnode-sdk/src/ens/encode-labelhash.ts b/packages/ensnode-sdk/src/ens/encode-labelhash.ts index a171542fda..d6017c8689 100644 --- a/packages/ensnode-sdk/src/ens/encode-labelhash.ts +++ b/packages/ensnode-sdk/src/ens/encode-labelhash.ts @@ -1,5 +1,6 @@ +import type { EncodedLabelHash, LabelHash } from "enssdk"; + import { isLabelHash } from "./labelhash"; -import type { EncodedLabelHash, LabelHash } from "./types"; /** * Formats a LabelHash as an Encoded LabelHash. diff --git a/packages/ensnode-sdk/src/ens/index.ts b/packages/ensnode-sdk/src/ens/index.ts index 5b0d4cd1fa..3a9ef37be3 100644 --- a/packages/ensnode-sdk/src/ens/index.ts +++ b/packages/ensnode-sdk/src/ens/index.ts @@ -1,4 +1,7 @@ -export { getENSRootChainId } from "@ensnode/datasources"; +export * from "enssdk"; + +export type { ENSNamespaceId } from "@ensnode/datasources"; +export { ENSNamespaceIds, getENSRootChainId } from "@ensnode/datasources"; export * from "./coin-type"; export * from "./constants"; @@ -12,4 +15,3 @@ export * from "./parse-labelhash"; export * from "./parse-reverse-name"; export * from "./reverse-name"; export * from "./subname-helpers"; -export * from "./types"; diff --git a/packages/ensnode-sdk/src/ens/is-normalized.ts b/packages/ensnode-sdk/src/ens/is-normalized.ts index b4dfd675cf..4130419d91 100644 --- a/packages/ensnode-sdk/src/ens/is-normalized.ts +++ b/packages/ensnode-sdk/src/ens/is-normalized.ts @@ -1,7 +1,6 @@ +import type { Label, Name, NormalizedName } from "enssdk"; import { normalize } from "viem/ens"; -import type { Label, Name, NormalizedName } from "./types"; - /** * Determines whether the Name is normalized. * diff --git a/packages/ensnode-sdk/src/ens/labelhash.ts b/packages/ensnode-sdk/src/ens/labelhash.ts index bf8eb1ae2a..bbb7fdb404 100644 --- a/packages/ensnode-sdk/src/ens/labelhash.ts +++ b/packages/ensnode-sdk/src/ens/labelhash.ts @@ -1,7 +1,6 @@ +import type { LabelHash } from "enssdk"; import { isHex } from "viem"; -import type { LabelHash } from "./types"; - /** * Checks if the input is a {@link LabelHash}. * diff --git a/packages/ensnode-sdk/src/ens/names.test.ts b/packages/ensnode-sdk/src/ens/names.test.ts index f4b2263fa8..7154f47393 100644 --- a/packages/ensnode-sdk/src/ens/names.test.ts +++ b/packages/ensnode-sdk/src/ens/names.test.ts @@ -1,7 +1,7 @@ +import type { Name, NormalizedName } from "enssdk"; import { describe, expect, it } from "vitest"; import { beautifyName, ENS_ROOT, getNameHierarchy, getParentNameFQDN } from "./names"; -import type { Name, NormalizedName } from "./types"; describe("names", () => { describe("getNameHierarchy", () => { diff --git a/packages/ensnode-sdk/src/ens/names.ts b/packages/ensnode-sdk/src/ens/names.ts index e4f7a5348e..cc4fac8dba 100644 --- a/packages/ensnode-sdk/src/ens/names.ts +++ b/packages/ensnode-sdk/src/ens/names.ts @@ -1,7 +1,7 @@ import { ens_beautify } from "@adraffy/ens-normalize"; +import type { Label, Name, NormalizedName } from "enssdk"; import { isNormalizedLabel } from "./is-normalized"; -import type { Label, Name, NormalizedName } from "./types"; /** * Name for the ENS Root diff --git a/packages/ensnode-sdk/src/ens/parse-labelhash.ts b/packages/ensnode-sdk/src/ens/parse-labelhash.ts index 98ae231c7b..234cf2236c 100644 --- a/packages/ensnode-sdk/src/ens/parse-labelhash.ts +++ b/packages/ensnode-sdk/src/ens/parse-labelhash.ts @@ -1,7 +1,6 @@ +import type { LabelHash } from "enssdk"; import { isHex } from "viem"; -import type { LabelHash } from "./types"; - /** * Parses a labelHash string and normalizes it to a canonical `LabelHash`. * diff --git a/packages/ensnode-sdk/src/ens/parse-reverse-name.ts b/packages/ensnode-sdk/src/ens/parse-reverse-name.ts index f9e35bf614..fdca3f675c 100644 --- a/packages/ensnode-sdk/src/ens/parse-reverse-name.ts +++ b/packages/ensnode-sdk/src/ens/parse-reverse-name.ts @@ -1,8 +1,8 @@ +import type { CoinType, Label, Name } from "enssdk"; import { type Address, hexToBigInt, isAddress } from "viem"; import { asLowerCaseAddress } from "../shared/address"; -import { bigintToCoinType, type CoinType, DEFAULT_EVM_COIN_TYPE, ETH_COIN_TYPE } from "./coin-type"; -import type { Label, Name } from "./types"; +import { bigintToCoinType, DEFAULT_EVM_COIN_TYPE, ETH_COIN_TYPE } from "./coin-type"; /** * Matches an ENSIP-19 Reverse Name diff --git a/packages/ensnode-sdk/src/ens/reverse-name.ts b/packages/ensnode-sdk/src/ens/reverse-name.ts index f8a6ccc231..9a6c305a5c 100644 --- a/packages/ensnode-sdk/src/ens/reverse-name.ts +++ b/packages/ensnode-sdk/src/ens/reverse-name.ts @@ -1,7 +1,7 @@ +import type { CoinType, Label, LiteralLabel, Name } from "enssdk"; import type { Address } from "viem"; -import { type CoinType, DEFAULT_EVM_COIN_TYPE, ETH_COIN_TYPE } from "./coin-type"; -import type { Label, LiteralLabel, Name } from "./types"; +import { DEFAULT_EVM_COIN_TYPE, ETH_COIN_TYPE } from "./coin-type"; /** * Gets the Label used for the reverse names of subnames as per ENSIP-11 & ENSIP-19. diff --git a/packages/ensnode-sdk/src/ens/subname-helpers.ts b/packages/ensnode-sdk/src/ens/subname-helpers.ts index cfb3f3fff6..19cadf2e9e 100644 --- a/packages/ensnode-sdk/src/ens/subname-helpers.ts +++ b/packages/ensnode-sdk/src/ens/subname-helpers.ts @@ -1,7 +1,6 @@ +import type { LabelHash, Node } from "enssdk"; import { concat, type Hex, keccak256, toHex } from "viem"; -import type { LabelHash, Node } from "./types"; - /** * Implements one step of the namehash algorithm, combining `labelHash` with `node` to produce * the `node` of a given subdomain. Note that the order of the arguments is 'reversed' (as compared to diff --git a/packages/ensnode-sdk/src/ensapi/api/name-tokens/request.ts b/packages/ensnode-sdk/src/ensapi/api/name-tokens/request.ts index 0c80547938..ab2423ef40 100644 --- a/packages/ensnode-sdk/src/ensapi/api/name-tokens/request.ts +++ b/packages/ensnode-sdk/src/ensapi/api/name-tokens/request.ts @@ -1,4 +1,4 @@ -import type { Name, Node } from "../../../ens/types"; +import type { Name, Node } from "enssdk"; /** * Represents request to Name Tokens API. diff --git a/packages/ensnode-sdk/src/ensapi/api/name-tokens/response.ts b/packages/ensnode-sdk/src/ensapi/api/name-tokens/response.ts index e18b1903c5..7cd498a7a0 100644 --- a/packages/ensnode-sdk/src/ensapi/api/name-tokens/response.ts +++ b/packages/ensnode-sdk/src/ensapi/api/name-tokens/response.ts @@ -1,4 +1,5 @@ -import type { InterpretedName, Node } from "../../../ens/types"; +import type { InterpretedName, Node } from "enssdk"; + import type { UnixTimestamp } from "../../../shared/types"; import type { NameToken, NameTokenOwnershipTypes } from "../../../tokenscope/name-token"; import type { ErrorResponse } from "../shared/errors"; diff --git a/packages/ensnode-sdk/src/ensapi/api/name-tokens/zod-schemas.test.ts b/packages/ensnode-sdk/src/ensapi/api/name-tokens/zod-schemas.test.ts index b9f2c0957a..7cec63add7 100644 --- a/packages/ensnode-sdk/src/ensapi/api/name-tokens/zod-schemas.test.ts +++ b/packages/ensnode-sdk/src/ensapi/api/name-tokens/zod-schemas.test.ts @@ -1,7 +1,6 @@ +import { AssetNamespaces, type InterpretedName } from "enssdk"; import { describe, expect, it } from "vitest"; -import type { InterpretedName } from "../../../ens/types"; -import { AssetNamespaces } from "../../../shared/types"; import { NFTMintStatuses } from "../../../tokenscope/assets"; import { NameTokenOwnershipTypes } from "../../../tokenscope/name-token"; import { NameTokensResponseCodes, type NameTokensResponseOk } from "./response"; diff --git a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/filters.ts b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/filters.ts index 5c7c764e4f..52956f02cf 100644 --- a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/filters.ts +++ b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/filters.ts @@ -1,6 +1,6 @@ +import type { Node } from "enssdk"; import type { Address } from "viem"; -import type { Node } from "../../../ens/types"; import type { UnixTimestamp } from "../../../shared/types"; import { type RegistrarActionsFilter, diff --git a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/request.ts b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/request.ts index eb5e1dac8e..14c4ac8396 100644 --- a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/request.ts +++ b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/request.ts @@ -1,6 +1,6 @@ +import type { Node } from "enssdk"; import type { Address } from "viem"; -import type { Node } from "../../../ens/types"; import type { UnixTimestamp } from "../../../shared/types"; import type { RequestPageParams } from "../shared/pagination"; diff --git a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/response.ts b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/response.ts index 7bf3e59561..f87c87c42e 100644 --- a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/response.ts +++ b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/response.ts @@ -1,4 +1,5 @@ -import type { InterpretedName } from "../../../ens/types"; +import type { InterpretedName } from "enssdk"; + import type { RegistrarAction } from "../../../registrars/registrar-action"; import type { UnixTimestamp } from "../../../shared/types"; import type { IndexingStatusResponseCodes } from "../indexing-status/response"; diff --git a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/zod-schemas.test.ts b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/zod-schemas.test.ts index a506985863..b92a67b5e9 100644 --- a/packages/ensnode-sdk/src/ensapi/api/registrar-actions/zod-schemas.test.ts +++ b/packages/ensnode-sdk/src/ensapi/api/registrar-actions/zod-schemas.test.ts @@ -1,6 +1,6 @@ +import type { InterpretedName } from "enssdk"; import { describe, expect, it } from "vitest"; -import type { InterpretedName } from "../../../ens/types"; import { RegistrarActionsResponseCodes, type RegistrarActionsResponseError } from "./response"; import type { SerializedNamedRegistrarAction, diff --git a/packages/ensnode-sdk/src/ensindexer/config/label-utils.ts b/packages/ensnode-sdk/src/ensindexer/config/label-utils.ts index 7baa8cf3a6..87078b8804 100644 --- a/packages/ensnode-sdk/src/ensindexer/config/label-utils.ts +++ b/packages/ensnode-sdk/src/ensindexer/config/label-utils.ts @@ -1,7 +1,6 @@ +import type { LabelHash } from "enssdk"; import { type ByteArray, hexToBytes } from "viem"; -import type { LabelHash } from "../../ens"; - /** * Converts a Labelhash to bytes, with validation * @param labelHash The Labelhash to convert diff --git a/packages/ensnode-sdk/src/ensindexer/config/serialize.ts b/packages/ensnode-sdk/src/ensindexer/config/serialize.ts index a24838803e..a397f3c861 100644 --- a/packages/ensnode-sdk/src/ensindexer/config/serialize.ts +++ b/packages/ensnode-sdk/src/ensindexer/config/serialize.ts @@ -1,4 +1,5 @@ -import type { ChainId } from "../../shared/types"; +import type { ChainId } from "enssdk"; + import type { SerializedEnsIndexerPublicConfig, SerializedIndexedChainIds, diff --git a/packages/ensnode-sdk/src/ensindexer/config/serialized-types.ts b/packages/ensnode-sdk/src/ensindexer/config/serialized-types.ts index 6f1829eb79..ef9b9c8fa6 100644 --- a/packages/ensnode-sdk/src/ensindexer/config/serialized-types.ts +++ b/packages/ensnode-sdk/src/ensindexer/config/serialized-types.ts @@ -1,4 +1,5 @@ -import type { ChainId } from "../../shared/types"; +import type { ChainId } from "enssdk"; + import type { EnsIndexerPublicConfig, EnsIndexerVersionInfo } from "./types"; export type SerializedIndexedChainIds = Array; diff --git a/packages/ensnode-sdk/src/ensindexer/config/types.ts b/packages/ensnode-sdk/src/ensindexer/config/types.ts index afc70c50dd..8702cd5c32 100644 --- a/packages/ensnode-sdk/src/ensindexer/config/types.ts +++ b/packages/ensnode-sdk/src/ensindexer/config/types.ts @@ -1,7 +1,8 @@ +import type { ChainId } from "enssdk"; + import type { ENSNamespaceId } from "@ensnode/datasources"; import type { EnsRainbowClientLabelSet, EnsRainbowPublicConfig } from "../../ensrainbow"; -import type { ChainId } from "../../shared/types"; /** * A PluginName is a unique id for a 'plugin': we use the notion of diff --git a/packages/ensnode-sdk/src/ensv2/ids-lib.ts b/packages/ensnode-sdk/src/ensv2/ids-lib.ts index e5b260c47e..dc1a26986c 100644 --- a/packages/ensnode-sdk/src/ensv2/ids-lib.ts +++ b/packages/ensnode-sdk/src/ensv2/ids-lib.ts @@ -1,18 +1,10 @@ -import { type Address, hexToBigInt } from "viem"; - -import { - type AccountId, - AssetNamespaces, - formatAccountId, - formatAssetId, - type LabelHash, - type Node, -} from "@ensnode/ensnode-sdk"; - import type { + AccountId, DomainId, ENSv1DomainId, ENSv2DomainId, + LabelHash, + Node, PermissionsId, PermissionsResourceId, PermissionsUserId, @@ -22,7 +14,11 @@ import type { ResolverId, ResolverRecordsId, StorageId, -} from "./ids"; +} from "enssdk"; +import { AssetNamespaces } from "enssdk"; +import { type Address, hexToBigInt } from "viem"; + +import { formatAccountId, formatAssetId } from "@ensnode/ensnode-sdk"; /** * Formats and brands an AccountId as a RegistryId. diff --git a/packages/ensnode-sdk/src/ensv2/index.ts b/packages/ensnode-sdk/src/ensv2/index.ts index 2e08fd50bd..237cf6adae 100644 --- a/packages/ensnode-sdk/src/ensv2/index.ts +++ b/packages/ensnode-sdk/src/ensv2/index.ts @@ -1,2 +1 @@ -export * from "./ids"; export * from "./ids-lib"; diff --git a/packages/ensnode-sdk/src/identity/identity.ts b/packages/ensnode-sdk/src/identity/identity.ts index 825d79c9e1..b90cd5e1d5 100644 --- a/packages/ensnode-sdk/src/identity/identity.ts +++ b/packages/ensnode-sdk/src/identity/identity.ts @@ -1,8 +1,8 @@ +import type { DefaultableChainId } from "enssdk"; import type { Address } from "viem"; import { type ENSNamespaceId, getENSRootChainId } from "@ensnode/datasources"; -import type { DefaultableChainId } from "../shared/types"; import { type Identity, ResolutionStatusIds, diff --git a/packages/ensnode-sdk/src/identity/types.ts b/packages/ensnode-sdk/src/identity/types.ts index fabfd9df83..70f163537a 100644 --- a/packages/ensnode-sdk/src/identity/types.ts +++ b/packages/ensnode-sdk/src/identity/types.ts @@ -1,8 +1,6 @@ +import type { DefaultableChainId, Name } from "enssdk"; import type { Address } from "viem"; -import type { Name } from "../ens"; -import type { DefaultableChainId } from "../shared/types"; - /** * The resolution status for an `Identity`. */ diff --git a/packages/ensnode-sdk/src/index.ts b/packages/ensnode-sdk/src/index.ts index 64551c5894..02b67bf557 100644 --- a/packages/ensnode-sdk/src/index.ts +++ b/packages/ensnode-sdk/src/index.ts @@ -1,3 +1,8 @@ +// re-export ENSNamespaceIds and ENSNamespaceId from @ensnode/datasources +// so consumers don't need it as a dependency +export type { ENSNamespaceId } from "@ensnode/datasources"; +export { ENSNamespaceIds } from "@ensnode/datasources"; + export * from "./ens"; export * from "./ensapi"; export * from "./ensindexer"; @@ -26,7 +31,6 @@ export * from "./shared/numbers"; export * from "./shared/prerequisites"; export * from "./shared/root-registry"; export * from "./shared/serialize"; -export * from "./shared/serialized-types"; export * from "./shared/types"; export * from "./shared/url"; export * from "./subgraph-api/prerequisites"; diff --git a/packages/ensnode-sdk/src/indexing-status/chain-indexing-status-snapshot.ts b/packages/ensnode-sdk/src/indexing-status/chain-indexing-status-snapshot.ts index 0e30d9303c..45451c46dd 100644 --- a/packages/ensnode-sdk/src/indexing-status/chain-indexing-status-snapshot.ts +++ b/packages/ensnode-sdk/src/indexing-status/chain-indexing-status-snapshot.ts @@ -1,10 +1,12 @@ +import type { ChainId } from "enssdk"; + import { type BlockRefRangeBounded, type BlockRefRangeLeftBounded, type BlockRefRangeWithStartBlock, RangeTypeIds, } from "../shared/blockrange"; -import type { BlockRef, ChainId, UnixTimestamp } from "../shared/types"; +import type { BlockRef, UnixTimestamp } from "../shared/types"; /** * The status of indexing a chain at the time an indexing status snapshot diff --git a/packages/ensnode-sdk/src/indexing-status/cross-chain-indexing-status-snapshot.ts b/packages/ensnode-sdk/src/indexing-status/cross-chain-indexing-status-snapshot.ts index 3d5e8968b9..5506706be8 100644 --- a/packages/ensnode-sdk/src/indexing-status/cross-chain-indexing-status-snapshot.ts +++ b/packages/ensnode-sdk/src/indexing-status/cross-chain-indexing-status-snapshot.ts @@ -1,5 +1,7 @@ +import type { ChainId } from "enssdk"; + import { RangeTypeIds } from "../shared/blockrange"; -import type { BlockRef, ChainId, UnixTimestamp } from "../shared/types"; +import type { BlockRef, UnixTimestamp } from "../shared/types"; import { ChainIndexingStatusIds, type ChainIndexingStatusSnapshot, diff --git a/packages/ensnode-sdk/src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts b/packages/ensnode-sdk/src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts index 7c2212d321..bc0b4343aa 100644 --- a/packages/ensnode-sdk/src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts +++ b/packages/ensnode-sdk/src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts @@ -1,6 +1,7 @@ +import type { ChainId } from "enssdk"; import { prettifyError } from "zod/v4"; -import type { ChainId, Unvalidated } from "../../shared/types"; +import type { Unvalidated } from "../../shared/types"; import type { ChainIndexingStatusSnapshot } from "../chain-indexing-status-snapshot"; import type { OmnichainIndexingStatusSnapshot } from "../omnichain-indexing-status-snapshot"; import type { SerializedOmnichainIndexingStatusSnapshot } from "../serialize/omnichain-indexing-status-snapshot"; diff --git a/packages/ensnode-sdk/src/indexing-status/omnichain-indexing-status-snapshot.ts b/packages/ensnode-sdk/src/indexing-status/omnichain-indexing-status-snapshot.ts index 969642c877..c475c72c64 100644 --- a/packages/ensnode-sdk/src/indexing-status/omnichain-indexing-status-snapshot.ts +++ b/packages/ensnode-sdk/src/indexing-status/omnichain-indexing-status-snapshot.ts @@ -1,4 +1,6 @@ -import type { ChainId, UnixTimestamp, Unvalidated } from "../shared/types"; +import type { ChainId } from "enssdk"; + +import type { UnixTimestamp, Unvalidated } from "../shared/types"; import { ChainIndexingStatusIds, type ChainIndexingStatusSnapshot, diff --git a/packages/ensnode-sdk/src/indexing-status/serialize/chain-indexing-status-snapshot.ts b/packages/ensnode-sdk/src/indexing-status/serialize/chain-indexing-status-snapshot.ts index 64ff1ccdc0..1cbf2429ed 100644 --- a/packages/ensnode-sdk/src/indexing-status/serialize/chain-indexing-status-snapshot.ts +++ b/packages/ensnode-sdk/src/indexing-status/serialize/chain-indexing-status-snapshot.ts @@ -1,6 +1,6 @@ +import type { ChainId, ChainIdString } from "enssdk"; + import { serializeChainId } from "../../shared/serialize"; -import type { ChainIdString } from "../../shared/serialized-types"; -import type { ChainId } from "../../shared/types"; import type { ChainIndexingStatusSnapshot, ChainIndexingStatusSnapshotBackfill, diff --git a/packages/ensnode-sdk/src/indexing-status/serialize/omnichain-indexing-status-snapshot.ts b/packages/ensnode-sdk/src/indexing-status/serialize/omnichain-indexing-status-snapshot.ts index a10386547a..9b4a5845b6 100644 --- a/packages/ensnode-sdk/src/indexing-status/serialize/omnichain-indexing-status-snapshot.ts +++ b/packages/ensnode-sdk/src/indexing-status/serialize/omnichain-indexing-status-snapshot.ts @@ -1,4 +1,5 @@ -import type { ChainIdString } from "../../shared/serialized-types"; +import type { ChainIdString } from "enssdk"; + import type { ChainIndexingStatusSnapshot, ChainIndexingStatusSnapshotCompleted, diff --git a/packages/ensnode-sdk/src/registrars/basenames-subregistry.ts b/packages/ensnode-sdk/src/registrars/basenames-subregistry.ts index 11375f05b1..ef79e393b9 100644 --- a/packages/ensnode-sdk/src/registrars/basenames-subregistry.ts +++ b/packages/ensnode-sdk/src/registrars/basenames-subregistry.ts @@ -1,3 +1,5 @@ +import type { AccountId, Name } from "enssdk"; + import { DatasourceNames, type ENSNamespaceId, @@ -5,9 +7,6 @@ import { maybeGetDatasource, } from "@ensnode/datasources"; -import type { Name } from "../ens"; -import type { AccountId } from "../shared/types"; - /** * Gets the SubregistryId (an AccountId) of the Basenames Subregistry contract (this is the * "BaseRegistrar" contract for Basenames) for the provided namespace. diff --git a/packages/ensnode-sdk/src/registrars/ethnames-subregistry.ts b/packages/ensnode-sdk/src/registrars/ethnames-subregistry.ts index 4a127b8f91..d72d88632d 100644 --- a/packages/ensnode-sdk/src/registrars/ethnames-subregistry.ts +++ b/packages/ensnode-sdk/src/registrars/ethnames-subregistry.ts @@ -1,3 +1,5 @@ +import type { AccountId, Name } from "enssdk"; + import { DatasourceNames, type ENSNamespaceId, @@ -5,9 +7,6 @@ import { maybeGetDatasource, } from "@ensnode/datasources"; -import type { Name } from "../ens"; -import type { AccountId } from "../shared/types"; - /** * Gets the SubregistryId (an AccountId) of the Ethnames Subregistry contract (this is the * "BaseRegistrar" contract for direct subnames of .eth) for the provided namespace. diff --git a/packages/ensnode-sdk/src/registrars/lineanames-subregistry.ts b/packages/ensnode-sdk/src/registrars/lineanames-subregistry.ts index b7ed4987c3..52b782d1f7 100644 --- a/packages/ensnode-sdk/src/registrars/lineanames-subregistry.ts +++ b/packages/ensnode-sdk/src/registrars/lineanames-subregistry.ts @@ -1,3 +1,5 @@ +import type { AccountId, Name } from "enssdk"; + import { DatasourceNames, type ENSNamespaceId, @@ -5,9 +7,6 @@ import { maybeGetDatasource, } from "@ensnode/datasources"; -import type { Name } from "../ens"; -import type { AccountId } from "../shared/types"; - /** * Gets the SubregistryId (an AccountId) of the Lineanames Subregistry contract (this is the * "BaseRegistrar" contract for Lineanames) for the provided namespace. diff --git a/packages/ensnode-sdk/src/registrars/registration-lifecycle.ts b/packages/ensnode-sdk/src/registrars/registration-lifecycle.ts index 40179600ab..ee7993c983 100644 --- a/packages/ensnode-sdk/src/registrars/registration-lifecycle.ts +++ b/packages/ensnode-sdk/src/registrars/registration-lifecycle.ts @@ -1,4 +1,5 @@ -import type { Node } from "../ens"; +import type { Node } from "enssdk"; + import type { UnixTimestamp } from "../shared/types"; import type { Subregistry } from "./subregistry"; diff --git a/packages/ensnode-sdk/src/registrars/subregistry.ts b/packages/ensnode-sdk/src/registrars/subregistry.ts index 2f0856dde7..8a71ce70ba 100644 --- a/packages/ensnode-sdk/src/registrars/subregistry.ts +++ b/packages/ensnode-sdk/src/registrars/subregistry.ts @@ -1,5 +1,4 @@ -import type { Node } from "../ens"; -import type { AccountId } from "../shared/types"; +import type { AccountId, Node } from "enssdk"; /** * Subregistry diff --git a/packages/ensnode-sdk/src/resolution/ensip19-chainid.ts b/packages/ensnode-sdk/src/resolution/ensip19-chainid.ts index 654c5c48cd..ca49b495ef 100644 --- a/packages/ensnode-sdk/src/resolution/ensip19-chainid.ts +++ b/packages/ensnode-sdk/src/resolution/ensip19-chainid.ts @@ -1,9 +1,9 @@ +import type { ChainId, DefaultableChainId } from "enssdk"; import { mainnet } from "viem/chains"; import { type ENSNamespaceId, getENSRootChainId } from "@ensnode/datasources"; import { DEFAULT_EVM_CHAIN_ID } from "../ens"; -import type { ChainId, DefaultableChainId } from "../shared/types"; /** * Gets the "chainId param" that should be used for a primary name resolution diff --git a/packages/ensnode-sdk/src/resolution/resolver-records-response.ts b/packages/ensnode-sdk/src/resolution/resolver-records-response.ts index b66c5c3694..99577b5d8f 100644 --- a/packages/ensnode-sdk/src/resolution/resolver-records-response.ts +++ b/packages/ensnode-sdk/src/resolution/resolver-records-response.ts @@ -1,4 +1,5 @@ -import type { CoinType, Name } from "../ens"; +import type { CoinType, Name } from "enssdk"; + import type { ResolverRecordsSelection } from "./resolver-records-selection"; /** diff --git a/packages/ensnode-sdk/src/resolution/resolver-records-selection.ts b/packages/ensnode-sdk/src/resolution/resolver-records-selection.ts index 2e2c49b452..ffe216c0c2 100644 --- a/packages/ensnode-sdk/src/resolution/resolver-records-selection.ts +++ b/packages/ensnode-sdk/src/resolution/resolver-records-selection.ts @@ -1,4 +1,4 @@ -import type { CoinType } from "../ens"; +import type { CoinType } from "enssdk"; /** * Encodes a selection of Resolver records in the context of a specific Name. diff --git a/packages/ensnode-sdk/src/resolution/types.ts b/packages/ensnode-sdk/src/resolution/types.ts index 630d026e48..58cdae025e 100644 --- a/packages/ensnode-sdk/src/resolution/types.ts +++ b/packages/ensnode-sdk/src/resolution/types.ts @@ -1,7 +1,6 @@ +import type { ChainId, Name } from "enssdk"; import type { Address } from "viem"; -import type { Name } from "../ens"; -import type { ChainId } from "../shared/types"; import type { ResolverRecordsResponse } from "./resolver-records-response"; import type { ResolverRecordsSelection } from "./resolver-records-selection"; diff --git a/packages/ensnode-sdk/src/shared/account-id.test.ts b/packages/ensnode-sdk/src/shared/account-id.test.ts index 6fecd4fe81..c639eb4ff6 100644 --- a/packages/ensnode-sdk/src/shared/account-id.test.ts +++ b/packages/ensnode-sdk/src/shared/account-id.test.ts @@ -1,9 +1,9 @@ +import type { AccountId } from "enssdk"; import type { Address } from "viem"; import { describe, expect, it } from "vitest"; import { parseAccountId } from "./deserialize"; import { formatAccountId } from "./serialize"; -import type { AccountId } from "./types"; const vitalikEthAddressLowercase: Address = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"; const vitalikEthAddressChecksummed: Address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"; diff --git a/packages/ensnode-sdk/src/shared/account-id.ts b/packages/ensnode-sdk/src/shared/account-id.ts index 5c1a7de921..5257974693 100644 --- a/packages/ensnode-sdk/src/shared/account-id.ts +++ b/packages/ensnode-sdk/src/shared/account-id.ts @@ -1,7 +1,6 @@ +import type { AccountId } from "enssdk"; import { isAddressEqual } from "viem"; -import type { AccountId } from "./types"; - /** * Determines where the provided AccountId values represent the same address on the same chain. */ diff --git a/packages/ensnode-sdk/src/shared/config/build-rpc-urls.test.ts b/packages/ensnode-sdk/src/shared/config/build-rpc-urls.test.ts index 8b87a037b6..08d71e03e0 100644 --- a/packages/ensnode-sdk/src/shared/config/build-rpc-urls.test.ts +++ b/packages/ensnode-sdk/src/shared/config/build-rpc-urls.test.ts @@ -1,3 +1,4 @@ +import type { ChainId } from "enssdk"; import { lineaSepolia } from "viem/chains"; import { describe, expect, it } from "vitest"; @@ -8,7 +9,6 @@ import { getENSNamespace, } from "@ensnode/datasources"; -import type { ChainId } from "../types"; import { buildAlchemyBaseUrl, buildDRPCUrl, buildQuickNodeURL } from "./build-rpc-urls"; const KEY = "whatever"; diff --git a/packages/ensnode-sdk/src/shared/config/indexed-blockranges.test.ts b/packages/ensnode-sdk/src/shared/config/indexed-blockranges.test.ts index 4353839f32..908ab4cc63 100644 --- a/packages/ensnode-sdk/src/shared/config/indexed-blockranges.test.ts +++ b/packages/ensnode-sdk/src/shared/config/indexed-blockranges.test.ts @@ -1,3 +1,4 @@ +import type { ChainId } from "enssdk"; import { afterEach, describe, expect, it, vi } from "vitest"; import * as datasources from "@ensnode/datasources"; @@ -5,7 +6,6 @@ import { type DatasourceName, DatasourceNames, ENSNamespaceIds } from "@ensnode/ import { PluginName } from "../../ensindexer/config/types"; import { type BlockNumberRangeWithStartBlock, buildBlockNumberRange } from "../blockrange"; -import type { ChainId } from "../types"; import { buildIndexedBlockranges } from "./indexed-blockranges"; vi.mock("@ensnode/datasources", async () => { diff --git a/packages/ensnode-sdk/src/shared/config/indexed-blockranges.ts b/packages/ensnode-sdk/src/shared/config/indexed-blockranges.ts index 12248dd51a..3611d71d2f 100644 --- a/packages/ensnode-sdk/src/shared/config/indexed-blockranges.ts +++ b/packages/ensnode-sdk/src/shared/config/indexed-blockranges.ts @@ -1,3 +1,5 @@ +import type { ChainId } from "enssdk"; + import { type ContractConfig, type DatasourceName, @@ -12,7 +14,6 @@ import { mergeBlockNumberRanges, RangeTypeIds, } from "../blockrange"; -import type { ChainId } from "../types"; /** * Build a map of indexed blockranges for each indexed chain, based on the ENSIndexer configuration. diff --git a/packages/ensnode-sdk/src/shared/config/rpc-configs-from-env.ts b/packages/ensnode-sdk/src/shared/config/rpc-configs-from-env.ts index 1dc3728b35..e4dd604229 100644 --- a/packages/ensnode-sdk/src/shared/config/rpc-configs-from-env.ts +++ b/packages/ensnode-sdk/src/shared/config/rpc-configs-from-env.ts @@ -1,3 +1,5 @@ +import type { ChainIdString } from "enssdk"; + import { type Datasource, type ENSNamespaceId, @@ -6,7 +8,6 @@ import { } from "@ensnode/datasources"; import { serializeChainId } from "../serialize"; -import type { ChainIdString } from "../serialized-types"; import type { Unvalidated } from "../types"; import { alchemySupportsChain, diff --git a/packages/ensnode-sdk/src/shared/config/types.ts b/packages/ensnode-sdk/src/shared/config/types.ts index d0b8f54a24..155feb745f 100644 --- a/packages/ensnode-sdk/src/shared/config/types.ts +++ b/packages/ensnode-sdk/src/shared/config/types.ts @@ -1,7 +1,6 @@ +import type { ChainId, UrlString } from "enssdk"; import type { z } from "zod/v4"; -import type { UrlString } from "../serialized-types"; -import type { ChainId } from "../types"; import type { DatabaseSchemaNameSchema, PortNumberSchema, diff --git a/packages/ensnode-sdk/src/shared/config/zod-schemas.ts b/packages/ensnode-sdk/src/shared/config/zod-schemas.ts index 3d9db6de69..ee15496dd4 100644 --- a/packages/ensnode-sdk/src/shared/config/zod-schemas.ts +++ b/packages/ensnode-sdk/src/shared/config/zod-schemas.ts @@ -1,9 +1,9 @@ +import type { ChainId } from "enssdk"; import { z } from "zod/v4"; import { ENSNamespaceIds } from "@ensnode/datasources"; import { deserializeChainId } from "../deserialize"; -import type { ChainId } from "../types"; import { isHttpProtocol, isWebSocketProtocol } from "../url"; import { makeChainIdStringSchema, makeUrlSchema } from "../zod-schemas"; import type { RpcConfig } from "./types"; diff --git a/packages/ensnode-sdk/src/shared/datasource-contract.ts b/packages/ensnode-sdk/src/shared/datasource-contract.ts index 9f2355db13..ab5224c9f2 100644 --- a/packages/ensnode-sdk/src/shared/datasource-contract.ts +++ b/packages/ensnode-sdk/src/shared/datasource-contract.ts @@ -1,10 +1,12 @@ +import type { AccountId } from "enssdk"; + import { type Datasource, type DatasourceName, type ENSNamespaceId, maybeGetDatasource, } from "@ensnode/datasources"; -import { type AccountId, accountIdEqual } from "@ensnode/ensnode-sdk"; +import { accountIdEqual } from "@ensnode/ensnode-sdk"; /** * Gets the AccountId for the contract in the specified namespace, datasource, and diff --git a/packages/ensnode-sdk/src/shared/deserialize.ts b/packages/ensnode-sdk/src/shared/deserialize.ts index 05e72ddc47..8c81416a51 100644 --- a/packages/ensnode-sdk/src/shared/deserialize.ts +++ b/packages/ensnode-sdk/src/shared/deserialize.ts @@ -1,8 +1,8 @@ +import type { AccountId, ChainId, ChainIdString, UrlString } from "enssdk"; import z, { prettifyError } from "zod/v4"; import type { PriceDai, PriceEth, PriceUsdc } from "./currencies"; -import type { ChainIdString, UrlString } from "./serialized-types"; -import type { AccountId, BlockNumber, BlockRef, ChainId, Datetime, Duration } from "./types"; +import type { BlockNumber, BlockRef, Datetime, Duration } from "./types"; import { makeAccountIdStringSchema, makeBlockNumberSchema, diff --git a/packages/ensnode-sdk/src/shared/interpretation/interpret-record-values.ts b/packages/ensnode-sdk/src/shared/interpretation/interpret-record-values.ts index 29834eca0a..8e19305a2c 100644 --- a/packages/ensnode-sdk/src/shared/interpretation/interpret-record-values.ts +++ b/packages/ensnode-sdk/src/shared/interpretation/interpret-record-values.ts @@ -1,6 +1,7 @@ +import type { NormalizedName } from "enssdk"; import { isAddress, isAddressEqual, zeroAddress } from "viem"; -import { asLowerCaseAddress, isNormalizedName, type NormalizedName } from "@ensnode/ensnode-sdk"; +import { asLowerCaseAddress, isNormalizedName } from "@ensnode/ensnode-sdk"; import { hasNullByte } from "../null-bytes"; diff --git a/packages/ensnode-sdk/src/shared/interpretation/interpret-tokenid.ts b/packages/ensnode-sdk/src/shared/interpretation/interpret-tokenid.ts index 9903609d98..8076fa1d2b 100644 --- a/packages/ensnode-sdk/src/shared/interpretation/interpret-tokenid.ts +++ b/packages/ensnode-sdk/src/shared/interpretation/interpret-tokenid.ts @@ -1,4 +1,6 @@ -import { type LabelHash, type Node, uint256ToHex32 } from "../../ens"; +import type { LabelHash, Node } from "enssdk"; + +import { uint256ToHex32 } from "../../ens"; /** * Decodes a uint256-encoded-LabelHash (eg. from a tokenId) into a {@link LabelHash}. diff --git a/packages/ensnode-sdk/src/shared/interpretation/interpreted-names-and-labels.ts b/packages/ensnode-sdk/src/shared/interpretation/interpreted-names-and-labels.ts index 5f28383ad5..3a154195b6 100644 --- a/packages/ensnode-sdk/src/shared/interpretation/interpreted-names-and-labels.ts +++ b/packages/ensnode-sdk/src/shared/interpretation/interpreted-names-and-labels.ts @@ -1,18 +1,17 @@ +import type { + InterpretedLabel, + InterpretedName, + Label, + LabelHash, + LabelHashPath, + LiteralLabel, + LiteralName, + Name, +} from "enssdk"; import { isHex } from "viem"; import { labelhash } from "viem/ens"; -import { - encodeLabelHash, - type InterpretedLabel, - type InterpretedName, - isNormalizedLabel, - type Label, - type LabelHash, - type LabelHashPath, - type LiteralLabel, - type LiteralName, - type Name, -} from "../../ens"; +import { encodeLabelHash, isNormalizedLabel } from "../../ens"; import { labelhashLiteralLabel } from "../labelhash"; /** diff --git a/packages/ensnode-sdk/src/shared/interpretation/reinterpretation.ts b/packages/ensnode-sdk/src/shared/interpretation/reinterpretation.ts index 7da091f84a..979c2b3b85 100644 --- a/packages/ensnode-sdk/src/shared/interpretation/reinterpretation.ts +++ b/packages/ensnode-sdk/src/shared/interpretation/reinterpretation.ts @@ -1,12 +1,7 @@ +import type { InterpretedLabel, InterpretedName } from "enssdk"; import { labelhash as labelToLabelHash } from "viem"; -import { - encodeLabelHash, - type InterpretedLabel, - type InterpretedName, - isEncodedLabelHash, - isNormalizedLabel, -} from "../../ens"; +import { encodeLabelHash, isEncodedLabelHash, isNormalizedLabel } from "../../ens"; /** * Reinterpret Label diff --git a/packages/ensnode-sdk/src/shared/labelhash.ts b/packages/ensnode-sdk/src/shared/labelhash.ts index e8274a9f20..3dc083137a 100644 --- a/packages/ensnode-sdk/src/shared/labelhash.ts +++ b/packages/ensnode-sdk/src/shared/labelhash.ts @@ -1,7 +1,6 @@ +import type { LabelHash, LiteralLabel } from "enssdk"; import { keccak256, stringToBytes } from "viem"; -import type { LabelHash, LiteralLabel } from "../ens"; - /** * Implements the ENS `labelhash` function for Literal Labels. * @see https://docs.ens.domains/ensip/1 diff --git a/packages/ensnode-sdk/src/shared/root-registry.ts b/packages/ensnode-sdk/src/shared/root-registry.ts index df50dfbdc5..ef566c3954 100644 --- a/packages/ensnode-sdk/src/shared/root-registry.ts +++ b/packages/ensnode-sdk/src/shared/root-registry.ts @@ -1,6 +1,7 @@ +import type { AccountId } from "enssdk"; + import { DatasourceNames, type ENSNamespaceId } from "@ensnode/datasources"; import { - type AccountId, accountIdEqual, getDatasourceContract, makeRegistryId, diff --git a/packages/ensnode-sdk/src/shared/serialize.ts b/packages/ensnode-sdk/src/shared/serialize.ts index 3045cb13e3..1c2efc5d94 100644 --- a/packages/ensnode-sdk/src/shared/serialize.ts +++ b/packages/ensnode-sdk/src/shared/serialize.ts @@ -1,4 +1,14 @@ import { AccountId as CaipAccountId, AssetId as CaipAssetId } from "caip"; +import type { + AccountId, + AccountIdString, + AssetId, + AssetIdString, + ChainId, + ChainIdString, + DatetimeISO8601, + UrlString, +} from "enssdk"; import { uint256ToHex32 } from "../ens"; import type { @@ -11,14 +21,7 @@ import type { SerializedPriceEth, SerializedPriceUsdc, } from "./currencies"; -import type { - AccountIdString, - AssetIdString, - ChainIdString, - DatetimeISO8601, - UrlString, -} from "./serialized-types"; -import type { AccountId, AssetId, ChainId, Datetime } from "./types"; +import type { Datetime } from "./types"; /** * Serializes a {@link ChainId} value into its string representation. diff --git a/packages/ensnode-sdk/src/shared/types.ts b/packages/ensnode-sdk/src/shared/types.ts index edceda0009..d2740e5478 100644 --- a/packages/ensnode-sdk/src/shared/types.ts +++ b/packages/ensnode-sdk/src/shared/types.ts @@ -1,67 +1,3 @@ -import type { Address } from "viem"; - -import type { DEFAULT_EVM_CHAIN_ID } from "../ens"; - -/** - * Chain ID - * - * Represents a unique identifier for a chain. - * Guaranteed to be a positive integer. - * - * Chain id standards are organized by the Ethereum Community @ https://github.com/ethereum-lists/chains - **/ -export type ChainId = number; - -/** - * Defaultable Chain ID - * - * Represents a unique identifier for a chain, or - * the default chain as defined by ENSIP-19. - * - * @see https://docs.ens.domains/ensip/19/#annex-supported-chains - * - * Guaranteed to be a non-negative integer. - **/ -export type DefaultableChainId = typeof DEFAULT_EVM_CHAIN_ID | ChainId; - -/** - * Represents an account (contract or EOA) at `address` on chain `chainId`. - * - * @see https://chainagnostic.org/CAIPs/caip-10 - */ -export interface AccountId { - chainId: ChainId; - address: Address; -} - -/** - * An enum representing the possible CAIP-19 Asset Namespace values. - * - * @see https://chainagnostic.org/CAIPs/caip-19 - */ -export const AssetNamespaces = { - ERC721: "erc721", - ERC1155: "erc1155", -} as const; - -export type AssetNamespace = (typeof AssetNamespaces)[keyof typeof AssetNamespaces]; - -/** - * A uint256 value that identifies a specific NFT within a NFT contract. - */ -export type TokenId = bigint; - -/** - * Represents an Asset in `assetNamespace` by `tokenId` in `contract`. - * - * @see https://chainagnostic.org/CAIPs/caip-19 - */ -export interface AssetId { - assetNamespace: AssetNamespace; - contract: AccountId; - tokenId: TokenId; -} - /** * Block Number * diff --git a/packages/ensnode-sdk/src/shared/zod-schemas.ts b/packages/ensnode-sdk/src/shared/zod-schemas.ts index a1e08f55d7..000227366d 100644 --- a/packages/ensnode-sdk/src/shared/zod-schemas.ts +++ b/packages/ensnode-sdk/src/shared/zod-schemas.ts @@ -1,5 +1,13 @@ import type { CoinType } from "@ensdomains/address-encoder"; import { AccountId as CaipAccountId } from "caip"; +import type { + AccountId, + AccountIdString, + ChainId, + DefaultableChainId, + InterpretedName, + Node, +} from "enssdk"; import { type Address, type Hex, isAddress, isHex, size } from "viem"; /** * All zod schemas we define must remain internal implementation details. @@ -11,7 +19,7 @@ import { type Address, type Hex, isAddress, isHex, size } from "viem"; */ import { z } from "zod/v4"; -import { ENSNamespaceIds, type InterpretedName, type Node } from "../ens"; +import { ENSNamespaceIds } from "../ens"; import { asLowerCaseAddress } from "./address"; import { type CurrencyId, @@ -21,16 +29,7 @@ import { type PriceUsdc, } from "./currencies"; import { reinterpretName } from "./interpretation/reinterpretation"; -import type { AccountIdString } from "./serialized-types"; -import type { - AccountId, - BlockRef, - ChainId, - Datetime, - DefaultableChainId, - Duration, - UnixTimestamp, -} from "./types"; +import type { BlockRef, Datetime, Duration, UnixTimestamp } from "./types"; /** * Parses a string value as a boolean. diff --git a/packages/ensnode-sdk/src/tokenscope/assets.ts b/packages/ensnode-sdk/src/tokenscope/assets.ts index ddd24b16a0..79fd495c2a 100644 --- a/packages/ensnode-sdk/src/tokenscope/assets.ts +++ b/packages/ensnode-sdk/src/tokenscope/assets.ts @@ -1,10 +1,17 @@ +import type { + AccountId, + AssetId, + AssetIdString, + AssetNamespace, + ChainId, + Node, + TokenId, +} from "enssdk"; import { type Address, type Hex, isAddressEqual, zeroAddress } from "viem"; import { prettifyError } from "zod/v4"; -import { type Node, uint256ToHex32 } from "../ens"; +import { uint256ToHex32 } from "../ens"; import { formatAssetId } from "../shared/serialize"; -import type { AssetIdString } from "../shared/serialized-types"; -import type { AccountId, AssetId, AssetNamespace, ChainId, TokenId } from "../shared/types"; import { makeAssetIdSchema, makeAssetIdStringSchema } from "./zod-schemas"; /** diff --git a/packages/ensnode-sdk/src/tokenscope/name-token.test.ts b/packages/ensnode-sdk/src/tokenscope/name-token.test.ts index 834adb4624..63f8377616 100644 --- a/packages/ensnode-sdk/src/tokenscope/name-token.test.ts +++ b/packages/ensnode-sdk/src/tokenscope/name-token.test.ts @@ -1,10 +1,9 @@ +import type { AccountId, InterpretedName } from "enssdk"; import { zeroAddress } from "viem"; import { describe, expect, it } from "vitest"; import { ENSNamespaceIds } from "@ensnode/datasources"; -import type { InterpretedName } from "../ens"; -import type { AccountId } from "../shared/types"; import { getNameTokenOwnership, type NameTokenOwnershipBurned, diff --git a/packages/ensnode-sdk/src/tokenscope/name-token.ts b/packages/ensnode-sdk/src/tokenscope/name-token.ts index 698073012c..3820dae7d4 100644 --- a/packages/ensnode-sdk/src/tokenscope/name-token.ts +++ b/packages/ensnode-sdk/src/tokenscope/name-token.ts @@ -1,11 +1,11 @@ +import type { AccountId, AssetId, InterpretedName } from "enssdk"; import { isAddressEqual, zeroAddress } from "viem"; import { DatasourceNames, type ENSNamespaceId } from "@ensnode/datasources"; -import { getParentNameFQDN, type InterpretedName } from "../ens"; +import { getParentNameFQDN } from "../ens"; import { accountIdEqual } from "../shared/account-id"; import { getDatasourceContract, maybeGetDatasourceContract } from "../shared/datasource-contract"; -import type { AccountId, AssetId } from "../shared/types"; import { type NFTMintStatus, type SerializedAssetId, serializeAssetId } from "./assets"; /** diff --git a/packages/ensnode-sdk/src/tokenscope/zod-schemas.test.ts b/packages/ensnode-sdk/src/tokenscope/zod-schemas.test.ts index 409c779e33..6b632421c1 100644 --- a/packages/ensnode-sdk/src/tokenscope/zod-schemas.test.ts +++ b/packages/ensnode-sdk/src/tokenscope/zod-schemas.test.ts @@ -1,7 +1,6 @@ +import type { AssetId, AssetIdString } from "enssdk"; import { describe, expect, it } from "vitest"; -import type { AssetIdString } from "../shared/serialized-types"; -import type { AssetId } from "../shared/types"; import { serializeAssetId } from "./assets"; import { makeAssetIdSchema, makeAssetIdStringSchema } from "./zod-schemas"; diff --git a/packages/ensnode-sdk/src/tokenscope/zod-schemas.ts b/packages/ensnode-sdk/src/tokenscope/zod-schemas.ts index b3f828d6e9..2d6877abca 100644 --- a/packages/ensnode-sdk/src/tokenscope/zod-schemas.ts +++ b/packages/ensnode-sdk/src/tokenscope/zod-schemas.ts @@ -1,9 +1,9 @@ import { AssetId as CaipAssetId } from "caip"; +import { type AssetId, AssetNamespaces } from "enssdk"; import { zeroAddress } from "viem"; import { z } from "zod/v4"; import type { ParsePayload } from "zod/v4/core"; -import { type AssetId, AssetNamespaces } from "../shared/types"; import { makeAccountIdSchema, makeNodeSchema } from "../shared/zod-schemas"; import { type DomainAssetId, NFTMintStatuses, type SerializedAssetId } from "./assets"; import { diff --git a/packages/enssdk/package.json b/packages/enssdk/package.json index 276fa00e5c..4d69fd781b 100644 --- a/packages/enssdk/package.json +++ b/packages/enssdk/package.json @@ -19,6 +19,7 @@ "dist" ], "exports": { + ".": "./src/index.ts", "./core": "./src/core/index.ts", "./omnigraph": "./src/omnigraph/index.ts" }, @@ -26,6 +27,10 @@ "publishConfig": { "access": "public", "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, "./core": { "types": "./dist/core/index.d.ts", "default": "./dist/core/index.js" @@ -45,8 +50,10 @@ "generate:gqlschema": "gql.tada generate-output" }, "dependencies": { + "@ensdomains/address-encoder": "^1.1.2", "gql.tada": "^1.8.10", - "graphql": "^16.11.0" + "graphql": "^16.11.0", + "viem": "catalog:" }, "devDependencies": { "@ensnode/shared-configs": "workspace:*", diff --git a/packages/enssdk/src/index.ts b/packages/enssdk/src/index.ts new file mode 100644 index 0000000000..fb4d8ecafb --- /dev/null +++ b/packages/enssdk/src/index.ts @@ -0,0 +1 @@ +export * from "./lib/types"; diff --git a/packages/enssdk/src/lib/types/coin-type.ts b/packages/enssdk/src/lib/types/coin-type.ts new file mode 100644 index 0000000000..039ffc7485 --- /dev/null +++ b/packages/enssdk/src/lib/types/coin-type.ts @@ -0,0 +1 @@ +export type { CoinType, EvmCoinType } from "@ensdomains/address-encoder"; diff --git a/packages/ensnode-sdk/src/ens/types.ts b/packages/enssdk/src/lib/types/ens.ts similarity index 95% rename from packages/ensnode-sdk/src/ens/types.ts rename to packages/enssdk/src/lib/types/ens.ts index bb67919395..cf5e94a9ac 100644 --- a/packages/ensnode-sdk/src/ens/types.ts +++ b/packages/enssdk/src/lib/types/ens.ts @@ -1,12 +1,5 @@ import type { Hex } from "viem"; -import type { DomainId } from "../ensv2"; - -export type { ENSNamespaceId } from "@ensnode/datasources"; -// re-export ENSNamespaceIds and ENSNamespaceId from @ensnode/datasources -// so consumers don't need it as a dependency -export { ENSNamespaceIds } from "@ensnode/datasources"; - /** * A hash value that uniquely identifies a single ENS name. * Result of `namehash` function as specified in ENSIP-1. @@ -65,12 +58,6 @@ export type LabelHash = Hex; */ export type LabelHashPath = LabelHash[]; -/** - * CanonicalPath is an ordered list of DomainIds describing the canonical path to a Domain. - * It is ordered in namegraph TRAVERSAL order (i.e. the opposite order of an ENS Name's labels). - */ -export type CanonicalPath = DomainId[]; - /** * A Label is a single part of an ENS Name. * diff --git a/packages/ensnode-sdk/src/ensv2/ids.ts b/packages/enssdk/src/lib/types/ensv2.ts similarity index 65% rename from packages/ensnode-sdk/src/ensv2/ids.ts rename to packages/enssdk/src/lib/types/ensv2.ts index 102f052372..3fee2e4452 100644 --- a/packages/ensnode-sdk/src/ensv2/ids.ts +++ b/packages/enssdk/src/lib/types/ensv2.ts @@ -1,4 +1,5 @@ -import type { AccountIdString, Node } from "@ensnode/ensnode-sdk"; +import type { Node } from "./ens"; +import type { AccountIdString } from "./shared"; /** * Serialized CAIP-10 Asset ID that uniquely identifies a Registry contract. @@ -6,9 +7,12 @@ import type { AccountIdString, Node } from "@ensnode/ensnode-sdk"; export type RegistryId = string & { __brand: "RegistryContractId" }; /** - * A Domain's Canonical Id is uint256(labelHash) with lower (right-most) 32 bits zero'd. + * A Label's Storage Id is uint256(labelHash) with lower (right-most) 32 bits zero'd. + * + * In ENSv2, the rightmost 32 bits of a TokenId is used for version management, and it is the leftmost + * 224 bits that are a stable identifier for a Label within a Registry. */ -export type CanonicalId = bigint; +export type StorageId = bigint; /** * The node that uniquely identifies an ENSv1 name. @@ -16,7 +20,8 @@ export type CanonicalId = bigint; export type ENSv1DomainId = Node & { __brand: "ENSv1DomainId" }; /** - * The Serialized CAIP-19 Asset ID that uniquely identifies an ENSv2 name. + * The Serialized CAIP-19 Asset ID (using Storage Id instead of TokenId) that uniquely identifies + * an ENSv2 name. */ export type ENSv2DomainId = string & { __brand: "ENSv2DomainId" }; @@ -59,3 +64,9 @@ export type RegistrationId = string & { __brand: "RegistrationId" }; * Uniquely identifies a Renewal entity. */ export type RenewalId = string & { __brand: "RenewalId" }; + +/** + * CanonicalPath is an ordered list of DomainIds describing the canonical path to a Domain. + * It is ordered in namegraph TRAVERSAL order (i.e. the opposite order of an ENS Name's labels). + */ +export type CanonicalPath = DomainId[]; diff --git a/packages/enssdk/src/lib/types/evm.ts b/packages/enssdk/src/lib/types/evm.ts new file mode 100644 index 0000000000..562635904a --- /dev/null +++ b/packages/enssdk/src/lib/types/evm.ts @@ -0,0 +1,61 @@ +import type { Address } from "viem"; + +/** + * Chain ID + * + * Represents a unique identifier for a chain. + * Guaranteed to be a positive integer. + * + * Chain id standards are organized by the Ethereum Community @ https://github.com/ethereum-lists/chains + **/ +export type ChainId = number; + +/** + * Defaultable Chain ID + * + * Represents a unique identifier for a chain, or + * the default chain as defined by ENSIP-19. + * + * @see https://docs.ens.domains/ensip/19/#annex-supported-chains + * + * Guaranteed to be a non-negative integer. + **/ +export type DefaultableChainId = 0 | ChainId; + +/** + * Represents an account (contract or EOA) at `address` on chain `chainId`. + * + * @see https://chainagnostic.org/CAIPs/caip-10 + */ +export interface AccountId { + chainId: ChainId; + address: Address; +} + +/** + * An enum representing the possible CAIP-19 Asset Namespace values. + * + * @see https://chainagnostic.org/CAIPs/caip-19 + */ +export const AssetNamespaces = { + ERC721: "erc721", + ERC1155: "erc1155", +} as const; + +export type AssetNamespace = (typeof AssetNamespaces)[keyof typeof AssetNamespaces]; + +/** + * A uint256 value that identifies a specific NFT within a NFT contract. + */ +export type TokenId = bigint; + +/** + * Represents an Asset in `assetNamespace` by `tokenId` in `contract`. + * + * @see https://chainagnostic.org/CAIPs/caip-19 + */ +export interface AssetId { + assetNamespace: AssetNamespace; + contract: AccountId; + tokenId: TokenId; +} diff --git a/packages/enssdk/src/lib/types/index.ts b/packages/enssdk/src/lib/types/index.ts new file mode 100644 index 0000000000..742549e4a7 --- /dev/null +++ b/packages/enssdk/src/lib/types/index.ts @@ -0,0 +1,5 @@ +export * from "./coin-type"; +export * from "./ens"; +export * from "./ensv2"; +export * from "./evm"; +export * from "./shared"; diff --git a/packages/ensnode-sdk/src/shared/serialized-types.ts b/packages/enssdk/src/lib/types/shared.ts similarity index 95% rename from packages/ensnode-sdk/src/shared/serialized-types.ts rename to packages/enssdk/src/lib/types/shared.ts index 5128d47783..06265d9ffa 100644 --- a/packages/ensnode-sdk/src/shared/serialized-types.ts +++ b/packages/enssdk/src/lib/types/shared.ts @@ -1,5 +1,3 @@ -import type { AccountId } from "./types"; - /** * Serialized representation of {@link ChainId}. **/ diff --git a/packages/enssdk/src/omnigraph/graphql.ts b/packages/enssdk/src/omnigraph/graphql.ts index 75cbc89fca..4a621f6a3d 100644 --- a/packages/enssdk/src/omnigraph/graphql.ts +++ b/packages/enssdk/src/omnigraph/graphql.ts @@ -1,21 +1,45 @@ import { initGraphQLTada } from "gql.tada"; +import type { Address, Hex } from "viem"; +import type { + CoinType, + DomainId, + InterpretedName, + Node, + PermissionsId, + PermissionsResourceId, + PermissionsUserId, + RegistrationId, + RegistryId, + RenewalId, + ResolverId, + ResolverRecordsId, +} from "../lib/types"; import type { introspection } from "./generated/graphql-env"; -// Semantic scalar types — these will eventually be imported from enssdk's -// own type definitions. For now, defined inline. -type Name = string; - export const graphql = initGraphQLTada<{ introspection: introspection; + // NOTE: keep these type defs in sync with the scalars in apps/ensapi/src/graphql-api/builder.ts scalars: { - Address: `0x${string}`; - BigInt: bigint; - ChainId: number; - Hex: `0x${string}`; ID: string; - Name: Name; - Node: `0x${string}`; + // NOTE: graphql clients don't really do deserialization of scalars like bigint, so instead we + // just helpfully type the string as 'a stringified bigint' + BigInt: `${bigint}`; + Address: Address; + Hex: Hex; + ChainId: number; + CoinType: CoinType; + Name: InterpretedName; + Node: Node; + DomainId: DomainId; + RegistryId: RegistryId; + ResolverId: ResolverId; + PermissionsId: PermissionsId; + PermissionsResourceId: PermissionsResourceId; + PermissionsUserId: PermissionsUserId; + RegistrationId: RegistrationId; + RenewalId: RenewalId; + ResolverRecordsId: ResolverRecordsId; }; }>(); diff --git a/packages/enssdk/tsup.config.ts b/packages/enssdk/tsup.config.ts index 4c0916ed86..8792705715 100644 --- a/packages/enssdk/tsup.config.ts +++ b/packages/enssdk/tsup.config.ts @@ -2,6 +2,7 @@ import { defineConfig } from "tsup"; export default defineConfig({ entry: { + index: "src/index.ts", "core/index": "src/core/index.ts", "omnigraph/index": "src/omnigraph/index.ts", }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 39884f65b6..e70bc4cc3a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -396,6 +396,9 @@ importers: drizzle-orm: specifier: 'catalog:' version: 0.41.0(@electric-sql/pglite@0.2.13)(@opentelemetry/api@1.9.0(patch_hash=4b2adeefaf7c22f9987d0a125d69cab900719bec7ed7636648bea6947107033a))(@types/pg@8.16.0)(kysely@0.28.14)(pg@8.16.3) + enssdk: + specifier: workspace:* + version: link:../../packages/enssdk graphql: specifier: ^16.11.0 version: 16.11.0 @@ -927,6 +930,9 @@ importers: date-fns: specifier: 'catalog:' version: 4.1.0 + enssdk: + specifier: workspace:* + version: link:../enssdk zod: specifier: 'catalog:' version: 4.3.6 @@ -974,12 +980,18 @@ importers: packages/enssdk: dependencies: + '@ensdomains/address-encoder': + specifier: ^1.1.2 + version: 1.1.4 gql.tada: specifier: ^1.8.10 version: 1.9.1(graphql@16.11.0)(typescript@5.9.3) graphql: specifier: ^16.11.0 version: 16.11.0 + viem: + specifier: 'catalog:' + version: 2.38.5(typescript@5.9.3)(zod@4.3.6) devDependencies: '@ensnode/shared-configs': specifier: workspace:* From 54ba073a48971a84ee93480f3316b2fdd5e6e614 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 31 Mar 2026 16:55:39 -0500 Subject: [PATCH 3/8] docs(changeset): Omnigraph API (BREAKING): Removed `ENSv2Domain.canonicalId` in favor of accessing `ENSv2Domain.tokenId` directly. --- .changeset/dirty-snakes-knock.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/dirty-snakes-knock.md diff --git a/.changeset/dirty-snakes-knock.md b/.changeset/dirty-snakes-knock.md new file mode 100644 index 0000000000..5578a667bf --- /dev/null +++ b/.changeset/dirty-snakes-knock.md @@ -0,0 +1,5 @@ +--- +"ensapi": minor +--- + +Omnigraph API (BREAKING): Removed `ENSv2Domain.canonicalId` in favor of accessing `ENSv2Domain.tokenId` directly. From bb3c1573f24d425da9f57dc30721886d68ef3b73 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 31 Mar 2026 17:25:50 -0500 Subject: [PATCH 4/8] refactor: rename graphql-api to omnigraph --- .../ensadmin/src/app/@actions/api/{graphql => omnigraph}/page.tsx | 0 apps/ensadmin/src/app/api/{graphql => omnigraph}/loading.tsx | 0 apps/ensadmin/src/app/api/{graphql => omnigraph}/page.tsx | 0 .../ensnode-graphql-api.ts => omnigraph/omnigraph-api.ts} | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/builder.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/context.ts | 0 .../src/{graphql-api => omnigraph-api}/lib/connection-helpers.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/lib/cursors.ts | 0 .../lib/find-domains/canonical-registries-cte.ts | 0 .../lib/find-domains/domain-cursor.test.ts | 0 .../lib/find-domains/domain-cursor.ts | 0 .../lib/find-domains/find-domains-resolver-helpers.test.ts | 0 .../lib/find-domains/find-domains-resolver-helpers.ts | 0 .../lib/find-domains/find-domains-resolver.ts | 0 .../lib/find-domains/layers/base-domain-set.ts | 0 .../lib/find-domains/layers/filter-by-canonical.ts | 0 .../lib/find-domains/layers/filter-by-name.ts | 0 .../lib/find-domains/layers/filter-by-owner.ts | 0 .../lib/find-domains/layers/filter-by-parent.ts | 0 .../lib/find-domains/layers/filter-by-registry.ts | 0 .../lib/find-domains/layers/index.ts | 0 .../lib/find-domains/layers/with-ordering-metadata.ts | 0 .../src/{graphql-api => omnigraph-api}/lib/find-domains/types.ts | 0 .../lib/find-events/find-events-resolver.ts | 0 .../src/{graphql-api => omnigraph-api}/lib/get-canonical-path.ts | 0 .../lib/get-domain-by-interpreted-name.ts | 0 .../src/{graphql-api => omnigraph-api}/lib/get-domain-resolver.ts | 0 .../{graphql-api => omnigraph-api}/lib/get-latest-registration.ts | 0 .../ensapi/src/{graphql-api => omnigraph-api}/lib/get-model-id.ts | 0 .../src/{graphql-api => omnigraph-api}/lib/lazy-connection.ts | 0 .../src/{graphql-api => omnigraph-api}/lib/reject-any-errors.ts | 0 .../{graphql-api => omnigraph-api}/lib/write-graphql-schema.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema.ts | 0 .../src/{graphql-api => omnigraph-api}/schema/account-id.ts | 0 .../schema/account.integration.test.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/account.ts | 0 .../src/{graphql-api => omnigraph-api}/schema/connection.ts | 0 .../ensapi/src/{graphql-api => omnigraph-api}/schema/constants.ts | 0 .../schema/domain.integration.test.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/domain.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/event.ts | 0 .../schema/example-queries.integration.test.ts | 0 .../{graphql-api => omnigraph-api}/schema/example-queries.test.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/label.ts | 0 .../src/{graphql-api => omnigraph-api}/schema/name-or-node.ts | 0 .../src/{graphql-api => omnigraph-api}/schema/order-direction.ts | 0 .../schema/permissions.integration.test.ts | 0 .../src/{graphql-api => omnigraph-api}/schema/permissions.ts | 0 .../schema/query.integration.test.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/query.ts | 0 .../src/{graphql-api => omnigraph-api}/schema/registration.ts | 0 .../schema/registry-permissions-user.ts | 0 .../schema/registry.integration.test.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/registry.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/renewal.ts | 0 .../schema/resolver-permissions-user.ts | 0 .../src/{graphql-api => omnigraph-api}/schema/resolver-records.ts | 0 .../schema/resolver.integration.test.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/resolver.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/schema/scalars.ts | 0 apps/ensapi/src/{graphql-api => omnigraph-api}/yoga.ts | 0 .../{ensnode-graphql-api-client.ts => omnigraph-api-client.ts} | 0 .../src/{graphql-api => omnigraph-api}/example-queries.ts | 0 .../src/{graphql-api => omnigraph-api}/prerequisites.ts | 0 64 files changed, 0 insertions(+), 0 deletions(-) rename apps/ensadmin/src/app/@actions/api/{graphql => omnigraph}/page.tsx (100%) rename apps/ensadmin/src/app/api/{graphql => omnigraph}/loading.tsx (100%) rename apps/ensadmin/src/app/api/{graphql => omnigraph}/page.tsx (100%) rename apps/ensapi/src/handlers/api/{graphql/ensnode-graphql-api.ts => omnigraph/omnigraph-api.ts} (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/builder.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/context.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/connection-helpers.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/cursors.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/canonical-registries-cte.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/domain-cursor.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/domain-cursor.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/find-domains-resolver-helpers.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/find-domains-resolver-helpers.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/find-domains-resolver.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/base-domain-set.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/filter-by-canonical.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/filter-by-name.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/filter-by-owner.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/filter-by-parent.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/filter-by-registry.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/index.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/layers/with-ordering-metadata.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-domains/types.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/find-events/find-events-resolver.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/get-canonical-path.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/get-domain-by-interpreted-name.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/get-domain-resolver.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/get-latest-registration.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/get-model-id.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/lazy-connection.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/reject-any-errors.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/lib/write-graphql-schema.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/account-id.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/account.integration.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/account.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/connection.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/constants.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/domain.integration.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/domain.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/event.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/example-queries.integration.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/example-queries.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/label.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/name-or-node.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/order-direction.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/permissions.integration.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/permissions.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/query.integration.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/query.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/registration.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/registry-permissions-user.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/registry.integration.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/registry.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/renewal.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/resolver-permissions-user.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/resolver-records.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/resolver.integration.test.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/resolver.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/schema/scalars.ts (100%) rename apps/ensapi/src/{graphql-api => omnigraph-api}/yoga.ts (100%) rename apps/ensapi/src/test/integration/{ensnode-graphql-api-client.ts => omnigraph-api-client.ts} (100%) rename packages/ensnode-sdk/src/{graphql-api => omnigraph-api}/example-queries.ts (100%) rename packages/ensnode-sdk/src/{graphql-api => omnigraph-api}/prerequisites.ts (100%) diff --git a/apps/ensadmin/src/app/@actions/api/graphql/page.tsx b/apps/ensadmin/src/app/@actions/api/omnigraph/page.tsx similarity index 100% rename from apps/ensadmin/src/app/@actions/api/graphql/page.tsx rename to apps/ensadmin/src/app/@actions/api/omnigraph/page.tsx diff --git a/apps/ensadmin/src/app/api/graphql/loading.tsx b/apps/ensadmin/src/app/api/omnigraph/loading.tsx similarity index 100% rename from apps/ensadmin/src/app/api/graphql/loading.tsx rename to apps/ensadmin/src/app/api/omnigraph/loading.tsx diff --git a/apps/ensadmin/src/app/api/graphql/page.tsx b/apps/ensadmin/src/app/api/omnigraph/page.tsx similarity index 100% rename from apps/ensadmin/src/app/api/graphql/page.tsx rename to apps/ensadmin/src/app/api/omnigraph/page.tsx diff --git a/apps/ensapi/src/handlers/api/graphql/ensnode-graphql-api.ts b/apps/ensapi/src/handlers/api/omnigraph/omnigraph-api.ts similarity index 100% rename from apps/ensapi/src/handlers/api/graphql/ensnode-graphql-api.ts rename to apps/ensapi/src/handlers/api/omnigraph/omnigraph-api.ts diff --git a/apps/ensapi/src/graphql-api/builder.ts b/apps/ensapi/src/omnigraph-api/builder.ts similarity index 100% rename from apps/ensapi/src/graphql-api/builder.ts rename to apps/ensapi/src/omnigraph-api/builder.ts diff --git a/apps/ensapi/src/graphql-api/context.ts b/apps/ensapi/src/omnigraph-api/context.ts similarity index 100% rename from apps/ensapi/src/graphql-api/context.ts rename to apps/ensapi/src/omnigraph-api/context.ts diff --git a/apps/ensapi/src/graphql-api/lib/connection-helpers.ts b/apps/ensapi/src/omnigraph-api/lib/connection-helpers.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/connection-helpers.ts rename to apps/ensapi/src/omnigraph-api/lib/connection-helpers.ts diff --git a/apps/ensapi/src/graphql-api/lib/cursors.ts b/apps/ensapi/src/omnigraph-api/lib/cursors.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/cursors.ts rename to apps/ensapi/src/omnigraph-api/lib/cursors.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/canonical-registries-cte.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/canonical-registries-cte.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/canonical-registries-cte.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/canonical-registries-cte.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/domain-cursor.test.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/domain-cursor.test.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.test.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/domain-cursor.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/domain-cursor.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/find-domains-resolver-helpers.test.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/find-domains-resolver-helpers.test.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/find-domains-resolver-helpers.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/find-domains-resolver-helpers.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/find-domains-resolver.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/find-domains-resolver.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/base-domain-set.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/base-domain-set.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/base-domain-set.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/base-domain-set.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-canonical.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-canonical.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-canonical.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-canonical.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-name.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-name.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-name.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-name.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-owner.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-owner.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-owner.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-owner.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-parent.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-parent.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-parent.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-parent.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-registry.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-registry.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/filter-by-registry.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/filter-by-registry.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/index.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/index.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/index.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/index.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/layers/with-ordering-metadata.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/layers/with-ordering-metadata.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/layers/with-ordering-metadata.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/layers/with-ordering-metadata.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-domains/types.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/types.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-domains/types.ts rename to apps/ensapi/src/omnigraph-api/lib/find-domains/types.ts diff --git a/apps/ensapi/src/graphql-api/lib/find-events/find-events-resolver.ts b/apps/ensapi/src/omnigraph-api/lib/find-events/find-events-resolver.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/find-events/find-events-resolver.ts rename to apps/ensapi/src/omnigraph-api/lib/find-events/find-events-resolver.ts diff --git a/apps/ensapi/src/graphql-api/lib/get-canonical-path.ts b/apps/ensapi/src/omnigraph-api/lib/get-canonical-path.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/get-canonical-path.ts rename to apps/ensapi/src/omnigraph-api/lib/get-canonical-path.ts diff --git a/apps/ensapi/src/graphql-api/lib/get-domain-by-interpreted-name.ts b/apps/ensapi/src/omnigraph-api/lib/get-domain-by-interpreted-name.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/get-domain-by-interpreted-name.ts rename to apps/ensapi/src/omnigraph-api/lib/get-domain-by-interpreted-name.ts diff --git a/apps/ensapi/src/graphql-api/lib/get-domain-resolver.ts b/apps/ensapi/src/omnigraph-api/lib/get-domain-resolver.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/get-domain-resolver.ts rename to apps/ensapi/src/omnigraph-api/lib/get-domain-resolver.ts diff --git a/apps/ensapi/src/graphql-api/lib/get-latest-registration.ts b/apps/ensapi/src/omnigraph-api/lib/get-latest-registration.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/get-latest-registration.ts rename to apps/ensapi/src/omnigraph-api/lib/get-latest-registration.ts diff --git a/apps/ensapi/src/graphql-api/lib/get-model-id.ts b/apps/ensapi/src/omnigraph-api/lib/get-model-id.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/get-model-id.ts rename to apps/ensapi/src/omnigraph-api/lib/get-model-id.ts diff --git a/apps/ensapi/src/graphql-api/lib/lazy-connection.ts b/apps/ensapi/src/omnigraph-api/lib/lazy-connection.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/lazy-connection.ts rename to apps/ensapi/src/omnigraph-api/lib/lazy-connection.ts diff --git a/apps/ensapi/src/graphql-api/lib/reject-any-errors.ts b/apps/ensapi/src/omnigraph-api/lib/reject-any-errors.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/reject-any-errors.ts rename to apps/ensapi/src/omnigraph-api/lib/reject-any-errors.ts diff --git a/apps/ensapi/src/graphql-api/lib/write-graphql-schema.ts b/apps/ensapi/src/omnigraph-api/lib/write-graphql-schema.ts similarity index 100% rename from apps/ensapi/src/graphql-api/lib/write-graphql-schema.ts rename to apps/ensapi/src/omnigraph-api/lib/write-graphql-schema.ts diff --git a/apps/ensapi/src/graphql-api/schema.ts b/apps/ensapi/src/omnigraph-api/schema.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema.ts rename to apps/ensapi/src/omnigraph-api/schema.ts diff --git a/apps/ensapi/src/graphql-api/schema/account-id.ts b/apps/ensapi/src/omnigraph-api/schema/account-id.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/account-id.ts rename to apps/ensapi/src/omnigraph-api/schema/account-id.ts diff --git a/apps/ensapi/src/graphql-api/schema/account.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/account.integration.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/account.integration.test.ts rename to apps/ensapi/src/omnigraph-api/schema/account.integration.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/account.ts b/apps/ensapi/src/omnigraph-api/schema/account.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/account.ts rename to apps/ensapi/src/omnigraph-api/schema/account.ts diff --git a/apps/ensapi/src/graphql-api/schema/connection.ts b/apps/ensapi/src/omnigraph-api/schema/connection.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/connection.ts rename to apps/ensapi/src/omnigraph-api/schema/connection.ts diff --git a/apps/ensapi/src/graphql-api/schema/constants.ts b/apps/ensapi/src/omnigraph-api/schema/constants.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/constants.ts rename to apps/ensapi/src/omnigraph-api/schema/constants.ts diff --git a/apps/ensapi/src/graphql-api/schema/domain.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/domain.integration.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/domain.integration.test.ts rename to apps/ensapi/src/omnigraph-api/schema/domain.integration.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/domain.ts b/apps/ensapi/src/omnigraph-api/schema/domain.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/domain.ts rename to apps/ensapi/src/omnigraph-api/schema/domain.ts diff --git a/apps/ensapi/src/graphql-api/schema/event.ts b/apps/ensapi/src/omnigraph-api/schema/event.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/event.ts rename to apps/ensapi/src/omnigraph-api/schema/event.ts diff --git a/apps/ensapi/src/graphql-api/schema/example-queries.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/example-queries.integration.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/example-queries.integration.test.ts rename to apps/ensapi/src/omnigraph-api/schema/example-queries.integration.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/example-queries.test.ts b/apps/ensapi/src/omnigraph-api/schema/example-queries.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/example-queries.test.ts rename to apps/ensapi/src/omnigraph-api/schema/example-queries.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/label.ts b/apps/ensapi/src/omnigraph-api/schema/label.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/label.ts rename to apps/ensapi/src/omnigraph-api/schema/label.ts diff --git a/apps/ensapi/src/graphql-api/schema/name-or-node.ts b/apps/ensapi/src/omnigraph-api/schema/name-or-node.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/name-or-node.ts rename to apps/ensapi/src/omnigraph-api/schema/name-or-node.ts diff --git a/apps/ensapi/src/graphql-api/schema/order-direction.ts b/apps/ensapi/src/omnigraph-api/schema/order-direction.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/order-direction.ts rename to apps/ensapi/src/omnigraph-api/schema/order-direction.ts diff --git a/apps/ensapi/src/graphql-api/schema/permissions.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/permissions.integration.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/permissions.integration.test.ts rename to apps/ensapi/src/omnigraph-api/schema/permissions.integration.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/permissions.ts b/apps/ensapi/src/omnigraph-api/schema/permissions.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/permissions.ts rename to apps/ensapi/src/omnigraph-api/schema/permissions.ts diff --git a/apps/ensapi/src/graphql-api/schema/query.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/query.integration.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/query.integration.test.ts rename to apps/ensapi/src/omnigraph-api/schema/query.integration.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/query.ts b/apps/ensapi/src/omnigraph-api/schema/query.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/query.ts rename to apps/ensapi/src/omnigraph-api/schema/query.ts diff --git a/apps/ensapi/src/graphql-api/schema/registration.ts b/apps/ensapi/src/omnigraph-api/schema/registration.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/registration.ts rename to apps/ensapi/src/omnigraph-api/schema/registration.ts diff --git a/apps/ensapi/src/graphql-api/schema/registry-permissions-user.ts b/apps/ensapi/src/omnigraph-api/schema/registry-permissions-user.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/registry-permissions-user.ts rename to apps/ensapi/src/omnigraph-api/schema/registry-permissions-user.ts diff --git a/apps/ensapi/src/graphql-api/schema/registry.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/registry.integration.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/registry.integration.test.ts rename to apps/ensapi/src/omnigraph-api/schema/registry.integration.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/registry.ts b/apps/ensapi/src/omnigraph-api/schema/registry.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/registry.ts rename to apps/ensapi/src/omnigraph-api/schema/registry.ts diff --git a/apps/ensapi/src/graphql-api/schema/renewal.ts b/apps/ensapi/src/omnigraph-api/schema/renewal.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/renewal.ts rename to apps/ensapi/src/omnigraph-api/schema/renewal.ts diff --git a/apps/ensapi/src/graphql-api/schema/resolver-permissions-user.ts b/apps/ensapi/src/omnigraph-api/schema/resolver-permissions-user.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/resolver-permissions-user.ts rename to apps/ensapi/src/omnigraph-api/schema/resolver-permissions-user.ts diff --git a/apps/ensapi/src/graphql-api/schema/resolver-records.ts b/apps/ensapi/src/omnigraph-api/schema/resolver-records.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/resolver-records.ts rename to apps/ensapi/src/omnigraph-api/schema/resolver-records.ts diff --git a/apps/ensapi/src/graphql-api/schema/resolver.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/resolver.integration.test.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/resolver.integration.test.ts rename to apps/ensapi/src/omnigraph-api/schema/resolver.integration.test.ts diff --git a/apps/ensapi/src/graphql-api/schema/resolver.ts b/apps/ensapi/src/omnigraph-api/schema/resolver.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/resolver.ts rename to apps/ensapi/src/omnigraph-api/schema/resolver.ts diff --git a/apps/ensapi/src/graphql-api/schema/scalars.ts b/apps/ensapi/src/omnigraph-api/schema/scalars.ts similarity index 100% rename from apps/ensapi/src/graphql-api/schema/scalars.ts rename to apps/ensapi/src/omnigraph-api/schema/scalars.ts diff --git a/apps/ensapi/src/graphql-api/yoga.ts b/apps/ensapi/src/omnigraph-api/yoga.ts similarity index 100% rename from apps/ensapi/src/graphql-api/yoga.ts rename to apps/ensapi/src/omnigraph-api/yoga.ts diff --git a/apps/ensapi/src/test/integration/ensnode-graphql-api-client.ts b/apps/ensapi/src/test/integration/omnigraph-api-client.ts similarity index 100% rename from apps/ensapi/src/test/integration/ensnode-graphql-api-client.ts rename to apps/ensapi/src/test/integration/omnigraph-api-client.ts diff --git a/packages/ensnode-sdk/src/graphql-api/example-queries.ts b/packages/ensnode-sdk/src/omnigraph-api/example-queries.ts similarity index 100% rename from packages/ensnode-sdk/src/graphql-api/example-queries.ts rename to packages/ensnode-sdk/src/omnigraph-api/example-queries.ts diff --git a/packages/ensnode-sdk/src/graphql-api/prerequisites.ts b/packages/ensnode-sdk/src/omnigraph-api/prerequisites.ts similarity index 100% rename from packages/ensnode-sdk/src/graphql-api/prerequisites.ts rename to packages/ensnode-sdk/src/omnigraph-api/prerequisites.ts From d58999faec59653877048bf5294357a165b78020 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 31 Mar 2026 17:25:50 -0500 Subject: [PATCH 5/8] refactor: rename graphql-api to omnigraph --- .../src/app/@actions/api/omnigraph/page.tsx | 2 +- apps/ensadmin/src/app/api/omnigraph/page.tsx | 4 +- apps/ensadmin/src/components/app-sidebar.tsx | 4 +- .../hooks/active/use-ensadmin-features.tsx | 12 ++--- apps/ensapi/biome.jsonc | 2 +- apps/ensapi/package.json | 2 +- .../handlers/api/omnigraph/omnigraph-api.ts | 6 +-- apps/ensapi/src/handlers/api/router.ts | 4 +- apps/ensapi/src/index.ts | 2 +- apps/ensapi/src/omnigraph-api/builder.ts | 2 +- .../omnigraph-api/lib/connection-helpers.ts | 2 +- .../lib/find-domains/domain-cursor.ts | 8 ++-- .../find-domains-resolver-helpers.test.ts | 2 +- .../find-domains-resolver-helpers.ts | 8 ++-- .../lib/find-domains/find-domains-resolver.ts | 18 ++++---- .../lib/find-events/find-events-resolver.ts | 6 +-- .../omnigraph-api/lib/write-graphql-schema.ts | 2 +- apps/ensapi/src/omnigraph-api/schema.ts | 2 +- .../src/omnigraph-api/schema/account-id.ts | 2 +- .../schema/account.integration.test.ts | 2 +- .../src/omnigraph-api/schema/account.ts | 30 ++++++------- .../src/omnigraph-api/schema/connection.ts | 2 +- .../src/omnigraph-api/schema/constants.ts | 4 +- .../schema/domain.integration.test.ts | 2 +- .../ensapi/src/omnigraph-api/schema/domain.ts | 44 ++++++++++--------- apps/ensapi/src/omnigraph-api/schema/event.ts | 4 +- apps/ensapi/src/omnigraph-api/schema/label.ts | 2 +- .../src/omnigraph-api/schema/name-or-node.ts | 2 +- .../omnigraph-api/schema/order-direction.ts | 2 +- .../schema/permissions.integration.test.ts | 2 +- .../src/omnigraph-api/schema/permissions.ts | 18 ++++---- .../schema/query.integration.test.ts | 6 +-- apps/ensapi/src/omnigraph-api/schema/query.ts | 30 ++++++------- .../src/omnigraph-api/schema/registration.ts | 20 ++++----- .../schema/registry-permissions-user.ts | 6 +-- .../schema/registry.integration.test.ts | 2 +- .../src/omnigraph-api/schema/registry.ts | 22 +++++----- .../src/omnigraph-api/schema/renewal.ts | 6 +-- .../schema/resolver-permissions-user.ts | 6 +-- .../omnigraph-api/schema/resolver-records.ts | 4 +- .../schema/resolver.integration.test.ts | 2 +- .../src/omnigraph-api/schema/resolver.ts | 22 +++++----- .../src/omnigraph-api/schema/scalars.ts | 2 +- apps/ensapi/src/omnigraph-api/yoga.ts | 4 +- .../find-domains/domain-pagination-queries.ts | 2 +- .../find-domains/test-domain-pagination.ts | 4 +- .../find-events/event-pagination-queries.ts | 2 +- .../src/test/integration/global-setup.ts | 4 +- .../src/test/integration/graphql-utils.ts | 2 +- .../test/integration/omnigraph-api-client.ts | 6 +-- apps/ensindexer/ponder/ponder.config.ts | 2 +- packages/ensnode-sdk/src/index.ts | 2 +- packages/ensnode-sdk/src/internal.ts | 2 +- .../src/omnigraph-api/prerequisites.ts | 4 +- packages/enssdk/src/omnigraph/graphql.ts | 5 ++- 55 files changed, 188 insertions(+), 183 deletions(-) diff --git a/apps/ensadmin/src/app/@actions/api/omnigraph/page.tsx b/apps/ensadmin/src/app/@actions/api/omnigraph/page.tsx index 6c748f1df1..c4708bb7d4 100644 --- a/apps/ensadmin/src/app/@actions/api/omnigraph/page.tsx +++ b/apps/ensadmin/src/app/@actions/api/omnigraph/page.tsx @@ -9,7 +9,7 @@ import { useValidatedSelectedConnection } from "@/hooks/active/use-selected-conn export default function Actions() { const selectedConnection = useValidatedSelectedConnection(); const url = useMemo( - () => new URL(`/api/graphql`, selectedConnection).toString(), + () => new URL(`/api/omnigraph`, selectedConnection).toString(), [selectedConnection], ); diff --git a/apps/ensadmin/src/app/api/omnigraph/page.tsx b/apps/ensadmin/src/app/api/omnigraph/page.tsx index 7707613611..82caf52222 100644 --- a/apps/ensadmin/src/app/api/omnigraph/page.tsx +++ b/apps/ensadmin/src/app/api/omnigraph/page.tsx @@ -19,7 +19,7 @@ function GraphQLPage() { const namespace = useActiveNamespace(); const selectedConnection = useValidatedSelectedConnection(); const url = useMemo( - () => new URL(`/api/graphql`, selectedConnection).toString(), + () => new URL(`/api/omnigraph`, selectedConnection).toString(), [selectedConnection], ); @@ -44,7 +44,7 @@ function GraphQLPage() { export default function Page() { return ( - + ); diff --git a/apps/ensadmin/src/components/app-sidebar.tsx b/apps/ensadmin/src/components/app-sidebar.tsx index 8ca3c055da..a40112b61e 100644 --- a/apps/ensadmin/src/components/app-sidebar.tsx +++ b/apps/ensadmin/src/components/app-sidebar.tsx @@ -52,8 +52,8 @@ const navItems = [ url: "/api/subgraph", }, { - title: "GraphQL (ENS v1 + v2)", - url: "/api/graphql", + title: "Omnigraph (ENS v1 + v2)", + url: "/api/omnigraph", }, ], }, diff --git a/apps/ensadmin/src/hooks/active/use-ensadmin-features.tsx b/apps/ensadmin/src/hooks/active/use-ensadmin-features.tsx index 9da559a696..587781a6be 100644 --- a/apps/ensadmin/src/hooks/active/use-ensadmin-features.tsx +++ b/apps/ensadmin/src/hooks/active/use-ensadmin-features.tsx @@ -2,7 +2,7 @@ import { useMemo } from "react"; import { useENSNodeConfig } from "@ensnode/ensnode-react"; import { - hasGraphqlApiConfigSupport, + hasOmnigraphApiConfigSupport, hasRegistrarActionsConfigSupport, hasRegistrarActionsIndexingStatusSupport, hasSubgraphApiConfigSupport, @@ -33,9 +33,9 @@ export interface ENSAdminFeatures { subgraph: FeatureStatus; /** - * Whether ENSAdmin's ENSNode GraphQL API tooling is supported by the connected ENSNode. + * Whether ENSAdmin's ENSNode Omnigraph API tooling is supported by the connected ENSNode. */ - graphql: FeatureStatus; + omnigraph: FeatureStatus; } const prerequisiteResultToFeatureStatus = (result: PrerequisiteResult): FeatureStatus => { @@ -96,13 +96,13 @@ export function useENSAdminFeatures(): ENSAdminFeatures { return prerequisiteResultToFeatureStatus(hasSubgraphApiConfigSupport(ensIndexerPublicConfig)); }, [configQuery]); - const graphql: FeatureStatus = useMemo(() => { + const omnigraph: FeatureStatus = useMemo(() => { if (configQuery.status === "error") return CONFIG_ERROR_STATUS; if (configQuery.status === "pending") return CONNECTING_STATUS; const { ensIndexerPublicConfig } = configQuery.data; - return prerequisiteResultToFeatureStatus(hasGraphqlApiConfigSupport(ensIndexerPublicConfig)); + return prerequisiteResultToFeatureStatus(hasOmnigraphApiConfigSupport(ensIndexerPublicConfig)); }, [configQuery]); - return { registrarActions, subgraph, graphql }; + return { registrarActions, subgraph, omnigraph }; } diff --git a/apps/ensapi/biome.jsonc b/apps/ensapi/biome.jsonc index a9e9629ae1..9232b81cbf 100644 --- a/apps/ensapi/biome.jsonc +++ b/apps/ensapi/biome.jsonc @@ -4,7 +4,7 @@ "overrides": [ // allow unused function parameters in pothos schema files due to resolve() pattern { - "includes": ["./src/graphql-api/**/*.ts"], + "includes": ["./src/omnigraph-api/**/*.ts"], "linter": { "rules": { "correctness": { diff --git a/apps/ensapi/package.json b/apps/ensapi/package.json index 6495829925..a536fba066 100644 --- a/apps/ensapi/package.json +++ b/apps/ensapi/package.json @@ -19,7 +19,7 @@ "lint": "biome check --write .", "lint:ci": "biome ci", "typecheck": "tsgo --noEmit", - "generate:gqlschema": "tsx src/graphql-api/lib/write-graphql-schema.ts" + "generate:gqlschema": "tsx src/omnigraph-api/lib/write-graphql-schema.ts" }, "dependencies": { "@ensdomains/ensjs": "^4.0.2", diff --git a/apps/ensapi/src/handlers/api/omnigraph/omnigraph-api.ts b/apps/ensapi/src/handlers/api/omnigraph/omnigraph-api.ts index 920e95e609..31fbf3d292 100644 --- a/apps/ensapi/src/handlers/api/omnigraph/omnigraph-api.ts +++ b/apps/ensapi/src/handlers/api/omnigraph/omnigraph-api.ts @@ -1,6 +1,6 @@ import config from "@/config"; -import { hasGraphqlApiConfigSupport } from "@ensnode/ensnode-sdk"; +import { hasOmnigraphApiConfigSupport } from "@ensnode/ensnode-sdk"; import { createApp } from "@/lib/hono-factory"; @@ -8,7 +8,7 @@ const app = createApp(); // 503 if prerequisites not met app.use(async (c, next) => { - const prerequisite = hasGraphqlApiConfigSupport(config.ensIndexerPublicConfig); + const prerequisite = hasOmnigraphApiConfigSupport(config.ensIndexerPublicConfig); if (!prerequisite.supported) { return c.text(`Service Unavailable: ${prerequisite.reason}`, 503); } @@ -20,7 +20,7 @@ app.use(async (c) => { // defer the loading of the GraphQL Server until runtime, which allows these modules to require // the Namechain datasource // TODO(ensv2): this can be removed if/when all ENSNamespaces define the Namechain Datasource - const { yoga } = await import("@/graphql-api/yoga"); + const { yoga } = await import("@/omnigraph-api/yoga"); return yoga.fetch(c.req.raw, c.var); }); diff --git a/apps/ensapi/src/handlers/api/router.ts b/apps/ensapi/src/handlers/api/router.ts index 1a8d31e543..1b15e11f1c 100644 --- a/apps/ensapi/src/handlers/api/router.ts +++ b/apps/ensapi/src/handlers/api/router.ts @@ -2,9 +2,9 @@ import { createApp } from "@/lib/hono-factory"; import nameTokensApi from "./explore/name-tokens-api"; import registrarActionsApi from "./explore/registrar-actions-api"; -import ensnodeGraphQLApi from "./graphql/ensnode-graphql-api"; import realtimeApi from "./meta/realtime-api"; import statusApi from "./meta/status-api"; +import omnigraphApi from "./omnigraph/omnigraph-api"; import resolutionApi from "./resolution/resolution-api"; const app = createApp(); @@ -14,6 +14,6 @@ app.route("/realtime", realtimeApi); app.route("/resolve", resolutionApi); app.route("/name-tokens", nameTokensApi); app.route("/registrar-actions", registrarActionsApi); -app.route("/graphql", ensnodeGraphQLApi); +app.route("/omnigraph", omnigraphApi); export default app; diff --git a/apps/ensapi/src/index.ts b/apps/ensapi/src/index.ts index 1c741b90b0..f96e3e4552 100644 --- a/apps/ensapi/src/index.ts +++ b/apps/ensapi/src/index.ts @@ -7,9 +7,9 @@ import { getReferralLeaderboardEditionsCaches } from "@/cache/referral-leaderboa import { referralProgramEditionConfigSetCache } from "@/cache/referral-program-edition-set.cache"; import { referrerLeaderboardCache } from "@/cache/referrer-leaderboard.cache"; import { redactEnsApiConfig } from "@/config/redact"; -import { writeGraphQLSchema } from "@/graphql-api/lib/write-graphql-schema"; import { sdk } from "@/lib/instrumentation"; import logger from "@/lib/logger"; +import { writeGraphQLSchema } from "@/omnigraph-api/lib/write-graphql-schema"; import app from "./app"; diff --git a/apps/ensapi/src/omnigraph-api/builder.ts b/apps/ensapi/src/omnigraph-api/builder.ts index 214406f016..7299207112 100644 --- a/apps/ensapi/src/omnigraph-api/builder.ts +++ b/apps/ensapi/src/omnigraph-api/builder.ts @@ -18,7 +18,7 @@ import type { } from "enssdk"; import type { Address, Hex } from "viem"; -import type { context } from "@/graphql-api/context"; +import type { context } from "@/omnigraph-api/context"; export const builder = new SchemaBuilder<{ Context: ReturnType; diff --git a/apps/ensapi/src/omnigraph-api/lib/connection-helpers.ts b/apps/ensapi/src/omnigraph-api/lib/connection-helpers.ts index 962e490506..e23a9017ba 100644 --- a/apps/ensapi/src/omnigraph-api/lib/connection-helpers.ts +++ b/apps/ensapi/src/omnigraph-api/lib/connection-helpers.ts @@ -1,7 +1,7 @@ import { and, asc, desc, gt, lt } from "drizzle-orm"; import z from "zod/v4"; -import { cursors } from "@/graphql-api/lib/cursors"; +import { cursors } from "@/omnigraph-api/lib/cursors"; type Column = Parameters[0]; diff --git a/apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.ts index 7197bd1015..4aa463fecb 100644 --- a/apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.ts +++ b/apps/ensapi/src/omnigraph-api/lib/find-domains/domain-cursor.ts @@ -1,9 +1,9 @@ import type { DomainId } from "@ensnode/ensnode-sdk"; -import { cursors } from "@/graphql-api/lib/cursors"; -import type { DomainOrderValue } from "@/graphql-api/lib/find-domains/types"; -import type { DomainsOrderBy } from "@/graphql-api/schema/domain"; -import type { OrderDirection } from "@/graphql-api/schema/order-direction"; +import { cursors } from "@/omnigraph-api/lib/cursors"; +import type { DomainOrderValue } from "@/omnigraph-api/lib/find-domains/types"; +import type { DomainsOrderBy } from "@/omnigraph-api/schema/domain"; +import type { OrderDirection } from "@/omnigraph-api/schema/order-direction"; /** * Composite Domain cursor for keyset pagination. diff --git a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts index 875719f6e4..b554dba8e5 100644 --- a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts +++ b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from "vitest"; vi.mock("@/config", () => ({ default: { namespace: "mainnet" } })); -vi.mock("@/graphql-api/lib/find-domains/find-domains-by-labelhash-path", () => ({})); +vi.mock("@/omnigraph-api/lib/find-domains/find-domains-by-labelhash-path", () => ({})); import { isEffectiveDesc } from "./find-domains-resolver-helpers"; diff --git a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.ts index 4b817d59a3..b26540e9d7 100644 --- a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.ts +++ b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.ts @@ -1,9 +1,9 @@ import { asc, desc, type SQL, sql } from "drizzle-orm"; -import type { DomainCursor } from "@/graphql-api/lib/find-domains/domain-cursor"; -import type { DomainsWithOrderingMetadata } from "@/graphql-api/lib/find-domains/layers/with-ordering-metadata"; -import type { DomainsOrderBy } from "@/graphql-api/schema/domain"; -import type { OrderDirection } from "@/graphql-api/schema/order-direction"; +import type { DomainCursor } from "@/omnigraph-api/lib/find-domains/domain-cursor"; +import type { DomainsWithOrderingMetadata } from "@/omnigraph-api/lib/find-domains/layers/with-ordering-metadata"; +import type { DomainsOrderBy } from "@/omnigraph-api/schema/domain"; +import type { OrderDirection } from "@/omnigraph-api/schema/order-direction"; /** * Get the order column for a given DomainsOrderBy value. diff --git a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver.ts index ae26b32bbf..2b5d677aba 100644 --- a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver.ts +++ b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver.ts @@ -1,27 +1,27 @@ import { type ResolveCursorConnectionArgs, resolveCursorConnection } from "@pothos/plugin-relay"; import { and, count } from "drizzle-orm"; -import type { context as createContext } from "@/graphql-api/context"; +import { ensDb } from "@/lib/ensdb/singleton"; +import { makeLogger } from "@/lib/logger"; +import type { context as createContext } from "@/omnigraph-api/context"; import type { DomainsWithOrderingMetadata, DomainsWithOrderingMetadataResult, -} from "@/graphql-api/lib/find-domains/layers/with-ordering-metadata"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { rejectAnyErrors } from "@/graphql-api/lib/reject-any-errors"; +} from "@/omnigraph-api/lib/find-domains/layers/with-ordering-metadata"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { rejectAnyErrors } from "@/omnigraph-api/lib/reject-any-errors"; import { PAGINATION_DEFAULT_MAX_SIZE, PAGINATION_DEFAULT_PAGE_SIZE, -} from "@/graphql-api/schema/constants"; +} from "@/omnigraph-api/schema/constants"; import { DOMAINS_DEFAULT_ORDER_BY, DOMAINS_DEFAULT_ORDER_DIR, type Domain, DomainInterfaceRef, type DomainsOrderBy, -} from "@/graphql-api/schema/domain"; -import type { OrderDirection } from "@/graphql-api/schema/order-direction"; -import { ensDb } from "@/lib/ensdb/singleton"; -import { makeLogger } from "@/lib/logger"; +} from "@/omnigraph-api/schema/domain"; +import type { OrderDirection } from "@/omnigraph-api/schema/order-direction"; import { DomainCursors } from "./domain-cursor"; import { cursorFilter, orderFindDomains } from "./find-domains-resolver-helpers"; diff --git a/apps/ensapi/src/omnigraph-api/lib/find-events/find-events-resolver.ts b/apps/ensapi/src/omnigraph-api/lib/find-events/find-events-resolver.ts index 09936f49a9..593d013bf9 100644 --- a/apps/ensapi/src/omnigraph-api/lib/find-events/find-events-resolver.ts +++ b/apps/ensapi/src/omnigraph-api/lib/find-events/find-events-resolver.ts @@ -2,10 +2,10 @@ import { type ResolveCursorConnectionArgs, resolveCursorConnection } from "@poth import { and, count, eq, getTableColumns, gte, inArray, lte, type SQL, sql } from "drizzle-orm"; import type { Address, Hex } from "viem"; -import { orderPaginationBy, paginateBy } from "@/graphql-api/lib/connection-helpers"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { ID_PAGINATED_CONNECTION_ARGS } from "@/graphql-api/schema/constants"; import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { orderPaginationBy, paginateBy } from "@/omnigraph-api/lib/connection-helpers"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { ID_PAGINATED_CONNECTION_ARGS } from "@/omnigraph-api/schema/constants"; /** * A join table that relates some entity to events via an `eventId` column. diff --git a/apps/ensapi/src/omnigraph-api/lib/write-graphql-schema.ts b/apps/ensapi/src/omnigraph-api/lib/write-graphql-schema.ts index a1ade33f10..0e59b846dc 100644 --- a/apps/ensapi/src/omnigraph-api/lib/write-graphql-schema.ts +++ b/apps/ensapi/src/omnigraph-api/lib/write-graphql-schema.ts @@ -13,7 +13,7 @@ const ENSSDK_ROOT = resolve(MONOREPO_ROOT, "packages/enssdk/"); const OUTPUT_PATH = resolve(ENSSDK_ROOT, "src/omnigraph/generated/schema.graphql"); async function _writeGraphQLSchema() { - const { schema } = await import("@/graphql-api/schema"); + const { schema } = await import("@/omnigraph-api/schema"); const schemaAsString = printSchema(lexicographicSortSchema(schema)); await writeFile(OUTPUT_PATH, schemaAsString); diff --git a/apps/ensapi/src/omnigraph-api/schema.ts b/apps/ensapi/src/omnigraph-api/schema.ts index cca3d16441..b75da6d213 100644 --- a/apps/ensapi/src/omnigraph-api/schema.ts +++ b/apps/ensapi/src/omnigraph-api/schema.ts @@ -1,4 +1,4 @@ -import { builder } from "@/graphql-api/builder"; +import { builder } from "@/omnigraph-api/builder"; import "./schema/account-id"; import "./schema/connection"; diff --git a/apps/ensapi/src/omnigraph-api/schema/account-id.ts b/apps/ensapi/src/omnigraph-api/schema/account-id.ts index 1376dd4895..a0d5132244 100644 --- a/apps/ensapi/src/omnigraph-api/schema/account-id.ts +++ b/apps/ensapi/src/omnigraph-api/schema/account-id.ts @@ -1,6 +1,6 @@ import type { AccountId } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; +import { builder } from "@/omnigraph-api/builder"; export const AccountIdRef = builder.objectRef("AccountId"); AccountIdRef.implement({ diff --git a/apps/ensapi/src/omnigraph-api/schema/account.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/account.integration.test.ts index 0125ccc927..dc824adcc9 100644 --- a/apps/ensapi/src/omnigraph-api/schema/account.integration.test.ts +++ b/apps/ensapi/src/omnigraph-api/schema/account.integration.test.ts @@ -3,7 +3,6 @@ import { beforeAll, describe, expect, it } from "vitest"; import type { Name } from "@ensnode/ensnode-sdk"; -import { gql } from "@/test/integration/ensnode-graphql-api-client"; import { AccountDomainsPaginated, type PaginatedDomainResult, @@ -21,6 +20,7 @@ import { type PaginatedGraphQLConnection, request, } from "@/test/integration/graphql-utils"; +import { gql } from "@/test/integration/omnigraph-api-client"; // via devnet const DEVNET_DEPLOYER: Address = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"; diff --git a/apps/ensapi/src/omnigraph-api/schema/account.ts b/apps/ensapi/src/omnigraph-api/schema/account.ts index cb1b3ed0dd..60841d4928 100644 --- a/apps/ensapi/src/omnigraph-api/schema/account.ts +++ b/apps/ensapi/src/omnigraph-api/schema/account.ts @@ -2,31 +2,31 @@ import { type ResolveCursorConnectionArgs, resolveCursorConnection } from "@poth import { and, count, eq, getTableColumns } from "drizzle-orm"; import type { Address } from "viem"; -import { builder } from "@/graphql-api/builder"; -import { orderPaginationBy, paginateBy } from "@/graphql-api/lib/connection-helpers"; -import { resolveFindDomains } from "@/graphql-api/lib/find-domains/find-domains-resolver"; +import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { orderPaginationBy, paginateBy } from "@/omnigraph-api/lib/connection-helpers"; +import { resolveFindDomains } from "@/omnigraph-api/lib/find-domains/find-domains-resolver"; import { domainsBase, filterByCanonical, filterByName, filterByOwner, withOrderingMetadata, -} from "@/graphql-api/lib/find-domains/layers"; -import { resolveFindEvents } from "@/graphql-api/lib/find-events/find-events-resolver"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { AccountIdInput } from "@/graphql-api/schema/account-id"; -import { ID_PAGINATED_CONNECTION_ARGS } from "@/graphql-api/schema/constants"; +} from "@/omnigraph-api/lib/find-domains/layers"; +import { resolveFindEvents } from "@/omnigraph-api/lib/find-events/find-events-resolver"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { AccountIdInput } from "@/omnigraph-api/schema/account-id"; +import { ID_PAGINATED_CONNECTION_ARGS } from "@/omnigraph-api/schema/constants"; import { AccountDomainsWhereInput, DomainInterfaceRef, DomainsOrderInput, -} from "@/graphql-api/schema/domain"; -import { AccountEventsWhereInput, EventRef } from "@/graphql-api/schema/event"; -import { PermissionsUserRef } from "@/graphql-api/schema/permissions"; -import { RegistryPermissionsUserRef } from "@/graphql-api/schema/registry-permissions-user"; -import { ResolverPermissionsUserRef } from "@/graphql-api/schema/resolver-permissions-user"; -import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +} from "@/omnigraph-api/schema/domain"; +import { AccountEventsWhereInput, EventRef } from "@/omnigraph-api/schema/event"; +import { PermissionsUserRef } from "@/omnigraph-api/schema/permissions"; +import { RegistryPermissionsUserRef } from "@/omnigraph-api/schema/registry-permissions-user"; +import { ResolverPermissionsUserRef } from "@/omnigraph-api/schema/resolver-permissions-user"; export const AccountRef = builder.loadableObjectRef("Account", { load: (ids: Address[]) => diff --git a/apps/ensapi/src/omnigraph-api/schema/connection.ts b/apps/ensapi/src/omnigraph-api/schema/connection.ts index 5336b1d8e0..69d3c0ea9b 100644 --- a/apps/ensapi/src/omnigraph-api/schema/connection.ts +++ b/apps/ensapi/src/omnigraph-api/schema/connection.ts @@ -1,4 +1,4 @@ -import { builder } from "@/graphql-api/builder"; +import { builder } from "@/omnigraph-api/builder"; builder.globalConnectionField("totalCount", (t) => t.field({ diff --git a/apps/ensapi/src/omnigraph-api/schema/constants.ts b/apps/ensapi/src/omnigraph-api/schema/constants.ts index 6e3d5b0909..c9aa4c59e7 100644 --- a/apps/ensapi/src/omnigraph-api/schema/constants.ts +++ b/apps/ensapi/src/omnigraph-api/schema/constants.ts @@ -1,5 +1,5 @@ -import { cursors } from "@/graphql-api/lib/cursors"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; +import { cursors } from "@/omnigraph-api/lib/cursors"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; export const PAGINATION_DEFAULT_PAGE_SIZE = 100; export const PAGINATION_DEFAULT_MAX_SIZE = 1000; diff --git a/apps/ensapi/src/omnigraph-api/schema/domain.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/domain.integration.test.ts index bb3848bfbc..3e4d66e211 100644 --- a/apps/ensapi/src/omnigraph-api/schema/domain.integration.test.ts +++ b/apps/ensapi/src/omnigraph-api/schema/domain.integration.test.ts @@ -3,7 +3,6 @@ import { beforeAll, describe, expect, it } from "vitest"; import type { InterpretedLabel, Name } from "@ensnode/ensnode-sdk"; import { DEVNET_ETH_LABELS } from "@/test/integration/devnet-names"; -import { gql } from "@/test/integration/ensnode-graphql-api-client"; import { DomainSubdomainsPaginated, type PaginatedDomainResult, @@ -21,6 +20,7 @@ import { type PaginatedGraphQLConnection, request, } from "@/test/integration/graphql-utils"; +import { gql } from "@/test/integration/omnigraph-api-client"; const NAME_WITH_EVENTS = "newowner.eth"; diff --git a/apps/ensapi/src/omnigraph-api/schema/domain.ts b/apps/ensapi/src/omnigraph-api/schema/domain.ts index fcc81e849e..7c19fa3235 100644 --- a/apps/ensapi/src/omnigraph-api/schema/domain.ts +++ b/apps/ensapi/src/omnigraph-api/schema/domain.ts @@ -8,34 +8,38 @@ import { interpretedLabelsToInterpretedName, } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { orderPaginationBy, paginateBy, paginateByInt } from "@/graphql-api/lib/connection-helpers"; -import { resolveFindDomains } from "@/graphql-api/lib/find-domains/find-domains-resolver"; +import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { + orderPaginationBy, + paginateBy, + paginateByInt, +} from "@/omnigraph-api/lib/connection-helpers"; +import { resolveFindDomains } from "@/omnigraph-api/lib/find-domains/find-domains-resolver"; import { domainsBase, filterByName, filterByParent, withOrderingMetadata, -} from "@/graphql-api/lib/find-domains/layers"; -import { resolveFindEvents } from "@/graphql-api/lib/find-events/find-events-resolver"; -import { getDomainResolver } from "@/graphql-api/lib/get-domain-resolver"; -import { getLatestRegistration } from "@/graphql-api/lib/get-latest-registration"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { rejectAnyErrors } from "@/graphql-api/lib/reject-any-errors"; -import { AccountRef } from "@/graphql-api/schema/account"; +} from "@/omnigraph-api/lib/find-domains/layers"; +import { resolveFindEvents } from "@/omnigraph-api/lib/find-events/find-events-resolver"; +import { getDomainResolver } from "@/omnigraph-api/lib/get-domain-resolver"; +import { getLatestRegistration } from "@/omnigraph-api/lib/get-latest-registration"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { rejectAnyErrors } from "@/omnigraph-api/lib/reject-any-errors"; +import { AccountRef } from "@/omnigraph-api/schema/account"; import { ID_PAGINATED_CONNECTION_ARGS, INDEX_PAGINATED_CONNECTION_ARGS, -} from "@/graphql-api/schema/constants"; -import { EventRef, EventsWhereInput } from "@/graphql-api/schema/event"; -import { LabelRef } from "@/graphql-api/schema/label"; -import { OrderDirection } from "@/graphql-api/schema/order-direction"; -import { PermissionsUserRef } from "@/graphql-api/schema/permissions"; -import { RegistrationInterfaceRef } from "@/graphql-api/schema/registration"; -import { RegistryRef } from "@/graphql-api/schema/registry"; -import { ResolverRef } from "@/graphql-api/schema/resolver"; -import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +} from "@/omnigraph-api/schema/constants"; +import { EventRef, EventsWhereInput } from "@/omnigraph-api/schema/event"; +import { LabelRef } from "@/omnigraph-api/schema/label"; +import { OrderDirection } from "@/omnigraph-api/schema/order-direction"; +import { PermissionsUserRef } from "@/omnigraph-api/schema/permissions"; +import { RegistrationInterfaceRef } from "@/omnigraph-api/schema/registration"; +import { RegistryRef } from "@/omnigraph-api/schema/registry"; +import { ResolverRef } from "@/omnigraph-api/schema/resolver"; const isENSv1Domain = (domain: Domain): domain is ENSv1Domain => "parentId" in domain; diff --git a/apps/ensapi/src/omnigraph-api/schema/event.ts b/apps/ensapi/src/omnigraph-api/schema/event.ts index 404f493aed..99a9702c73 100644 --- a/apps/ensapi/src/omnigraph-api/schema/event.ts +++ b/apps/ensapi/src/omnigraph-api/schema/event.ts @@ -1,6 +1,6 @@ -import { builder } from "@/graphql-api/builder"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; import { ensDb } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; export const EventRef = builder.loadableObjectRef("Event", { load: (ids: string[]) => diff --git a/apps/ensapi/src/omnigraph-api/schema/label.ts b/apps/ensapi/src/omnigraph-api/schema/label.ts index 004022b3ad..6e8ea181ee 100644 --- a/apps/ensapi/src/omnigraph-api/schema/label.ts +++ b/apps/ensapi/src/omnigraph-api/schema/label.ts @@ -1,5 +1,5 @@ -import { builder } from "@/graphql-api/builder"; import type { ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; export const LabelRef = builder.objectRef("Label"); LabelRef.implement({ diff --git a/apps/ensapi/src/omnigraph-api/schema/name-or-node.ts b/apps/ensapi/src/omnigraph-api/schema/name-or-node.ts index 75c4ac8c5d..b2038bef2b 100644 --- a/apps/ensapi/src/omnigraph-api/schema/name-or-node.ts +++ b/apps/ensapi/src/omnigraph-api/schema/name-or-node.ts @@ -1,4 +1,4 @@ -import { builder } from "@/graphql-api/builder"; +import { builder } from "@/omnigraph-api/builder"; /** * Input that requires one of `name` or `node`. diff --git a/apps/ensapi/src/omnigraph-api/schema/order-direction.ts b/apps/ensapi/src/omnigraph-api/schema/order-direction.ts index 3fcec85eeb..63f92d10f9 100644 --- a/apps/ensapi/src/omnigraph-api/schema/order-direction.ts +++ b/apps/ensapi/src/omnigraph-api/schema/order-direction.ts @@ -1,4 +1,4 @@ -import { builder } from "@/graphql-api/builder"; +import { builder } from "@/omnigraph-api/builder"; export const OrderDirection = builder.enumType("OrderDirection", { description: "Sort direction", diff --git a/apps/ensapi/src/omnigraph-api/schema/permissions.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/permissions.integration.test.ts index c11de1ac00..249e3876e7 100644 --- a/apps/ensapi/src/omnigraph-api/schema/permissions.integration.test.ts +++ b/apps/ensapi/src/omnigraph-api/schema/permissions.integration.test.ts @@ -5,7 +5,6 @@ import { beforeAll, describe, expect, it } from "vitest"; import { DatasourceNames, EnhancedAccessControlABI } from "@ensnode/datasources"; import { getDatasourceContract } from "@ensnode/ensnode-sdk"; -import { gql } from "@/test/integration/ensnode-graphql-api-client"; import { EventFragment, type EventResult, @@ -18,6 +17,7 @@ import { type PaginatedGraphQLConnection, request, } from "@/test/integration/graphql-utils"; +import { gql } from "@/test/integration/omnigraph-api-client"; const namespace = "ens-test-env"; diff --git a/apps/ensapi/src/omnigraph-api/schema/permissions.ts b/apps/ensapi/src/omnigraph-api/schema/permissions.ts index 1087c1aef4..08558661ca 100644 --- a/apps/ensapi/src/omnigraph-api/schema/permissions.ts +++ b/apps/ensapi/src/omnigraph-api/schema/permissions.ts @@ -10,16 +10,16 @@ import { ROOT_RESOURCE, } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { orderPaginationBy, paginateBy } from "@/graphql-api/lib/connection-helpers"; -import { resolveFindEvents } from "@/graphql-api/lib/find-events/find-events-resolver"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { AccountRef } from "@/graphql-api/schema/account"; -import { AccountIdRef } from "@/graphql-api/schema/account-id"; -import { ID_PAGINATED_CONNECTION_ARGS } from "@/graphql-api/schema/constants"; -import { EventRef, EventsWhereInput } from "@/graphql-api/schema/event"; import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { orderPaginationBy, paginateBy } from "@/omnigraph-api/lib/connection-helpers"; +import { resolveFindEvents } from "@/omnigraph-api/lib/find-events/find-events-resolver"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { AccountRef } from "@/omnigraph-api/schema/account"; +import { AccountIdRef } from "@/omnigraph-api/schema/account-id"; +import { ID_PAGINATED_CONNECTION_ARGS } from "@/omnigraph-api/schema/constants"; +import { EventRef, EventsWhereInput } from "@/omnigraph-api/schema/event"; export const PermissionsRef = builder.loadableObjectRef("Permissions", { load: (ids: PermissionsId[]) => diff --git a/apps/ensapi/src/omnigraph-api/schema/query.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/query.integration.test.ts index aa44b2aa7e..2a46c97da4 100644 --- a/apps/ensapi/src/omnigraph-api/schema/query.integration.test.ts +++ b/apps/ensapi/src/omnigraph-api/schema/query.integration.test.ts @@ -14,7 +14,6 @@ import { } from "@ensnode/ensnode-sdk"; import { DEVNET_NAMES } from "@/test/integration/devnet-names"; -import { gql } from "@/test/integration/ensnode-graphql-api-client"; import { type PaginatedDomainResult, QueryDomainsPaginated, @@ -26,6 +25,7 @@ import { type PaginatedGraphQLConnection, request, } from "@/test/integration/graphql-utils"; +import { gql } from "@/test/integration/omnigraph-api-client"; const namespace = "ens-test-env"; @@ -37,8 +37,8 @@ const V2_ROOT_REGISTRY = getDatasourceContract( const V1_ETH_DOMAIN_ID = makeENSv1DomainId(namehash("eth")); -const V2_ETH_CANONICAL_ID = getStorageId(labelhash("eth")); -const V2_ETH_DOMAIN_ID = makeENSv2DomainId(V2_ROOT_REGISTRY, V2_ETH_CANONICAL_ID); +const V2_ETH_STORAGE_ID = getStorageId(labelhash("eth")); +const V2_ETH_DOMAIN_ID = makeENSv2DomainId(V2_ROOT_REGISTRY, V2_ETH_STORAGE_ID); describe("Query.root", () => { it("returns the root registry", async () => { diff --git a/apps/ensapi/src/omnigraph-api/schema/query.ts b/apps/ensapi/src/omnigraph-api/schema/query.ts index 331132b8ab..8170455455 100644 --- a/apps/ensapi/src/omnigraph-api/schema/query.ts +++ b/apps/ensapi/src/omnigraph-api/schema/query.ts @@ -9,20 +9,21 @@ import { maybeGetENSv2RootRegistryId, } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { orderPaginationBy, paginateBy } from "@/graphql-api/lib/connection-helpers"; -import { resolveFindDomains } from "@/graphql-api/lib/find-domains/find-domains-resolver"; +import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { orderPaginationBy, paginateBy } from "@/omnigraph-api/lib/connection-helpers"; +import { resolveFindDomains } from "@/omnigraph-api/lib/find-domains/find-domains-resolver"; import { domainsBase, filterByCanonical, filterByName, withOrderingMetadata, -} from "@/graphql-api/lib/find-domains/layers"; -import { getDomainIdByInterpretedName } from "@/graphql-api/lib/get-domain-by-interpreted-name"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { AccountRef } from "@/graphql-api/schema/account"; -import { AccountIdInput } from "@/graphql-api/schema/account-id"; -import { ID_PAGINATED_CONNECTION_ARGS } from "@/graphql-api/schema/constants"; +} from "@/omnigraph-api/lib/find-domains/layers"; +import { getDomainIdByInterpretedName } from "@/omnigraph-api/lib/get-domain-by-interpreted-name"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { AccountRef } from "@/omnigraph-api/schema/account"; +import { AccountIdInput } from "@/omnigraph-api/schema/account-id"; +import { ID_PAGINATED_CONNECTION_ARGS } from "@/omnigraph-api/schema/constants"; import { DomainIdInput, DomainInterfaceRef, @@ -30,12 +31,11 @@ import { DomainsWhereInput, ENSv1DomainRef, ENSv2DomainRef, -} from "@/graphql-api/schema/domain"; -import { PermissionsRef } from "@/graphql-api/schema/permissions"; -import { RegistrationInterfaceRef } from "@/graphql-api/schema/registration"; -import { RegistryIdInput, RegistryRef } from "@/graphql-api/schema/registry"; -import { ResolverIdInput, ResolverRef } from "@/graphql-api/schema/resolver"; -import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +} from "@/omnigraph-api/schema/domain"; +import { PermissionsRef } from "@/omnigraph-api/schema/permissions"; +import { RegistrationInterfaceRef } from "@/omnigraph-api/schema/registration"; +import { RegistryIdInput, RegistryRef } from "@/omnigraph-api/schema/registry"; +import { ResolverIdInput, ResolverRef } from "@/omnigraph-api/schema/resolver"; // don't want them to get familiar/accustomed to these methods until their necessity is certain const INCLUDE_DEV_METHODS = process.env.NODE_ENV !== "production"; diff --git a/apps/ensapi/src/omnigraph-api/schema/registration.ts b/apps/ensapi/src/omnigraph-api/schema/registration.ts index fb192e2ece..8c90bb28e3 100644 --- a/apps/ensapi/src/omnigraph-api/schema/registration.ts +++ b/apps/ensapi/src/omnigraph-api/schema/registration.ts @@ -10,17 +10,17 @@ import { type RequiredAndNotNull, } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { orderPaginationBy, paginateByInt } from "@/graphql-api/lib/connection-helpers"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { AccountRef } from "@/graphql-api/schema/account"; -import { AccountIdRef } from "@/graphql-api/schema/account-id"; -import { INDEX_PAGINATED_CONNECTION_ARGS } from "@/graphql-api/schema/constants"; -import { DomainInterfaceRef } from "@/graphql-api/schema/domain"; -import { EventRef } from "@/graphql-api/schema/event"; -import { RenewalRef } from "@/graphql-api/schema/renewal"; import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { orderPaginationBy, paginateByInt } from "@/omnigraph-api/lib/connection-helpers"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { AccountRef } from "@/omnigraph-api/schema/account"; +import { AccountIdRef } from "@/omnigraph-api/schema/account-id"; +import { INDEX_PAGINATED_CONNECTION_ARGS } from "@/omnigraph-api/schema/constants"; +import { DomainInterfaceRef } from "@/omnigraph-api/schema/domain"; +import { EventRef } from "@/omnigraph-api/schema/event"; +import { RenewalRef } from "@/omnigraph-api/schema/renewal"; export const RegistrationInterfaceRef = builder.loadableInterfaceRef("Registration", { load: (ids: RegistrationId[]) => diff --git a/apps/ensapi/src/omnigraph-api/schema/registry-permissions-user.ts b/apps/ensapi/src/omnigraph-api/schema/registry-permissions-user.ts index 34490d5954..bbc91106d4 100644 --- a/apps/ensapi/src/omnigraph-api/schema/registry-permissions-user.ts +++ b/apps/ensapi/src/omnigraph-api/schema/registry-permissions-user.ts @@ -1,9 +1,9 @@ import { makeRegistryId } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { AccountRef } from "@/graphql-api/schema/account"; -import { RegistryRef } from "@/graphql-api/schema/registry"; import type { ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { AccountRef } from "@/omnigraph-api/schema/account"; +import { RegistryRef } from "@/omnigraph-api/schema/registry"; /** * Represents a PermissionsUser whose contract is a Registry, providing a semantic `registry` field. diff --git a/apps/ensapi/src/omnigraph-api/schema/registry.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/registry.integration.test.ts index 475ecf847a..574061542e 100644 --- a/apps/ensapi/src/omnigraph-api/schema/registry.integration.test.ts +++ b/apps/ensapi/src/omnigraph-api/schema/registry.integration.test.ts @@ -4,7 +4,6 @@ import { DatasourceNames } from "@ensnode/datasources"; import { getDatasourceContract, type InterpretedLabel } from "@ensnode/ensnode-sdk"; import { DEVNET_ETH_LABELS } from "@/test/integration/devnet-names"; -import { gql } from "@/test/integration/ensnode-graphql-api-client"; import { type PaginatedDomainResult, RegistryDomainsPaginated, @@ -16,6 +15,7 @@ import { type PaginatedGraphQLConnection, request, } from "@/test/integration/graphql-utils"; +import { gql } from "@/test/integration/omnigraph-api-client"; const namespace = "ens-test-env"; diff --git a/apps/ensapi/src/omnigraph-api/schema/registry.ts b/apps/ensapi/src/omnigraph-api/schema/registry.ts index b57fe05da0..333f3205e1 100644 --- a/apps/ensapi/src/omnigraph-api/schema/registry.ts +++ b/apps/ensapi/src/omnigraph-api/schema/registry.ts @@ -3,27 +3,27 @@ import { and, eq } from "drizzle-orm"; import { makePermissionsId, type RegistryId } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { orderPaginationBy, paginateBy } from "@/graphql-api/lib/connection-helpers"; -import { resolveFindDomains } from "@/graphql-api/lib/find-domains/find-domains-resolver"; +import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { orderPaginationBy, paginateBy } from "@/omnigraph-api/lib/connection-helpers"; +import { resolveFindDomains } from "@/omnigraph-api/lib/find-domains/find-domains-resolver"; import { domainsBase, filterByName, filterByRegistry, withOrderingMetadata, -} from "@/graphql-api/lib/find-domains/layers"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { AccountIdInput, AccountIdRef } from "@/graphql-api/schema/account-id"; -import { ID_PAGINATED_CONNECTION_ARGS } from "@/graphql-api/schema/constants"; +} from "@/omnigraph-api/lib/find-domains/layers"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { AccountIdInput, AccountIdRef } from "@/omnigraph-api/schema/account-id"; +import { ID_PAGINATED_CONNECTION_ARGS } from "@/omnigraph-api/schema/constants"; import { DomainInterfaceRef, DomainsOrderInput, ENSv2DomainRef, RegistryDomainsWhereInput, -} from "@/graphql-api/schema/domain"; -import { PermissionsRef } from "@/graphql-api/schema/permissions"; -import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +} from "@/omnigraph-api/schema/domain"; +import { PermissionsRef } from "@/omnigraph-api/schema/permissions"; export const RegistryRef = builder.loadableObjectRef("Registry", { load: (ids: RegistryId[]) => diff --git a/apps/ensapi/src/omnigraph-api/schema/renewal.ts b/apps/ensapi/src/omnigraph-api/schema/renewal.ts index 7ef01e9e52..1fe79a03f2 100644 --- a/apps/ensapi/src/omnigraph-api/schema/renewal.ts +++ b/apps/ensapi/src/omnigraph-api/schema/renewal.ts @@ -1,9 +1,9 @@ import type { RenewalId } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; -import { EventRef } from "@/graphql-api/schema/event"; import { ensDb } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; +import { EventRef } from "@/omnigraph-api/schema/event"; export const RenewalRef = builder.loadableObjectRef("Renewal", { load: (ids: RenewalId[]) => diff --git a/apps/ensapi/src/omnigraph-api/schema/resolver-permissions-user.ts b/apps/ensapi/src/omnigraph-api/schema/resolver-permissions-user.ts index 4b752164a6..b7c96fcb37 100644 --- a/apps/ensapi/src/omnigraph-api/schema/resolver-permissions-user.ts +++ b/apps/ensapi/src/omnigraph-api/schema/resolver-permissions-user.ts @@ -1,9 +1,9 @@ import { makeResolverId } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { AccountRef } from "@/graphql-api/schema/account"; -import { ResolverRef } from "@/graphql-api/schema/resolver"; import type { ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { AccountRef } from "@/omnigraph-api/schema/account"; +import { ResolverRef } from "@/omnigraph-api/schema/resolver"; /** * Represents a PermissionsUser whose contract is a Resolver, providing a semantic `resolver` field. diff --git a/apps/ensapi/src/omnigraph-api/schema/resolver-records.ts b/apps/ensapi/src/omnigraph-api/schema/resolver-records.ts index 70b38bc3d1..bbc6b674af 100644 --- a/apps/ensapi/src/omnigraph-api/schema/resolver-records.ts +++ b/apps/ensapi/src/omnigraph-api/schema/resolver-records.ts @@ -1,8 +1,8 @@ import { bigintToCoinType, type ResolverRecordsId } from "@ensnode/ensnode-sdk"; -import { builder } from "@/graphql-api/builder"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; import { ensDb } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; export const ResolverRecordsRef = builder.loadableObjectRef("ResolverRecords", { load: (ids: ResolverRecordsId[]) => diff --git a/apps/ensapi/src/omnigraph-api/schema/resolver.integration.test.ts b/apps/ensapi/src/omnigraph-api/schema/resolver.integration.test.ts index 04eaaa6b6a..ecea044380 100644 --- a/apps/ensapi/src/omnigraph-api/schema/resolver.integration.test.ts +++ b/apps/ensapi/src/omnigraph-api/schema/resolver.integration.test.ts @@ -1,6 +1,5 @@ import { describe, expect, it } from "vitest"; -import { gql } from "@/test/integration/ensnode-graphql-api-client"; import { EventFragment, type EventResult, @@ -13,6 +12,7 @@ import { type PaginatedGraphQLConnection, request, } from "@/test/integration/graphql-utils"; +import { gql } from "@/test/integration/omnigraph-api-client"; // TODO: once the devnet has deterministic resolver addresses, we can resolver(by: { contract }) // but until then we'll access by a domain's assigned resolver diff --git a/apps/ensapi/src/omnigraph-api/schema/resolver.ts b/apps/ensapi/src/omnigraph-api/schema/resolver.ts index de194f89b8..2e9d47783a 100644 --- a/apps/ensapi/src/omnigraph-api/schema/resolver.ts +++ b/apps/ensapi/src/omnigraph-api/schema/resolver.ts @@ -7,18 +7,18 @@ import { namehash } from "viem"; import { makePermissionsId, makeResolverRecordsId, type ResolverId } from "@ensnode/ensnode-sdk"; import { isBridgedResolver } from "@ensnode/ensnode-sdk/internal"; -import { builder } from "@/graphql-api/builder"; -import { orderPaginationBy, paginateBy } from "@/graphql-api/lib/connection-helpers"; -import { resolveFindEvents } from "@/graphql-api/lib/find-events/find-events-resolver"; -import { getModelId } from "@/graphql-api/lib/get-model-id"; -import { lazyConnection } from "@/graphql-api/lib/lazy-connection"; -import { AccountIdInput, AccountIdRef } from "@/graphql-api/schema/account-id"; -import { ID_PAGINATED_CONNECTION_ARGS } from "@/graphql-api/schema/constants"; -import { EventRef, EventsWhereInput } from "@/graphql-api/schema/event"; -import { NameOrNodeInput } from "@/graphql-api/schema/name-or-node"; -import { PermissionsRef } from "@/graphql-api/schema/permissions"; -import { ResolverRecordsRef } from "@/graphql-api/schema/resolver-records"; import { ensDb, ensIndexerSchema } from "@/lib/ensdb/singleton"; +import { builder } from "@/omnigraph-api/builder"; +import { orderPaginationBy, paginateBy } from "@/omnigraph-api/lib/connection-helpers"; +import { resolveFindEvents } from "@/omnigraph-api/lib/find-events/find-events-resolver"; +import { getModelId } from "@/omnigraph-api/lib/get-model-id"; +import { lazyConnection } from "@/omnigraph-api/lib/lazy-connection"; +import { AccountIdInput, AccountIdRef } from "@/omnigraph-api/schema/account-id"; +import { ID_PAGINATED_CONNECTION_ARGS } from "@/omnigraph-api/schema/constants"; +import { EventRef, EventsWhereInput } from "@/omnigraph-api/schema/event"; +import { NameOrNodeInput } from "@/omnigraph-api/schema/name-or-node"; +import { PermissionsRef } from "@/omnigraph-api/schema/permissions"; +import { ResolverRecordsRef } from "@/omnigraph-api/schema/resolver-records"; /** * Note that this indexed Resolver entity represents not _all_ Resolver contracts that exist onchain, diff --git a/apps/ensapi/src/omnigraph-api/schema/scalars.ts b/apps/ensapi/src/omnigraph-api/schema/scalars.ts index 112d08a2b7..2f061a390b 100644 --- a/apps/ensapi/src/omnigraph-api/schema/scalars.ts +++ b/apps/ensapi/src/omnigraph-api/schema/scalars.ts @@ -24,7 +24,7 @@ import { makeLowercaseAddressSchema, } from "@ensnode/ensnode-sdk/internal"; -import { builder } from "@/graphql-api/builder"; +import { builder } from "@/omnigraph-api/builder"; builder.scalarType("BigInt", { description: "BigInt represents non-fractional signed whole numeric values.", diff --git a/apps/ensapi/src/omnigraph-api/yoga.ts b/apps/ensapi/src/omnigraph-api/yoga.ts index 7ac1e447fb..aa66bedf96 100644 --- a/apps/ensapi/src/omnigraph-api/yoga.ts +++ b/apps/ensapi/src/omnigraph-api/yoga.ts @@ -4,9 +4,9 @@ import { createYoga } from "graphql-yoga"; -import { context } from "@/graphql-api/context"; -import { schema } from "@/graphql-api/schema"; import { makeLogger } from "@/lib/logger"; +import { context } from "@/omnigraph-api/context"; +import { schema } from "@/omnigraph-api/schema"; const logger = makeLogger("ensnode-graphql"); diff --git a/apps/ensapi/src/test/integration/find-domains/domain-pagination-queries.ts b/apps/ensapi/src/test/integration/find-domains/domain-pagination-queries.ts index 2f9325b8c9..8355a41dac 100644 --- a/apps/ensapi/src/test/integration/find-domains/domain-pagination-queries.ts +++ b/apps/ensapi/src/test/integration/find-domains/domain-pagination-queries.ts @@ -1,6 +1,6 @@ import type { InterpretedLabel, Name } from "@ensnode/ensnode-sdk"; -import { gql } from "@/test/integration/ensnode-graphql-api-client"; +import { gql } from "@/test/integration/omnigraph-api-client"; const PageInfoFragment = gql` fragment PageInfoFragment on PageInfo { diff --git a/apps/ensapi/src/test/integration/find-domains/test-domain-pagination.ts b/apps/ensapi/src/test/integration/find-domains/test-domain-pagination.ts index 53d8b92790..abd213fb7f 100644 --- a/apps/ensapi/src/test/integration/find-domains/test-domain-pagination.ts +++ b/apps/ensapi/src/test/integration/find-domains/test-domain-pagination.ts @@ -1,7 +1,7 @@ import { beforeAll, describe, expect, it } from "vitest"; -import type { DomainsOrderByValue, DomainsOrderInput } from "@/graphql-api/schema/domain"; -import type { OrderDirectionValue } from "@/graphql-api/schema/order-direction"; +import type { DomainsOrderByValue, DomainsOrderInput } from "@/omnigraph-api/schema/domain"; +import type { OrderDirectionValue } from "@/omnigraph-api/schema/order-direction"; import type { PaginatedDomainResult } from "@/test/integration/find-domains/domain-pagination-queries"; import { collectBackward, diff --git a/apps/ensapi/src/test/integration/find-events/event-pagination-queries.ts b/apps/ensapi/src/test/integration/find-events/event-pagination-queries.ts index b5d9b7e065..c7d7dfaa6f 100644 --- a/apps/ensapi/src/test/integration/find-events/event-pagination-queries.ts +++ b/apps/ensapi/src/test/integration/find-events/event-pagination-queries.ts @@ -1,4 +1,4 @@ -import { gql } from "@/test/integration/ensnode-graphql-api-client"; +import { gql } from "@/test/integration/omnigraph-api-client"; const PageInfoFragment = gql` fragment PageInfoFragment on PageInfo { diff --git a/apps/ensapi/src/test/integration/global-setup.ts b/apps/ensapi/src/test/integration/global-setup.ts index 5c23cd14a9..e0d36d3ec1 100644 --- a/apps/ensapi/src/test/integration/global-setup.ts +++ b/apps/ensapi/src/test/integration/global-setup.ts @@ -1,4 +1,4 @@ -import { client, ENSNODE_GRAPHQL_API_URL, gql } from "./ensnode-graphql-api-client"; +import { client, ENSNODE_OMNIGRAPH_API_URL, gql } from "./omnigraph-api-client"; export async function setup() { try { @@ -13,7 +13,7 @@ export async function setup() { `); } catch (error) { throw new Error( - `Integration test health check failed: could not reach ${ENSNODE_GRAPHQL_API_URL}. ` + + `Integration test health check failed: could not reach ${ENSNODE_OMNIGRAPH_API_URL}. ` + `Ensure ensapi is running before running integration tests.\n` + `Original error: ${error}`, ); diff --git a/apps/ensapi/src/test/integration/graphql-utils.ts b/apps/ensapi/src/test/integration/graphql-utils.ts index a4467d81e6..50346ba3d7 100644 --- a/apps/ensapi/src/test/integration/graphql-utils.ts +++ b/apps/ensapi/src/test/integration/graphql-utils.ts @@ -2,8 +2,8 @@ import { type DocumentNode, Kind, parse, print } from "graphql"; import type { RequestDocument, Variables } from "graphql-request"; import { expect } from "vitest"; -import { client } from "./ensnode-graphql-api-client"; import { highlightGraphQL, highlightJSON } from "./highlight"; +import { client } from "./omnigraph-api-client"; export type GraphQLConnection = { edges: { node: NODE }[]; diff --git a/apps/ensapi/src/test/integration/omnigraph-api-client.ts b/apps/ensapi/src/test/integration/omnigraph-api-client.ts index 764ef47aac..dd48dfdc6a 100644 --- a/apps/ensapi/src/test/integration/omnigraph-api-client.ts +++ b/apps/ensapi/src/test/integration/omnigraph-api-client.ts @@ -2,9 +2,9 @@ import { GraphQLClient } from "graphql-request"; export { gql } from "graphql-request"; -export const ENSNODE_GRAPHQL_API_URL = new URL( - "/api/graphql", +export const ENSNODE_OMNIGRAPH_API_URL = new URL( + "/api/omnigraph", process.env.ENSNODE_URL || "http://localhost:4334", ).href; -export const client = new GraphQLClient(ENSNODE_GRAPHQL_API_URL); +export const client = new GraphQLClient(ENSNODE_OMNIGRAPH_API_URL); diff --git a/apps/ensindexer/ponder/ponder.config.ts b/apps/ensindexer/ponder/ponder.config.ts index 19d8cccbe9..bdb21adccf 100644 --- a/apps/ensindexer/ponder/ponder.config.ts +++ b/apps/ensindexer/ponder/ponder.config.ts @@ -16,7 +16,7 @@ console.log(prettyPrintJson(redactENSIndexerConfig(config))); // log warning about dual activation of subgraph and ensv2 plugins if (config.plugins.includes(PluginName.Subgraph) && config.plugins.includes(PluginName.ENSv2)) { console.warn( - `Both the '${PluginName.Subgraph}' and '${PluginName.ENSv2}' plugins are enabled. This results in the availability of both the legacy Subgraph-Compatible GraphQL API (/subgraph) _and_ ENSNode's GraphQL API (/api/graphql), and comes with an associated increase in indexing time. If your intent is to have both APIs available in parallel, excellent, otherwise you may benefit from only enabling the plugin for the API you plan to use.`, + `Both the '${PluginName.Subgraph}' and '${PluginName.ENSv2}' plugins are enabled. This results in the availability of both the legacy Subgraph-Compatible GraphQL API (/subgraph) _and_ ENSNode's Omnigraph API (/api/omnigraph), and comes with an associated increase in indexing time. If your intent is to have both APIs available in parallel, excellent, otherwise you may benefit from only enabling the plugin for the API you plan to use.`, ); } diff --git a/packages/ensnode-sdk/src/index.ts b/packages/ensnode-sdk/src/index.ts index 02b67bf557..666ba0cec6 100644 --- a/packages/ensnode-sdk/src/index.ts +++ b/packages/ensnode-sdk/src/index.ts @@ -8,9 +8,9 @@ export * from "./ensapi"; export * from "./ensindexer"; export * from "./ensrainbow"; export * from "./ensv2"; -export * from "./graphql-api/prerequisites"; export * from "./identity"; export * from "./indexing-status"; +export * from "./omnigraph-api/prerequisites"; export * from "./registrars"; export * from "./resolution"; export * from "./shared/account-id"; diff --git a/packages/ensnode-sdk/src/internal.ts b/packages/ensnode-sdk/src/internal.ts index ef3612745e..8029f1db3d 100644 --- a/packages/ensnode-sdk/src/internal.ts +++ b/packages/ensnode-sdk/src/internal.ts @@ -20,7 +20,7 @@ export * from "./ensapi/api/shared/errors/zod-schemas"; export * from "./ensapi/api/shared/pagination/zod-schemas"; export * from "./ensapi/config/zod-schemas"; export * from "./ensindexer/config/zod-schemas"; -export * from "./graphql-api/example-queries"; +export * from "./omnigraph-api/example-queries"; export * from "./registrars/zod-schemas"; export * from "./rpc"; export * from "./shared/config/build-rpc-urls"; diff --git a/packages/ensnode-sdk/src/omnigraph-api/prerequisites.ts b/packages/ensnode-sdk/src/omnigraph-api/prerequisites.ts index 9167ec870b..10f466601e 100644 --- a/packages/ensnode-sdk/src/omnigraph-api/prerequisites.ts +++ b/packages/ensnode-sdk/src/omnigraph-api/prerequisites.ts @@ -2,9 +2,9 @@ import { type EnsIndexerPublicConfig, PluginName } from "../ensindexer/config/ty import type { PrerequisiteResult } from "../shared/prerequisites"; /** - * Check if provided EnsIndexerPublicConfig supports the ENSNode GraphQL API. + * Check if provided EnsIndexerPublicConfig supports the ENSNode Omnigraph API. */ -export function hasGraphqlApiConfigSupport(config: EnsIndexerPublicConfig): PrerequisiteResult { +export function hasOmnigraphApiConfigSupport(config: EnsIndexerPublicConfig): PrerequisiteResult { const supported = config.plugins.includes(PluginName.ENSv2); if (supported) return { supported }; diff --git a/packages/enssdk/src/omnigraph/graphql.ts b/packages/enssdk/src/omnigraph/graphql.ts index 4a621f6a3d..da877d27ed 100644 --- a/packages/enssdk/src/omnigraph/graphql.ts +++ b/packages/enssdk/src/omnigraph/graphql.ts @@ -2,6 +2,7 @@ import { initGraphQLTada } from "gql.tada"; import type { Address, Hex } from "viem"; import type { + ChainId, CoinType, DomainId, InterpretedName, @@ -19,15 +20,15 @@ import type { introspection } from "./generated/graphql-env"; export const graphql = initGraphQLTada<{ introspection: introspection; - // NOTE: keep these type defs in sync with the scalars in apps/ensapi/src/graphql-api/builder.ts scalars: { ID: string; // NOTE: graphql clients don't really do deserialization of scalars like bigint, so instead we // just helpfully type the string as 'a stringified bigint' BigInt: `${bigint}`; + // NOTE: keep these scalar types in sync with the scalars in apps/ensapi/src/omnigraph-api/builder.ts Address: Address; Hex: Hex; - ChainId: number; + ChainId: ChainId; CoinType: CoinType; Name: InterpretedName; Node: Node; From d9637fce221a017cd09fd834e9a435e37085cb19 Mon Sep 17 00:00:00 2001 From: shrugs Date: Tue, 31 Mar 2026 17:43:36 -0500 Subject: [PATCH 6/8] fix: bot notes --- .changeset/dirty-snakes-knock.md | 2 +- .../lib/find-domains/find-domains-resolver-helpers.test.ts | 1 - packages/enssdk/src/omnigraph/graphql.ts | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/dirty-snakes-knock.md b/.changeset/dirty-snakes-knock.md index 5578a667bf..b044efce59 100644 --- a/.changeset/dirty-snakes-knock.md +++ b/.changeset/dirty-snakes-knock.md @@ -2,4 +2,4 @@ "ensapi": minor --- -Omnigraph API (BREAKING): Removed `ENSv2Domain.canonicalId` in favor of accessing `ENSv2Domain.tokenId` directly. +Omnigraph API (BREAKING): Removed `ENSv2Domain.canonicalId`. diff --git a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts index b554dba8e5..7582acbaaf 100644 --- a/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts +++ b/apps/ensapi/src/omnigraph-api/lib/find-domains/find-domains-resolver-helpers.test.ts @@ -1,7 +1,6 @@ import { describe, expect, it, vi } from "vitest"; vi.mock("@/config", () => ({ default: { namespace: "mainnet" } })); -vi.mock("@/omnigraph-api/lib/find-domains/find-domains-by-labelhash-path", () => ({})); import { isEffectiveDesc } from "./find-domains-resolver-helpers"; diff --git a/packages/enssdk/src/omnigraph/graphql.ts b/packages/enssdk/src/omnigraph/graphql.ts index da877d27ed..21634d555e 100644 --- a/packages/enssdk/src/omnigraph/graphql.ts +++ b/packages/enssdk/src/omnigraph/graphql.ts @@ -25,7 +25,8 @@ export const graphql = initGraphQLTada<{ // NOTE: graphql clients don't really do deserialization of scalars like bigint, so instead we // just helpfully type the string as 'a stringified bigint' BigInt: `${bigint}`; - // NOTE: keep these scalar types in sync with the scalars in apps/ensapi/src/omnigraph-api/builder.ts + // NOTE: keep these semantic scalar types in sync with the scalars in apps/ensapi/src/omnigraph-api/builder.ts + // (i.e. excluding the BigInt scalar, which we handle above) Address: Address; Hex: Hex; ChainId: ChainId; From 066cf12d702aaa69d7dce74eddc24c137f62a45f Mon Sep 17 00:00:00 2001 From: shrugs Date: Wed, 1 Apr 2026 11:38:21 -0500 Subject: [PATCH 7/8] docs(changeset): Omnigraph API (BREAKING): API route path changed from `/api/graphql` to `/api/omnigraph`. --- .changeset/moody-ends-drive.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/moody-ends-drive.md diff --git a/.changeset/moody-ends-drive.md b/.changeset/moody-ends-drive.md new file mode 100644 index 0000000000..b19cb16465 --- /dev/null +++ b/.changeset/moody-ends-drive.md @@ -0,0 +1,5 @@ +--- +"ensapi": minor +--- + +Omnigraph API (BREAKING): API route path changed from `/api/graphql` to `/api/omnigraph`. From a0c11622f105df2e13d6a9bdf99b81bbdf181d6e Mon Sep 17 00:00:00 2001 From: shrugs Date: Wed, 1 Apr 2026 11:40:38 -0500 Subject: [PATCH 8/8] fix: small pr notes --- apps/ensapi/src/omnigraph-api/schema/scalars.ts | 2 +- packages/enssdk/package.json | 7 +++++-- pnpm-lock.yaml | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/ensapi/src/omnigraph-api/schema/scalars.ts b/apps/ensapi/src/omnigraph-api/schema/scalars.ts index 2f061a390b..80133ec534 100644 --- a/apps/ensapi/src/omnigraph-api/schema/scalars.ts +++ b/apps/ensapi/src/omnigraph-api/schema/scalars.ts @@ -45,7 +45,7 @@ builder.scalarType("Hex", { z.coerce .string() .check((ctx) => { - if (!isHex(value)) { + if (!isHex(ctx.value)) { ctx.issues.push({ code: "custom", message: "Must be a valid Hex", diff --git a/packages/enssdk/package.json b/packages/enssdk/package.json index 4d69fd781b..acbfcef1de 100644 --- a/packages/enssdk/package.json +++ b/packages/enssdk/package.json @@ -52,13 +52,16 @@ "dependencies": { "@ensdomains/address-encoder": "^1.1.2", "gql.tada": "^1.8.10", - "graphql": "^16.11.0", - "viem": "catalog:" + "graphql": "^16.11.0" + }, + "peerDependencies": { + "viem": "^2" }, "devDependencies": { "@ensnode/shared-configs": "workspace:*", "tsup": "catalog:", "typescript": "catalog:", + "viem": "catalog:", "vitest": "catalog:" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e70bc4cc3a..8fa5a0b225 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -989,9 +989,6 @@ importers: graphql: specifier: ^16.11.0 version: 16.11.0 - viem: - specifier: 'catalog:' - version: 2.38.5(typescript@5.9.3)(zod@4.3.6) devDependencies: '@ensnode/shared-configs': specifier: workspace:* @@ -1002,6 +999,9 @@ importers: typescript: specifier: 'catalog:' version: 5.9.3 + viem: + specifier: 'catalog:' + version: 2.38.5(typescript@5.9.3)(zod@4.3.6) vitest: specifier: 'catalog:' version: 4.0.5(@types/debug@4.1.12)(@types/node@24.10.9)(jiti@2.6.1)(jsdom@27.0.1(postcss@8.5.6))(lightningcss@1.30.2)(tsx@4.21.0)(yaml@2.8.3)