@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.
|
@@ -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
|
|
16
|
-
? handles
|
|
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
|
};
|