import type { Account, Address, Chain, Client, Hash, NamehashErrorType, Transport, WriteContractErrorType } from 'viem'; import type { Prettify, WriteTransactionParameters } from '../../../types/index.js'; import { type ClientWithOverridesErrorType } from '../../../utils/clientWithOverrides.js'; import { type SetContentHashParametersErrorType } from '../../../utils/resolver/setContentHash.js'; export type SetContentHashRecordWriteParametersParameters = { /** Name to set content hash for */ name: string; /** Content hash value */ contentHash: string | null; /** The resolver address to use */ resolverAddress: Address; }; export type SetContentHashRecordWriteParametersErrorType = SetContentHashParametersErrorType | NamehashErrorType; export declare const setContentHashRecordWriteParameters: (client: Client, { name, contentHash, resolverAddress, }: SetContentHashRecordWriteParametersParameters) => { readonly abi: readonly [{ readonly inputs: readonly [{ readonly name: "node"; readonly type: "bytes32"; }, { readonly name: "hash"; readonly type: "bytes"; }]; readonly name: "setContenthash"; readonly outputs: readonly []; readonly stateMutability: "nonpayable"; readonly type: "function"; }]; readonly functionName: "setContenthash"; readonly args: readonly [`0x${string}`, `0x${string}`]; readonly address: `0x${string}`; readonly chain: chain; readonly account: Account; }; export type SetContentHashRecordParameters = Prettify>; export type SetContentHashRecordReturnType = Hash; export type SetContentHashRecordErrorType = SetContentHashRecordWriteParametersErrorType | ClientWithOverridesErrorType | WriteContractErrorType; /** * Sets the content hash record for a name on a resolver. * @param client - {@link Client} * @param options - {@link SetContentHashRecordOptions} * @returns Transaction hash. {@link SetContentHashRecordReturnType} * * @example * import { createWalletClient, custom } from 'viem' * import { mainnet } from 'viem/chains' * import { addEnsContracts } from '@ensdomains/ensjs' * import { setContentHashRecord } from '@ensdomains/ensjs/wallet' * * const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' }) * const wallet = createWalletClient({ * account, * chain: addEnsContracts(mainnet), * transport: custom(window.ethereum), * }) * const hash = await setContentHashRecord(wallet, { * name: 'ens.eth', * contentHash: 'ipns://k51qzi5uqu5djdczd6zw0grmo23j2vkj9uzvujencg15s5rlkq0ss4ivll8wqw', * resolverAddress: '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41', * }) * // 0x... */ export declare function setContentHashRecord(client: Client, { name, contentHash, resolverAddress, ...txArgs }: SetContentHashRecordParameters): Promise; //# sourceMappingURL=setContentHashRecord.d.ts.map