Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dry-roses-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": minor
---

Adds options refetchInterval and retry params to useReadContract
Original file line number Diff line number Diff line change
Expand Up @@ -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<UseQueryOptions, "enabled">;
type PickedQueryOptions = Prettify<
Pick<UseQueryOptions, "enabled"> & {
refetchInterval?: number;
retry?: number;
}
Comment on lines +24 to +27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make more sense to just ad these to the Pick ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially tried that but react query had some janky types that were causing issues

>;

/**
* A hook to read from a contract.
Expand Down