@tokenops/sdk 1.1.1 → 1.6.0
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.
- package/CHANGELOG.md +158 -2
- package/README.md +18 -8
- package/SECURITY.md +7 -1
- package/dist/{chunk-56UI7LUR.cjs → chunk-2RNW4MIJ.cjs} +37 -0
- package/dist/{chunk-VDXVNZCO.cjs → chunk-43RFBQ73.cjs} +85 -29
- package/dist/{chunk-BE2AIZ3K.js → chunk-46T67CE2.js} +1 -1
- package/dist/{chunk-WRCUDSUJ.js → chunk-4KJ66YRH.js} +61 -3
- package/dist/{chunk-ITQ7WKVC.cjs → chunk-4ZCXK4VI.cjs} +68 -8
- package/dist/{chunk-JFLEEXKP.js → chunk-6WSNS3UV.js} +58 -2
- package/dist/{chunk-W7JHOK7G.cjs → chunk-7G7UOQV4.cjs} +4 -4
- package/dist/{chunk-5KHIQG7Y.cjs → chunk-AYGRYDBX.cjs} +35 -36
- package/dist/{chunk-5SGMJADP.cjs → chunk-BD4LZBVF.cjs} +85 -9
- package/dist/{chunk-OYLZEEHF.cjs → chunk-BK7YIVLK.cjs} +304 -179
- package/dist/{chunk-SEKC7H5Y.cjs → chunk-CBRL2PJA.cjs} +12 -11
- package/dist/{chunk-XWDVPV42.js → chunk-CNP4L3GF.js} +4 -4
- package/dist/{chunk-IVE3QEGD.js → chunk-DRSPMIZ7.js} +28 -1
- package/dist/{chunk-SAGJIEQK.cjs → chunk-EUKPOXWR.cjs} +15 -16
- package/dist/chunk-FT4LNBOS.js +11 -0
- package/dist/{chunk-ITQBDRWX.js → chunk-HETNKZEE.js} +1 -1
- package/dist/{chunk-JJ4R5QXF.js → chunk-KSDSXJ34.js} +1 -1
- package/dist/{chunk-SYHXDHWX.cjs → chunk-LBWRFZR3.cjs} +218 -31
- package/dist/{chunk-ZXCOJY2Z.js → chunk-NFW7AUEX.js} +1 -1
- package/dist/{chunk-FPQBFIUW.cjs → chunk-OL6SHN3D.cjs} +3 -3
- package/dist/{chunk-XSNLAS5M.js → chunk-PD7ME2BT.js} +75 -2
- package/dist/{chunk-FXCW7LVB.js → chunk-QET3Q4JP.js} +94 -9
- package/dist/{chunk-M7V2EDPB.js → chunk-QKKBBH7I.js} +2 -2
- package/dist/{chunk-XXXDQSHE.js → chunk-S2XD75JM.js} +12 -3
- package/dist/{chunk-5SA2HF2W.cjs → chunk-SPGSO5SO.cjs} +31 -22
- package/dist/{chunk-Q7ARQSUH.cjs → chunk-SYHNZSZZ.cjs} +3 -3
- package/dist/{chunk-X56UVEXS.js → chunk-TN65XNTI.js} +248 -120
- package/dist/chunk-U57COLUE.js +56 -0
- package/dist/{chunk-OQZAZIAS.js → chunk-UE5XK2SY.js} +193 -6
- package/dist/{chunk-NS44KBV5.cjs → chunk-UJS4N2XM.cjs} +12 -12
- package/dist/{chunk-IR5AK5U5.js → chunk-V5D7BHW3.js} +4 -5
- package/dist/{chunk-3PQ2RFPC.js → chunk-VHSNYUYV.js} +5 -4
- package/dist/{chunk-CQIPRNS7.cjs → chunk-VR3FREBX.cjs} +3 -3
- package/dist/{chunk-G7G75C46.cjs → chunk-WO72UBQD.cjs} +11 -11
- package/dist/chunk-WOEETTH7.cjs +59 -0
- package/dist/{chunk-QE7ZONJ2.js → chunk-WTK6JDSI.js} +4 -5
- package/dist/{chunk-3ZRHDTEX.cjs → chunk-WUXUWTFW.cjs} +3 -3
- package/dist/{chunk-23F7JIK5.cjs → chunk-YFIWCYHC.cjs} +141 -54
- package/dist/{chunk-FYQ2UW4T.js → chunk-YPYCWLYP.js} +1 -1
- package/dist/chunk-ZQUE2B3Q.cjs +33 -0
- package/dist/core/addresses.d.ts +1 -1
- package/dist/core/errors.d.ts +41 -1
- package/dist/core/revert-mapper.d.ts +77 -0
- package/dist/core/wagmi-compat.d.ts +40 -0
- package/dist/fhe/index.cjs +134 -68
- package/dist/fhe/index.d.cts +2 -1
- package/dist/fhe/index.d.ts +2 -1
- package/dist/fhe/index.js +64 -10
- package/dist/fhe/mock-erc7984.d.ts +4 -4
- package/dist/fhe/operators.d.ts +142 -2
- package/dist/fhe/react/index.cjs +21 -8
- package/dist/fhe/react/index.d.cts +2 -0
- package/dist/fhe/react/index.d.ts +2 -0
- package/dist/fhe/react/index.js +8 -3
- package/dist/fhe/react/useEnsureOperator.d.ts +56 -0
- package/dist/fhe/react/useIsOperator.d.ts +54 -0
- package/dist/fhe/sepolia-encryptor-web.d.ts +45 -4
- package/dist/fhe/sepolia-encryptor.d.ts +38 -0
- package/dist/fhe-airdrop/advanced/index.cjs +9 -9
- package/dist/fhe-airdrop/advanced/index.js +7 -7
- package/dist/fhe-airdrop/advanced/react/index.cjs +14 -14
- package/dist/fhe-airdrop/advanced/react/index.js +10 -10
- package/dist/fhe-airdrop/airdrop.d.ts +9 -0
- package/dist/fhe-airdrop/encryption.d.ts +8 -0
- package/dist/fhe-airdrop/factory.d.ts +86 -1
- package/dist/fhe-airdrop/index.cjs +69 -66
- package/dist/fhe-airdrop/index.d.cts +3 -3
- package/dist/fhe-airdrop/index.d.ts +3 -3
- package/dist/fhe-airdrop/index.js +7 -8
- package/dist/fhe-airdrop/react/index.cjs +176 -135
- package/dist/fhe-airdrop/react/index.d.cts +7 -4
- package/dist/fhe-airdrop/react/index.d.ts +7 -4
- package/dist/fhe-airdrop/react/index.js +43 -16
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +17 -11
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +3 -2
- package/dist/fhe-airdrop/react/useClaim.d.ts +10 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +8 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +8 -0
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +8 -0
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +51 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +1 -1
- package/dist/fhe-airdrop/types.d.ts +56 -0
- package/dist/fhe-disperse/encryption.d.ts +8 -0
- package/dist/fhe-disperse/errors.d.ts +55 -0
- package/dist/fhe-disperse/index.cjs +77 -66
- package/dist/fhe-disperse/index.d.cts +2 -2
- package/dist/fhe-disperse/index.d.ts +2 -2
- package/dist/fhe-disperse/index.js +8 -9
- package/dist/fhe-disperse/react/index.cjs +108 -87
- package/dist/fhe-disperse/react/index.d.cts +4 -2
- package/dist/fhe-disperse/react/index.d.ts +4 -2
- package/dist/fhe-disperse/react/index.js +12 -11
- package/dist/fhe-disperse/react/useCalculateFee.d.ts +7 -0
- package/dist/fhe-disperse/react/useDisperse.d.ts +9 -0
- package/dist/fhe-disperse/react/usePreflightDisperse.d.ts +7 -0
- package/dist/fhe-disperse/react/useSingletonCalculateFee.d.ts +7 -0
- package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-disperse/singleton.d.ts +29 -0
- package/dist/fhe-disperse/subtotals.d.ts +6 -0
- package/dist/fhe-vesting/advanced/index.cjs +8 -9
- package/dist/fhe-vesting/advanced/index.js +6 -7
- package/dist/fhe-vesting/advanced/react/index.cjs +15 -15
- package/dist/fhe-vesting/advanced/react/index.js +12 -12
- package/dist/fhe-vesting/encryption.d.ts +8 -0
- package/dist/fhe-vesting/index.cjs +82 -79
- package/dist/fhe-vesting/index.d.cts +2 -2
- package/dist/fhe-vesting/index.d.ts +2 -2
- package/dist/fhe-vesting/index.js +9 -10
- package/dist/fhe-vesting/manager.d.ts +119 -1
- package/dist/fhe-vesting/react/index.cjs +264 -224
- package/dist/fhe-vesting/react/index.d.cts +9 -6
- package/dist/fhe-vesting/react/index.d.ts +9 -6
- package/dist/fhe-vesting/react/index.js +44 -21
- package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAdminClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +10 -0
- package/dist/fhe-vesting/react/useBatchCreateVesting.d.ts +8 -0
- package/dist/fhe-vesting/react/useClaim.d.ts +3 -1
- package/dist/fhe-vesting/react/useCreateVesting.d.ts +8 -0
- package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +1 -1
- package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +1 -1
- package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-vesting/react/usePartialClaim.d.ts +9 -1
- package/dist/fhe-vesting/react/usePreflightCreateVesting.d.ts +37 -0
- package/dist/fhe-vesting/react/useVestingClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useVestingInfo.d.ts +1 -1
- package/dist/fhe-vesting/react/useWithdrawAdmin.d.ts +6 -0
- package/dist/fhe-vesting/react/useWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-vesting/types.d.ts +45 -0
- package/dist/index.cjs +93 -86
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -3
- package/dist/testnet-faucet/index.cjs +58 -55
- package/dist/testnet-faucet/index.d.cts +1 -1
- package/dist/testnet-faucet/index.d.ts +1 -1
- package/dist/testnet-faucet/index.js +5 -6
- package/dist/testnet-faucet/react/index.cjs +60 -56
- package/dist/testnet-faucet/react/index.d.cts +3 -2
- package/dist/testnet-faucet/react/index.d.ts +3 -2
- package/dist/testnet-faucet/react/index.js +11 -11
- package/dist/testnet-faucet/react/useConfidentialBalance.d.ts +3 -2
- package/dist/testnet-faucet/react/useUnderlyingBalance.d.ts +2 -2
- package/package.json +14 -8
- package/dist/chunk-66IHPTOK.cjs +0 -20
- package/dist/chunk-KWFFIJYX.js +0 -11
- package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +0 -25
- package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +0 -30
- package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +0 -13
- package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +0 -14
- package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +0 -13
- package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +0 -25
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var chunkYFIWCYHC_cjs = require('../../chunk-YFIWCYHC.cjs');
|
|
4
|
+
var chunkWOEETTH7_cjs = require('../../chunk-WOEETTH7.cjs');
|
|
5
|
+
require('../../chunk-ZQUE2B3Q.cjs');
|
|
6
|
+
require('../../chunk-4ZCXK4VI.cjs');
|
|
7
|
+
require('../../chunk-UJS4N2XM.cjs');
|
|
8
|
+
require('../../chunk-SYHNZSZZ.cjs');
|
|
5
9
|
require('../../chunk-FWHYQZ5E.cjs');
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
9
|
-
var
|
|
10
|
-
require('../../chunk-CQIPRNS7.cjs');
|
|
10
|
+
require('../../chunk-43RFBQ73.cjs');
|
|
11
|
+
var chunkWUXUWTFW_cjs = require('../../chunk-WUXUWTFW.cjs');
|
|
12
|
+
require('../../chunk-VR3FREBX.cjs');
|
|
13
|
+
var chunk2RNW4MIJ_cjs = require('../../chunk-2RNW4MIJ.cjs');
|
|
11
14
|
require('../../chunk-VJKZWYYJ.cjs');
|
|
12
|
-
require('../../chunk-66IHPTOK.cjs');
|
|
13
|
-
var chunk56UI7LUR_cjs = require('../../chunk-56UI7LUR.cjs');
|
|
14
15
|
var reactQuery = require('@tanstack/react-query');
|
|
15
16
|
var react = require('react');
|
|
16
17
|
var wagmi = require('wagmi');
|
|
@@ -20,7 +21,7 @@ var FHE_DISPERSE_NAMESPACE = "fhe-disperse";
|
|
|
20
21
|
function tryResolveSingletonAddress(override, chainId) {
|
|
21
22
|
if (override) return override;
|
|
22
23
|
if (chainId === void 0) return void 0;
|
|
23
|
-
return
|
|
24
|
+
return chunkWUXUWTFW_cjs.getFheDisperseSingletonAddress(chainId);
|
|
24
25
|
}
|
|
25
26
|
function useMemoDisperseClient(opts = {}) {
|
|
26
27
|
const publicClient = wagmi.usePublicClient({ chainId: opts.chainId });
|
|
@@ -33,14 +34,14 @@ function useMemoDisperseClient(opts = {}) {
|
|
|
33
34
|
const client = react.useMemo(() => {
|
|
34
35
|
if (!publicClient) return void 0;
|
|
35
36
|
if (!resolvedAddress) return void 0;
|
|
36
|
-
return
|
|
37
|
+
return chunkYFIWCYHC_cjs.createConfidentialDisperseClient({
|
|
37
38
|
publicClient,
|
|
38
39
|
...walletClient ? { walletClient } : {},
|
|
39
40
|
address: resolvedAddress,
|
|
40
41
|
...chainId !== void 0 ? { chainId } : {},
|
|
41
42
|
// Lazy — invoked per-encryption inside the headless client. Picks up
|
|
42
43
|
// whichever EncryptorSource the consumer last passed in.
|
|
43
|
-
encryptor: () =>
|
|
44
|
+
encryptor: () => chunkYFIWCYHC_cjs.resolveEncryptor(encryptorSourceRef.current),
|
|
44
45
|
...opts.aclAddress ? { aclAddress: opts.aclAddress } : {}
|
|
45
46
|
});
|
|
46
47
|
}, [publicClient, walletClient, resolvedAddress, chainId, opts.aclAddress]);
|
|
@@ -56,16 +57,16 @@ function useMemoDisperseClient(opts = {}) {
|
|
|
56
57
|
function computeSingletonResolutionError(override, chainId) {
|
|
57
58
|
if (override) return void 0;
|
|
58
59
|
if (chainId === void 0) {
|
|
59
|
-
return new
|
|
60
|
+
return new chunk2RNW4MIJ_cjs.DeploymentAddressUnavailableError({
|
|
60
61
|
reason: "chain-id-missing",
|
|
61
62
|
product: "fheDisperse",
|
|
62
63
|
contract: "disperseConfidentialSingleton",
|
|
63
64
|
clientLabel: "ConfidentialDisperseClient"
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
|
-
const resolved =
|
|
67
|
+
const resolved = chunkWUXUWTFW_cjs.getFheDisperseSingletonAddress(chainId);
|
|
67
68
|
if (!resolved) {
|
|
68
|
-
return new
|
|
69
|
+
return new chunk2RNW4MIJ_cjs.DeploymentAddressUnavailableError({
|
|
69
70
|
reason: "registry-not-deployed",
|
|
70
71
|
product: "fheDisperse",
|
|
71
72
|
contract: "disperseConfidentialSingleton",
|
|
@@ -268,7 +269,7 @@ function useRegister(options = {}) {
|
|
|
268
269
|
return reactQuery.useMutation({
|
|
269
270
|
mutationFn: async (args) => {
|
|
270
271
|
if (!client) {
|
|
271
|
-
throw resolutionError ?? new
|
|
272
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useRegister", "disperse");
|
|
272
273
|
}
|
|
273
274
|
return client.register(args);
|
|
274
275
|
}
|
|
@@ -279,7 +280,7 @@ function useApproveTokenOnWallets(options = {}) {
|
|
|
279
280
|
return reactQuery.useMutation({
|
|
280
281
|
mutationFn: async (args) => {
|
|
281
282
|
if (!client) {
|
|
282
|
-
throw resolutionError ?? new
|
|
283
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useApproveTokenOnWallets", "disperse");
|
|
283
284
|
}
|
|
284
285
|
return client.approveTokenOnWallets(args);
|
|
285
286
|
}
|
|
@@ -290,7 +291,7 @@ function useRevokeTokenOnWallets(options = {}) {
|
|
|
290
291
|
return reactQuery.useMutation({
|
|
291
292
|
mutationFn: async (args) => {
|
|
292
293
|
if (!client) {
|
|
293
|
-
throw resolutionError ?? new
|
|
294
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useRevokeTokenOnWallets", "disperse");
|
|
294
295
|
}
|
|
295
296
|
return client.revokeTokenOnWallets(args);
|
|
296
297
|
}
|
|
@@ -301,7 +302,7 @@ function useRecoverFromWallets(options = {}) {
|
|
|
301
302
|
return reactQuery.useMutation({
|
|
302
303
|
mutationFn: async (args) => {
|
|
303
304
|
if (!client) {
|
|
304
|
-
throw resolutionError ?? new
|
|
305
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useRecoverFromWallets", "disperse");
|
|
305
306
|
}
|
|
306
307
|
return client.recoverFromWallets(args);
|
|
307
308
|
}
|
|
@@ -312,7 +313,7 @@ function useRecoverERC20FromWallets(options = {}) {
|
|
|
312
313
|
return reactQuery.useMutation({
|
|
313
314
|
mutationFn: async (args) => {
|
|
314
315
|
if (!client) {
|
|
315
|
-
throw resolutionError ?? new
|
|
316
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useRecoverERC20FromWallets", "disperse");
|
|
316
317
|
}
|
|
317
318
|
return client.recoverERC20FromWallets(args);
|
|
318
319
|
}
|
|
@@ -323,7 +324,7 @@ function useDisperse(options = {}) {
|
|
|
323
324
|
return reactQuery.useMutation({
|
|
324
325
|
mutationFn: async (args) => {
|
|
325
326
|
if (!client) {
|
|
326
|
-
throw resolutionError ?? new
|
|
327
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useDisperse", "disperse");
|
|
327
328
|
}
|
|
328
329
|
return client.disperse(args);
|
|
329
330
|
}
|
|
@@ -334,7 +335,7 @@ function useAccessEncryptedFeeReserve(options = {}) {
|
|
|
334
335
|
return reactQuery.useMutation({
|
|
335
336
|
mutationFn: async (args) => {
|
|
336
337
|
if (!client) {
|
|
337
|
-
throw resolutionError ?? new
|
|
338
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useAccessEncryptedFeeReserve", "disperse");
|
|
338
339
|
}
|
|
339
340
|
return client.getEncryptedFeeReserve(args);
|
|
340
341
|
}
|
|
@@ -346,7 +347,7 @@ function useDiscloseHandleToParty(options = {}) {
|
|
|
346
347
|
return reactQuery.useMutation({
|
|
347
348
|
mutationFn: async (args) => {
|
|
348
349
|
if (!client) {
|
|
349
|
-
throw resolutionError ?? new
|
|
350
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useDiscloseHandleToParty", "disperse");
|
|
350
351
|
}
|
|
351
352
|
return client.discloseHandleToParty(args);
|
|
352
353
|
}
|
|
@@ -357,7 +358,7 @@ function useBatchDiscloseHandlesToParty(options = {}) {
|
|
|
357
358
|
return reactQuery.useMutation({
|
|
358
359
|
mutationFn: async (args) => {
|
|
359
360
|
if (!client) {
|
|
360
|
-
throw resolutionError ?? new
|
|
361
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useBatchDiscloseHandlesToParty", "disperse");
|
|
361
362
|
}
|
|
362
363
|
return client.batchDiscloseHandlesToParty(args);
|
|
363
364
|
}
|
|
@@ -367,7 +368,7 @@ function usePause(options = {}) {
|
|
|
367
368
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
368
369
|
return reactQuery.useMutation({
|
|
369
370
|
mutationFn: async ({ account }) => {
|
|
370
|
-
if (!client) throw resolutionError ?? new
|
|
371
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("usePause", "disperse");
|
|
371
372
|
return client.pause(account);
|
|
372
373
|
}
|
|
373
374
|
});
|
|
@@ -376,7 +377,7 @@ function useUnpause(options = {}) {
|
|
|
376
377
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
377
378
|
return reactQuery.useMutation({
|
|
378
379
|
mutationFn: async ({ account }) => {
|
|
379
|
-
if (!client) throw resolutionError ?? new
|
|
380
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useUnpause", "disperse");
|
|
380
381
|
return client.unpause(account);
|
|
381
382
|
}
|
|
382
383
|
});
|
|
@@ -385,7 +386,7 @@ function useSetFeeConfig(options = {}) {
|
|
|
385
386
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
386
387
|
return reactQuery.useMutation({
|
|
387
388
|
mutationFn: async ({ config, account }) => {
|
|
388
|
-
if (!client) throw resolutionError ?? new
|
|
389
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useSetFeeConfig", "disperse");
|
|
389
390
|
return client.setFeeConfig(config, account);
|
|
390
391
|
}
|
|
391
392
|
});
|
|
@@ -394,7 +395,7 @@ function useSetCustomFee(options = {}) {
|
|
|
394
395
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
395
396
|
return reactQuery.useMutation({
|
|
396
397
|
mutationFn: async ({ user, gasFee, tokenFee, account }) => {
|
|
397
|
-
if (!client) throw resolutionError ?? new
|
|
398
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useSetCustomFee", "disperse");
|
|
398
399
|
return client.setCustomFee(user, gasFee, tokenFee, account);
|
|
399
400
|
}
|
|
400
401
|
});
|
|
@@ -404,7 +405,7 @@ function useDisableCustomFee(options = {}) {
|
|
|
404
405
|
return reactQuery.useMutation({
|
|
405
406
|
mutationFn: async ({ user, account }) => {
|
|
406
407
|
if (!client) {
|
|
407
|
-
throw resolutionError ?? new
|
|
408
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useDisableCustomFee", "disperse");
|
|
408
409
|
}
|
|
409
410
|
return client.disableCustomFee(user, account);
|
|
410
411
|
}
|
|
@@ -415,7 +416,7 @@ function useSetMaxBatchSizeHolding(options = {}) {
|
|
|
415
416
|
return reactQuery.useMutation({
|
|
416
417
|
mutationFn: async ({ size, account }) => {
|
|
417
418
|
if (!client) {
|
|
418
|
-
throw resolutionError ?? new
|
|
419
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useSetMaxBatchSizeHolding", "disperse");
|
|
419
420
|
}
|
|
420
421
|
return client.setMaxBatchSizeHolding(size, account);
|
|
421
422
|
}
|
|
@@ -426,7 +427,7 @@ function useSetMaxBatchSizeDirect(options = {}) {
|
|
|
426
427
|
return reactQuery.useMutation({
|
|
427
428
|
mutationFn: async ({ size, account }) => {
|
|
428
429
|
if (!client) {
|
|
429
|
-
throw resolutionError ?? new
|
|
430
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useSetMaxBatchSizeDirect", "disperse");
|
|
430
431
|
}
|
|
431
432
|
return client.setMaxBatchSizeDirect(size, account);
|
|
432
433
|
}
|
|
@@ -437,7 +438,7 @@ function useSetMaxBatchSizeTokenFee(options = {}) {
|
|
|
437
438
|
return reactQuery.useMutation({
|
|
438
439
|
mutationFn: async ({ size, account }) => {
|
|
439
440
|
if (!client) {
|
|
440
|
-
throw resolutionError ?? new
|
|
441
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useSetMaxBatchSizeTokenFee", "disperse");
|
|
441
442
|
}
|
|
442
443
|
return client.setMaxBatchSizeTokenFee(size, account);
|
|
443
444
|
}
|
|
@@ -447,7 +448,7 @@ function useWithdrawGasFee(options = {}) {
|
|
|
447
448
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
448
449
|
return reactQuery.useMutation({
|
|
449
450
|
mutationFn: async ({ to, amount, account }) => {
|
|
450
|
-
if (!client) throw resolutionError ?? new
|
|
451
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useWithdrawGasFee", "disperse");
|
|
451
452
|
return client.withdrawGasFee(to, amount, account);
|
|
452
453
|
}
|
|
453
454
|
});
|
|
@@ -457,7 +458,7 @@ function useWithdrawTokenFee(options = {}) {
|
|
|
457
458
|
return reactQuery.useMutation({
|
|
458
459
|
mutationFn: async (args) => {
|
|
459
460
|
if (!client) {
|
|
460
|
-
throw resolutionError ?? new
|
|
461
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useWithdrawTokenFee", "disperse");
|
|
461
462
|
}
|
|
462
463
|
if (args.encryptedInput !== void 0) {
|
|
463
464
|
const { token: token2, to: to2, encryptedInput, account: account2 } = args;
|
|
@@ -469,7 +470,7 @@ function useWithdrawTokenFee(options = {}) {
|
|
|
469
470
|
});
|
|
470
471
|
}
|
|
471
472
|
const { token, to, amount, encryptor: encryptorSource, account } = args;
|
|
472
|
-
const eager = encryptorSource ?
|
|
473
|
+
const eager = encryptorSource ? chunkYFIWCYHC_cjs.resolveEncryptor(encryptorSource) : void 0;
|
|
473
474
|
return client.withdrawTokenFee({
|
|
474
475
|
token,
|
|
475
476
|
to,
|
|
@@ -485,7 +486,7 @@ function useRescueConfidentialTokens(options = {}) {
|
|
|
485
486
|
return reactQuery.useMutation({
|
|
486
487
|
mutationFn: async ({ token, to, account }) => {
|
|
487
488
|
if (!client) {
|
|
488
|
-
throw resolutionError ?? new
|
|
489
|
+
throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useRescueConfidentialTokens", "disperse");
|
|
489
490
|
}
|
|
490
491
|
return client.rescueConfidentialTokens(token, to, account);
|
|
491
492
|
}
|
|
@@ -495,7 +496,7 @@ function useRescueERC20(options = {}) {
|
|
|
495
496
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
496
497
|
return reactQuery.useMutation({
|
|
497
498
|
mutationFn: async ({ token, to, account }) => {
|
|
498
|
-
if (!client) throw resolutionError ?? new
|
|
499
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useRescueERC20", "disperse");
|
|
499
500
|
return client.rescueERC20(token, to, account);
|
|
500
501
|
}
|
|
501
502
|
});
|
|
@@ -504,7 +505,7 @@ function useGrantRole(options = {}) {
|
|
|
504
505
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
505
506
|
return reactQuery.useMutation({
|
|
506
507
|
mutationFn: async ({ role, accountTarget, account }) => {
|
|
507
|
-
if (!client) throw resolutionError ?? new
|
|
508
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useGrantRole", "disperse");
|
|
508
509
|
return client.grantRole(role, accountTarget, account);
|
|
509
510
|
}
|
|
510
511
|
});
|
|
@@ -513,7 +514,7 @@ function useRevokeRole(options = {}) {
|
|
|
513
514
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
514
515
|
return reactQuery.useMutation({
|
|
515
516
|
mutationFn: async ({ role, accountTarget, account }) => {
|
|
516
|
-
if (!client) throw resolutionError ?? new
|
|
517
|
+
if (!client) throw resolutionError ?? new chunk2RNW4MIJ_cjs.MissingClientError("useRevokeRole", "disperse");
|
|
517
518
|
return client.revokeRole(role, accountTarget, account);
|
|
518
519
|
}
|
|
519
520
|
});
|
|
@@ -521,195 +522,215 @@ function useRevokeRole(options = {}) {
|
|
|
521
522
|
|
|
522
523
|
Object.defineProperty(exports, "AlreadyRegisteredError", {
|
|
523
524
|
enumerable: true,
|
|
524
|
-
get: function () { return
|
|
525
|
+
get: function () { return chunkYFIWCYHC_cjs.AlreadyRegisteredError; }
|
|
525
526
|
});
|
|
526
527
|
Object.defineProperty(exports, "DEFAULT_ADMIN_ROLE", {
|
|
527
528
|
enumerable: true,
|
|
528
|
-
get: function () { return
|
|
529
|
+
get: function () { return chunkYFIWCYHC_cjs.DEFAULT_ADMIN_ROLE; }
|
|
529
530
|
});
|
|
530
531
|
Object.defineProperty(exports, "DisperseEncryptedReserveNotGrantedError", {
|
|
531
532
|
enumerable: true,
|
|
532
|
-
get: function () { return
|
|
533
|
+
get: function () { return chunkYFIWCYHC_cjs.DisperseEncryptedReserveNotGrantedError; }
|
|
533
534
|
});
|
|
534
535
|
Object.defineProperty(exports, "DisperseSubwalletNotFoundError", {
|
|
535
536
|
enumerable: true,
|
|
536
|
-
get: function () { return
|
|
537
|
+
get: function () { return chunkYFIWCYHC_cjs.DisperseSubwalletNotFoundError; }
|
|
537
538
|
});
|
|
538
539
|
Object.defineProperty(exports, "FEE_COLLECTOR_ROLE", {
|
|
539
540
|
enumerable: true,
|
|
540
|
-
get: function () { return
|
|
541
|
+
get: function () { return chunkYFIWCYHC_cjs.FEE_COLLECTOR_ROLE; }
|
|
541
542
|
});
|
|
542
543
|
Object.defineProperty(exports, "FEE_MANAGER_ROLE", {
|
|
543
544
|
enumerable: true,
|
|
544
|
-
get: function () { return
|
|
545
|
+
get: function () { return chunkYFIWCYHC_cjs.FEE_MANAGER_ROLE; }
|
|
545
546
|
});
|
|
546
547
|
Object.defineProperty(exports, "NotRegisteredError", {
|
|
547
548
|
enumerable: true,
|
|
548
|
-
get: function () { return
|
|
549
|
+
get: function () { return chunkYFIWCYHC_cjs.NotRegisteredError; }
|
|
549
550
|
});
|
|
550
551
|
Object.defineProperty(exports, "PAUSER_ROLE", {
|
|
551
552
|
enumerable: true,
|
|
552
|
-
get: function () { return
|
|
553
|
+
get: function () { return chunkYFIWCYHC_cjs.PAUSER_ROLE; }
|
|
554
|
+
});
|
|
555
|
+
Object.defineProperty(exports, "SingletonNotApprovedError", {
|
|
556
|
+
enumerable: true,
|
|
557
|
+
get: function () { return chunkYFIWCYHC_cjs.SingletonNotApprovedError; }
|
|
558
|
+
});
|
|
559
|
+
Object.defineProperty(exports, "SubwalletsNotApprovedError", {
|
|
560
|
+
enumerable: true,
|
|
561
|
+
get: function () { return chunkYFIWCYHC_cjs.SubwalletsNotApprovedError; }
|
|
553
562
|
});
|
|
554
563
|
Object.defineProperty(exports, "WITHDRAWER_ROLE", {
|
|
555
564
|
enumerable: true,
|
|
556
|
-
get: function () { return
|
|
565
|
+
get: function () { return chunkYFIWCYHC_cjs.WITHDRAWER_ROLE; }
|
|
557
566
|
});
|
|
558
567
|
Object.defineProperty(exports, "computeSubtotals", {
|
|
559
568
|
enumerable: true,
|
|
560
|
-
get: function () { return
|
|
569
|
+
get: function () { return chunkYFIWCYHC_cjs.computeSubtotals; }
|
|
561
570
|
});
|
|
562
571
|
Object.defineProperty(exports, "encryptUint64", {
|
|
563
572
|
enumerable: true,
|
|
564
|
-
get: function () { return
|
|
573
|
+
get: function () { return chunkYFIWCYHC_cjs.encryptUint64; }
|
|
565
574
|
});
|
|
566
575
|
Object.defineProperty(exports, "encryptUint64Batch", {
|
|
567
576
|
enumerable: true,
|
|
568
|
-
get: function () { return
|
|
577
|
+
get: function () { return chunkYFIWCYHC_cjs.encryptUint64Batch; }
|
|
569
578
|
});
|
|
570
579
|
Object.defineProperty(exports, "resolveEncryptor", {
|
|
571
580
|
enumerable: true,
|
|
572
|
-
get: function () { return
|
|
581
|
+
get: function () { return chunkYFIWCYHC_cjs.resolveEncryptor; }
|
|
582
|
+
});
|
|
583
|
+
Object.defineProperty(exports, "useEnsureOperator", {
|
|
584
|
+
enumerable: true,
|
|
585
|
+
get: function () { return chunkWOEETTH7_cjs.useEnsureOperator; }
|
|
586
|
+
});
|
|
587
|
+
Object.defineProperty(exports, "useIsOperator", {
|
|
588
|
+
enumerable: true,
|
|
589
|
+
get: function () { return chunkWOEETTH7_cjs.useIsOperator; }
|
|
573
590
|
});
|
|
574
591
|
Object.defineProperty(exports, "AccessDeniedError", {
|
|
575
592
|
enumerable: true,
|
|
576
|
-
get: function () { return
|
|
593
|
+
get: function () { return chunk2RNW4MIJ_cjs.AccessDeniedError; }
|
|
577
594
|
});
|
|
578
595
|
Object.defineProperty(exports, "AlreadyInitializedError", {
|
|
579
596
|
enumerable: true,
|
|
580
|
-
get: function () { return
|
|
597
|
+
get: function () { return chunk2RNW4MIJ_cjs.AlreadyInitializedError; }
|
|
581
598
|
});
|
|
582
599
|
Object.defineProperty(exports, "BatchTooLargeError", {
|
|
583
600
|
enumerable: true,
|
|
584
|
-
get: function () { return
|
|
601
|
+
get: function () { return chunk2RNW4MIJ_cjs.BatchTooLargeError; }
|
|
585
602
|
});
|
|
586
603
|
Object.defineProperty(exports, "ContractRevertError", {
|
|
587
604
|
enumerable: true,
|
|
588
|
-
get: function () { return
|
|
605
|
+
get: function () { return chunk2RNW4MIJ_cjs.ContractRevertError; }
|
|
589
606
|
});
|
|
590
607
|
Object.defineProperty(exports, "DecryptionFailedError", {
|
|
591
608
|
enumerable: true,
|
|
592
|
-
get: function () { return
|
|
609
|
+
get: function () { return chunk2RNW4MIJ_cjs.DecryptionFailedError; }
|
|
593
610
|
});
|
|
594
611
|
Object.defineProperty(exports, "DeploymentAddressUnavailableError", {
|
|
595
612
|
enumerable: true,
|
|
596
|
-
get: function () { return
|
|
613
|
+
get: function () { return chunk2RNW4MIJ_cjs.DeploymentAddressUnavailableError; }
|
|
597
614
|
});
|
|
598
615
|
Object.defineProperty(exports, "EncryptionFailedError", {
|
|
599
616
|
enumerable: true,
|
|
600
|
-
get: function () { return
|
|
617
|
+
get: function () { return chunk2RNW4MIJ_cjs.EncryptionFailedError; }
|
|
601
618
|
});
|
|
602
619
|
Object.defineProperty(exports, "FeatureDisabledError", {
|
|
603
620
|
enumerable: true,
|
|
604
|
-
get: function () { return
|
|
621
|
+
get: function () { return chunk2RNW4MIJ_cjs.FeatureDisabledError; }
|
|
605
622
|
});
|
|
606
623
|
Object.defineProperty(exports, "FheHandleNotAllowedError", {
|
|
607
624
|
enumerable: true,
|
|
608
|
-
get: function () { return
|
|
625
|
+
get: function () { return chunk2RNW4MIJ_cjs.FheHandleNotAllowedError; }
|
|
609
626
|
});
|
|
610
627
|
Object.defineProperty(exports, "InsufficientBalanceError", {
|
|
611
628
|
enumerable: true,
|
|
612
|
-
get: function () { return
|
|
629
|
+
get: function () { return chunk2RNW4MIJ_cjs.InsufficientBalanceError; }
|
|
613
630
|
});
|
|
614
631
|
Object.defineProperty(exports, "InsufficientFeeError", {
|
|
615
632
|
enumerable: true,
|
|
616
|
-
get: function () { return
|
|
633
|
+
get: function () { return chunk2RNW4MIJ_cjs.InsufficientFeeError; }
|
|
617
634
|
});
|
|
618
635
|
Object.defineProperty(exports, "InsufficientGasFundsError", {
|
|
619
636
|
enumerable: true,
|
|
620
|
-
get: function () { return
|
|
637
|
+
get: function () { return chunk2RNW4MIJ_cjs.InsufficientGasFundsError; }
|
|
621
638
|
});
|
|
622
639
|
Object.defineProperty(exports, "InvalidArgumentError", {
|
|
623
640
|
enumerable: true,
|
|
624
|
-
get: function () { return
|
|
641
|
+
get: function () { return chunk2RNW4MIJ_cjs.InvalidArgumentError; }
|
|
625
642
|
});
|
|
626
643
|
Object.defineProperty(exports, "InvalidSignatureError", {
|
|
627
644
|
enumerable: true,
|
|
628
|
-
get: function () { return
|
|
645
|
+
get: function () { return chunk2RNW4MIJ_cjs.InvalidSignatureError; }
|
|
629
646
|
});
|
|
630
647
|
Object.defineProperty(exports, "MissingAccountError", {
|
|
631
648
|
enumerable: true,
|
|
632
|
-
get: function () { return
|
|
649
|
+
get: function () { return chunk2RNW4MIJ_cjs.MissingAccountError; }
|
|
633
650
|
});
|
|
634
651
|
Object.defineProperty(exports, "MissingClientError", {
|
|
635
652
|
enumerable: true,
|
|
636
|
-
get: function () { return
|
|
653
|
+
get: function () { return chunk2RNW4MIJ_cjs.MissingClientError; }
|
|
637
654
|
});
|
|
638
655
|
Object.defineProperty(exports, "MissingEncryptorError", {
|
|
639
656
|
enumerable: true,
|
|
640
|
-
get: function () { return
|
|
657
|
+
get: function () { return chunk2RNW4MIJ_cjs.MissingEncryptorError; }
|
|
641
658
|
});
|
|
642
659
|
Object.defineProperty(exports, "MissingPublicClientError", {
|
|
643
660
|
enumerable: true,
|
|
644
|
-
get: function () { return
|
|
661
|
+
get: function () { return chunk2RNW4MIJ_cjs.MissingPublicClientError; }
|
|
645
662
|
});
|
|
646
663
|
Object.defineProperty(exports, "MissingWalletClientError", {
|
|
647
664
|
enumerable: true,
|
|
648
|
-
get: function () { return
|
|
665
|
+
get: function () { return chunk2RNW4MIJ_cjs.MissingWalletClientError; }
|
|
649
666
|
});
|
|
650
667
|
Object.defineProperty(exports, "NetworkError", {
|
|
651
668
|
enumerable: true,
|
|
652
|
-
get: function () { return
|
|
669
|
+
get: function () { return chunk2RNW4MIJ_cjs.NetworkError; }
|
|
670
|
+
});
|
|
671
|
+
Object.defineProperty(exports, "OperatorNotApprovedError", {
|
|
672
|
+
enumerable: true,
|
|
673
|
+
get: function () { return chunk2RNW4MIJ_cjs.OperatorNotApprovedError; }
|
|
653
674
|
});
|
|
654
675
|
Object.defineProperty(exports, "PausedError", {
|
|
655
676
|
enumerable: true,
|
|
656
|
-
get: function () { return
|
|
677
|
+
get: function () { return chunk2RNW4MIJ_cjs.PausedError; }
|
|
657
678
|
});
|
|
658
679
|
Object.defineProperty(exports, "ReceiptEventAmbiguousError", {
|
|
659
680
|
enumerable: true,
|
|
660
|
-
get: function () { return
|
|
681
|
+
get: function () { return chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError; }
|
|
661
682
|
});
|
|
662
683
|
Object.defineProperty(exports, "ReceiptEventNotFoundError", {
|
|
663
684
|
enumerable: true,
|
|
664
|
-
get: function () { return
|
|
685
|
+
get: function () { return chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError; }
|
|
665
686
|
});
|
|
666
687
|
Object.defineProperty(exports, "ReentrancyError", {
|
|
667
688
|
enumerable: true,
|
|
668
|
-
get: function () { return
|
|
689
|
+
get: function () { return chunk2RNW4MIJ_cjs.ReentrancyError; }
|
|
669
690
|
});
|
|
670
691
|
Object.defineProperty(exports, "RelayerUnreachableError", {
|
|
671
692
|
enumerable: true,
|
|
672
|
-
get: function () { return
|
|
693
|
+
get: function () { return chunk2RNW4MIJ_cjs.RelayerUnreachableError; }
|
|
673
694
|
});
|
|
674
695
|
Object.defineProperty(exports, "SigningFailedError", {
|
|
675
696
|
enumerable: true,
|
|
676
|
-
get: function () { return
|
|
697
|
+
get: function () { return chunk2RNW4MIJ_cjs.SigningFailedError; }
|
|
677
698
|
});
|
|
678
699
|
Object.defineProperty(exports, "TokenOpsSdkError", {
|
|
679
700
|
enumerable: true,
|
|
680
|
-
get: function () { return
|
|
701
|
+
get: function () { return chunk2RNW4MIJ_cjs.TokenOpsSdkError; }
|
|
681
702
|
});
|
|
682
703
|
Object.defineProperty(exports, "TransferFailedError", {
|
|
683
704
|
enumerable: true,
|
|
684
|
-
get: function () { return
|
|
705
|
+
get: function () { return chunk2RNW4MIJ_cjs.TransferFailedError; }
|
|
685
706
|
});
|
|
686
707
|
Object.defineProperty(exports, "UnknownWriteFailureError", {
|
|
687
708
|
enumerable: true,
|
|
688
|
-
get: function () { return
|
|
709
|
+
get: function () { return chunk2RNW4MIJ_cjs.UnknownWriteFailureError; }
|
|
689
710
|
});
|
|
690
711
|
Object.defineProperty(exports, "UnsupportedChainError", {
|
|
691
712
|
enumerable: true,
|
|
692
|
-
get: function () { return
|
|
713
|
+
get: function () { return chunk2RNW4MIJ_cjs.UnsupportedChainError; }
|
|
693
714
|
});
|
|
694
715
|
Object.defineProperty(exports, "UserDecryptNotAllowedError", {
|
|
695
716
|
enumerable: true,
|
|
696
|
-
get: function () { return
|
|
717
|
+
get: function () { return chunk2RNW4MIJ_cjs.UserDecryptNotAllowedError; }
|
|
697
718
|
});
|
|
698
719
|
Object.defineProperty(exports, "UserRejectedSignatureError", {
|
|
699
720
|
enumerable: true,
|
|
700
|
-
get: function () { return
|
|
721
|
+
get: function () { return chunk2RNW4MIJ_cjs.UserRejectedSignatureError; }
|
|
701
722
|
});
|
|
702
723
|
Object.defineProperty(exports, "WalletChainMismatchError", {
|
|
703
724
|
enumerable: true,
|
|
704
|
-
get: function () { return
|
|
725
|
+
get: function () { return chunk2RNW4MIJ_cjs.WalletChainMismatchError; }
|
|
705
726
|
});
|
|
706
727
|
Object.defineProperty(exports, "WalletRejectedError", {
|
|
707
728
|
enumerable: true,
|
|
708
|
-
get: function () { return
|
|
729
|
+
get: function () { return chunk2RNW4MIJ_cjs.WalletRejectedError; }
|
|
709
730
|
});
|
|
710
731
|
Object.defineProperty(exports, "isTokenOpsSdkError", {
|
|
711
732
|
enumerable: true,
|
|
712
|
-
get: function () { return
|
|
733
|
+
get: function () { return chunk2RNW4MIJ_cjs.isTokenOpsSdkError; }
|
|
713
734
|
});
|
|
714
735
|
exports.FHE_DISPERSE_KEY = FHE_DISPERSE_KEY;
|
|
715
736
|
exports.FHE_DISPERSE_NAMESPACE = FHE_DISPERSE_NAMESPACE;
|
|
@@ -77,6 +77,8 @@ export { FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, PAUSER_ROLE, WITHDRAWER_ROLE, DEF
|
|
|
77
77
|
export { computeSubtotals, } from "../singleton.js";
|
|
78
78
|
export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "../encryption.js";
|
|
79
79
|
export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type DiscloseHandleArgs, type DisperseArgs, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, } from "../types.js";
|
|
80
|
-
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
|
|
80
|
+
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
|
|
81
81
|
export { type PreflightResult } from "../../core/preflight.js";
|
|
82
|
-
export { NotRegisteredError, AlreadyRegisteredError } from "../errors.js";
|
|
82
|
+
export { NotRegisteredError, AlreadyRegisteredError, SubwalletsNotApprovedError, SingletonNotApprovedError, } from "../errors.js";
|
|
83
|
+
export { useIsOperator, type UseIsOperatorOptions } from "../../fhe/react/useIsOperator.js";
|
|
84
|
+
export { useEnsureOperator, type UseEnsureOperatorOptions, type EnsureOperatorVariables, } from "../../fhe/react/useEnsureOperator.js";
|
|
@@ -77,6 +77,8 @@ export { FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, PAUSER_ROLE, WITHDRAWER_ROLE, DEF
|
|
|
77
77
|
export { computeSubtotals, } from "../singleton.js";
|
|
78
78
|
export { encryptUint64, encryptUint64Batch, resolveEncryptor, type Encryptor, type EncryptorSource, type EncryptUint64Args, type EncryptUint64BatchArgs, type FheValueInput, } from "../encryption.js";
|
|
79
79
|
export { DisperseSubwalletNotFoundError, DisperseEncryptedReserveNotGrantedError, type BatchDiscloseHandlesArgs, type BatchLimits, type CalculateFeeArgs, type CalculatedFee, type DiscloseHandleArgs, type DisperseArgs, type DisperseMode, type DisperseResult, type EncryptedInput, type EncryptedInputs, type EncryptedViewResult, type FeeConfig, type GetEncryptedFeeReserveArgs, type PreflightDisperseArgs, type PreflightReport, type RecipientCheck, type RegisterResult, type SubwalletApprovalState, type UserFees, } from "../types.js";
|
|
80
|
-
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
|
|
80
|
+
export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ContractRevertError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../../core/errors.js";
|
|
81
81
|
export { type PreflightResult } from "../../core/preflight.js";
|
|
82
|
-
export { NotRegisteredError, AlreadyRegisteredError } from "../errors.js";
|
|
82
|
+
export { NotRegisteredError, AlreadyRegisteredError, SubwalletsNotApprovedError, SingletonNotApprovedError, } from "../errors.js";
|
|
83
|
+
export { useIsOperator, type UseIsOperatorOptions } from "../../fhe/react/useIsOperator.js";
|
|
84
|
+
export { useEnsureOperator, type UseEnsureOperatorOptions, type EnsureOperatorVariables, } from "../../fhe/react/useEnsureOperator.js";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { resolveEncryptor, createConfidentialDisperseClient } from '../../chunk-
|
|
2
|
-
export { AlreadyRegisteredError, DEFAULT_ADMIN_ROLE, DisperseEncryptedReserveNotGrantedError, DisperseSubwalletNotFoundError, FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, NotRegisteredError, PAUSER_ROLE, WITHDRAWER_ROLE, computeSubtotals, encryptUint64, encryptUint64Batch, resolveEncryptor } from '../../chunk-
|
|
3
|
-
|
|
1
|
+
import { resolveEncryptor, createConfidentialDisperseClient } from '../../chunk-QET3Q4JP.js';
|
|
2
|
+
export { AlreadyRegisteredError, DEFAULT_ADMIN_ROLE, DisperseEncryptedReserveNotGrantedError, DisperseSubwalletNotFoundError, FEE_COLLECTOR_ROLE, FEE_MANAGER_ROLE, NotRegisteredError, PAUSER_ROLE, SingletonNotApprovedError, SubwalletsNotApprovedError, WITHDRAWER_ROLE, computeSubtotals, encryptUint64, encryptUint64Batch, resolveEncryptor } from '../../chunk-QET3Q4JP.js';
|
|
3
|
+
export { useEnsureOperator, useIsOperator } from '../../chunk-U57COLUE.js';
|
|
4
|
+
import '../../chunk-FT4LNBOS.js';
|
|
5
|
+
import '../../chunk-4KJ66YRH.js';
|
|
6
|
+
import '../../chunk-NFW7AUEX.js';
|
|
7
|
+
import '../../chunk-YPYCWLYP.js';
|
|
4
8
|
import '../../chunk-7VELUOMI.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import {
|
|
9
|
-
|
|
9
|
+
import '../../chunk-6WSNS3UV.js';
|
|
10
|
+
import { getFheDisperseSingletonAddress } from '../../chunk-QKKBBH7I.js';
|
|
11
|
+
import '../../chunk-46T67CE2.js';
|
|
12
|
+
import { MissingClientError, DeploymentAddressUnavailableError } from '../../chunk-DRSPMIZ7.js';
|
|
13
|
+
export { AccessDeniedError, AlreadyInitializedError, BatchTooLargeError, ContractRevertError, DecryptionFailedError, DeploymentAddressUnavailableError, EncryptionFailedError, FeatureDisabledError, FheHandleNotAllowedError, InsufficientBalanceError, InsufficientFeeError, InsufficientGasFundsError, InvalidArgumentError, InvalidSignatureError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, NetworkError, OperatorNotApprovedError, PausedError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ReentrancyError, RelayerUnreachableError, SigningFailedError, TokenOpsSdkError, TransferFailedError, UnknownWriteFailureError, UnsupportedChainError, UserDecryptNotAllowedError, UserRejectedSignatureError, WalletChainMismatchError, WalletRejectedError, isTokenOpsSdkError } from '../../chunk-DRSPMIZ7.js';
|
|
10
14
|
import '../../chunk-Q2GP5UDC.js';
|
|
11
|
-
import '../../chunk-KWFFIJYX.js';
|
|
12
|
-
import { MissingClientError, DeploymentAddressUnavailableError } from '../../chunk-IVE3QEGD.js';
|
|
13
|
-
export { AccessDeniedError, AlreadyInitializedError, BatchTooLargeError, ContractRevertError, DecryptionFailedError, DeploymentAddressUnavailableError, EncryptionFailedError, FeatureDisabledError, FheHandleNotAllowedError, InsufficientBalanceError, InsufficientFeeError, InsufficientGasFundsError, InvalidArgumentError, InvalidSignatureError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, NetworkError, PausedError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, ReentrancyError, RelayerUnreachableError, SigningFailedError, TokenOpsSdkError, TransferFailedError, UnknownWriteFailureError, UnsupportedChainError, UserDecryptNotAllowedError, UserRejectedSignatureError, WalletChainMismatchError, WalletRejectedError, isTokenOpsSdkError } from '../../chunk-IVE3QEGD.js';
|
|
14
15
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
15
16
|
import { useRef, useMemo } from 'react';
|
|
16
17
|
import { usePublicClient, useWalletClient } from 'wagmi';
|
|
@@ -18,6 +18,13 @@ export interface UseCalculateFeeArgs extends BaseHookOptions {
|
|
|
18
18
|
*
|
|
19
19
|
* Hook is disabled until `user`, `mode`, and `recipients` are set.
|
|
20
20
|
*
|
|
21
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
22
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
23
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
24
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
25
|
+
* transparent TTT test token uses 18 decimals. `totalTokens` follows this
|
|
26
|
+
* convention.
|
|
27
|
+
*
|
|
21
28
|
* @example
|
|
22
29
|
* const { data: fee } = useCalculateFee({
|
|
23
30
|
* user, mode: "direct", recipients: 100,
|
|
@@ -7,6 +7,13 @@ import { type DisperseHookOptions } from "./_shared.js";
|
|
|
7
7
|
* subtotals in a single proof batch, computes `msg.value` for gas-fee modes,
|
|
8
8
|
* and dispatches to the correct contract entry point based on `mode`.
|
|
9
9
|
*
|
|
10
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
11
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
12
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
13
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
14
|
+
* transparent TTT test token uses 18 decimals. Every entry of `amounts[]`
|
|
15
|
+
* follows this convention.
|
|
16
|
+
*
|
|
10
17
|
* **Encryptor resolution.** The hook-level `encryptor` (from
|
|
11
18
|
* {@link DisperseHookOptions}) is forwarded lazily to the SDK client. If
|
|
12
19
|
* missing when the mutation runs, the SDK throws
|
|
@@ -18,6 +25,8 @@ import { type DisperseHookOptions } from "./_shared.js";
|
|
|
18
25
|
* After success, invalidate `useGetFees`, `useHasApprovedSubwallets`, and any
|
|
19
26
|
* downstream token-balance queries owned by the consumer.
|
|
20
27
|
*
|
|
28
|
+
* **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
|
|
29
|
+
*
|
|
21
30
|
* @example
|
|
22
31
|
* function Component() {
|
|
23
32
|
* const zamaSDK = useZamaSDK();
|