@pyratzlabs/react-fhevm-utils 2.2.0 → 2.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.
|
@@ -2,6 +2,10 @@ import { Address } from "viem";
|
|
|
2
2
|
export interface EncryptValueParams {
|
|
3
3
|
tokenAddress: Address;
|
|
4
4
|
}
|
|
5
|
+
interface EncryptionMutationParams {
|
|
6
|
+
values: bigint[];
|
|
7
|
+
userAddress?: Address;
|
|
8
|
+
}
|
|
5
9
|
export interface EncryptionResult {
|
|
6
10
|
handles: Uint8Array[];
|
|
7
11
|
inputProof: Uint8Array;
|
|
@@ -18,7 +22,7 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
18
22
|
mutate: import("@tanstack/react-query").UseMutateFunction<{
|
|
19
23
|
handles: Uint8Array[];
|
|
20
24
|
inputProof: Uint8Array;
|
|
21
|
-
}, Error,
|
|
25
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
22
26
|
reset: () => void;
|
|
23
27
|
context: unknown;
|
|
24
28
|
failureCount: number;
|
|
@@ -28,10 +32,10 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
28
32
|
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
29
33
|
handles: Uint8Array[];
|
|
30
34
|
inputProof: Uint8Array;
|
|
31
|
-
}, Error,
|
|
35
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
32
36
|
} | {
|
|
33
37
|
data: undefined;
|
|
34
|
-
variables:
|
|
38
|
+
variables: EncryptionMutationParams;
|
|
35
39
|
error: null;
|
|
36
40
|
isError: false;
|
|
37
41
|
isIdle: false;
|
|
@@ -41,7 +45,7 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
41
45
|
mutate: import("@tanstack/react-query").UseMutateFunction<{
|
|
42
46
|
handles: Uint8Array[];
|
|
43
47
|
inputProof: Uint8Array;
|
|
44
|
-
}, Error,
|
|
48
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
45
49
|
reset: () => void;
|
|
46
50
|
context: unknown;
|
|
47
51
|
failureCount: number;
|
|
@@ -51,11 +55,11 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
51
55
|
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
52
56
|
handles: Uint8Array[];
|
|
53
57
|
inputProof: Uint8Array;
|
|
54
|
-
}, Error,
|
|
58
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
55
59
|
} | {
|
|
56
60
|
data: undefined;
|
|
57
61
|
error: Error;
|
|
58
|
-
variables:
|
|
62
|
+
variables: EncryptionMutationParams;
|
|
59
63
|
isError: true;
|
|
60
64
|
isIdle: false;
|
|
61
65
|
isPending: false;
|
|
@@ -64,7 +68,7 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
64
68
|
mutate: import("@tanstack/react-query").UseMutateFunction<{
|
|
65
69
|
handles: Uint8Array[];
|
|
66
70
|
inputProof: Uint8Array;
|
|
67
|
-
}, Error,
|
|
71
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
68
72
|
reset: () => void;
|
|
69
73
|
context: unknown;
|
|
70
74
|
failureCount: number;
|
|
@@ -74,14 +78,14 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
74
78
|
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
75
79
|
handles: Uint8Array[];
|
|
76
80
|
inputProof: Uint8Array;
|
|
77
|
-
}, Error,
|
|
81
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
78
82
|
} | {
|
|
79
83
|
data: {
|
|
80
84
|
handles: Uint8Array[];
|
|
81
85
|
inputProof: Uint8Array;
|
|
82
86
|
};
|
|
83
87
|
error: null;
|
|
84
|
-
variables:
|
|
88
|
+
variables: EncryptionMutationParams;
|
|
85
89
|
isError: false;
|
|
86
90
|
isIdle: false;
|
|
87
91
|
isPending: false;
|
|
@@ -90,7 +94,7 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
90
94
|
mutate: import("@tanstack/react-query").UseMutateFunction<{
|
|
91
95
|
handles: Uint8Array[];
|
|
92
96
|
inputProof: Uint8Array;
|
|
93
|
-
}, Error,
|
|
97
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
94
98
|
reset: () => void;
|
|
95
99
|
context: unknown;
|
|
96
100
|
failureCount: number;
|
|
@@ -100,5 +104,6 @@ export declare const useEncryptValue: ({ tokenAddress }: EncryptValueParams) =>
|
|
|
100
104
|
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
101
105
|
handles: Uint8Array[];
|
|
102
106
|
inputProof: Uint8Array;
|
|
103
|
-
}, Error,
|
|
107
|
+
}, Error, EncryptionMutationParams, unknown>;
|
|
104
108
|
};
|
|
109
|
+
export {};
|
|
@@ -15,7 +15,7 @@ export const useEncryptValue = ({ tokenAddress }) => {
|
|
|
15
15
|
const { instance } = useFhevmContext();
|
|
16
16
|
const { address } = useAccount();
|
|
17
17
|
const encryptMutation = useMutation({
|
|
18
|
-
mutationFn: (
|
|
18
|
+
mutationFn: (_a) => __awaiter(void 0, [_a], void 0, function* ({ values, userAddress }) { return encryptValues(tokenAddress, values, instance, userAddress !== null && userAddress !== void 0 ? userAddress : address); }),
|
|
19
19
|
});
|
|
20
20
|
return Object.assign({}, encryptMutation);
|
|
21
21
|
};
|