import type { Account, Address, Chain, GetChainContractAddressErrorType, Hash, WriteContractErrorType } from 'viem'; import type { ChainWithContracts, RequireClientContracts } from '../../../../clients/chain.js'; import type { Prettify, WriteTransactionParameters } from '../../../../types/index.js'; type BaseSetPrimaryNameDataParameters = { /** The name to set as primary */ name: string; /** The address to set the primary name for */ address?: Address; /** The resolver address to use */ resolverAddress?: Address; }; type SelfSetPrimaryNameDataParameters = { address?: never; resolverAddress?: never; }; type OtherSetPrimaryNameDataParameters = { address: Address; resolverAddress?: Address; }; export type SetPrimaryNameWriteParametersParameters = BaseSetPrimaryNameDataParameters & (SelfSetPrimaryNameDataParameters | OtherSetPrimaryNameDataParameters); export type SetPrimaryNameWriteParametersReturnType = ReturnType; export type SetPrimaryNameWriteParametersErrorType = GetChainContractAddressErrorType; export declare const setPrimaryNameWriteParameters: (client: RequireClientContracts, { name, address, resolverAddress, }: SetPrimaryNameWriteParametersParameters) => { readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "addr"; readonly type: "address"; }, { readonly name: "owner"; readonly type: "address"; }, { readonly name: "resolver"; readonly type: "address"; }, { readonly name: "name"; readonly type: "string"; }]; readonly name: "setNameForAddr"; readonly outputs: readonly [{ readonly name: ""; readonly type: "bytes32"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "setNameForAddr"; readonly args: readonly [`0x${string}`, `0x${string}`, `0x${string}`, string]; readonly address: `0x${string}`; readonly account: account; readonly chain: Omit & { contracts: { ensPublicResolver: import("viem").ChainContract; ensReverseRegistrar: import("viem").ChainContract; }; } & { blockExplorers?: { [key: string]: { name: string; url: string; apiUrl?: string | undefined; }; default: { name: string; url: string; apiUrl?: string | undefined; }; } | undefined; blockTime?: number | undefined; contracts?: import("viem").Prettify<{ [key: string]: import("viem").ChainContract | { [sourceId: number]: import("viem").ChainContract | undefined; } | undefined; } & { ensRegistry?: import("viem").ChainContract | undefined; ensUniversalResolver?: import("viem").ChainContract | undefined; multicall3?: import("viem").ChainContract | undefined; erc6492Verifier?: import("viem").ChainContract | undefined; }> | undefined; ensTlds?: readonly string[] | undefined; id: number; name: string; nativeCurrency: { name: string; symbol: string; decimals: number; }; experimental_preconfirmationTime?: number | undefined; rpcUrls: { [key: string]: { http: readonly string[]; webSocket?: readonly string[] | undefined; }; default: { http: readonly string[]; webSocket?: readonly string[] | undefined; }; }; sourceId?: number | undefined; supportsTransactionReplacementDetection?: boolean | undefined; testnet?: boolean | undefined; } & import("viem").ChainConfig | undefined>; } | { readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "name"; readonly type: "string"; }]; readonly name: "setName"; readonly outputs: readonly [{ readonly name: ""; readonly type: "bytes32"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "setName"; readonly args: readonly [string]; readonly address: `0x${string}`; readonly account: account; readonly chain: Omit & { contracts: { ensPublicResolver: import("viem").ChainContract; ensReverseRegistrar: import("viem").ChainContract; }; } & { blockExplorers?: { [key: string]: { name: string; url: string; apiUrl?: string | undefined; }; default: { name: string; url: string; apiUrl?: string | undefined; }; } | undefined; blockTime?: number | undefined; contracts?: import("viem").Prettify<{ [key: string]: import("viem").ChainContract | { [sourceId: number]: import("viem").ChainContract | undefined; } | undefined; } & { ensRegistry?: import("viem").ChainContract | undefined; ensUniversalResolver?: import("viem").ChainContract | undefined; multicall3?: import("viem").ChainContract | undefined; erc6492Verifier?: import("viem").ChainContract | undefined; }> | undefined; ensTlds?: readonly string[] | undefined; id: number; name: string; nativeCurrency: { name: string; symbol: string; decimals: number; }; experimental_preconfirmationTime?: number | undefined; rpcUrls: { [key: string]: { http: readonly string[]; webSocket?: readonly string[] | undefined; }; default: { http: readonly string[]; webSocket?: readonly string[] | undefined; }; }; sourceId?: number | undefined; supportsTransactionReplacementDetection?: boolean | undefined; testnet?: boolean | undefined; } & import("viem").ChainConfig | undefined>; }; export type SetPrimaryNameParameters> = Prettify>; export type SetPrimaryNameReturnType = Hash; export type SetPrimaryNameErrorType = SetPrimaryNameWriteParametersErrorType | WriteContractErrorType; /** * Sets a primary name for an address. * @param client - {@link Client} * @param options - {@link SetPrimaryNameOptions} * @returns Transaction hash. {@link SetPrimaryNameReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * import { addEnsContracts } from '@ensdomains/ensjs' * import { setPrimaryName } from '@ensdomains/ensjs/wallet/v1' * * const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' }) * const wallet = createWalletClient({ * account, * chain: addEnsContracts(mainnet), * transport: custom(window.ethereum), * }) * const hash = await setPrimaryName(wallet, { * name: 'ens.eth', * }) * // 0x... */ export declare function setPrimaryName>(client: RequireClientContracts, { name, address, resolverAddress, ...txArgs }: SetPrimaryNameParameters): Promise; export {}; //# sourceMappingURL=setPrimaryName.d.ts.map