@zama-fhe/react-sdk 1.0.0 → 1.1.0-alpha.1

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.
@@ -1,269 +1,2 @@
1
- "use client";
2
- import { symbolContract, decimalsContract, balanceOfContract, confidentialBalanceOfContract, getWrapperContract, underlyingContract, wrapperExistsContract, supportsInterfaceContract, confidentialBatchTransferContract, confidentialTransferContract, finalizeUnwrapContract, setOperatorContract, unwrapContract, unwrapFromBalanceContract, wrapContract, wrapETHContract } from '@zama-fhe/sdk';
3
- import { formatUnits } from 'viem';
4
- import { useConnection, useReadContracts, useReadContract, useWriteContract } from 'wagmi';
5
- import { getChainId, getConnection, signTypedData, writeContract, readContract, waitForTransactionReceipt } from 'wagmi/actions';
6
-
7
- // src/wagmi/use-balance-of.ts
8
- function useBalanceOf(config) {
9
- const { address: connectedAddress } = useConnection();
10
- const { tokenAddress, userAddress = connectedAddress } = config;
11
- const enabled = !!tokenAddress && !!userAddress;
12
- const { data, ...query } = useReadContracts({
13
- contracts: [
14
- symbolContract(tokenAddress),
15
- decimalsContract(tokenAddress),
16
- enabled ? balanceOfContract(tokenAddress, userAddress) : {}
17
- ],
18
- query: { enabled }
19
- });
20
- const symbol = data?.[0]?.result;
21
- const decimals = data?.[1]?.result;
22
- const value = data?.[2]?.result;
23
- const formatted = value !== void 0 && decimals !== void 0 ? formatUnits(value, decimals) : void 0;
24
- return {
25
- data: { value, symbol, decimals, formatted },
26
- ...query
27
- };
28
- }
29
- function useBalanceOfSuspense(config) {
30
- const { address: connectedAddress } = useConnection();
31
- const { tokenAddress, userAddress = connectedAddress } = config;
32
- const enabled = !!userAddress;
33
- const { data, ...query } = useReadContracts({
34
- contracts: [
35
- symbolContract(tokenAddress),
36
- decimalsContract(tokenAddress),
37
- enabled ? balanceOfContract(tokenAddress, userAddress) : {}
38
- ],
39
- query: { suspense: true, enabled }
40
- });
41
- const symbol = data?.[0]?.result;
42
- const decimals = data?.[1]?.result;
43
- const value = data?.[2]?.result;
44
- const formatted = value !== void 0 && decimals !== void 0 ? formatUnits(value, decimals) : void 0;
45
- return {
46
- data: { value, symbol, decimals, formatted },
47
- ...query
48
- };
49
- }
50
- function useConfidentialBalanceOf(config) {
51
- const { tokenAddress, userAddress } = config;
52
- const enabled = !!tokenAddress && !!userAddress;
53
- const contract = enabled ? confidentialBalanceOfContract(tokenAddress, userAddress) : {};
54
- return useReadContract({ ...contract, query: { enabled } });
55
- }
56
- function useConfidentialBalanceOfSuspense(config) {
57
- const contract = confidentialBalanceOfContract(config.tokenAddress, config.userAddress);
58
- return useReadContract({ ...contract, query: { suspense: true } });
59
- }
60
- function useConfidentialTransfer() {
61
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
62
- function transfer(encryptedErc20, to, handle, inputProof) {
63
- return mutate(confidentialTransferContract(encryptedErc20, to, handle, inputProof));
64
- }
65
- async function transferAsync(encryptedErc20, to, handle, inputProof) {
66
- return mutateAsync(confidentialTransferContract(encryptedErc20, to, handle, inputProof));
67
- }
68
- return {
69
- mutate: transfer,
70
- mutateAsync: transferAsync,
71
- ...mutation
72
- };
73
- }
74
- function useConfidentialBatchTransfer() {
75
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
76
- function batchTransfer(batcherAddress, tokenAddress, fromAddress, batchTransferData, fees) {
77
- return mutate(
78
- confidentialBatchTransferContract(
79
- batcherAddress,
80
- tokenAddress,
81
- fromAddress,
82
- batchTransferData,
83
- fees
84
- )
85
- );
86
- }
87
- async function batchTransferAsync(batcherAddress, tokenAddress, fromAddress, batchTransferData, fees) {
88
- return mutateAsync(
89
- confidentialBatchTransferContract(
90
- batcherAddress,
91
- tokenAddress,
92
- fromAddress,
93
- batchTransferData,
94
- fees
95
- )
96
- );
97
- }
98
- return {
99
- mutate: batchTransfer,
100
- mutateAsync: batchTransferAsync,
101
- ...mutation
102
- };
103
- }
104
- function useUnwrap() {
105
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
106
- function unwrap(encryptedErc20, from, to, encryptedAmount, inputProof) {
107
- return mutate(unwrapContract(encryptedErc20, from, to, encryptedAmount, inputProof));
108
- }
109
- async function unwrapAsync(encryptedErc20, from, to, encryptedAmount, inputProof) {
110
- return mutateAsync(unwrapContract(encryptedErc20, from, to, encryptedAmount, inputProof));
111
- }
112
- return {
113
- mutate: unwrap,
114
- mutateAsync: unwrapAsync,
115
- ...mutation
116
- };
117
- }
118
- function useUnwrapFromBalance() {
119
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
120
- function unwrapFromBalance(encryptedErc20, from, to, encryptedBalance) {
121
- return mutate(unwrapFromBalanceContract(encryptedErc20, from, to, encryptedBalance));
122
- }
123
- async function unwrapFromBalanceAsync(encryptedErc20, from, to, encryptedBalance) {
124
- return mutateAsync(unwrapFromBalanceContract(encryptedErc20, from, to, encryptedBalance));
125
- }
126
- return {
127
- mutate: unwrapFromBalance,
128
- mutateAsync: unwrapFromBalanceAsync,
129
- ...mutation
130
- };
131
- }
132
- function useFinalizeUnwrap() {
133
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
134
- function finalizeUnwrap(wrapper, burntAmount, burntAmountCleartext, decryptionProof) {
135
- return mutate(
136
- finalizeUnwrapContract(wrapper, burntAmount, burntAmountCleartext, decryptionProof)
137
- );
138
- }
139
- async function finalizeUnwrapAsync(wrapper, burntAmount, burntAmountCleartext, decryptionProof) {
140
- return mutateAsync(
141
- finalizeUnwrapContract(wrapper, burntAmount, burntAmountCleartext, decryptionProof)
142
- );
143
- }
144
- return {
145
- mutate: finalizeUnwrap,
146
- mutateAsync: finalizeUnwrapAsync,
147
- ...mutation
148
- };
149
- }
150
- function useSetOperator() {
151
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
152
- function setOperator(tokenAddress, spender, timestamp) {
153
- return mutate(setOperatorContract(tokenAddress, spender, timestamp));
154
- }
155
- async function setOperatorAsync(tokenAddress, spender, timestamp) {
156
- return mutateAsync(setOperatorContract(tokenAddress, spender, timestamp));
157
- }
158
- return {
159
- mutate: setOperator,
160
- mutateAsync: setOperatorAsync,
161
- ...mutation
162
- };
163
- }
164
- function useWrapperForToken(config) {
165
- const { coordinator, tokenAddress } = config;
166
- const enabled = !!coordinator && !!tokenAddress;
167
- const contract = enabled ? getWrapperContract(coordinator, tokenAddress) : {};
168
- return useReadContract({ ...contract, query: { enabled } });
169
- }
170
- function useWrapperForTokenSuspense(config) {
171
- const contract = getWrapperContract(config.coordinator, config.tokenAddress);
172
- return useReadContract({ ...contract, query: { suspense: true } });
173
- }
174
- function useUnderlyingToken(config) {
175
- const { wrapperAddress } = config;
176
- const enabled = !!wrapperAddress;
177
- const contract = enabled ? underlyingContract(wrapperAddress) : {};
178
- return useReadContract({ ...contract, query: { enabled } });
179
- }
180
- function useUnderlyingTokenSuspense(config) {
181
- const contract = underlyingContract(config.wrapperAddress);
182
- return useReadContract({ ...contract, query: { suspense: true } });
183
- }
184
- function useWrapperExists(config) {
185
- const { coordinator, tokenAddress } = config;
186
- const enabled = !!coordinator && !!tokenAddress;
187
- const contract = enabled ? wrapperExistsContract(coordinator, tokenAddress) : {};
188
- return useReadContract({ ...contract, query: { enabled } });
189
- }
190
- function useWrapperExistsSuspense(config) {
191
- const contract = wrapperExistsContract(config.coordinator, config.tokenAddress);
192
- return useReadContract({ ...contract, query: { suspense: true } });
193
- }
194
- function useSupportsInterface(config) {
195
- const { tokenAddress, interfaceId } = config;
196
- const enabled = !!tokenAddress && !!interfaceId;
197
- const contract = enabled ? supportsInterfaceContract(tokenAddress, interfaceId) : {};
198
- return useReadContract({ ...contract, query: { enabled } });
199
- }
200
- function useSupportsInterfaceSuspense(config) {
201
- const contract = supportsInterfaceContract(config.tokenAddress, config.interfaceId);
202
- return useReadContract({ ...contract, query: { suspense: true } });
203
- }
204
- function useWrap() {
205
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
206
- function wrap(wrapperAddress, to, amount) {
207
- return mutate(wrapContract(wrapperAddress, to, amount));
208
- }
209
- async function wrapAsync(wrapperAddress, to, amount) {
210
- return mutateAsync(wrapContract(wrapperAddress, to, amount));
211
- }
212
- return {
213
- mutate: wrap,
214
- mutateAsync: wrapAsync,
215
- ...mutation
216
- };
217
- }
218
- function useWrapETH() {
219
- const { mutate, mutateAsync, ...mutation } = useWriteContract();
220
- function wrapETH(wrapperAddress, to, amount, value) {
221
- return mutate(wrapETHContract(wrapperAddress, to, amount, value));
222
- }
223
- async function wrapETHAsync(wrapperAddress, to, amount, value) {
224
- return mutateAsync(wrapETHContract(wrapperAddress, to, amount, value));
225
- }
226
- return {
227
- mutate: wrapETH,
228
- mutateAsync: wrapETHAsync,
229
- ...mutation
230
- };
231
- }
232
- var WagmiSigner = class {
233
- config;
234
- constructor(config) {
235
- this.config = config;
236
- }
237
- async getChainId() {
238
- return getChainId(this.config);
239
- }
240
- async getAddress() {
241
- const account = getConnection(this.config);
242
- if (!account?.address) {
243
- throw new TypeError("Invalid address");
244
- }
245
- return account.address;
246
- }
247
- async signTypedData(typedData) {
248
- const { EIP712Domain: _, ...sigTypes } = typedData.types;
249
- return signTypedData(this.config, {
250
- primaryType: Object.keys(sigTypes)[0],
251
- types: sigTypes,
252
- domain: typedData.domain,
253
- message: typedData.message
254
- });
255
- }
256
- async writeContract(config) {
257
- return writeContract(this.config, config);
258
- }
259
- async readContract(config) {
260
- return readContract(this.config, config);
261
- }
262
- async waitForTransactionReceipt(hash) {
263
- return waitForTransactionReceipt(this.config, { hash });
264
- }
265
- };
266
-
267
- export { WagmiSigner, useBalanceOf, useBalanceOfSuspense, useConfidentialBalanceOf, useConfidentialBalanceOfSuspense, useConfidentialBatchTransfer, useConfidentialTransfer, useFinalizeUnwrap, useSetOperator, useSupportsInterface, useSupportsInterfaceSuspense, useUnderlyingToken, useUnderlyingTokenSuspense, useUnwrap, useUnwrapFromBalance, useWrap, useWrapETH, useWrapperExists, useWrapperExistsSuspense, useWrapperForToken, useWrapperForTokenSuspense };
268
- //# sourceMappingURL=index.js.map
1
+ "use client";import{TransactionRevertedError as e}from"@zama-fhe/sdk";import{getAccount as t,getChainId as n,readContract as r,signTypedData as i,waitForTransactionReceipt as a,watchConnection as o,writeContract as s}from"wagmi/actions";var c=class{config;constructor(e){this.config=e.config}async getChainId(){return n(this.config)}async getAddress(){let e=t(this.config);if(!e?.address)throw TypeError(`Invalid address`);return e.address}async signTypedData(e){let{EIP712Domain:t,...n}=e.types;return i(this.config,{primaryType:Object.keys(n)[0],types:n,domain:e.domain,message:e.message})}async writeContract(e){return s(this.config,e)}async readContract(e){return r(this.config,e)}async waitForTransactionReceipt(t){try{return await a(this.config,{hash:t})}catch(n){let r=n instanceof Error?n.message:String(n);throw r.includes(`could not be found`)||r.includes(`Transaction not found`)?new e(`Could not find transaction receipt for hash "${t.slice(0,10)}…". If using ERC-4337 with a bundler, your connector may be returning a UserOperation hash instead of a transaction hash.`,{cause:n instanceof Error?n:void 0}):n}}subscribe({onDisconnect:e=()=>{},onAccountChange:t=()=>{},onChainChange:n=()=>{}}){return o(this.config,{onChange(r,i){r.status===`disconnected`&&i.status!==`disconnected`&&e(),i.address&&r.address&&r.address!==i.address&&t(r.address),typeof i.chainId==`number`&&typeof r.chainId==`number`&&r.chainId!==i.chainId&&n(r.chainId)}})}};export{c as WagmiSigner};
269
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/wagmi/use-balance-of.ts","../../src/wagmi/use-confidential-balance-of.ts","../../src/wagmi/use-confidential-transfer.ts","../../src/wagmi/use-confidential-batch-transfer.ts","../../src/wagmi/use-unwrap.ts","../../src/wagmi/use-unwrap-from-balance.ts","../../src/wagmi/use-finalize-unwrap.ts","../../src/wagmi/use-set-operator.ts","../../src/wagmi/use-wrapper-for-token.ts","../../src/wagmi/use-underlying-token.ts","../../src/wagmi/use-wrapper-exists.ts","../../src/wagmi/use-supports-interface.ts","../../src/wagmi/use-wrap.ts","../../src/wagmi/use-wrap-eth.ts","../../src/wagmi/wagmi-signer.ts"],"names":["useWriteContract","use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EAAS;AACrB,MAAA,MAAM,IAAI,UAAU,iBAAiB,CAAA;AAAA,IACvC;AACA,IAAA,OAAO,OAAA,CAAQ,OAAA;AAAA,EACjB;AAAA,EAEA,MAAM,cAAc,SAAA,EAA0C;AAC5D,IAAA,MAAM,EAAE,YAAA,EAAc,CAAA,EAAG,GAAG,QAAA,KAAa,SAAA,CAAU,KAAA;AACnD,IAAA,OAAO,aAAA,CAAc,KAAK,MAAA,EAAQ;AAAA,MAChC,WAAA,EAAa,MAAA,CAAO,IAAA,CAAK,QAAQ,EAAE,CAAC,CAAA;AAAA,MACpC,KAAA,EAAO,QAAA;AAAA,MACP,QAAQ,SAAA,CAAU,MAAA;AAAA,MAClB,SAAS,SAAA,CAAU;AAAA,KACpB,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,cAA4C,MAAA,EAAyB;AACzE,IAAA,OAAO,aAAA,CAAc,IAAA,CAAK,MAAA,EAAQ,MAA6C,CAAA;AAAA,EACjF;AAAA,EAEA,MAAM,aAAmE,MAAA,EAAuB;AAC9F,IAAA,OAAO,YAAA,CAAa,IAAA,CAAK,MAAA,EAAQ,MAAM,CAAA;AAAA,EACzC;AAAA,EAEA,MAAM,0BAA0B,IAAA,EAAwC;AACtE,IAAA,OAAO,yBAAA,CAA0B,IAAA,CAAK,MAAA,EAAQ,EAAE,MAAM,CAAA;AAAA,EACxD;AACF","file":"index.js","sourcesContent":["\"use client\";\n\nimport type { Address } from \"@zama-fhe/sdk\";\nimport { balanceOfContract, decimalsContract, symbolContract } from \"@zama-fhe/sdk\";\nimport { formatUnits } from \"viem\";\nimport { useConnection, useReadContracts } from \"wagmi\";\n\nexport interface UseBalanceOfConfig {\n tokenAddress: Address;\n userAddress?: Address;\n}\n\nexport type UseBalanceOfResult = Omit<ReturnType<typeof useReadContracts>, \"data\"> & {\n data: {\n value: bigint | undefined;\n symbol: string | undefined;\n decimals: number | undefined;\n formatted: string | undefined;\n };\n};\n\nexport function useBalanceOf(config: UseBalanceOfConfig): UseBalanceOfResult {\n const { address: connectedAddress } = useConnection();\n const { tokenAddress, userAddress = connectedAddress } = config;\n const enabled = !!tokenAddress && !!userAddress;\n\n const { data, ...query } = useReadContracts({\n contracts: [\n symbolContract(tokenAddress),\n decimalsContract(tokenAddress),\n enabled ? balanceOfContract(tokenAddress, userAddress) : {},\n ],\n query: { enabled },\n });\n\n const symbol = data?.[0]?.result as string | undefined;\n const decimals = data?.[1]?.result as number | undefined;\n const value = data?.[2]?.result as bigint | undefined;\n const formatted =\n value !== undefined && decimals !== undefined ? formatUnits(value, decimals) : undefined;\n\n return {\n data: { value, symbol, decimals, formatted },\n ...query,\n };\n}\n\nexport interface UseBalanceOfSuspenseConfig {\n tokenAddress: Address;\n userAddress?: Address;\n}\n\nexport function useBalanceOfSuspense(config: UseBalanceOfSuspenseConfig): UseBalanceOfResult {\n const { address: connectedAddress } = useConnection();\n const { tokenAddress, userAddress = connectedAddress } = config;\n const enabled = !!userAddress;\n\n const { data, ...query } = useReadContracts({\n contracts: [\n symbolContract(tokenAddress),\n decimalsContract(tokenAddress),\n enabled ? balanceOfContract(tokenAddress, userAddress) : {},\n ],\n query: { suspense: true, enabled: enabled },\n });\n\n const symbol = data?.[0]?.result as string | undefined;\n const decimals = data?.[1]?.result as number | undefined;\n const value = data?.[2]?.result as bigint | undefined;\n const formatted =\n value !== undefined && decimals !== undefined ? formatUnits(value, decimals) : undefined;\n\n return {\n data: { value, symbol, decimals, formatted },\n ...query,\n };\n}\n","\"use client\";\n\nimport { confidentialBalanceOfContract } from \"@zama-fhe/sdk\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport { useReadContract } from \"wagmi\";\n\nexport interface UseConfidentialBalanceOfConfig {\n tokenAddress: Address | undefined;\n userAddress: Address | undefined;\n}\n\nexport function useConfidentialBalanceOf(config: UseConfidentialBalanceOfConfig) {\n const { tokenAddress, userAddress } = config;\n const enabled = !!tokenAddress && !!userAddress;\n const contract = enabled ? confidentialBalanceOfContract(tokenAddress, userAddress) : {};\n return useReadContract({ ...contract, query: { enabled } });\n}\n\nexport interface UseConfidentialBalanceOfSuspenseConfig {\n tokenAddress: Address;\n userAddress: Address;\n}\n\nexport function useConfidentialBalanceOfSuspense(config: UseConfidentialBalanceOfSuspenseConfig) {\n const contract = confidentialBalanceOfContract(config.tokenAddress, config.userAddress);\n return useReadContract({ ...contract, query: { suspense: true } });\n}\n","\"use client\";\n\nimport { confidentialTransferContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype EncryptedTransferParameters = Parameters<typeof confidentialTransferContract>;\n\nexport function useConfidentialTransfer() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function transfer(\n encryptedErc20: EncryptedTransferParameters[0],\n to: EncryptedTransferParameters[1],\n handle: EncryptedTransferParameters[2],\n inputProof: EncryptedTransferParameters[3],\n ) {\n return mutate(confidentialTransferContract(encryptedErc20, to, handle, inputProof));\n }\n\n async function transferAsync(\n encryptedErc20: EncryptedTransferParameters[0],\n to: EncryptedTransferParameters[1],\n handle: EncryptedTransferParameters[2],\n inputProof: EncryptedTransferParameters[3],\n ) {\n return mutateAsync(confidentialTransferContract(encryptedErc20, to, handle, inputProof));\n }\n\n return {\n mutate: transfer,\n mutateAsync: transferAsync,\n ...mutation,\n };\n}\n","\"use client\";\n\nimport { confidentialBatchTransferContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype BatchTransferParameters = Parameters<typeof confidentialBatchTransferContract>;\n\nexport function useConfidentialBatchTransfer() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function batchTransfer(\n batcherAddress: BatchTransferParameters[0],\n tokenAddress: BatchTransferParameters[1],\n fromAddress: BatchTransferParameters[2],\n batchTransferData: BatchTransferParameters[3],\n fees: BatchTransferParameters[4],\n ) {\n return mutate(\n confidentialBatchTransferContract(\n batcherAddress,\n tokenAddress,\n fromAddress,\n batchTransferData,\n fees,\n ),\n );\n }\n\n async function batchTransferAsync(\n batcherAddress: BatchTransferParameters[0],\n tokenAddress: BatchTransferParameters[1],\n fromAddress: BatchTransferParameters[2],\n batchTransferData: BatchTransferParameters[3],\n fees: BatchTransferParameters[4],\n ) {\n return mutateAsync(\n confidentialBatchTransferContract(\n batcherAddress,\n tokenAddress,\n fromAddress,\n batchTransferData,\n fees,\n ),\n );\n }\n\n return {\n mutate: batchTransfer,\n mutateAsync: batchTransferAsync,\n ...mutation,\n };\n}\n","\"use client\";\n\nimport { unwrapContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype UnwrapParameters = Parameters<typeof unwrapContract>;\n\nexport function useUnwrap() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function unwrap(\n encryptedErc20: UnwrapParameters[0],\n from: UnwrapParameters[1],\n to: UnwrapParameters[2],\n encryptedAmount: UnwrapParameters[3],\n inputProof: UnwrapParameters[4],\n ) {\n return mutate(unwrapContract(encryptedErc20, from, to, encryptedAmount, inputProof));\n }\n\n async function unwrapAsync(\n encryptedErc20: UnwrapParameters[0],\n from: UnwrapParameters[1],\n to: UnwrapParameters[2],\n encryptedAmount: UnwrapParameters[3],\n inputProof: UnwrapParameters[4],\n ) {\n return mutateAsync(unwrapContract(encryptedErc20, from, to, encryptedAmount, inputProof));\n }\n\n return {\n mutate: unwrap,\n mutateAsync: unwrapAsync,\n ...mutation,\n };\n}\n","\"use client\";\n\nimport { unwrapFromBalanceContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype UnwrapFromBalanceParameters = Parameters<typeof unwrapFromBalanceContract>;\n\nexport function useUnwrapFromBalance() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function unwrapFromBalance(\n encryptedErc20: UnwrapFromBalanceParameters[0],\n from: UnwrapFromBalanceParameters[1],\n to: UnwrapFromBalanceParameters[2],\n encryptedBalance: UnwrapFromBalanceParameters[3],\n ) {\n return mutate(unwrapFromBalanceContract(encryptedErc20, from, to, encryptedBalance));\n }\n\n async function unwrapFromBalanceAsync(\n encryptedErc20: UnwrapFromBalanceParameters[0],\n from: UnwrapFromBalanceParameters[1],\n to: UnwrapFromBalanceParameters[2],\n encryptedBalance: UnwrapFromBalanceParameters[3],\n ) {\n return mutateAsync(unwrapFromBalanceContract(encryptedErc20, from, to, encryptedBalance));\n }\n\n return {\n mutate: unwrapFromBalance,\n mutateAsync: unwrapFromBalanceAsync,\n ...mutation,\n };\n}\n","\"use client\";\n\nimport { finalizeUnwrapContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype FinalizeUnwrapParameters = Parameters<typeof finalizeUnwrapContract>;\n\nexport function useFinalizeUnwrap() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function finalizeUnwrap(\n wrapper: FinalizeUnwrapParameters[0],\n burntAmount: FinalizeUnwrapParameters[1],\n burntAmountCleartext: FinalizeUnwrapParameters[2],\n decryptionProof: FinalizeUnwrapParameters[3],\n ) {\n return mutate(\n finalizeUnwrapContract(wrapper, burntAmount, burntAmountCleartext, decryptionProof),\n );\n }\n\n async function finalizeUnwrapAsync(\n wrapper: FinalizeUnwrapParameters[0],\n burntAmount: FinalizeUnwrapParameters[1],\n burntAmountCleartext: FinalizeUnwrapParameters[2],\n decryptionProof: FinalizeUnwrapParameters[3],\n ) {\n return mutateAsync(\n finalizeUnwrapContract(wrapper, burntAmount, burntAmountCleartext, decryptionProof),\n );\n }\n\n return {\n mutate: finalizeUnwrap,\n mutateAsync: finalizeUnwrapAsync,\n ...mutation,\n };\n}\n","\"use client\";\n\nimport { setOperatorContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype SetOperatorParameters = Parameters<typeof setOperatorContract>;\n\nexport function useSetOperator() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function setOperator(\n tokenAddress: SetOperatorParameters[0],\n spender: SetOperatorParameters[1],\n timestamp?: SetOperatorParameters[2],\n ) {\n return mutate(setOperatorContract(tokenAddress, spender, timestamp));\n }\n\n async function setOperatorAsync(\n tokenAddress: SetOperatorParameters[0],\n spender: SetOperatorParameters[1],\n timestamp?: SetOperatorParameters[2],\n ) {\n return mutateAsync(setOperatorContract(tokenAddress, spender, timestamp));\n }\n\n return {\n mutate: setOperator,\n mutateAsync: setOperatorAsync,\n ...mutation,\n };\n}\n","\"use client\";\n\nimport { getWrapperContract } from \"@zama-fhe/sdk\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport { useReadContract } from \"wagmi\";\n\nexport interface UseWrapperForTokenConfig {\n coordinator: Address | undefined;\n tokenAddress: Address | undefined;\n}\n\nexport function useWrapperForToken(config: UseWrapperForTokenConfig) {\n const { coordinator, tokenAddress } = config;\n const enabled = !!coordinator && !!tokenAddress;\n const contract = enabled ? getWrapperContract(coordinator, tokenAddress) : {};\n return useReadContract({ ...contract, query: { enabled } });\n}\n\nexport interface UseWrapperForTokenSuspenseConfig {\n coordinator: Address;\n tokenAddress: Address;\n}\n\nexport function useWrapperForTokenSuspense(config: UseWrapperForTokenSuspenseConfig) {\n const contract = getWrapperContract(config.coordinator, config.tokenAddress);\n return useReadContract({ ...contract, query: { suspense: true } });\n}\n","\"use client\";\n\nimport { underlyingContract } from \"@zama-fhe/sdk\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport { useReadContract } from \"wagmi\";\n\nexport interface UseUnderlyingTokenConfig {\n wrapperAddress: Address | undefined;\n}\n\nexport function useUnderlyingToken(config: UseUnderlyingTokenConfig) {\n const { wrapperAddress } = config;\n const enabled = !!wrapperAddress;\n const contract = enabled ? underlyingContract(wrapperAddress) : {};\n return useReadContract({ ...contract, query: { enabled } });\n}\n\nexport interface UseUnderlyingTokenSuspenseConfig {\n wrapperAddress: Address;\n}\n\nexport function useUnderlyingTokenSuspense(config: UseUnderlyingTokenSuspenseConfig) {\n const contract = underlyingContract(config.wrapperAddress);\n return useReadContract({ ...contract, query: { suspense: true } });\n}\n","\"use client\";\n\nimport { wrapperExistsContract } from \"@zama-fhe/sdk\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport { useReadContract } from \"wagmi\";\n\nexport interface UseWrapperExistsConfig {\n coordinator: Address | undefined;\n tokenAddress: Address | undefined;\n}\n\nexport function useWrapperExists(config: UseWrapperExistsConfig) {\n const { coordinator, tokenAddress } = config;\n const enabled = !!coordinator && !!tokenAddress;\n const contract = enabled ? wrapperExistsContract(coordinator, tokenAddress) : {};\n return useReadContract({ ...contract, query: { enabled } });\n}\n\nexport interface UseWrapperExistsSuspenseConfig {\n coordinator: Address;\n tokenAddress: Address;\n}\n\nexport function useWrapperExistsSuspense(config: UseWrapperExistsSuspenseConfig) {\n const contract = wrapperExistsContract(config.coordinator, config.tokenAddress);\n return useReadContract({ ...contract, query: { suspense: true } });\n}\n","\"use client\";\n\nimport { supportsInterfaceContract } from \"@zama-fhe/sdk\";\nimport type { Address } from \"@zama-fhe/sdk\";\nimport { useReadContract } from \"wagmi\";\n\nexport interface UseSupportsInterfaceConfig {\n tokenAddress: Address | undefined;\n interfaceId: Address | undefined;\n}\n\nexport function useSupportsInterface(config: UseSupportsInterfaceConfig) {\n const { tokenAddress, interfaceId } = config;\n const enabled = !!tokenAddress && !!interfaceId;\n const contract = enabled ? supportsInterfaceContract(tokenAddress, interfaceId) : {};\n return useReadContract({ ...contract, query: { enabled } });\n}\n\nexport interface UseSupportsInterfaceSuspenseConfig {\n tokenAddress: Address;\n interfaceId: Address;\n}\n\nexport function useSupportsInterfaceSuspense(config: UseSupportsInterfaceSuspenseConfig) {\n const contract = supportsInterfaceContract(config.tokenAddress, config.interfaceId);\n return useReadContract({ ...contract, query: { suspense: true } });\n}\n","\"use client\";\n\nimport { wrapContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype WrapParameters = Parameters<typeof wrapContract>;\n\nexport function useWrap() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function wrap(\n wrapperAddress: WrapParameters[0],\n to: WrapParameters[1],\n amount: WrapParameters[2],\n ) {\n return mutate(wrapContract(wrapperAddress, to, amount));\n }\n\n async function wrapAsync(\n wrapperAddress: WrapParameters[0],\n to: WrapParameters[1],\n amount: WrapParameters[2],\n ) {\n return mutateAsync(wrapContract(wrapperAddress, to, amount));\n }\n\n return {\n mutate: wrap,\n mutateAsync: wrapAsync,\n ...mutation,\n };\n}\n","\"use client\";\n\nimport { wrapETHContract } from \"@zama-fhe/sdk\";\nimport { useWriteContract } from \"wagmi\";\n\ntype WrapETHParameters = Parameters<typeof wrapETHContract>;\n\nexport function useWrapETH() {\n const { mutate, mutateAsync, ...mutation } = useWriteContract();\n\n function wrapETH(\n wrapperAddress: WrapETHParameters[0],\n to: WrapETHParameters[1],\n amount: WrapETHParameters[2],\n value: WrapETHParameters[3],\n ) {\n return mutate(wrapETHContract(wrapperAddress, to, amount, value));\n }\n\n async function wrapETHAsync(\n wrapperAddress: WrapETHParameters[0],\n to: WrapETHParameters[1],\n amount: WrapETHParameters[2],\n value: WrapETHParameters[3],\n ) {\n return mutateAsync(wrapETHContract(wrapperAddress, to, amount, value));\n }\n\n return {\n mutate: wrapETH,\n mutateAsync: wrapETHAsync,\n ...mutation,\n };\n}\n","import type {\n GenericSigner,\n ContractCallConfig,\n TransactionReceipt,\n Address,\n Hex,\n EIP712TypedData,\n} from \"@zama-fhe/sdk\";\nimport type { Config } from \"wagmi\";\nimport {\n getChainId,\n getConnection,\n readContract,\n signTypedData,\n waitForTransactionReceipt,\n writeContract,\n} from \"wagmi/actions\";\n\n/**\n * GenericSigner backed by wagmi.\n *\n * @param config - Wagmi config (from useConfig())\n */\nexport class WagmiSigner implements GenericSigner {\n private readonly config: Config;\n\n constructor(config: Config) {\n this.config = config;\n }\n\n async getChainId(): Promise<number> {\n return getChainId(this.config);\n }\n\n async getAddress(): Promise<Address> {\n const account = getConnection(this.config);\n if (!account?.address) {\n throw new TypeError(\"Invalid address\");\n }\n return account.address;\n }\n\n async signTypedData(typedData: EIP712TypedData): Promise<Hex> {\n const { EIP712Domain: _, ...sigTypes } = typedData.types;\n return signTypedData(this.config, {\n primaryType: Object.keys(sigTypes)[0]!,\n types: sigTypes,\n domain: typedData.domain,\n message: typedData.message,\n });\n }\n\n async writeContract<C extends ContractCallConfig>(config: C): Promise<Hex> {\n return writeContract(this.config, config as Parameters<typeof writeContract>[1]);\n }\n\n async readContract<T, C extends ContractCallConfig = ContractCallConfig>(config: C): Promise<T> {\n return readContract(this.config, config) as Promise<T>;\n }\n\n async waitForTransactionReceipt(hash: Hex): Promise<TransactionReceipt> {\n return waitForTransactionReceipt(this.config, { hash });\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/wagmi/wagmi-signer.ts"],"sourcesContent":["import type {\n Address,\n ContractAbi,\n EIP712TypedData,\n GenericSigner,\n Hex,\n ReadContractArgs,\n ReadContractConfig,\n ReadContractReturnType,\n ReadFunctionName,\n SignerLifecycleCallbacks,\n TransactionReceipt,\n WriteContractArgs,\n WriteFunctionName,\n WriteContractConfig,\n} from \"@zama-fhe/sdk\";\nimport { TransactionRevertedError } from \"@zama-fhe/sdk\";\nimport type { Config } from \"wagmi\";\nimport {\n getChainId,\n getAccount,\n readContract,\n signTypedData,\n waitForTransactionReceipt,\n watchConnection,\n writeContract,\n} from \"wagmi/actions\";\n\n/** Configuration for {@link WagmiSigner}. */\nexport interface WagmiSignerConfig {\n config: Config;\n}\n\n/**\n * GenericSigner backed by wagmi.\n *\n * @param signerConfig - {@link WagmiSignerConfig} with wagmi config\n */\nexport class WagmiSigner implements GenericSigner {\n private readonly config: Config;\n\n constructor(signerConfig: WagmiSignerConfig) {\n this.config = signerConfig.config;\n }\n\n async getChainId(): Promise<number> {\n return getChainId(this.config);\n }\n\n async getAddress(): Promise<Address> {\n const account = getAccount(this.config);\n if (!account?.address) {\n throw new TypeError(\"Invalid address\");\n }\n return account.address;\n }\n\n async signTypedData(typedData: EIP712TypedData): Promise<Hex> {\n const { EIP712Domain: _, ...sigTypes } = typedData.types;\n return signTypedData(this.config, {\n primaryType: Object.keys(sigTypes)[0]!,\n types: sigTypes,\n domain: typedData.domain,\n message: typedData.message,\n });\n }\n\n async writeContract<\n const TAbi extends ContractAbi,\n TFunctionName extends WriteFunctionName<TAbi>,\n const TArgs extends WriteContractArgs<TAbi, TFunctionName>,\n >(config: WriteContractConfig<TAbi, TFunctionName, TArgs>): Promise<Hex> {\n return writeContract(this.config, config as Parameters<typeof writeContract>[1]);\n }\n\n async readContract<\n const TAbi extends ContractAbi,\n TFunctionName extends ReadFunctionName<TAbi>,\n const TArgs extends ReadContractArgs<TAbi, TFunctionName>,\n >(\n config: ReadContractConfig<TAbi, TFunctionName, TArgs>,\n ): Promise<ReadContractReturnType<TAbi, TFunctionName, TArgs>> {\n return readContract(this.config, config);\n }\n\n async waitForTransactionReceipt(hash: Hex): Promise<TransactionReceipt> {\n try {\n return await waitForTransactionReceipt(this.config, { hash });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (message.includes(\"could not be found\") || message.includes(\"Transaction not found\")) {\n throw new TransactionRevertedError(\n `Could not find transaction receipt for hash \"${hash.slice(0, 10)}…\". ` +\n \"If using ERC-4337 with a bundler, your connector may be returning a UserOperation hash \" +\n \"instead of a transaction hash.\",\n { cause: error instanceof Error ? error : undefined },\n );\n }\n throw error;\n }\n }\n\n subscribe({\n onDisconnect = () => {},\n onAccountChange = () => {},\n onChainChange = () => {},\n }: SignerLifecycleCallbacks): () => void {\n return watchConnection(this.config, {\n onChange(connection, prevConnection) {\n if (connection.status === \"disconnected\" && prevConnection.status !== \"disconnected\") {\n onDisconnect();\n }\n if (\n prevConnection.address &&\n connection.address &&\n connection.address !== prevConnection.address\n ) {\n onAccountChange(connection.address);\n }\n if (\n typeof prevConnection.chainId === \"number\" &&\n typeof connection.chainId === \"number\" &&\n connection.chainId !== prevConnection.chainId\n ) {\n onChainChange(connection.chainId);\n }\n },\n });\n }\n}\n"],"mappings":"6OAsCA,IAAa,EAAb,KAAkD,CACh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EAAc,EAAW,QAAQ,EAGtC,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@zama-fhe/react-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0-alpha.1",
4
4
  "description": "React hooks for Zama SDK",
5
- "license": "BSD-3-Clause",
5
+ "license": "BSD-3-Clause-Clear",
6
6
  "author": "Zama",
7
7
  "repository": {
8
8
  "type": "git",
@@ -17,14 +17,6 @@
17
17
  "types": "./dist/index.d.ts",
18
18
  "import": "./dist/index.js"
19
19
  },
20
- "./viem": {
21
- "types": "./dist/viem/index.d.ts",
22
- "import": "./dist/viem/index.js"
23
- },
24
- "./ethers": {
25
- "types": "./dist/ethers/index.d.ts",
26
- "import": "./dist/ethers/index.js"
27
- },
28
20
  "./wagmi": {
29
21
  "types": "./dist/wagmi/index.d.ts",
30
22
  "import": "./dist/wagmi/index.js"
@@ -35,6 +27,9 @@
35
27
  "README.md",
36
28
  "LICENSE"
37
29
  ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
38
33
  "keywords": [
39
34
  "fhe",
40
35
  "zama",
@@ -52,37 +47,30 @@
52
47
  "url": "https://github.com/zama-ai/sdk/issues"
53
48
  },
54
49
  "scripts": {
55
- "build": "tsup",
56
- "prepare": "tsup",
50
+ "build": "rm -rf dist && rolldown --config rolldown.config.ts",
57
51
  "lint": "eslint .",
58
52
  "typecheck": "tsc --noEmit"
59
53
  },
60
- "dependencies": {
61
- "tsup": "^8.5.1"
54
+ "devDependencies": {
55
+ "@zama-fhe/sdk": "workspace:*",
56
+ "rolldown": "1.0.0-rc.7",
57
+ "rolldown-plugin-dts": "^0.22.4",
58
+ "viem": "^2.47.0"
62
59
  },
63
60
  "peerDependencies": {
64
- "@zama-fhe/sdk": "workspace:*",
65
- "react": ">=18",
66
61
  "@tanstack/react-query": ">=5",
67
- "ethers": ">=6",
68
- "viem": ">=2",
62
+ "@zama-fhe/sdk": "^1.1.0-alpha.1",
63
+ "react": ">=18",
64
+ "viem": "^2.47.0",
69
65
  "wagmi": ">=2"
70
66
  },
71
67
  "sideEffects": false,
72
68
  "peerDependenciesMeta": {
73
- "ethers": {
74
- "optional": true
75
- },
76
- "viem": {
77
- "optional": true
78
- },
79
69
  "wagmi": {
80
70
  "optional": true
81
71
  }
82
72
  },
83
- "packageManager": "pnpm@10.30.2",
84
73
  "engines": {
85
- "node": ">=24",
86
- "pnpm": ">=10"
74
+ "node": ">=22"
87
75
  }
88
76
  }
@@ -1,162 +0,0 @@
1
- import * as _tanstack_react_query from '@tanstack/react-query';
2
- import { Address } from '@zama-fhe/sdk';
3
- import { readConfidentialBalanceOfContract, writeConfidentialTransferContract, writeConfidentialBatchTransferContract, writeUnwrapContract, writeUnwrapFromBalanceContract, writeFinalizeUnwrapContract, writeSetOperatorContract, readWrapperForTokenContract, readUnderlyingTokenContract, writeWrapContract, writeWrapETHContract, readWrapperExistsContract, readSupportsInterfaceContract } from '@zama-fhe/sdk/ethers';
4
- export { EthersSigner } from '@zama-fhe/sdk/ethers';
5
-
6
- type Params$c = Parameters<typeof readConfidentialBalanceOfContract>;
7
- interface UseConfidentialBalanceOfConfig {
8
- provider: Params$c[0];
9
- tokenAddress: Address | undefined;
10
- userAddress: Address | undefined;
11
- }
12
- interface UseConfidentialBalanceOfSuspenseConfig {
13
- provider: Params$c[0];
14
- tokenAddress: Address;
15
- userAddress: Address;
16
- }
17
- declare function useConfidentialBalanceOf(config: UseConfidentialBalanceOfConfig): _tanstack_react_query.UseQueryResult<any, Error>;
18
- declare function useConfidentialBalanceOfSuspense(config: UseConfidentialBalanceOfSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<any, Error>;
19
-
20
- type WriteFn$7 = typeof writeConfidentialTransferContract;
21
- type Params$b = Parameters<WriteFn$7>;
22
- interface ConfidentialTransferParams {
23
- signer: Params$b[0];
24
- tokenAddress: Params$b[1];
25
- to: Params$b[2];
26
- handle: Params$b[3];
27
- inputProof: Params$b[4];
28
- }
29
- declare function useConfidentialTransfer(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, ConfidentialTransferParams, unknown>;
30
-
31
- type WriteFn$6 = typeof writeConfidentialBatchTransferContract;
32
- type Params$a = Parameters<WriteFn$6>;
33
- interface ConfidentialBatchTransferParams {
34
- signer: Params$a[0];
35
- batcherAddress: Params$a[1];
36
- tokenAddress: Params$a[2];
37
- fromAddress: Params$a[3];
38
- batchTransferData: Params$a[4];
39
- fees: Params$a[5];
40
- }
41
- declare function useConfidentialBatchTransfer(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, ConfidentialBatchTransferParams, unknown>;
42
-
43
- type WriteFn$5 = typeof writeUnwrapContract;
44
- type Params$9 = Parameters<WriteFn$5>;
45
- interface UnwrapParams {
46
- signer: Params$9[0];
47
- encryptedErc20: Params$9[1];
48
- from: Params$9[2];
49
- to: Params$9[3];
50
- encryptedAmount: Params$9[4];
51
- inputProof: Params$9[5];
52
- }
53
- declare function useUnwrap(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, UnwrapParams, unknown>;
54
-
55
- type WriteFn$4 = typeof writeUnwrapFromBalanceContract;
56
- type Params$8 = Parameters<WriteFn$4>;
57
- interface UnwrapFromBalanceParams {
58
- signer: Params$8[0];
59
- encryptedErc20: Params$8[1];
60
- from: Params$8[2];
61
- to: Params$8[3];
62
- encryptedBalance: Params$8[4];
63
- }
64
- declare function useUnwrapFromBalance(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, UnwrapFromBalanceParams, unknown>;
65
-
66
- type WriteFn$3 = typeof writeFinalizeUnwrapContract;
67
- type Params$7 = Parameters<WriteFn$3>;
68
- interface FinalizeUnwrapParams {
69
- signer: Params$7[0];
70
- wrapper: Params$7[1];
71
- burntAmount: Params$7[2];
72
- burntAmountCleartext: Params$7[3];
73
- decryptionProof: Params$7[4];
74
- }
75
- declare function useFinalizeUnwrap(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, FinalizeUnwrapParams, unknown>;
76
-
77
- type WriteFn$2 = typeof writeSetOperatorContract;
78
- type Params$6 = Parameters<WriteFn$2>;
79
- interface SetOperatorParams {
80
- signer: Params$6[0];
81
- tokenAddress: Params$6[1];
82
- spender: Params$6[2];
83
- timestamp?: Params$6[3];
84
- }
85
- declare function useSetOperator(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, SetOperatorParams, unknown>;
86
-
87
- type Params$5 = Parameters<typeof readWrapperForTokenContract>;
88
- interface UseWrapperForTokenConfig {
89
- provider: Params$5[0];
90
- coordinator: Address | undefined;
91
- tokenAddress: Address | undefined;
92
- }
93
- interface UseWrapperForTokenSuspenseConfig {
94
- provider: Params$5[0];
95
- coordinator: Address;
96
- tokenAddress: Address;
97
- }
98
- declare function useWrapperForToken(config: UseWrapperForTokenConfig): _tanstack_react_query.UseQueryResult<any, Error>;
99
- declare function useWrapperForTokenSuspense(config: UseWrapperForTokenSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<any, Error>;
100
-
101
- type Params$4 = Parameters<typeof readUnderlyingTokenContract>;
102
- interface UseUnderlyingTokenConfig {
103
- provider: Params$4[0];
104
- wrapperAddress: Address | undefined;
105
- }
106
- interface UseUnderlyingTokenSuspenseConfig {
107
- provider: Params$4[0];
108
- wrapperAddress: Address;
109
- }
110
- declare function useUnderlyingToken(config: UseUnderlyingTokenConfig): _tanstack_react_query.UseQueryResult<any, Error>;
111
- declare function useUnderlyingTokenSuspense(config: UseUnderlyingTokenSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<any, Error>;
112
-
113
- type WriteFn$1 = typeof writeWrapContract;
114
- type Params$3 = Parameters<WriteFn$1>;
115
- interface WrapParams {
116
- signer: Params$3[0];
117
- wrapperAddress: Params$3[1];
118
- to: Params$3[2];
119
- amount: Params$3[3];
120
- }
121
- declare function useWrap(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, WrapParams, unknown>;
122
-
123
- type WriteFn = typeof writeWrapETHContract;
124
- type Params$2 = Parameters<WriteFn>;
125
- interface WrapETHParams {
126
- signer: Params$2[0];
127
- wrapperAddress: Params$2[1];
128
- to: Params$2[2];
129
- amount: Params$2[3];
130
- value: Params$2[4];
131
- }
132
- declare function useWrapETH(): _tanstack_react_query.UseMutationResult<`0x${string}`, Error, WrapETHParams, unknown>;
133
-
134
- type Params$1 = Parameters<typeof readWrapperExistsContract>;
135
- interface UseWrapperExistsConfig {
136
- provider: Params$1[0];
137
- coordinator: Address | undefined;
138
- tokenAddress: Address | undefined;
139
- }
140
- interface UseWrapperExistsSuspenseConfig {
141
- provider: Params$1[0];
142
- coordinator: Address;
143
- tokenAddress: Address;
144
- }
145
- declare function useWrapperExists(config: UseWrapperExistsConfig): _tanstack_react_query.UseQueryResult<any, Error>;
146
- declare function useWrapperExistsSuspense(config: UseWrapperExistsSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<any, Error>;
147
-
148
- type Params = Parameters<typeof readSupportsInterfaceContract>;
149
- interface UseSupportsInterfaceConfig {
150
- provider: Params[0];
151
- tokenAddress: Params[1] | undefined;
152
- interfaceId: Params[2] | undefined;
153
- }
154
- interface UseSupportsInterfaceSuspenseConfig {
155
- provider: Params[0];
156
- tokenAddress: Params[1];
157
- interfaceId: Params[2];
158
- }
159
- declare function useSupportsInterface(config: UseSupportsInterfaceConfig): _tanstack_react_query.UseQueryResult<any, Error>;
160
- declare function useSupportsInterfaceSuspense(config: UseSupportsInterfaceSuspenseConfig): _tanstack_react_query.UseSuspenseQueryResult<any, Error>;
161
-
162
- export { type ConfidentialBatchTransferParams, type ConfidentialTransferParams, type FinalizeUnwrapParams, type SetOperatorParams, type UnwrapFromBalanceParams, type UnwrapParams, type UseConfidentialBalanceOfConfig, type UseConfidentialBalanceOfSuspenseConfig, type UseSupportsInterfaceConfig, type UseSupportsInterfaceSuspenseConfig, type UseUnderlyingTokenConfig, type UseUnderlyingTokenSuspenseConfig, type UseWrapperExistsConfig, type UseWrapperExistsSuspenseConfig, type UseWrapperForTokenConfig, type UseWrapperForTokenSuspenseConfig, type WrapETHParams, type WrapParams, useConfidentialBalanceOf, useConfidentialBalanceOfSuspense, useConfidentialBatchTransfer, useConfidentialTransfer, useFinalizeUnwrap, useSetOperator, useSupportsInterface, useSupportsInterfaceSuspense, useUnderlyingToken, useUnderlyingTokenSuspense, useUnwrap, useUnwrapFromBalance, useWrap, useWrapETH, useWrapperExists, useWrapperExistsSuspense, useWrapperForToken, useWrapperForTokenSuspense };