import { type Account, type Address, type Chain, type GetChainContractAddressErrorType, type LabelhashErrorType, type NamehashErrorType, type WriteContractErrorType, type WriteContractReturnType } from 'viem'; import type { ChainWithContracts, RequireClientContracts } from '../../../../clients/chain.js'; import { AdditionalParameterSpecifiedError, InvalidContractTypeError, UnsupportedNameTypeError } from '../../../../errors/general.js'; import type { ErrorType } from '../../../../errors/utils.js'; import type { Prettify, WriteTransactionParameters } from '../../../../types/index.js'; import { type ClientWithOverridesErrorType } from '../../../../utils/clientWithOverrides.js'; import { type MakeLabelNodeAndParentErrorType } from '../../../../utils/name/makeLabelNodeAndParent.js'; export type TransferNameSupportedContract = 'registry' | 'nameWrapper' | 'registrar'; export type TransferNameWriteParametersParameters = { /** Name to transfer */ name: string; /** Transfer recipient */ newOwnerAddress: Address; /** Contract to use for transfer */ contract: contract; /** Reclaim ownership as registrant (registrar only) */ reclaim?: contract extends 'registrar' ? boolean : never; /** Transfer name as the parent owner */ asParent?: contract extends 'registrar' ? never : boolean; }; export type TransferNameWriteParametersErrorType = AdditionalParameterSpecifiedError | GetChainContractAddressErrorType | MakeLabelNodeAndParentErrorType | NamehashErrorType | LabelhashErrorType | InvalidContractTypeError | UnsupportedNameTypeError | ErrorType; export declare const transferNameWriteParameters: (client: RequireClientContracts, { name, newOwnerAddress, contract, reclaim, asParent, }: TransferNameWriteParametersParameters) => { readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }, { readonly name: "label"; readonly type: "bytes32"; }, { readonly name: "owner"; readonly type: "address"; }]; readonly name: "setSubnodeOwner"; readonly outputs: readonly [{ readonly name: ""; readonly type: "bytes32"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "setSubnodeOwner"; readonly args: readonly [`0x${string}`, `0x${string}`, `0x${string}`]; readonly address: `0x${string}`; readonly chain: Omit & { contracts: { ensBaseRegistrarImplementation: import("viem").ChainContract; ensNameWrapper: import("viem").ChainContract; ensLegacyRegistry: 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 account: account; } | { readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }, { readonly name: "owner"; readonly type: "address"; }]; readonly name: "setOwner"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "setOwner"; readonly args: readonly [`0x${string}`, `0x${string}`]; readonly address: `0x${string}`; readonly chain: Omit & { contracts: { ensBaseRegistrarImplementation: import("viem").ChainContract; ensNameWrapper: import("viem").ChainContract; ensLegacyRegistry: 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 account: account; } | { readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "id"; readonly type: "uint256"; }, { readonly name: "owner"; readonly type: "address"; }]; readonly name: "reclaim"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "reclaim"; readonly args: readonly [bigint, `0x${string}`]; readonly address: `0x${string}`; readonly chain: Omit & { contracts: { ensBaseRegistrarImplementation: import("viem").ChainContract; ensNameWrapper: import("viem").ChainContract; ensLegacyRegistry: 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 account: account; } | { readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "from"; readonly type: "address"; }, { readonly name: "to"; readonly type: "address"; }, { readonly name: "tokenId"; readonly type: "uint256"; }]; readonly name: "safeTransferFrom"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "safeTransferFrom"; readonly args: readonly [`0x${string}`, `0x${string}`, bigint]; readonly address: `0x${string}`; readonly chain: Omit & { contracts: { ensBaseRegistrarImplementation: import("viem").ChainContract; ensNameWrapper: import("viem").ChainContract; ensLegacyRegistry: 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 account: account; } | { readonly abi: readonly [{ readonly inputs: readonly []; readonly name: "CannotUpgrade"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "IncompatibleParent"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "owner"; readonly type: "address"; }]; readonly name: "IncorrectTargetOwner"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "IncorrectTokenType"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "labelHash"; readonly type: "bytes32"; }, { readonly name: "expectedLabelhash"; readonly type: "bytes32"; }]; readonly name: "LabelMismatch"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "label"; readonly type: "string"; }]; readonly name: "LabelTooLong"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "LabelTooShort"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "NameIsNotWrapped"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }]; readonly name: "OperationProhibited"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }, { readonly name: "addr"; readonly type: "address"; }]; readonly name: "Unauthorised"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "parentNode"; readonly type: "bytes32"; }, { readonly name: "label"; readonly type: "string"; }, { readonly name: "owner"; readonly type: "address"; }, { readonly name: "fuses"; readonly type: "uint32"; }, { readonly name: "expiry"; readonly type: "uint64"; }]; readonly name: "setSubnodeOwner"; readonly outputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }]; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "setSubnodeOwner"; readonly args: readonly [`0x${string}`, string, `0x${string}`, 0, bigint]; readonly address: `0x${string}`; readonly chain: Omit & { contracts: { ensBaseRegistrarImplementation: import("viem").ChainContract; ensNameWrapper: import("viem").ChainContract; ensLegacyRegistry: 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 account: account; } | { readonly abi: readonly [{ readonly inputs: readonly []; readonly name: "CannotUpgrade"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "IncompatibleParent"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "owner"; readonly type: "address"; }]; readonly name: "IncorrectTargetOwner"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "IncorrectTokenType"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "labelHash"; readonly type: "bytes32"; }, { readonly name: "expectedLabelhash"; readonly type: "bytes32"; }]; readonly name: "LabelMismatch"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "label"; readonly type: "string"; }]; readonly name: "LabelTooLong"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "LabelTooShort"; readonly type: "error"; }, { readonly inputs: readonly []; readonly name: "NameIsNotWrapped"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }]; readonly name: "OperationProhibited"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }, { readonly name: "addr"; readonly type: "address"; }]; readonly name: "Unauthorised"; readonly type: "error"; }, { readonly inputs: readonly [{ readonly name: "from"; readonly type: "address"; }, { readonly name: "to"; readonly type: "address"; }, { readonly name: "id"; readonly type: "uint256"; }, { readonly name: "amount"; readonly type: "uint256"; }, { readonly name: "data"; readonly type: "bytes"; }]; readonly name: "safeTransferFrom"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "safeTransferFrom"; readonly args: readonly [`0x${string}`, `0x${string}`, bigint, bigint, "0x"]; readonly address: `0x${string}`; readonly chain: Omit & { contracts: { ensBaseRegistrarImplementation: import("viem").ChainContract; ensNameWrapper: import("viem").ChainContract; ensLegacyRegistry: 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 account: account; }; export type TransferNameParameters> = Prettify & WriteTransactionParameters>; export type TransferNameReturnType = WriteContractReturnType; export type TransferNameErrorType = TransferNameWriteParametersErrorType | ClientWithOverridesErrorType | WriteContractErrorType; /** * Transfers a name to a new owner. * @param client - {@link Client} * @param options - {@link TransferNameOptions} * @returns Transaction hash. {@link TransferNameReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * import { addEnsContracts } from '@ensdomains/ensjs' * import { transferName } 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 transferName(wallet, { * name: 'ens.eth', * newOwnerAddress: '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7', * contract: 'registry', * }) * // 0x... */ export declare function transferName>(client: RequireClientContracts, { name, newOwnerAddress, contract, reclaim, asParent, ...txArgs }: TransferNameParameters): Promise; //# sourceMappingURL=transferName.d.ts.map