diff --git a/packages/svelte/src/lib/runes/scaffoldReadContract.svelte.ts b/packages/svelte/src/lib/runes/scaffoldReadContract.svelte.ts index 3df3752..79520c7 100644 --- a/packages/svelte/src/lib/runes/scaffoldReadContract.svelte.ts +++ b/packages/svelte/src/lib/runes/scaffoldReadContract.svelte.ts @@ -32,22 +32,25 @@ export const createScaffoldReadContract = < const targetNetwork = $derived.by(createTargetNetwork()); const result = $derived.by( - createReadContract({ - chainId: targetNetwork.id, - functionName, - address: deployedContract?.address, - abi: deployedContract?.abi, - watch: true, - args: args, - value: value, - enabled: !Array.isArray(args) || !args.some(arg => arg === undefined), - ...(readConfig as any), - }) as () => Omit, "data" | "refetch"> & { - data: AbiFunctionReturnType | undefined; - refetch: ( - options?: RefetchOptions | undefined, - ) => Promise, ReadContractErrorType>>; - }, + createReadContract( + () => + ({ + chainId: targetNetwork.id, + functionName, + address: deployedContract?.address, + abi: deployedContract?.abi, + watch: true, + args: args, + value: value, + enabled: !Array.isArray(args) || !args.some(arg => arg === undefined), + ...(readConfig as any), + }) as () => Omit, "data" | "refetch"> & { + data: AbiFunctionReturnType | undefined; + refetch: ( + options?: RefetchOptions | undefined, + ) => Promise, ReadContractErrorType>>; + }, + ), ); return () => result;