Account Domains
Using the Unigraph SQL requires that you have the unigraph plugin activated in your ENSNode instance. Learn more
Count the Domains owned by an address, grouped by Domain type (ENSv1Domain vs ENSv2Domain) — a single query spanning both protocol versions. See Connect for setup.
SELECT type, count(*) FROM ensindexer_0.domainsWHERE owner_id = '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'GROUP BY type;import { count, eq } from 'drizzle-orm';
const counts = await ensDb.select({ type: ensIndexerSchema.domain.type, count: count() }).from(ensIndexerSchema.domain).where(eq(ensIndexerSchema.domain.ownerId, "0xd8da6bf26964af9d7eed9e03e53415d37aa96045")).groupBy(ensIndexerSchema.domain.type);