diff --git a/.changeset/dry-roses-cross.md b/.changeset/dry-roses-cross.md new file mode 100644 index 00000000000..d7ce816edf8 --- /dev/null +++ b/.changeset/dry-roses-cross.md @@ -0,0 +1,5 @@ +--- +"thirdweb": minor +--- + +Adds options refetchInterval and retry params to useReadContract diff --git a/packages/thirdweb/src/react/core/hooks/contract/useReadContract.ts b/packages/thirdweb/src/react/core/hooks/contract/useReadContract.ts index 3c6cee6ba9b..4727e6f5356 100644 --- a/packages/thirdweb/src/react/core/hooks/contract/useReadContract.ts +++ b/packages/thirdweb/src/react/core/hooks/contract/useReadContract.ts @@ -18,8 +18,14 @@ import type { import type { PreparedMethod } from "../../../../utils/abi/prepare-method.js"; import { getFunctionId } from "../../../../utils/function-id.js"; import { stringify } from "../../../../utils/json.js"; +import type { Prettify } from "../../../../utils/type-utils.js"; -type PickedQueryOptions = Pick; +type PickedQueryOptions = Prettify< + Pick & { + refetchInterval?: number; + retry?: number; + } +>; /** * A hook to read from a contract.