@tokenops/sdk 1.1.1 → 1.5.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.
- package/README.md +18 -8
- package/dist/{chunk-5SGMJADP.cjs → chunk-2NCLOQ56.cjs} +9 -9
- package/dist/{chunk-FXCW7LVB.js → chunk-2PWNH3UE.js} +35 -6
- package/dist/{chunk-FPQBFIUW.cjs → chunk-4WPGQSNT.cjs} +3 -3
- package/dist/{chunk-OYLZEEHF.cjs → chunk-5X5WL5CU.cjs} +265 -101
- package/dist/{chunk-56UI7LUR.cjs → chunk-67OV5CX2.cjs} +19 -0
- package/dist/{chunk-WRCUDSUJ.js → chunk-6BMP4ICG.js} +2 -2
- package/dist/{chunk-XXXDQSHE.js → chunk-6R4KNAPK.js} +5 -3
- package/dist/{chunk-XSNLAS5M.js → chunk-AOP6HMPW.js} +1 -1
- package/dist/{chunk-SAGJIEQK.cjs → chunk-C7BRZXJA.cjs} +14 -14
- package/dist/{chunk-OQZAZIAS.js → chunk-DUZIIRPF.js} +174 -5
- package/dist/{chunk-Q7ARQSUH.cjs → chunk-FAXIIH5R.cjs} +3 -3
- package/dist/chunk-FT4LNBOS.js +11 -0
- package/dist/{chunk-QE7ZONJ2.js → chunk-IJFQ5L4I.js} +4 -4
- package/dist/{chunk-X56UVEXS.js → chunk-IXLO7GO5.js} +209 -45
- package/dist/{chunk-CQIPRNS7.cjs → chunk-JK4XMMKM.cjs} +3 -3
- package/dist/{chunk-ITQ7WKVC.cjs → chunk-JYOTGRSO.cjs} +8 -8
- package/dist/{chunk-VDXVNZCO.cjs → chunk-KLKI352M.cjs} +85 -29
- package/dist/{chunk-5SA2HF2W.cjs → chunk-MCRBVJGZ.cjs} +24 -22
- package/dist/{chunk-3PQ2RFPC.js → chunk-NTZY6IB7.js} +4 -4
- package/dist/{chunk-JJ4R5QXF.js → chunk-ODLTEGHB.js} +1 -1
- package/dist/{chunk-XWDVPV42.js → chunk-ORFTDNFZ.js} +4 -4
- package/dist/{chunk-IR5AK5U5.js → chunk-OXTLPTO3.js} +4 -4
- package/dist/{chunk-23F7JIK5.cjs → chunk-PFXURMBZ.cjs} +77 -48
- package/dist/{chunk-3ZRHDTEX.cjs → chunk-PUPKNW3R.cjs} +2 -2
- package/dist/{chunk-IVE3QEGD.js → chunk-QBJ7O2B4.js} +18 -1
- package/dist/{chunk-JFLEEXKP.js → chunk-SG65XWH7.js} +58 -2
- package/dist/{chunk-G7G75C46.cjs → chunk-T46YXSBP.cjs} +11 -11
- package/dist/{chunk-NS44KBV5.cjs → chunk-TEBM66WA.cjs} +12 -12
- package/dist/{chunk-SYHXDHWX.cjs → chunk-TIUKIY5V.cjs} +193 -24
- package/dist/{chunk-W7JHOK7G.cjs → chunk-V2PXZVBF.cjs} +4 -4
- package/dist/{chunk-SEKC7H5Y.cjs → chunk-W7IGCOVL.cjs} +11 -11
- package/dist/{chunk-5KHIQG7Y.cjs → chunk-WENHUPZC.cjs} +31 -31
- package/dist/{chunk-ZXCOJY2Z.js → chunk-WMACINXO.js} +1 -1
- package/dist/{chunk-M7V2EDPB.js → chunk-XGGTQQFH.js} +1 -1
- package/dist/{chunk-ITQBDRWX.js → chunk-YQIBBEFJ.js} +1 -1
- package/dist/{chunk-BE2AIZ3K.js → chunk-ZA673I3O.js} +1 -1
- package/dist/chunk-ZQUE2B3Q.cjs +33 -0
- package/dist/{chunk-FYQ2UW4T.js → chunk-ZWXJTBZO.js} +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 +112 -66
- package/dist/fhe/index.d.cts +1 -1
- package/dist/fhe/index.d.ts +1 -1
- package/dist/fhe/index.js +50 -8
- package/dist/fhe/react/index.cjs +7 -7
- package/dist/fhe/react/index.js +2 -2
- package/dist/fhe/sepolia-encryptor-web.d.ts +27 -1
- package/dist/fhe/sepolia-encryptor.d.ts +38 -0
- package/dist/fhe-airdrop/advanced/index.cjs +9 -8
- package/dist/fhe-airdrop/advanced/index.js +7 -6
- package/dist/fhe-airdrop/advanced/react/index.cjs +14 -13
- package/dist/fhe-airdrop/advanced/react/index.js +10 -9
- package/dist/fhe-airdrop/airdrop.d.ts +2 -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 +61 -57
- 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 -7
- package/dist/fhe-airdrop/react/index.cjs +163 -133
- package/dist/fhe-airdrop/react/index.d.cts +4 -3
- package/dist/fhe-airdrop/react/index.d.ts +4 -3
- package/dist/fhe-airdrop/react/index.js +38 -13
- package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +2 -0
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +3 -2
- package/dist/fhe-airdrop/react/useClaim.d.ts +2 -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/types.d.ts +45 -0
- package/dist/fhe-disperse/encryption.d.ts +8 -0
- package/dist/fhe-disperse/index.cjs +69 -65
- package/dist/fhe-disperse/index.d.cts +1 -1
- package/dist/fhe-disperse/index.d.ts +1 -1
- package/dist/fhe-disperse/index.js +8 -8
- package/dist/fhe-disperse/react/index.cjs +90 -86
- package/dist/fhe-disperse/react/index.d.cts +1 -1
- package/dist/fhe-disperse/react/index.d.ts +1 -1
- package/dist/fhe-disperse/react/index.js +10 -10
- 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 -8
- package/dist/fhe-vesting/advanced/index.js +6 -6
- package/dist/fhe-vesting/advanced/react/index.cjs +15 -14
- package/dist/fhe-vesting/advanced/react/index.js +12 -11
- package/dist/fhe-vesting/encryption.d.ts +8 -0
- package/dist/fhe-vesting/index.cjs +79 -75
- 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 -9
- package/dist/fhe-vesting/manager.d.ts +100 -1
- package/dist/fhe-vesting/react/index.cjs +241 -219
- package/dist/fhe-vesting/react/index.d.cts +3 -2
- package/dist/fhe-vesting/react/index.d.ts +3 -2
- package/dist/fhe-vesting/react/index.js +29 -12
- package/dist/fhe-vesting/react/useAdminClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useBatchCreateVesting.d.ts +8 -0
- package/dist/fhe-vesting/react/useClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useCreateVesting.d.ts +8 -0
- package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-vesting/react/usePartialClaim.d.ts +8 -0
- 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/useWithdrawAdmin.d.ts +6 -0
- package/dist/fhe-vesting/react/useWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-vesting/types.d.ts +34 -0
- package/dist/index.cjs +61 -53
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/testnet-faucet/index.cjs +58 -54
- 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 -5
- package/dist/testnet-faucet/react/index.cjs +60 -55
- 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 -10
- package/dist/testnet-faucet/react/useConfidentialBalance.d.ts +3 -2
- package/dist/testnet-faucet/react/useUnderlyingBalance.d.ts +2 -2
- package/package.json +3 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var chunkPFXURMBZ_cjs = require('../../chunk-PFXURMBZ.cjs');
|
|
4
|
+
require('../../chunk-JYOTGRSO.cjs');
|
|
5
|
+
require('../../chunk-TEBM66WA.cjs');
|
|
6
|
+
require('../../chunk-FAXIIH5R.cjs');
|
|
5
7
|
require('../../chunk-FWHYQZ5E.cjs');
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
9
|
-
var chunk3ZRHDTEX_cjs = require('../../chunk-3ZRHDTEX.cjs');
|
|
10
|
-
require('../../chunk-CQIPRNS7.cjs');
|
|
8
|
+
require('../../chunk-KLKI352M.cjs');
|
|
9
|
+
var chunkPUPKNW3R_cjs = require('../../chunk-PUPKNW3R.cjs');
|
|
10
|
+
require('../../chunk-JK4XMMKM.cjs');
|
|
11
11
|
require('../../chunk-VJKZWYYJ.cjs');
|
|
12
12
|
require('../../chunk-66IHPTOK.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunk67OV5CX2_cjs = require('../../chunk-67OV5CX2.cjs');
|
|
14
14
|
var reactQuery = require('@tanstack/react-query');
|
|
15
15
|
var react = require('react');
|
|
16
16
|
var wagmi = require('wagmi');
|
|
@@ -20,7 +20,7 @@ var FHE_DISPERSE_NAMESPACE = "fhe-disperse";
|
|
|
20
20
|
function tryResolveSingletonAddress(override, chainId) {
|
|
21
21
|
if (override) return override;
|
|
22
22
|
if (chainId === void 0) return void 0;
|
|
23
|
-
return
|
|
23
|
+
return chunkPUPKNW3R_cjs.getFheDisperseSingletonAddress(chainId);
|
|
24
24
|
}
|
|
25
25
|
function useMemoDisperseClient(opts = {}) {
|
|
26
26
|
const publicClient = wagmi.usePublicClient({ chainId: opts.chainId });
|
|
@@ -33,14 +33,14 @@ function useMemoDisperseClient(opts = {}) {
|
|
|
33
33
|
const client = react.useMemo(() => {
|
|
34
34
|
if (!publicClient) return void 0;
|
|
35
35
|
if (!resolvedAddress) return void 0;
|
|
36
|
-
return
|
|
36
|
+
return chunkPFXURMBZ_cjs.createConfidentialDisperseClient({
|
|
37
37
|
publicClient,
|
|
38
38
|
...walletClient ? { walletClient } : {},
|
|
39
39
|
address: resolvedAddress,
|
|
40
40
|
...chainId !== void 0 ? { chainId } : {},
|
|
41
41
|
// Lazy — invoked per-encryption inside the headless client. Picks up
|
|
42
42
|
// whichever EncryptorSource the consumer last passed in.
|
|
43
|
-
encryptor: () =>
|
|
43
|
+
encryptor: () => chunkPFXURMBZ_cjs.resolveEncryptor(encryptorSourceRef.current),
|
|
44
44
|
...opts.aclAddress ? { aclAddress: opts.aclAddress } : {}
|
|
45
45
|
});
|
|
46
46
|
}, [publicClient, walletClient, resolvedAddress, chainId, opts.aclAddress]);
|
|
@@ -56,16 +56,16 @@ function useMemoDisperseClient(opts = {}) {
|
|
|
56
56
|
function computeSingletonResolutionError(override, chainId) {
|
|
57
57
|
if (override) return void 0;
|
|
58
58
|
if (chainId === void 0) {
|
|
59
|
-
return new
|
|
59
|
+
return new chunk67OV5CX2_cjs.DeploymentAddressUnavailableError({
|
|
60
60
|
reason: "chain-id-missing",
|
|
61
61
|
product: "fheDisperse",
|
|
62
62
|
contract: "disperseConfidentialSingleton",
|
|
63
63
|
clientLabel: "ConfidentialDisperseClient"
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
const resolved =
|
|
66
|
+
const resolved = chunkPUPKNW3R_cjs.getFheDisperseSingletonAddress(chainId);
|
|
67
67
|
if (!resolved) {
|
|
68
|
-
return new
|
|
68
|
+
return new chunk67OV5CX2_cjs.DeploymentAddressUnavailableError({
|
|
69
69
|
reason: "registry-not-deployed",
|
|
70
70
|
product: "fheDisperse",
|
|
71
71
|
contract: "disperseConfidentialSingleton",
|
|
@@ -268,7 +268,7 @@ function useRegister(options = {}) {
|
|
|
268
268
|
return reactQuery.useMutation({
|
|
269
269
|
mutationFn: async (args) => {
|
|
270
270
|
if (!client) {
|
|
271
|
-
throw resolutionError ?? new
|
|
271
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useRegister", "disperse");
|
|
272
272
|
}
|
|
273
273
|
return client.register(args);
|
|
274
274
|
}
|
|
@@ -279,7 +279,7 @@ function useApproveTokenOnWallets(options = {}) {
|
|
|
279
279
|
return reactQuery.useMutation({
|
|
280
280
|
mutationFn: async (args) => {
|
|
281
281
|
if (!client) {
|
|
282
|
-
throw resolutionError ?? new
|
|
282
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useApproveTokenOnWallets", "disperse");
|
|
283
283
|
}
|
|
284
284
|
return client.approveTokenOnWallets(args);
|
|
285
285
|
}
|
|
@@ -290,7 +290,7 @@ function useRevokeTokenOnWallets(options = {}) {
|
|
|
290
290
|
return reactQuery.useMutation({
|
|
291
291
|
mutationFn: async (args) => {
|
|
292
292
|
if (!client) {
|
|
293
|
-
throw resolutionError ?? new
|
|
293
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useRevokeTokenOnWallets", "disperse");
|
|
294
294
|
}
|
|
295
295
|
return client.revokeTokenOnWallets(args);
|
|
296
296
|
}
|
|
@@ -301,7 +301,7 @@ function useRecoverFromWallets(options = {}) {
|
|
|
301
301
|
return reactQuery.useMutation({
|
|
302
302
|
mutationFn: async (args) => {
|
|
303
303
|
if (!client) {
|
|
304
|
-
throw resolutionError ?? new
|
|
304
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useRecoverFromWallets", "disperse");
|
|
305
305
|
}
|
|
306
306
|
return client.recoverFromWallets(args);
|
|
307
307
|
}
|
|
@@ -312,7 +312,7 @@ function useRecoverERC20FromWallets(options = {}) {
|
|
|
312
312
|
return reactQuery.useMutation({
|
|
313
313
|
mutationFn: async (args) => {
|
|
314
314
|
if (!client) {
|
|
315
|
-
throw resolutionError ?? new
|
|
315
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useRecoverERC20FromWallets", "disperse");
|
|
316
316
|
}
|
|
317
317
|
return client.recoverERC20FromWallets(args);
|
|
318
318
|
}
|
|
@@ -323,7 +323,7 @@ function useDisperse(options = {}) {
|
|
|
323
323
|
return reactQuery.useMutation({
|
|
324
324
|
mutationFn: async (args) => {
|
|
325
325
|
if (!client) {
|
|
326
|
-
throw resolutionError ?? new
|
|
326
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useDisperse", "disperse");
|
|
327
327
|
}
|
|
328
328
|
return client.disperse(args);
|
|
329
329
|
}
|
|
@@ -334,7 +334,7 @@ function useAccessEncryptedFeeReserve(options = {}) {
|
|
|
334
334
|
return reactQuery.useMutation({
|
|
335
335
|
mutationFn: async (args) => {
|
|
336
336
|
if (!client) {
|
|
337
|
-
throw resolutionError ?? new
|
|
337
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useAccessEncryptedFeeReserve", "disperse");
|
|
338
338
|
}
|
|
339
339
|
return client.getEncryptedFeeReserve(args);
|
|
340
340
|
}
|
|
@@ -346,7 +346,7 @@ function useDiscloseHandleToParty(options = {}) {
|
|
|
346
346
|
return reactQuery.useMutation({
|
|
347
347
|
mutationFn: async (args) => {
|
|
348
348
|
if (!client) {
|
|
349
|
-
throw resolutionError ?? new
|
|
349
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useDiscloseHandleToParty", "disperse");
|
|
350
350
|
}
|
|
351
351
|
return client.discloseHandleToParty(args);
|
|
352
352
|
}
|
|
@@ -357,7 +357,7 @@ function useBatchDiscloseHandlesToParty(options = {}) {
|
|
|
357
357
|
return reactQuery.useMutation({
|
|
358
358
|
mutationFn: async (args) => {
|
|
359
359
|
if (!client) {
|
|
360
|
-
throw resolutionError ?? new
|
|
360
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useBatchDiscloseHandlesToParty", "disperse");
|
|
361
361
|
}
|
|
362
362
|
return client.batchDiscloseHandlesToParty(args);
|
|
363
363
|
}
|
|
@@ -367,7 +367,7 @@ function usePause(options = {}) {
|
|
|
367
367
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
368
368
|
return reactQuery.useMutation({
|
|
369
369
|
mutationFn: async ({ account }) => {
|
|
370
|
-
if (!client) throw resolutionError ?? new
|
|
370
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("usePause", "disperse");
|
|
371
371
|
return client.pause(account);
|
|
372
372
|
}
|
|
373
373
|
});
|
|
@@ -376,7 +376,7 @@ function useUnpause(options = {}) {
|
|
|
376
376
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
377
377
|
return reactQuery.useMutation({
|
|
378
378
|
mutationFn: async ({ account }) => {
|
|
379
|
-
if (!client) throw resolutionError ?? new
|
|
379
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useUnpause", "disperse");
|
|
380
380
|
return client.unpause(account);
|
|
381
381
|
}
|
|
382
382
|
});
|
|
@@ -385,7 +385,7 @@ function useSetFeeConfig(options = {}) {
|
|
|
385
385
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
386
386
|
return reactQuery.useMutation({
|
|
387
387
|
mutationFn: async ({ config, account }) => {
|
|
388
|
-
if (!client) throw resolutionError ?? new
|
|
388
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetFeeConfig", "disperse");
|
|
389
389
|
return client.setFeeConfig(config, account);
|
|
390
390
|
}
|
|
391
391
|
});
|
|
@@ -394,7 +394,7 @@ function useSetCustomFee(options = {}) {
|
|
|
394
394
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
395
395
|
return reactQuery.useMutation({
|
|
396
396
|
mutationFn: async ({ user, gasFee, tokenFee, account }) => {
|
|
397
|
-
if (!client) throw resolutionError ?? new
|
|
397
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetCustomFee", "disperse");
|
|
398
398
|
return client.setCustomFee(user, gasFee, tokenFee, account);
|
|
399
399
|
}
|
|
400
400
|
});
|
|
@@ -404,7 +404,7 @@ function useDisableCustomFee(options = {}) {
|
|
|
404
404
|
return reactQuery.useMutation({
|
|
405
405
|
mutationFn: async ({ user, account }) => {
|
|
406
406
|
if (!client) {
|
|
407
|
-
throw resolutionError ?? new
|
|
407
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useDisableCustomFee", "disperse");
|
|
408
408
|
}
|
|
409
409
|
return client.disableCustomFee(user, account);
|
|
410
410
|
}
|
|
@@ -415,7 +415,7 @@ function useSetMaxBatchSizeHolding(options = {}) {
|
|
|
415
415
|
return reactQuery.useMutation({
|
|
416
416
|
mutationFn: async ({ size, account }) => {
|
|
417
417
|
if (!client) {
|
|
418
|
-
throw resolutionError ?? new
|
|
418
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetMaxBatchSizeHolding", "disperse");
|
|
419
419
|
}
|
|
420
420
|
return client.setMaxBatchSizeHolding(size, account);
|
|
421
421
|
}
|
|
@@ -426,7 +426,7 @@ function useSetMaxBatchSizeDirect(options = {}) {
|
|
|
426
426
|
return reactQuery.useMutation({
|
|
427
427
|
mutationFn: async ({ size, account }) => {
|
|
428
428
|
if (!client) {
|
|
429
|
-
throw resolutionError ?? new
|
|
429
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetMaxBatchSizeDirect", "disperse");
|
|
430
430
|
}
|
|
431
431
|
return client.setMaxBatchSizeDirect(size, account);
|
|
432
432
|
}
|
|
@@ -437,7 +437,7 @@ function useSetMaxBatchSizeTokenFee(options = {}) {
|
|
|
437
437
|
return reactQuery.useMutation({
|
|
438
438
|
mutationFn: async ({ size, account }) => {
|
|
439
439
|
if (!client) {
|
|
440
|
-
throw resolutionError ?? new
|
|
440
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetMaxBatchSizeTokenFee", "disperse");
|
|
441
441
|
}
|
|
442
442
|
return client.setMaxBatchSizeTokenFee(size, account);
|
|
443
443
|
}
|
|
@@ -447,7 +447,7 @@ function useWithdrawGasFee(options = {}) {
|
|
|
447
447
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
448
448
|
return reactQuery.useMutation({
|
|
449
449
|
mutationFn: async ({ to, amount, account }) => {
|
|
450
|
-
if (!client) throw resolutionError ?? new
|
|
450
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useWithdrawGasFee", "disperse");
|
|
451
451
|
return client.withdrawGasFee(to, amount, account);
|
|
452
452
|
}
|
|
453
453
|
});
|
|
@@ -457,7 +457,7 @@ function useWithdrawTokenFee(options = {}) {
|
|
|
457
457
|
return reactQuery.useMutation({
|
|
458
458
|
mutationFn: async (args) => {
|
|
459
459
|
if (!client) {
|
|
460
|
-
throw resolutionError ?? new
|
|
460
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useWithdrawTokenFee", "disperse");
|
|
461
461
|
}
|
|
462
462
|
if (args.encryptedInput !== void 0) {
|
|
463
463
|
const { token: token2, to: to2, encryptedInput, account: account2 } = args;
|
|
@@ -469,7 +469,7 @@ function useWithdrawTokenFee(options = {}) {
|
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
471
|
const { token, to, amount, encryptor: encryptorSource, account } = args;
|
|
472
|
-
const eager = encryptorSource ?
|
|
472
|
+
const eager = encryptorSource ? chunkPFXURMBZ_cjs.resolveEncryptor(encryptorSource) : void 0;
|
|
473
473
|
return client.withdrawTokenFee({
|
|
474
474
|
token,
|
|
475
475
|
to,
|
|
@@ -485,7 +485,7 @@ function useRescueConfidentialTokens(options = {}) {
|
|
|
485
485
|
return reactQuery.useMutation({
|
|
486
486
|
mutationFn: async ({ token, to, account }) => {
|
|
487
487
|
if (!client) {
|
|
488
|
-
throw resolutionError ?? new
|
|
488
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useRescueConfidentialTokens", "disperse");
|
|
489
489
|
}
|
|
490
490
|
return client.rescueConfidentialTokens(token, to, account);
|
|
491
491
|
}
|
|
@@ -495,7 +495,7 @@ function useRescueERC20(options = {}) {
|
|
|
495
495
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
496
496
|
return reactQuery.useMutation({
|
|
497
497
|
mutationFn: async ({ token, to, account }) => {
|
|
498
|
-
if (!client) throw resolutionError ?? new
|
|
498
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useRescueERC20", "disperse");
|
|
499
499
|
return client.rescueERC20(token, to, account);
|
|
500
500
|
}
|
|
501
501
|
});
|
|
@@ -504,7 +504,7 @@ function useGrantRole(options = {}) {
|
|
|
504
504
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
505
505
|
return reactQuery.useMutation({
|
|
506
506
|
mutationFn: async ({ role, accountTarget, account }) => {
|
|
507
|
-
if (!client) throw resolutionError ?? new
|
|
507
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useGrantRole", "disperse");
|
|
508
508
|
return client.grantRole(role, accountTarget, account);
|
|
509
509
|
}
|
|
510
510
|
});
|
|
@@ -513,7 +513,7 @@ function useRevokeRole(options = {}) {
|
|
|
513
513
|
const { client, resolutionError } = useMemoDisperseClient(options);
|
|
514
514
|
return reactQuery.useMutation({
|
|
515
515
|
mutationFn: async ({ role, accountTarget, account }) => {
|
|
516
|
-
if (!client) throw resolutionError ?? new
|
|
516
|
+
if (!client) throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useRevokeRole", "disperse");
|
|
517
517
|
return client.revokeRole(role, accountTarget, account);
|
|
518
518
|
}
|
|
519
519
|
});
|
|
@@ -521,195 +521,199 @@ function useRevokeRole(options = {}) {
|
|
|
521
521
|
|
|
522
522
|
Object.defineProperty(exports, "AlreadyRegisteredError", {
|
|
523
523
|
enumerable: true,
|
|
524
|
-
get: function () { return
|
|
524
|
+
get: function () { return chunkPFXURMBZ_cjs.AlreadyRegisteredError; }
|
|
525
525
|
});
|
|
526
526
|
Object.defineProperty(exports, "DEFAULT_ADMIN_ROLE", {
|
|
527
527
|
enumerable: true,
|
|
528
|
-
get: function () { return
|
|
528
|
+
get: function () { return chunkPFXURMBZ_cjs.DEFAULT_ADMIN_ROLE; }
|
|
529
529
|
});
|
|
530
530
|
Object.defineProperty(exports, "DisperseEncryptedReserveNotGrantedError", {
|
|
531
531
|
enumerable: true,
|
|
532
|
-
get: function () { return
|
|
532
|
+
get: function () { return chunkPFXURMBZ_cjs.DisperseEncryptedReserveNotGrantedError; }
|
|
533
533
|
});
|
|
534
534
|
Object.defineProperty(exports, "DisperseSubwalletNotFoundError", {
|
|
535
535
|
enumerable: true,
|
|
536
|
-
get: function () { return
|
|
536
|
+
get: function () { return chunkPFXURMBZ_cjs.DisperseSubwalletNotFoundError; }
|
|
537
537
|
});
|
|
538
538
|
Object.defineProperty(exports, "FEE_COLLECTOR_ROLE", {
|
|
539
539
|
enumerable: true,
|
|
540
|
-
get: function () { return
|
|
540
|
+
get: function () { return chunkPFXURMBZ_cjs.FEE_COLLECTOR_ROLE; }
|
|
541
541
|
});
|
|
542
542
|
Object.defineProperty(exports, "FEE_MANAGER_ROLE", {
|
|
543
543
|
enumerable: true,
|
|
544
|
-
get: function () { return
|
|
544
|
+
get: function () { return chunkPFXURMBZ_cjs.FEE_MANAGER_ROLE; }
|
|
545
545
|
});
|
|
546
546
|
Object.defineProperty(exports, "NotRegisteredError", {
|
|
547
547
|
enumerable: true,
|
|
548
|
-
get: function () { return
|
|
548
|
+
get: function () { return chunkPFXURMBZ_cjs.NotRegisteredError; }
|
|
549
549
|
});
|
|
550
550
|
Object.defineProperty(exports, "PAUSER_ROLE", {
|
|
551
551
|
enumerable: true,
|
|
552
|
-
get: function () { return
|
|
552
|
+
get: function () { return chunkPFXURMBZ_cjs.PAUSER_ROLE; }
|
|
553
553
|
});
|
|
554
554
|
Object.defineProperty(exports, "WITHDRAWER_ROLE", {
|
|
555
555
|
enumerable: true,
|
|
556
|
-
get: function () { return
|
|
556
|
+
get: function () { return chunkPFXURMBZ_cjs.WITHDRAWER_ROLE; }
|
|
557
557
|
});
|
|
558
558
|
Object.defineProperty(exports, "computeSubtotals", {
|
|
559
559
|
enumerable: true,
|
|
560
|
-
get: function () { return
|
|
560
|
+
get: function () { return chunkPFXURMBZ_cjs.computeSubtotals; }
|
|
561
561
|
});
|
|
562
562
|
Object.defineProperty(exports, "encryptUint64", {
|
|
563
563
|
enumerable: true,
|
|
564
|
-
get: function () { return
|
|
564
|
+
get: function () { return chunkPFXURMBZ_cjs.encryptUint64; }
|
|
565
565
|
});
|
|
566
566
|
Object.defineProperty(exports, "encryptUint64Batch", {
|
|
567
567
|
enumerable: true,
|
|
568
|
-
get: function () { return
|
|
568
|
+
get: function () { return chunkPFXURMBZ_cjs.encryptUint64Batch; }
|
|
569
569
|
});
|
|
570
570
|
Object.defineProperty(exports, "resolveEncryptor", {
|
|
571
571
|
enumerable: true,
|
|
572
|
-
get: function () { return
|
|
572
|
+
get: function () { return chunkPFXURMBZ_cjs.resolveEncryptor; }
|
|
573
573
|
});
|
|
574
574
|
Object.defineProperty(exports, "AccessDeniedError", {
|
|
575
575
|
enumerable: true,
|
|
576
|
-
get: function () { return
|
|
576
|
+
get: function () { return chunk67OV5CX2_cjs.AccessDeniedError; }
|
|
577
577
|
});
|
|
578
578
|
Object.defineProperty(exports, "AlreadyInitializedError", {
|
|
579
579
|
enumerable: true,
|
|
580
|
-
get: function () { return
|
|
580
|
+
get: function () { return chunk67OV5CX2_cjs.AlreadyInitializedError; }
|
|
581
581
|
});
|
|
582
582
|
Object.defineProperty(exports, "BatchTooLargeError", {
|
|
583
583
|
enumerable: true,
|
|
584
|
-
get: function () { return
|
|
584
|
+
get: function () { return chunk67OV5CX2_cjs.BatchTooLargeError; }
|
|
585
585
|
});
|
|
586
586
|
Object.defineProperty(exports, "ContractRevertError", {
|
|
587
587
|
enumerable: true,
|
|
588
|
-
get: function () { return
|
|
588
|
+
get: function () { return chunk67OV5CX2_cjs.ContractRevertError; }
|
|
589
589
|
});
|
|
590
590
|
Object.defineProperty(exports, "DecryptionFailedError", {
|
|
591
591
|
enumerable: true,
|
|
592
|
-
get: function () { return
|
|
592
|
+
get: function () { return chunk67OV5CX2_cjs.DecryptionFailedError; }
|
|
593
593
|
});
|
|
594
594
|
Object.defineProperty(exports, "DeploymentAddressUnavailableError", {
|
|
595
595
|
enumerable: true,
|
|
596
|
-
get: function () { return
|
|
596
|
+
get: function () { return chunk67OV5CX2_cjs.DeploymentAddressUnavailableError; }
|
|
597
597
|
});
|
|
598
598
|
Object.defineProperty(exports, "EncryptionFailedError", {
|
|
599
599
|
enumerable: true,
|
|
600
|
-
get: function () { return
|
|
600
|
+
get: function () { return chunk67OV5CX2_cjs.EncryptionFailedError; }
|
|
601
601
|
});
|
|
602
602
|
Object.defineProperty(exports, "FeatureDisabledError", {
|
|
603
603
|
enumerable: true,
|
|
604
|
-
get: function () { return
|
|
604
|
+
get: function () { return chunk67OV5CX2_cjs.FeatureDisabledError; }
|
|
605
605
|
});
|
|
606
606
|
Object.defineProperty(exports, "FheHandleNotAllowedError", {
|
|
607
607
|
enumerable: true,
|
|
608
|
-
get: function () { return
|
|
608
|
+
get: function () { return chunk67OV5CX2_cjs.FheHandleNotAllowedError; }
|
|
609
609
|
});
|
|
610
610
|
Object.defineProperty(exports, "InsufficientBalanceError", {
|
|
611
611
|
enumerable: true,
|
|
612
|
-
get: function () { return
|
|
612
|
+
get: function () { return chunk67OV5CX2_cjs.InsufficientBalanceError; }
|
|
613
613
|
});
|
|
614
614
|
Object.defineProperty(exports, "InsufficientFeeError", {
|
|
615
615
|
enumerable: true,
|
|
616
|
-
get: function () { return
|
|
616
|
+
get: function () { return chunk67OV5CX2_cjs.InsufficientFeeError; }
|
|
617
617
|
});
|
|
618
618
|
Object.defineProperty(exports, "InsufficientGasFundsError", {
|
|
619
619
|
enumerable: true,
|
|
620
|
-
get: function () { return
|
|
620
|
+
get: function () { return chunk67OV5CX2_cjs.InsufficientGasFundsError; }
|
|
621
621
|
});
|
|
622
622
|
Object.defineProperty(exports, "InvalidArgumentError", {
|
|
623
623
|
enumerable: true,
|
|
624
|
-
get: function () { return
|
|
624
|
+
get: function () { return chunk67OV5CX2_cjs.InvalidArgumentError; }
|
|
625
625
|
});
|
|
626
626
|
Object.defineProperty(exports, "InvalidSignatureError", {
|
|
627
627
|
enumerable: true,
|
|
628
|
-
get: function () { return
|
|
628
|
+
get: function () { return chunk67OV5CX2_cjs.InvalidSignatureError; }
|
|
629
629
|
});
|
|
630
630
|
Object.defineProperty(exports, "MissingAccountError", {
|
|
631
631
|
enumerable: true,
|
|
632
|
-
get: function () { return
|
|
632
|
+
get: function () { return chunk67OV5CX2_cjs.MissingAccountError; }
|
|
633
633
|
});
|
|
634
634
|
Object.defineProperty(exports, "MissingClientError", {
|
|
635
635
|
enumerable: true,
|
|
636
|
-
get: function () { return
|
|
636
|
+
get: function () { return chunk67OV5CX2_cjs.MissingClientError; }
|
|
637
637
|
});
|
|
638
638
|
Object.defineProperty(exports, "MissingEncryptorError", {
|
|
639
639
|
enumerable: true,
|
|
640
|
-
get: function () { return
|
|
640
|
+
get: function () { return chunk67OV5CX2_cjs.MissingEncryptorError; }
|
|
641
641
|
});
|
|
642
642
|
Object.defineProperty(exports, "MissingPublicClientError", {
|
|
643
643
|
enumerable: true,
|
|
644
|
-
get: function () { return
|
|
644
|
+
get: function () { return chunk67OV5CX2_cjs.MissingPublicClientError; }
|
|
645
645
|
});
|
|
646
646
|
Object.defineProperty(exports, "MissingWalletClientError", {
|
|
647
647
|
enumerable: true,
|
|
648
|
-
get: function () { return
|
|
648
|
+
get: function () { return chunk67OV5CX2_cjs.MissingWalletClientError; }
|
|
649
649
|
});
|
|
650
650
|
Object.defineProperty(exports, "NetworkError", {
|
|
651
651
|
enumerable: true,
|
|
652
|
-
get: function () { return
|
|
652
|
+
get: function () { return chunk67OV5CX2_cjs.NetworkError; }
|
|
653
|
+
});
|
|
654
|
+
Object.defineProperty(exports, "OperatorNotApprovedError", {
|
|
655
|
+
enumerable: true,
|
|
656
|
+
get: function () { return chunk67OV5CX2_cjs.OperatorNotApprovedError; }
|
|
653
657
|
});
|
|
654
658
|
Object.defineProperty(exports, "PausedError", {
|
|
655
659
|
enumerable: true,
|
|
656
|
-
get: function () { return
|
|
660
|
+
get: function () { return chunk67OV5CX2_cjs.PausedError; }
|
|
657
661
|
});
|
|
658
662
|
Object.defineProperty(exports, "ReceiptEventAmbiguousError", {
|
|
659
663
|
enumerable: true,
|
|
660
|
-
get: function () { return
|
|
664
|
+
get: function () { return chunk67OV5CX2_cjs.ReceiptEventAmbiguousError; }
|
|
661
665
|
});
|
|
662
666
|
Object.defineProperty(exports, "ReceiptEventNotFoundError", {
|
|
663
667
|
enumerable: true,
|
|
664
|
-
get: function () { return
|
|
668
|
+
get: function () { return chunk67OV5CX2_cjs.ReceiptEventNotFoundError; }
|
|
665
669
|
});
|
|
666
670
|
Object.defineProperty(exports, "ReentrancyError", {
|
|
667
671
|
enumerable: true,
|
|
668
|
-
get: function () { return
|
|
672
|
+
get: function () { return chunk67OV5CX2_cjs.ReentrancyError; }
|
|
669
673
|
});
|
|
670
674
|
Object.defineProperty(exports, "RelayerUnreachableError", {
|
|
671
675
|
enumerable: true,
|
|
672
|
-
get: function () { return
|
|
676
|
+
get: function () { return chunk67OV5CX2_cjs.RelayerUnreachableError; }
|
|
673
677
|
});
|
|
674
678
|
Object.defineProperty(exports, "SigningFailedError", {
|
|
675
679
|
enumerable: true,
|
|
676
|
-
get: function () { return
|
|
680
|
+
get: function () { return chunk67OV5CX2_cjs.SigningFailedError; }
|
|
677
681
|
});
|
|
678
682
|
Object.defineProperty(exports, "TokenOpsSdkError", {
|
|
679
683
|
enumerable: true,
|
|
680
|
-
get: function () { return
|
|
684
|
+
get: function () { return chunk67OV5CX2_cjs.TokenOpsSdkError; }
|
|
681
685
|
});
|
|
682
686
|
Object.defineProperty(exports, "TransferFailedError", {
|
|
683
687
|
enumerable: true,
|
|
684
|
-
get: function () { return
|
|
688
|
+
get: function () { return chunk67OV5CX2_cjs.TransferFailedError; }
|
|
685
689
|
});
|
|
686
690
|
Object.defineProperty(exports, "UnknownWriteFailureError", {
|
|
687
691
|
enumerable: true,
|
|
688
|
-
get: function () { return
|
|
692
|
+
get: function () { return chunk67OV5CX2_cjs.UnknownWriteFailureError; }
|
|
689
693
|
});
|
|
690
694
|
Object.defineProperty(exports, "UnsupportedChainError", {
|
|
691
695
|
enumerable: true,
|
|
692
|
-
get: function () { return
|
|
696
|
+
get: function () { return chunk67OV5CX2_cjs.UnsupportedChainError; }
|
|
693
697
|
});
|
|
694
698
|
Object.defineProperty(exports, "UserDecryptNotAllowedError", {
|
|
695
699
|
enumerable: true,
|
|
696
|
-
get: function () { return
|
|
700
|
+
get: function () { return chunk67OV5CX2_cjs.UserDecryptNotAllowedError; }
|
|
697
701
|
});
|
|
698
702
|
Object.defineProperty(exports, "UserRejectedSignatureError", {
|
|
699
703
|
enumerable: true,
|
|
700
|
-
get: function () { return
|
|
704
|
+
get: function () { return chunk67OV5CX2_cjs.UserRejectedSignatureError; }
|
|
701
705
|
});
|
|
702
706
|
Object.defineProperty(exports, "WalletChainMismatchError", {
|
|
703
707
|
enumerable: true,
|
|
704
|
-
get: function () { return
|
|
708
|
+
get: function () { return chunk67OV5CX2_cjs.WalletChainMismatchError; }
|
|
705
709
|
});
|
|
706
710
|
Object.defineProperty(exports, "WalletRejectedError", {
|
|
707
711
|
enumerable: true,
|
|
708
|
-
get: function () { return
|
|
712
|
+
get: function () { return chunk67OV5CX2_cjs.WalletRejectedError; }
|
|
709
713
|
});
|
|
710
714
|
Object.defineProperty(exports, "isTokenOpsSdkError", {
|
|
711
715
|
enumerable: true,
|
|
712
|
-
get: function () { return
|
|
716
|
+
get: function () { return chunk67OV5CX2_cjs.isTokenOpsSdkError; }
|
|
713
717
|
});
|
|
714
718
|
exports.FHE_DISPERSE_KEY = FHE_DISPERSE_KEY;
|
|
715
719
|
exports.FHE_DISPERSE_NAMESPACE = FHE_DISPERSE_NAMESPACE;
|
|
@@ -77,6 +77,6 @@ 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
82
|
export { NotRegisteredError, AlreadyRegisteredError } from "../errors.js";
|
|
@@ -77,6 +77,6 @@ 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
82
|
export { NotRegisteredError, AlreadyRegisteredError } from "../errors.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
-
import '../../chunk-
|
|
1
|
+
import { resolveEncryptor, createConfidentialDisperseClient } from '../../chunk-2PWNH3UE.js';
|
|
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-2PWNH3UE.js';
|
|
3
|
+
import '../../chunk-6BMP4ICG.js';
|
|
4
|
+
import '../../chunk-WMACINXO.js';
|
|
5
|
+
import '../../chunk-ZWXJTBZO.js';
|
|
4
6
|
import '../../chunk-7VELUOMI.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import { getFheDisperseSingletonAddress } from '../../chunk-M7V2EDPB.js';
|
|
9
|
-
import '../../chunk-BE2AIZ3K.js';
|
|
7
|
+
import '../../chunk-SG65XWH7.js';
|
|
8
|
+
import { getFheDisperseSingletonAddress } from '../../chunk-XGGTQQFH.js';
|
|
9
|
+
import '../../chunk-ZA673I3O.js';
|
|
10
10
|
import '../../chunk-Q2GP5UDC.js';
|
|
11
11
|
import '../../chunk-KWFFIJYX.js';
|
|
12
|
-
import { MissingClientError, DeploymentAddressUnavailableError } from '../../chunk-
|
|
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-
|
|
12
|
+
import { MissingClientError, DeploymentAddressUnavailableError } from '../../chunk-QBJ7O2B4.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-QBJ7O2B4.js';
|
|
14
14
|
import { useQuery, useMutation } from '@tanstack/react-query';
|
|
15
15
|
import { useRef, useMemo } from 'react';
|
|
16
16
|
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();
|
|
@@ -19,6 +19,13 @@ export interface UsePreflightDisperseArgs extends BaseHookOptions {
|
|
|
19
19
|
* Hook is disabled until `user`, `token`, `recipients`, `amounts`, and `mode`
|
|
20
20
|
* are all set.
|
|
21
21
|
*
|
|
22
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
23
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
24
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
25
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
26
|
+
* transparent TTT test token uses 18 decimals. Pass `amounts[]` in the same
|
|
27
|
+
* units you will pass to `useDisperse` so the report reflects the real call.
|
|
28
|
+
*
|
|
22
29
|
* For live dashboards, set `refetchInterval` so the report stays current as
|
|
23
30
|
* the user toggles approvals in a wallet UI:
|
|
24
31
|
*
|