import type { ChainWithSubgraph } from '../../clients/chain.js'; import type { BaseResolverEvent, ContenthashChanged, DomainEvent, MulticoinAddrChanged, RegistrationEvent, ResolverEvent } from './events.js'; export type GetNameHistoryParameters = { /** Name to get history for */ name: string; /** Only fetch the first n events */ first?: number; /** Order direction */ orderDirection?: 'asc' | 'desc'; }; export type GetNameHistoryReturnType = { /** Array of domain events */ domainEvents: ReturnDomainEvent[]; /** Array of registration events */ registrationEvents: ReturnRegistrationEvent[] | null; /** Array of resolver events */ resolverEvents: ReturnResolverEvent[] | null; } | null; export type GetNameHistoryErrorType = Error; type FlattenedEvent = { [K in keyof TEvent]: TEvent[K] extends { id: string; } ? string | null : TEvent[K]; }; type ReturnDomainEvent = FlattenedEvent; type ReturnRegistrationEvent = FlattenedEvent; export type ReturnResolverEvent = FlattenedEvent | (BaseResolverEvent & { type: 'MulticoinAddrChanged'; coinType: string; coinName: string | null; decoded: boolean; addr: string | null; }) | (BaseResolverEvent & { type: 'ContenthashChanged'; decoded: boolean; contentHash: string | null; protocolType: string | null; })>; /** * Gets the history of a name from the subgraph. * @param client - {@link ClientWithEns} * @param parameters - {@link GetNameHistoryParameters} * @returns History object, or null if name could not be found. {@link GetNameHistoryReturnType} * * @example * import { createPublicClient, http } from 'viem' * import { mainnet } from 'viem/chains' * import { addEnsContracts } from '@ensdomains/ensjs' * import { getNameHistory } from '@ensdomains/ensjs/subgraph' * * const client = createPublicClient({ * chain: addEnsContracts(mainnet), * transport: http(), * }) * const result = await getNameHistory(client, { name: 'ens.eth' }) */ declare const getNameHistory: (client: { chain: ChainWithSubgraph; }, { name, first, orderDirection }: GetNameHistoryParameters) => Promise; export default getNameHistory; //# sourceMappingURL=getNameHistory.d.ts.map