@pyratzlabs/react-fhevm-utils 3.6.2 → 3.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,5 +27,6 @@ export declare const useUnwrap: ({ encryptedErc20 }: Props) => {
27
27
  isFailed: boolean;
28
28
  isLoading: boolean;
29
29
  isSuccess: boolean;
30
+ error: import("@wagmi/core").WriteContractErrorType | null;
30
31
  };
31
32
  export {};
@@ -4,7 +4,7 @@ import { useAccount } from "./useAccount";
4
4
  import { WRAPPER_ABI } from "../../types/ABI/Wrapper.abi";
5
5
  export const useUnwrap = ({ encryptedErc20 }) => {
6
6
  const { address } = useAccount();
7
- const { data, perform, isFailed, isLoading, isSuccess } = usePerformTransaction({
7
+ const { data, perform, isFailed, isLoading, isSuccess, error } = usePerformTransaction({
8
8
  abi: WRAPPER_ABI,
9
9
  address: encryptedErc20,
10
10
  functionName: "unwrap",
@@ -12,8 +12,8 @@ export const useUnwrap = ({ encryptedErc20 }) => {
12
12
  const unwrap = (handles, inputProof) => {
13
13
  if (!address)
14
14
  throw new Error("UNWRAP: User is not connected");
15
- const handle = typeof handles[0] === "string"
16
- ? handles[0]
15
+ const handle = typeof handles === "string"
16
+ ? handles
17
17
  : toHexString(handles[0]);
18
18
  const proof = inputProof ? toHexString(inputProof) : undefined;
19
19
  const args = proof
@@ -23,5 +23,5 @@ export const useUnwrap = ({ encryptedErc20 }) => {
23
23
  args,
24
24
  });
25
25
  };
26
- return { unwrapData: data, unwrap, isFailed, isLoading, isSuccess };
26
+ return { unwrapData: data, unwrap, isFailed, isLoading, isSuccess, error };
27
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyratzlabs/react-fhevm-utils",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "React hooks and utilities for Fhevmjs",
5
5
  "main": "dist/index.js",
6
6
  "files": [