@pyratzlabs/react-fhevm-utils 3.2.1 → 3.2.2
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.
|
@@ -5,6 +5,26 @@ interface Props<TAbi extends Abi, TFunction extends ContractFunctionName<TAbi, "
|
|
|
5
5
|
functionName: TFunction;
|
|
6
6
|
}
|
|
7
7
|
export declare const usePerformTransaction: <TAbi extends Abi, TFunction extends ContractFunctionName<TAbi, "nonpayable" | "payable">>({ abi, address, functionName, }: Props<TAbi, TFunction>) => {
|
|
8
|
+
data: {
|
|
9
|
+
blobGasPrice?: bigint | undefined;
|
|
10
|
+
blobGasUsed?: bigint | undefined;
|
|
11
|
+
blockHash: import("viem").Hash;
|
|
12
|
+
blockNumber: bigint;
|
|
13
|
+
contractAddress: Address | null | undefined;
|
|
14
|
+
cumulativeGasUsed: bigint;
|
|
15
|
+
effectiveGasPrice: bigint;
|
|
16
|
+
from: Address;
|
|
17
|
+
gasUsed: bigint;
|
|
18
|
+
logs: import("viem").Log<bigint, number, false>[];
|
|
19
|
+
logsBloom: import("viem").Hex;
|
|
20
|
+
root?: `0x${string}` | undefined;
|
|
21
|
+
status: "success" | "reverted";
|
|
22
|
+
to: Address | null;
|
|
23
|
+
transactionHash: import("viem").Hash;
|
|
24
|
+
transactionIndex: number;
|
|
25
|
+
type: import("viem").TransactionType;
|
|
26
|
+
chainId: number;
|
|
27
|
+
} | undefined;
|
|
8
28
|
error: import("@wagmi/core").WriteContractErrorType | null;
|
|
9
29
|
isSuccess: boolean;
|
|
10
30
|
isLoading: boolean;
|
|
@@ -12,7 +12,7 @@ import { simulateContract } from "@wagmi/core";
|
|
|
12
12
|
export const usePerformTransaction = ({ abi, address, functionName, }) => {
|
|
13
13
|
const config = useConfig();
|
|
14
14
|
const { writeContract, data: writeContractData, isError: isWriteError, error, } = useWriteContract();
|
|
15
|
-
const { isSuccess, isLoading, isError } = useWaitForTransactionReceipt({
|
|
15
|
+
const { data, isSuccess, isLoading, isError } = useWaitForTransactionReceipt({
|
|
16
16
|
hash: writeContractData,
|
|
17
17
|
});
|
|
18
18
|
const perform = (_a) => __awaiter(void 0, [_a], void 0, function* ({ args, value, }) {
|
|
@@ -31,6 +31,7 @@ export const usePerformTransaction = ({ abi, address, functionName, }) => {
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
return {
|
|
34
|
+
data,
|
|
34
35
|
error,
|
|
35
36
|
isSuccess,
|
|
36
37
|
isLoading,
|
|
@@ -3,6 +3,26 @@ interface Props {
|
|
|
3
3
|
encryptedErc20: Address;
|
|
4
4
|
}
|
|
5
5
|
export declare const useUnwrap: ({ encryptedErc20 }: Props) => {
|
|
6
|
+
unwrapData: {
|
|
7
|
+
blobGasPrice?: bigint | undefined;
|
|
8
|
+
blobGasUsed?: bigint | undefined;
|
|
9
|
+
blockHash: import("viem").Hash;
|
|
10
|
+
blockNumber: bigint;
|
|
11
|
+
contractAddress: Address | null | undefined;
|
|
12
|
+
cumulativeGasUsed: bigint;
|
|
13
|
+
effectiveGasPrice: bigint;
|
|
14
|
+
from: Address;
|
|
15
|
+
gasUsed: bigint;
|
|
16
|
+
logs: import("viem").Log<bigint, number, false>[];
|
|
17
|
+
logsBloom: import("viem").Hex;
|
|
18
|
+
root?: `0x${string}` | undefined;
|
|
19
|
+
status: "success" | "reverted";
|
|
20
|
+
to: Address | null;
|
|
21
|
+
transactionHash: import("viem").Hash;
|
|
22
|
+
transactionIndex: number;
|
|
23
|
+
type: import("viem").TransactionType;
|
|
24
|
+
chainId: number;
|
|
25
|
+
} | undefined;
|
|
6
26
|
unwrap: (wrapperAddress: Address, handles: Uint8Array[], inputProof: Uint8Array) => void;
|
|
7
27
|
isFailed: boolean;
|
|
8
28
|
isLoading: boolean;
|
|
@@ -5,7 +5,7 @@ import { toHexString } from "../../utils/string.utils";
|
|
|
5
5
|
import { useAccount } from "wagmi";
|
|
6
6
|
export const useUnwrap = ({ encryptedErc20 }) => {
|
|
7
7
|
const { address } = useAccount();
|
|
8
|
-
const { perform, isFailed, isLoading, isSuccess } = usePerformTransaction({
|
|
8
|
+
const { data, perform, isFailed, isLoading, isSuccess } = usePerformTransaction({
|
|
9
9
|
abi: encryptedABI,
|
|
10
10
|
address: encryptedErc20,
|
|
11
11
|
functionName: "confidentialTransferAndCall",
|
|
@@ -20,5 +20,5 @@ export const useUnwrap = ({ encryptedErc20 }) => {
|
|
|
20
20
|
args: [wrapperAddress, handle, proof, data],
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
return { unwrap, isFailed, isLoading, isSuccess };
|
|
23
|
+
return { unwrapData: data, unwrap, isFailed, isLoading, isSuccess };
|
|
24
24
|
};
|