@pyratzlabs/react-fhevm-utils 2.3.2 → 2.3.3
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.
|
@@ -3,7 +3,7 @@ interface Props {
|
|
|
3
3
|
encryptedErc20: Address;
|
|
4
4
|
}
|
|
5
5
|
export declare const useUnwrap: ({ encryptedErc20 }: Props) => {
|
|
6
|
-
unwrap: (wrapperAddress: Address, handles: Uint8Array[], inputProof: Uint8Array
|
|
6
|
+
unwrap: (wrapperAddress: Address, handles: Uint8Array[], inputProof: Uint8Array) => void;
|
|
7
7
|
isFailed: boolean;
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
isSuccess: boolean;
|
|
@@ -10,17 +10,14 @@ export const useUnwrap = ({ encryptedErc20 }) => {
|
|
|
10
10
|
address: encryptedErc20,
|
|
11
11
|
functionName: "confidentialTransferAndCall",
|
|
12
12
|
});
|
|
13
|
-
const unwrap = (wrapperAddress, handles, inputProof
|
|
13
|
+
const unwrap = (wrapperAddress, handles, inputProof) => {
|
|
14
14
|
if (!address)
|
|
15
15
|
throw new Error("UNWRAP: User is not connected");
|
|
16
|
-
if (!unwrapFee)
|
|
17
|
-
throw new Error("UNWRAP: Wrap fee is required");
|
|
18
16
|
const handle = toHexString(handles[0]);
|
|
19
17
|
const proof = toHexString(inputProof);
|
|
20
18
|
const data = encodeAbiParameters([{ type: "address" }, { type: "bytes" }], [address, "0x"]);
|
|
21
19
|
perform({
|
|
22
20
|
args: [wrapperAddress, handle, proof, data],
|
|
23
|
-
value: unwrapFee,
|
|
24
21
|
});
|
|
25
22
|
};
|
|
26
23
|
return { unwrap, isFailed, isLoading, isSuccess };
|