From 7ec2998c06b5448a3c097f64e252810b93f4388c Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Mon, 9 Dec 2024 16:59:18 +1100 Subject: [PATCH] fix: pass down config from useSimulate and useEstimateGas to internal useConnectorClient calls --- .changeset/proud-knives-behave.md | 5 +++++ packages/react/src/hooks/useEstimateGas.ts | 1 + packages/react/src/hooks/useSimulateContract.ts | 1 + 3 files changed, 7 insertions(+) create mode 100644 .changeset/proud-knives-behave.md diff --git a/.changeset/proud-knives-behave.md b/.changeset/proud-knives-behave.md new file mode 100644 index 0000000000..ff71b3d625 --- /dev/null +++ b/.changeset/proud-knives-behave.md @@ -0,0 +1,5 @@ +--- +"wagmi": patch +--- + +Fixed config parameter passing in useSimulateContract and useEstimateGas diff --git a/packages/react/src/hooks/useEstimateGas.ts b/packages/react/src/hooks/useEstimateGas.ts index ef1070af23..87c0e19e44 100644 --- a/packages/react/src/hooks/useEstimateGas.ts +++ b/packages/react/src/hooks/useEstimateGas.ts @@ -51,6 +51,7 @@ export function useEstimateGas( const config = useConfig(parameters) const { data: connectorClient } = useConnectorClient({ + config, connector, query: { enabled: parameters.account === undefined }, }) diff --git a/packages/react/src/hooks/useSimulateContract.ts b/packages/react/src/hooks/useSimulateContract.ts index 309331872d..e17913fb4f 100644 --- a/packages/react/src/hooks/useSimulateContract.ts +++ b/packages/react/src/hooks/useSimulateContract.ts @@ -92,6 +92,7 @@ export function useSimulateContract< const config = useConfig(parameters) const { data: connectorClient } = useConnectorClient({ + config, connector, query: { enabled: parameters.account === undefined }, })