diff --git a/docs/react.usecontractcall.md b/docs/react.usecontractcall.md
index f09b26b..da8b6db 100644
--- a/docs/react.usecontractcall.md
+++ b/docs/react.usecontractcall.md
@@ -12,7 +12,7 @@ Use this to get a function to make a write call to your contract
Signature:
```typescript
-export declare function useContractCall(contract: RequiredParam["contract"]>, functionName: RequiredParam): import("@tanstack/react-query").UseMutationResult;
+export declare function useContractCall(contract: RequiredParam["contract"]>, functionName: RequiredParam): import("@tanstack/react-query").UseMutationResult;
```
## Parameters
@@ -24,7 +24,7 @@ export declare function useContractCall(contract: RequiredParamReturns:
-import("@tanstack/react-query").UseMutationResult<any, unknown, unknown, unknown>
+import("@tanstack/react-query").UseMutationResult<any, unknown, unknown\[\] \| \[...unknown\[\], CallOverrides\] \| undefined, unknown>
a response object that includes the write function to call
@@ -36,6 +36,6 @@ const { contract } = useContract("{{contract_address}}");
const { mutate: myFunction, isLoading, error } = useContractCall(contract, "myFunction");
// the function can be called as follows:
-// myFunction(...args)
+// myFunction(["param 1", "param 2", ...])
```
diff --git a/docs/snippets.json b/docs/snippets.json
index d8da7ed..782133f 100644
--- a/docs/snippets.json
+++ b/docs/snippets.json
@@ -38,7 +38,7 @@
},
{
"name": "useContractCall",
- "example": "const { contract } = useContract(\"{{contract_address}}\");\nconst { mutate: myFunction, isLoading, error } = useContractCall(contract, \"myFunction\");\n\n// the function can be called as follows:\n// myFunction(...args)",
+ "example": "const { contract } = useContract(\"{{contract_address}}\");\nconst { mutate: myFunction, isLoading, error } = useContractCall(contract, \"myFunction\");\n\n// the function can be called as follows:\n// myFunction([\"param 1\", \"param 2\", ...])",
"reference": "https://portal.thirdweb.com/react/react.usecontractcall"
},
{
diff --git a/etc/react.api.md b/etc/react.api.md
index 334448c..866b81c 100644
--- a/etc/react.api.md
+++ b/etc/react.api.md
@@ -1255,7 +1255,7 @@ export function useContractAbi(contractAddress: RequiredParam):
};
// @beta
-export function useContractCall(contract: RequiredParam["contract"]>, functionName: RequiredParam): UseMutationResult;
+export function useContractCall(contract: RequiredParam["contract"]>, functionName: RequiredParam): UseMutationResult;
// @beta
export function useContractCompilerMetadata(contractAddress: RequiredParam): UseQueryResult< {
diff --git a/package.json b/package.json
index 5c80423..3d69127 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@thirdweb-dev/react",
- "version": "2.6.0",
+ "version": "2.6.1-0",
"repository": {
"type": "git",
"url": "git+https://github.com:thirdweb-dev/react.git"
diff --git a/src/hooks/async/contracts.ts b/src/hooks/async/contracts.ts
index f17414a..c89f6c8 100644
--- a/src/hooks/async/contracts.ts
+++ b/src/hooks/async/contracts.ts
@@ -409,7 +409,7 @@ export function useContractData(
* const { mutate: myFunction, isLoading, error } = useContractCall(contract, "myFunction");
*
* // the function can be called as follows:
- * // myFunction(...args)
+ * // myFunction(["param 1", "param 2", ...])
*```
*
* @param contract - the contract instance of the contract to call a function on
@@ -427,13 +427,13 @@ export function useContractCall(
const queryClient = useQueryClient();
return useMutation(
- async (...args: unknown[] | [...unknown[], CallOverrides]) => {
+ async (callParams?: unknown[] | [...unknown[], CallOverrides]) => {
invariant(contract, "contract must be defined");
invariant(functionName, "function name must be provided");
- if (!args.length) {
+ if (!callParams?.length) {
return contract.call(functionName);
}
- return contract.call(functionName, ...args);
+ return contract.call(functionName, ...callParams);
},
{
onSettled: () =>