@zama-fhe/react-sdk 1.0.0-alpha.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.
@@ -0,0 +1,142 @@
1
+ import * as _tanstack_react_query from '@tanstack/react-query';
2
+ import { Address, BatchTransferData } from '@zama-fhe/sdk';
3
+ import { PublicClient, WalletClient } from 'viem';
4
+ export { ViemSigner } from '@zama-fhe/sdk/viem';
5
+ export { q as useActivityFeed, s as useApproveUnderlying, v as useAuthorizeAll, w as useConfidentialApprove, x as useConfidentialBalance, y as useConfidentialBalances, z as useConfidentialTransferFrom, B as useResumeUnshield, E as useTokenMetadata, G as useUnshield, H as useUnshieldAll, I as useUnwrapAll } from '../use-approve-underlying-DAkxWhfm.js';
6
+
7
+ interface UseConfidentialBalanceOfConfig {
8
+ client: PublicClient;
9
+ tokenAddress: Address | undefined;
10
+ userAddress: Address | undefined;
11
+ }
12
+ interface UseConfidentialBalanceOfSuspenseConfig {
13
+ client: PublicClient;
14
+ tokenAddress: Address;
15
+ userAddress: Address;
16
+ }
17
+ declare function useConfidentialBalanceOf(config: UseConfidentialBalanceOfConfig): _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
18
+ declare function useConfidentialBalanceOfSuspense(config: UseConfidentialBalanceOfSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<`0x${string}`, Error>;
19
+
20
+ interface ConfidentialTransferParams {
21
+ client: WalletClient;
22
+ tokenAddress: Address;
23
+ to: Address;
24
+ handle: Uint8Array;
25
+ inputProof: Uint8Array;
26
+ }
27
+ declare function useConfidentialTransfer(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, ConfidentialTransferParams, unknown>;
28
+
29
+ interface ConfidentialBatchTransferParams {
30
+ client: WalletClient;
31
+ batcherAddress: Address;
32
+ tokenAddress: Address;
33
+ fromAddress: Address;
34
+ batchTransferData: BatchTransferData[];
35
+ fees: bigint;
36
+ }
37
+ declare function useConfidentialBatchTransfer(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, ConfidentialBatchTransferParams, unknown>;
38
+
39
+ interface UnwrapParams {
40
+ client: WalletClient;
41
+ encryptedErc20: Address;
42
+ from: Address;
43
+ to: Address;
44
+ encryptedAmount: Uint8Array;
45
+ inputProof: Uint8Array;
46
+ }
47
+ declare function useUnwrap(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, UnwrapParams, unknown>;
48
+
49
+ interface UnwrapFromBalanceParams {
50
+ client: WalletClient;
51
+ encryptedErc20: Address;
52
+ from: Address;
53
+ to: Address;
54
+ encryptedBalance: Address;
55
+ }
56
+ declare function useUnwrapFromBalance(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, UnwrapFromBalanceParams, unknown>;
57
+
58
+ interface FinalizeUnwrapParams {
59
+ client: WalletClient;
60
+ wrapper: Address;
61
+ burntAmount: Address;
62
+ burntAmountCleartext: bigint;
63
+ decryptionProof: Address;
64
+ }
65
+ declare function useFinalizeUnwrap(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, FinalizeUnwrapParams, unknown>;
66
+
67
+ interface SetOperatorParams {
68
+ client: WalletClient;
69
+ tokenAddress: Address;
70
+ spender: Address;
71
+ timestamp?: number;
72
+ }
73
+ declare function useSetOperator(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, SetOperatorParams, unknown>;
74
+
75
+ interface UseWrapperForZamaConfig {
76
+ client: PublicClient;
77
+ coordinator: Address | undefined;
78
+ tokenAddress: Address | undefined;
79
+ }
80
+ interface UseWrapperForTokenSuspenseConfig {
81
+ client: PublicClient;
82
+ coordinator: Address;
83
+ tokenAddress: Address;
84
+ }
85
+ declare function useWrapperForToken(config: UseWrapperForZamaConfig): _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
86
+ declare function useWrapperForTokenSuspense(config: UseWrapperForTokenSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<`0x${string}`, Error>;
87
+
88
+ interface UseUnderlyingZamaConfig {
89
+ client: PublicClient;
90
+ wrapperAddress: Address | undefined;
91
+ }
92
+ interface UseUnderlyingTokenSuspenseConfig {
93
+ client: PublicClient;
94
+ wrapperAddress: Address;
95
+ }
96
+ declare function useUnderlyingToken(config: UseUnderlyingZamaConfig): _tanstack_react_query.UseQueryResult<`0x${string}`, Error>;
97
+ declare function useUnderlyingTokenSuspense(config: UseUnderlyingTokenSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<`0x${string}`, Error>;
98
+
99
+ interface ShieldParams {
100
+ client: WalletClient;
101
+ wrapperAddress: Address;
102
+ to: Address;
103
+ amount: bigint;
104
+ }
105
+ declare function useShield(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, ShieldParams, unknown>;
106
+
107
+ interface ShieldETHParams {
108
+ client: WalletClient;
109
+ wrapperAddress: Address;
110
+ to: Address;
111
+ amount: bigint;
112
+ value: bigint;
113
+ }
114
+ declare function useShieldETH(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, ShieldETHParams, unknown>;
115
+
116
+ interface UseWrapperExistsConfig {
117
+ client: PublicClient;
118
+ coordinator: Address | undefined;
119
+ tokenAddress: Address | undefined;
120
+ }
121
+ interface UseWrapperExistsSuspenseConfig {
122
+ client: PublicClient;
123
+ coordinator: Address;
124
+ tokenAddress: Address;
125
+ }
126
+ declare function useWrapperExists(config: UseWrapperExistsConfig): _tanstack_react_query.UseQueryResult<boolean, Error>;
127
+ declare function useWrapperExistsSuspense(config: UseWrapperExistsSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<boolean, Error>;
128
+
129
+ interface UseSupportsInterfaceConfig {
130
+ client: PublicClient;
131
+ tokenAddress: Address | undefined;
132
+ interfaceId: Address | undefined;
133
+ }
134
+ interface UseSupportsInterfaceSuspenseConfig {
135
+ client: PublicClient;
136
+ tokenAddress: Address;
137
+ interfaceId: Address;
138
+ }
139
+ declare function useSupportsInterface(config: UseSupportsInterfaceConfig): _tanstack_react_query.UseQueryResult<boolean, Error>;
140
+ declare function useSupportsInterfaceSuspense(config: UseSupportsInterfaceSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<boolean, Error>;
141
+
142
+ export { type ConfidentialBatchTransferParams, type ConfidentialTransferParams, type FinalizeUnwrapParams, type SetOperatorParams, type ShieldETHParams, type ShieldParams, type UnwrapFromBalanceParams, type UnwrapParams, type UseConfidentialBalanceOfConfig, type UseConfidentialBalanceOfSuspenseConfig, type UseSupportsInterfaceConfig, type UseSupportsInterfaceSuspenseConfig, type UseUnderlyingTokenSuspenseConfig, type UseUnderlyingZamaConfig, type UseWrapperExistsConfig, type UseWrapperExistsSuspenseConfig, type UseWrapperForTokenSuspenseConfig, type UseWrapperForZamaConfig, useConfidentialBalanceOf, useConfidentialBalanceOfSuspense, useConfidentialBatchTransfer, useConfidentialTransfer, useFinalizeUnwrap, useSetOperator, useShield, useShieldETH, useSupportsInterface, useSupportsInterfaceSuspense, useUnderlyingToken, useUnderlyingTokenSuspense, useUnwrap, useUnwrapFromBalance, useWrapperExists, useWrapperExistsSuspense, useWrapperForToken, useWrapperForTokenSuspense };
@@ -0,0 +1,173 @@
1
+ "use client";
2
+ export { useActivityFeed, useApproveUnderlying, useAuthorizeAll, useConfidentialApprove, useConfidentialBalance, useConfidentialBalances, useConfidentialTransferFrom, useResumeUnshield, useTokenMetadata, useUnshield, useUnshieldAll, useUnwrapAll } from '../chunk-463DUSLG.js';
3
+ import { useQuery, useSuspenseQuery, useMutation } from '@tanstack/react-query';
4
+ import { readConfidentialBalanceOfContract, writeConfidentialTransferContract, writeConfidentialBatchTransferContract, writeUnwrapContract, writeUnwrapFromBalanceContract, writeFinalizeUnwrapContract, writeSetOperatorContract, readWrapperForTokenContract, readUnderlyingTokenContract, writeWrapContract, writeWrapETHContract, readWrapperExistsContract, readSupportsInterfaceContract } from '@zama-fhe/sdk/viem';
5
+ export { ViemSigner } from '@zama-fhe/sdk/viem';
6
+
7
+ function useConfidentialBalanceOf(config) {
8
+ const { client, tokenAddress, userAddress } = config;
9
+ const enabled = !!tokenAddress && !!userAddress;
10
+ return useQuery({
11
+ queryKey: ["confidentialBalanceOf", client, tokenAddress, userAddress],
12
+ queryFn: () => readConfidentialBalanceOfContract(client, tokenAddress, userAddress),
13
+ enabled
14
+ });
15
+ }
16
+ function useConfidentialBalanceOfSuspense(config) {
17
+ const { client, tokenAddress, userAddress } = config;
18
+ return useSuspenseQuery({
19
+ queryKey: ["confidentialBalanceOf", client, tokenAddress, userAddress],
20
+ queryFn: () => readConfidentialBalanceOfContract(client, tokenAddress, userAddress)
21
+ });
22
+ }
23
+ function useConfidentialTransfer() {
24
+ return useMutation({
25
+ mutationFn: (params) => writeConfidentialTransferContract(
26
+ params.client,
27
+ params.tokenAddress,
28
+ params.to,
29
+ params.handle,
30
+ params.inputProof
31
+ )
32
+ });
33
+ }
34
+ function useConfidentialBatchTransfer() {
35
+ return useMutation({
36
+ mutationFn: (params) => writeConfidentialBatchTransferContract(
37
+ params.client,
38
+ params.batcherAddress,
39
+ params.tokenAddress,
40
+ params.fromAddress,
41
+ params.batchTransferData,
42
+ params.fees
43
+ )
44
+ });
45
+ }
46
+ function useUnwrap() {
47
+ return useMutation({
48
+ mutationFn: (params) => writeUnwrapContract(
49
+ params.client,
50
+ params.encryptedErc20,
51
+ params.from,
52
+ params.to,
53
+ params.encryptedAmount,
54
+ params.inputProof
55
+ )
56
+ });
57
+ }
58
+ function useUnwrapFromBalance() {
59
+ return useMutation({
60
+ mutationFn: (params) => writeUnwrapFromBalanceContract(
61
+ params.client,
62
+ params.encryptedErc20,
63
+ params.from,
64
+ params.to,
65
+ params.encryptedBalance
66
+ )
67
+ });
68
+ }
69
+ function useFinalizeUnwrap() {
70
+ return useMutation({
71
+ mutationFn: (params) => writeFinalizeUnwrapContract(
72
+ params.client,
73
+ params.wrapper,
74
+ params.burntAmount,
75
+ params.burntAmountCleartext,
76
+ params.decryptionProof
77
+ )
78
+ });
79
+ }
80
+ function useSetOperator() {
81
+ return useMutation({
82
+ mutationFn: (params) => writeSetOperatorContract(
83
+ params.client,
84
+ params.tokenAddress,
85
+ params.spender,
86
+ params.timestamp
87
+ )
88
+ });
89
+ }
90
+ function useWrapperForToken(config) {
91
+ const { client, coordinator, tokenAddress } = config;
92
+ const enabled = !!coordinator && !!tokenAddress;
93
+ return useQuery({
94
+ queryKey: ["wrapperForToken", client, coordinator, tokenAddress],
95
+ queryFn: () => readWrapperForTokenContract(client, coordinator, tokenAddress),
96
+ enabled
97
+ });
98
+ }
99
+ function useWrapperForTokenSuspense(config) {
100
+ const { client, coordinator, tokenAddress } = config;
101
+ return useSuspenseQuery({
102
+ queryKey: ["wrapperForToken", client, coordinator, tokenAddress],
103
+ queryFn: () => readWrapperForTokenContract(client, coordinator, tokenAddress)
104
+ });
105
+ }
106
+ function useUnderlyingToken(config) {
107
+ const { client, wrapperAddress } = config;
108
+ const enabled = !!wrapperAddress;
109
+ return useQuery({
110
+ queryKey: ["underlyingToken", client, wrapperAddress],
111
+ queryFn: () => readUnderlyingTokenContract(client, wrapperAddress),
112
+ enabled
113
+ });
114
+ }
115
+ function useUnderlyingTokenSuspense(config) {
116
+ const { client, wrapperAddress } = config;
117
+ return useSuspenseQuery({
118
+ queryKey: ["underlyingToken", client, wrapperAddress],
119
+ queryFn: () => readUnderlyingTokenContract(client, wrapperAddress)
120
+ });
121
+ }
122
+ function useShield() {
123
+ return useMutation({
124
+ mutationFn: (params) => writeWrapContract(params.client, params.wrapperAddress, params.to, params.amount)
125
+ });
126
+ }
127
+ function useShieldETH() {
128
+ return useMutation({
129
+ mutationFn: (params) => writeWrapETHContract(
130
+ params.client,
131
+ params.wrapperAddress,
132
+ params.to,
133
+ params.amount,
134
+ params.value
135
+ )
136
+ });
137
+ }
138
+ function useWrapperExists(config) {
139
+ const { client, coordinator, tokenAddress } = config;
140
+ const enabled = !!coordinator && !!tokenAddress;
141
+ return useQuery({
142
+ queryKey: ["wrapperExists", client, coordinator, tokenAddress],
143
+ queryFn: () => readWrapperExistsContract(client, coordinator, tokenAddress),
144
+ enabled
145
+ });
146
+ }
147
+ function useWrapperExistsSuspense(config) {
148
+ const { client, coordinator, tokenAddress } = config;
149
+ return useSuspenseQuery({
150
+ queryKey: ["wrapperExists", client, coordinator, tokenAddress],
151
+ queryFn: () => readWrapperExistsContract(client, coordinator, tokenAddress)
152
+ });
153
+ }
154
+ function useSupportsInterface(config) {
155
+ const { client, tokenAddress, interfaceId } = config;
156
+ const enabled = !!tokenAddress && !!interfaceId;
157
+ return useQuery({
158
+ queryKey: ["supportsInterface", client, tokenAddress, interfaceId],
159
+ queryFn: () => readSupportsInterfaceContract(client, tokenAddress, interfaceId),
160
+ enabled
161
+ });
162
+ }
163
+ function useSupportsInterfaceSuspense(config) {
164
+ const { client, tokenAddress, interfaceId } = config;
165
+ return useSuspenseQuery({
166
+ queryKey: ["supportsInterface", client, tokenAddress, interfaceId],
167
+ queryFn: () => readSupportsInterfaceContract(client, tokenAddress, interfaceId)
168
+ });
169
+ }
170
+
171
+ export { useConfidentialBalanceOf, useConfidentialBalanceOfSuspense, useConfidentialBatchTransfer, useConfidentialTransfer, useFinalizeUnwrap, useSetOperator, useShield, useShieldETH, useSupportsInterface, useSupportsInterfaceSuspense, useUnderlyingToken, useUnderlyingTokenSuspense, useUnwrap, useUnwrapFromBalance, useWrapperExists, useWrapperExistsSuspense, useWrapperForToken, useWrapperForTokenSuspense };
172
+ //# sourceMappingURL=index.js.map
173
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/viem/use-confidential-balance-of.ts","../../src/viem/use-confidential-transfer.ts","../../src/viem/use-confidential-batch-transfer.ts","../../src/viem/use-unwrap.ts","../../src/viem/use-unwrap-from-balance.ts","../../src/viem/use-finalize-unwrap.ts","../../src/viem/use-set-operator.ts","../../src/viem/use-wrapper-for-token.ts","../../src/viem/use-underlying-token.ts","../../src/viem/use-wrap.ts","../../src/viem/use-wrap-eth.ts","../../src/viem/use-wrapper-exists.ts","../../src/viem/use-supports-interface.ts"],"names":["useMutation","useQu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,aAAa,YAAY;AAAA,GAC3E,CAAA;AACH;ACjBO,SAAS,qBAAqB,MAAA,EAAoC;AACvE,EAAA,MAAM,EAAE,MAAA,EAAQ,YAAA,EAAc,WAAA,EAAY,GAAI,MAAA;AAC9C,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,YAAA,IAAgB,CAAC,CAAC,WAAA;AACpC,EAAA,OAAOD,QAAAA,CAAS;AAAA,IACd,QAAA,EAAU,CAAC,mBAAA,EAAqB,MAAA,EAAQ,cAAc,WAAW,CAAA;AAAA,IACjE,OAAA,EAAS,MACP,6BAAA,CAA8B,MAAA,EAAQ,cAAyB,WAAsB,CAAA;AAAA,IACvF;AAAA,GACD,CAAA;AACH;AAEO,SAAS,6BAA6B,MAAA,EAA4C;AACvF,EAAA,MAAM,EAAE,MAAA,EAAQ,YAAA,EAAc,WAAA,EAAY,GAAI,MAAA;AAC9C,EAAA,OAAOC,gBAAAA,CAAiB;AAAA,IACtB,QAAA,EAAU,CAAC,mBAAA,EAAqB,MAAA,EAAQ,cAAc,WAAW,CAAA;AAAA,IACjE,OAAA,EAAS,MAAM,6BAAA,CAA8B,MAAA,EAAQ,cAAc,WAAW;AAAA,GAC/E,CAAA;AACH","file":"index.js","sourcesContent":["\"use client\";\n\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { PublicClient } from \"viem\";\nimport { readConfidentialBalanceOfContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface UseConfidentialBalanceOfConfig {\n client: PublicClient;\n tokenAddress: Address | undefined;\n userAddress: Address | undefined;\n}\n\nexport interface UseConfidentialBalanceOfSuspenseConfig {\n client: PublicClient;\n tokenAddress: Address;\n userAddress: Address;\n}\n\nexport function useConfidentialBalanceOf(config: UseConfidentialBalanceOfConfig) {\n const { client, tokenAddress, userAddress } = config;\n const enabled = !!tokenAddress && !!userAddress;\n return useQuery({\n queryKey: [\"confidentialBalanceOf\", client, tokenAddress, userAddress],\n queryFn: () =>\n readConfidentialBalanceOfContract(client, tokenAddress as Address, userAddress as Address),\n enabled,\n });\n}\n\nexport function useConfidentialBalanceOfSuspense(config: UseConfidentialBalanceOfSuspenseConfig) {\n const { client, tokenAddress, userAddress } = config;\n return useSuspenseQuery({\n queryKey: [\"confidentialBalanceOf\", client, tokenAddress, userAddress],\n queryFn: () =>\n readConfidentialBalanceOfContract(client, tokenAddress as Address, userAddress as Address),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeConfidentialTransferContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface ConfidentialTransferParams {\n client: WalletClient;\n tokenAddress: Address;\n to: Address;\n handle: Uint8Array;\n inputProof: Uint8Array;\n}\nexport function useConfidentialTransfer() {\n return useMutation<\n Awaited<ReturnType<typeof writeConfidentialTransferContract>>,\n Error,\n ConfidentialTransferParams\n >({\n mutationFn: (params) =>\n writeConfidentialTransferContract(\n params.client,\n params.tokenAddress,\n params.to,\n params.handle,\n params.inputProof,\n ),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address, BatchTransferData } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeConfidentialBatchTransferContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface ConfidentialBatchTransferParams {\n client: WalletClient;\n batcherAddress: Address;\n tokenAddress: Address;\n fromAddress: Address;\n batchTransferData: BatchTransferData[];\n fees: bigint;\n}\nexport function useConfidentialBatchTransfer() {\n return useMutation<\n Awaited<ReturnType<typeof writeConfidentialBatchTransferContract>>,\n Error,\n ConfidentialBatchTransferParams\n >({\n mutationFn: (params) =>\n writeConfidentialBatchTransferContract(\n params.client,\n params.batcherAddress,\n params.tokenAddress,\n params.fromAddress,\n params.batchTransferData,\n params.fees,\n ),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeUnwrapContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface UnwrapParams {\n client: WalletClient;\n encryptedErc20: Address;\n from: Address;\n to: Address;\n encryptedAmount: Uint8Array;\n inputProof: Uint8Array;\n}\nexport function useUnwrap() {\n return useMutation<Awaited<ReturnType<typeof writeUnwrapContract>>, Error, UnwrapParams>({\n mutationFn: (params) =>\n writeUnwrapContract(\n params.client,\n params.encryptedErc20,\n params.from,\n params.to,\n params.encryptedAmount,\n params.inputProof,\n ),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeUnwrapFromBalanceContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface UnwrapFromBalanceParams {\n client: WalletClient;\n encryptedErc20: Address;\n from: Address;\n to: Address;\n encryptedBalance: Address;\n}\nexport function useUnwrapFromBalance() {\n return useMutation<\n Awaited<ReturnType<typeof writeUnwrapFromBalanceContract>>,\n Error,\n UnwrapFromBalanceParams\n >({\n mutationFn: (params) =>\n writeUnwrapFromBalanceContract(\n params.client,\n params.encryptedErc20,\n params.from,\n params.to,\n params.encryptedBalance,\n ),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeFinalizeUnwrapContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface FinalizeUnwrapParams {\n client: WalletClient;\n wrapper: Address;\n burntAmount: Address;\n burntAmountCleartext: bigint;\n decryptionProof: Address;\n}\nexport function useFinalizeUnwrap() {\n return useMutation<\n Awaited<ReturnType<typeof writeFinalizeUnwrapContract>>,\n Error,\n FinalizeUnwrapParams\n >({\n mutationFn: (params) =>\n writeFinalizeUnwrapContract(\n params.client,\n params.wrapper,\n params.burntAmount,\n params.burntAmountCleartext,\n params.decryptionProof,\n ),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeSetOperatorContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface SetOperatorParams {\n client: WalletClient;\n tokenAddress: Address;\n spender: Address;\n timestamp?: number;\n}\nexport function useSetOperator() {\n return useMutation<\n Awaited<ReturnType<typeof writeSetOperatorContract>>,\n Error,\n SetOperatorParams\n >({\n mutationFn: (params) =>\n writeSetOperatorContract(\n params.client,\n params.tokenAddress,\n params.spender,\n params.timestamp,\n ),\n });\n}\n","\"use client\";\n\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { PublicClient } from \"viem\";\nimport { readWrapperForTokenContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface UseWrapperForZamaConfig {\n client: PublicClient;\n coordinator: Address | undefined;\n tokenAddress: Address | undefined;\n}\n\nexport interface UseWrapperForTokenSuspenseConfig {\n client: PublicClient;\n coordinator: Address;\n tokenAddress: Address;\n}\n\nexport function useWrapperForToken(config: UseWrapperForZamaConfig) {\n const { client, coordinator, tokenAddress } = config;\n const enabled = !!coordinator && !!tokenAddress;\n return useQuery({\n queryKey: [\"wrapperForToken\", client, coordinator, tokenAddress],\n queryFn: () =>\n readWrapperForTokenContract(client, coordinator as Address, tokenAddress as Address),\n enabled,\n });\n}\n\nexport function useWrapperForTokenSuspense(config: UseWrapperForTokenSuspenseConfig) {\n const { client, coordinator, tokenAddress } = config;\n return useSuspenseQuery({\n queryKey: [\"wrapperForToken\", client, coordinator, tokenAddress],\n queryFn: () => readWrapperForTokenContract(client, coordinator, tokenAddress),\n });\n}\n","\"use client\";\n\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { PublicClient } from \"viem\";\nimport { readUnderlyingTokenContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface UseUnderlyingZamaConfig {\n client: PublicClient;\n wrapperAddress: Address | undefined;\n}\n\nexport interface UseUnderlyingTokenSuspenseConfig {\n client: PublicClient;\n wrapperAddress: Address;\n}\n\nexport function useUnderlyingToken(config: UseUnderlyingZamaConfig) {\n const { client, wrapperAddress } = config;\n const enabled = !!wrapperAddress;\n return useQuery({\n queryKey: [\"underlyingToken\", client, wrapperAddress],\n queryFn: () => readUnderlyingTokenContract(client, wrapperAddress as Address),\n enabled,\n });\n}\n\nexport function useUnderlyingTokenSuspense(config: UseUnderlyingTokenSuspenseConfig) {\n const { client, wrapperAddress } = config;\n return useSuspenseQuery({\n queryKey: [\"underlyingToken\", client, wrapperAddress],\n queryFn: () => readUnderlyingTokenContract(client, wrapperAddress),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeWrapContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface ShieldParams {\n client: WalletClient;\n wrapperAddress: Address;\n to: Address;\n amount: bigint;\n}\nexport function useShield() {\n return useMutation<Awaited<ReturnType<typeof writeWrapContract>>, Error, ShieldParams>({\n mutationFn: (params) =>\n writeWrapContract(params.client, params.wrapperAddress, params.to, params.amount),\n });\n}\n","\"use client\";\n\nimport { useMutation } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { WalletClient } from \"viem\";\nimport { writeWrapETHContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface ShieldETHParams {\n client: WalletClient;\n wrapperAddress: Address;\n to: Address;\n amount: bigint;\n value: bigint;\n}\nexport function useShieldETH() {\n return useMutation<Awaited<ReturnType<typeof writeWrapETHContract>>, Error, ShieldETHParams>({\n mutationFn: (params) =>\n writeWrapETHContract(\n params.client,\n params.wrapperAddress,\n params.to,\n params.amount,\n params.value,\n ),\n });\n}\n","\"use client\";\n\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { PublicClient } from \"viem\";\nimport { readWrapperExistsContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface UseWrapperExistsConfig {\n client: PublicClient;\n coordinator: Address | undefined;\n tokenAddress: Address | undefined;\n}\n\nexport interface UseWrapperExistsSuspenseConfig {\n client: PublicClient;\n coordinator: Address;\n tokenAddress: Address;\n}\n\nexport function useWrapperExists(config: UseWrapperExistsConfig) {\n const { client, coordinator, tokenAddress } = config;\n const enabled = !!coordinator && !!tokenAddress;\n return useQuery({\n queryKey: [\"wrapperExists\", client, coordinator, tokenAddress],\n queryFn: () =>\n readWrapperExistsContract(client, coordinator as Address, tokenAddress as Address),\n enabled,\n });\n}\n\nexport function useWrapperExistsSuspense(config: UseWrapperExistsSuspenseConfig) {\n const { client, coordinator, tokenAddress } = config;\n return useSuspenseQuery({\n queryKey: [\"wrapperExists\", client, coordinator, tokenAddress],\n queryFn: () => readWrapperExistsContract(client, coordinator, tokenAddress),\n });\n}\n","\"use client\";\n\nimport { useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport type { PublicClient } from \"viem\";\nimport { readSupportsInterfaceContract } from \"@zama-fhe/sdk/viem\";\n\nexport interface UseSupportsInterfaceConfig {\n client: PublicClient;\n tokenAddress: Address | undefined;\n interfaceId: Address | undefined;\n}\n\nexport interface UseSupportsInterfaceSuspenseConfig {\n client: PublicClient;\n tokenAddress: Address;\n interfaceId: Address;\n}\n\nexport function useSupportsInterface(config: UseSupportsInterfaceConfig) {\n const { client, tokenAddress, interfaceId } = config;\n const enabled = !!tokenAddress && !!interfaceId;\n return useQuery({\n queryKey: [\"supportsInterface\", client, tokenAddress, interfaceId],\n queryFn: () =>\n readSupportsInterfaceContract(client, tokenAddress as Address, interfaceId as Address),\n enabled,\n });\n}\n\nexport function useSupportsInterfaceSuspense(config: UseSupportsInterfaceSuspenseConfig) {\n const { client, tokenAddress, interfaceId } = config;\n return useSuspenseQuery({\n queryKey: [\"supportsInterface\", client, tokenAddress, interfaceId],\n queryFn: () => readSupportsInterfaceContract(client, tokenAddress, interfaceId),\n });\n}\n"]}