import { type Address, type Chain, type MulticallErrorType, type NamehashErrorType, type ReadContractErrorType } from 'viem'; import type { RequireClientContracts } from '../../../../clients/chain.js'; import { type GetContractSpecificOwnerParametersErrorType, type OwnerContract } from '../../../../utils/v1/ownerFromContract.js'; export type GetOwnerParameters = { /** Name to get owner for */ name: string; /** Optional specific contract to get ownership value from */ contract?: contract; }; type BaseGetOwnerReturnType = { /** Owner of the name */ owner?: Address | null; /** Registrant of the name (registrar owner) */ registrant?: Address | null; /** The contract level that the ownership is on */ ownershipLevel: 'registry' | 'registrar' | 'nameWrapper'; }; type RegistrarOnlyOwnership = { owner?: never; registrant: Address; ownershipLevel: 'registrar'; }; type WrappedOwnership = { owner: Address; registrant?: never; ownershipLevel: 'nameWrapper'; }; type UnwrappedEth2ldOwnership = { registrant: Address | null; owner: Address; ownershipLevel: 'registrar'; }; type UnwrappedOwnership = { owner: Address; registrant?: never; ownershipLevel: 'registry'; }; export type GetOwnerReturnType = (BaseGetOwnerReturnType & (contract extends 'registrar' ? RegistrarOnlyOwnership : contract extends 'nameWrapper' ? WrappedOwnership : contract extends 'registry' ? UnwrappedOwnership : WrappedOwnership | UnwrappedEth2ldOwnership | UnwrappedOwnership)) | null; export type GetOwnerErrorType = NamehashErrorType | ReadContractErrorType | GetContractSpecificOwnerParametersErrorType | MulticallErrorType; /** * Gets the owner(s) of a name. * @param client - {@link Client} * @param parameters - {@link GetOwnerParameters} * @returns Owner data object, or `null` if no owners exist. {@link GetOwnerReturnType} * * @example * import { createPublicClient, http } from 'viem' * import { mainnet } from 'viem/chains' * import { addEnsContracts } from '@ensdomains/ensjs' * import { getOwner } from '@ensdomains/ensjs/public/v1' * * const client = createPublicClient({ * chain: addEnsContracts(mainnet), * transport: http(), * }) * const result = await getOwner(client, { name: 'ens.eth' }) * // { owner: '0xb6E040C9ECAaE172a89bD561c5F73e1C48d28cd9', registrant: '0xb6E040C9ECAaE172a89bD561c5F73e1C48d28cd9', ownershipLevel: 'registrar } */ export declare function getOwner(client: RequireClientContracts, { name, contract: contract_ }: GetOwnerParameters): Promise>; export {}; //# sourceMappingURL=getOwner.d.ts.map