@tokenops/sdk 2.0.0-alpha.1 → 2.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +5 -5
- package/dist/{chunk-JZLGCTGK.cjs → chunk-3YHBO2DL.cjs} +2 -2
- package/dist/{chunk-H5POPGOZ.js → chunk-44YJPMQC.js} +1 -1
- package/dist/{chunk-DZHYSUGY.js → chunk-A4DCEE33.js} +11 -5
- package/dist/{chunk-M4IT6DNJ.cjs → chunk-AREQJHKA.cjs} +108 -3
- package/dist/chunk-EBLBPUPI.cjs +255 -0
- package/dist/chunk-EYDA6Q6C.js +245 -0
- package/dist/{chunk-XAYGD4E4.cjs → chunk-FEDX7B6T.cjs} +3 -3
- package/dist/{chunk-JQYC66TO.cjs → chunk-FHWSBGWE.cjs} +5 -5
- package/dist/{chunk-5576FRT3.cjs → chunk-FT5H2Q7Y.cjs} +11 -5
- package/dist/{chunk-456VDDA3.js → chunk-GADGBQJO.js} +78 -25
- package/dist/{chunk-6NAVMWZQ.js → chunk-IGO5XSPS.js} +2 -2
- package/dist/{chunk-CTED3MTR.cjs → chunk-IUKKNJ2R.cjs} +82 -29
- package/dist/{chunk-FGEB7RMY.cjs → chunk-MM5BV5CS.cjs} +4 -4
- package/dist/{chunk-335Z2W67.js → chunk-PYYSB5ZN.js} +1 -1
- package/dist/{chunk-PUX5VXDB.cjs → chunk-PZZK3O3S.cjs} +1040 -42
- package/dist/{chunk-74QFZ5MK.js → chunk-SPLNGUFF.js} +1 -1
- package/dist/{chunk-6PXXGACR.cjs → chunk-UHHMVBLU.cjs} +2 -2
- package/dist/{chunk-O5676ZWY.js → chunk-VW356KR3.js} +108 -5
- package/dist/{chunk-EAJ7SYHE.js → chunk-WJMEBBU7.js} +1 -1
- package/dist/{chunk-GKKDAW44.js → chunk-X7WBPCEU.js} +1026 -32
- package/dist/core/addresses.d.ts +4 -4
- package/dist/core/errors.d.ts +1 -1
- package/dist/fhe/types.d.ts +2 -2
- package/dist/fhe-airdrop/abis/merkle.d.ts +24 -12
- package/dist/fhe-airdrop/advanced/index.cjs +4 -4
- package/dist/fhe-airdrop/advanced/index.js +1 -1
- package/dist/fhe-airdrop/advanced/react/index.cjs +590 -9
- package/dist/fhe-airdrop/advanced/react/index.d.cts +34 -0
- package/dist/fhe-airdrop/advanced/react/index.d.ts +34 -0
- package/dist/fhe-airdrop/advanced/react/index.js +561 -7
- package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
- package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +35 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +47 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
- package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +28 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
- package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
- package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
- package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
- package/dist/fhe-airdrop/airdrop-base.d.ts +8 -0
- package/dist/fhe-airdrop/campaign.d.ts +61 -20
- package/dist/fhe-airdrop/constants.d.ts +1 -1
- package/dist/fhe-airdrop/errors.d.ts +28 -0
- package/dist/fhe-airdrop/guards.d.ts +46 -2
- package/dist/fhe-airdrop/index.cjs +74 -971
- package/dist/fhe-airdrop/index.d.cts +2 -2
- package/dist/fhe-airdrop/index.d.ts +2 -2
- package/dist/fhe-airdrop/index.js +8 -927
- package/dist/fhe-airdrop/merkle-tree.d.ts +32 -38
- package/dist/fhe-airdrop/merkle.d.ts +52 -31
- package/dist/fhe-airdrop/react/_shared.d.ts +13 -0
- package/dist/fhe-airdrop/react/index.cjs +934 -84
- package/dist/fhe-airdrop/react/index.d.cts +49 -3
- package/dist/fhe-airdrop/react/index.d.ts +49 -3
- package/dist/fhe-airdrop/react/index.js +825 -22
- package/dist/fhe-airdrop/react/keys.d.ts +90 -0
- package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
- package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
- package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
- package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +35 -0
- package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +33 -0
- package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
- package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
- package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
- package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
- package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
- package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
- package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
- package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
- package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
- package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
- package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
- package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
- package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
- package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
- package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
- package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
- package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +4 -3
- package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
- package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
- package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
- package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
- package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
- package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
- package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
- package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +7 -19
- package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
- package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
- package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +67 -0
- package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
- package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
- package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
- package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +42 -0
- package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
- package/dist/fhe-airdrop/types.d.ts +14 -1
- package/dist/fhe-disperse/index.cjs +21 -21
- package/dist/fhe-disperse/index.js +2 -2
- package/dist/fhe-disperse/react/index.cjs +22 -22
- package/dist/fhe-disperse/react/index.js +3 -3
- package/dist/fhe-vesting/advanced/index.cjs +5 -5
- package/dist/fhe-vesting/advanced/index.js +3 -3
- package/dist/fhe-vesting/advanced/react/index.cjs +7 -7
- package/dist/fhe-vesting/advanced/react/index.js +4 -4
- package/dist/fhe-vesting/index.cjs +8 -8
- package/dist/fhe-vesting/index.js +2 -2
- package/dist/fhe-vesting/react/index.cjs +114 -114
- package/dist/fhe-vesting/react/index.js +3 -3
- package/dist/index.cjs +18 -18
- package/dist/index.js +1 -1
- package/dist/testnet-faucet/index.cjs +14 -14
- package/dist/testnet-faucet/index.js +2 -2
- package/dist/testnet-faucet/react/index.cjs +8 -8
- package/dist/testnet-faucet/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-NCVX3K2N.cjs +0 -161
- package/dist/chunk-VP2B4WM2.js +0 -154
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../../chunk-
|
|
5
|
-
require('../../../chunk-
|
|
3
|
+
var chunkEBLBPUPI_cjs = require('../../../chunk-EBLBPUPI.cjs');
|
|
4
|
+
require('../../../chunk-PZZK3O3S.cjs');
|
|
5
|
+
require('../../../chunk-AREQJHKA.cjs');
|
|
6
6
|
require('../../../chunk-FAXIIH5R.cjs');
|
|
7
7
|
require('../../../chunk-UG5RKLU2.cjs');
|
|
8
8
|
require('../../../chunk-MVDQMV25.cjs');
|
|
9
|
-
require('../../../chunk-
|
|
9
|
+
require('../../../chunk-FT5H2Q7Y.cjs');
|
|
10
10
|
require('../../../chunk-JK4XMMKM.cjs');
|
|
11
11
|
require('../../../chunk-66IHPTOK.cjs');
|
|
12
|
-
require('../../../chunk-67OV5CX2.cjs');
|
|
12
|
+
var chunk67OV5CX2_cjs = require('../../../chunk-67OV5CX2.cjs');
|
|
13
13
|
require('../../../chunk-VJKZWYYJ.cjs');
|
|
14
14
|
var reactQuery = require('@tanstack/react-query');
|
|
15
15
|
|
|
16
16
|
function usePredictEcdsaAirdropAddress(args) {
|
|
17
17
|
const { params, mode, deployer, userSalt, ...base } = args;
|
|
18
|
-
const { client, chainId, resolvedAddress } =
|
|
18
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
19
19
|
return reactQuery.useQuery({
|
|
20
20
|
...args.query,
|
|
21
|
-
queryKey:
|
|
21
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
22
22
|
chainId,
|
|
23
23
|
address: resolvedAddress,
|
|
24
24
|
fn: "predictEcdsaAirdropAddress",
|
|
@@ -30,10 +30,10 @@ function usePredictEcdsaAirdropAddress(args) {
|
|
|
30
30
|
}
|
|
31
31
|
function usePredictMerkleAirdropAddress(args) {
|
|
32
32
|
const { params, mode, deployer, userSalt, ...base } = args;
|
|
33
|
-
const { client, chainId, resolvedAddress } =
|
|
33
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
34
34
|
return reactQuery.useQuery({
|
|
35
35
|
...args.query,
|
|
36
|
-
queryKey:
|
|
36
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
37
37
|
chainId,
|
|
38
38
|
address: resolvedAddress,
|
|
39
39
|
fn: "predictMerkleAirdropAddress",
|
|
@@ -43,6 +43,587 @@ function usePredictMerkleAirdropAddress(args) {
|
|
|
43
43
|
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
function useClearCompliancePolicy(options = {}) {
|
|
47
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
48
|
+
const queryClient = reactQuery.useQueryClient();
|
|
49
|
+
return reactQuery.useMutation({
|
|
50
|
+
mutationFn: async (args) => {
|
|
51
|
+
if (!client) {
|
|
52
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useClearCompliancePolicy", "factory");
|
|
53
|
+
}
|
|
54
|
+
return client.clearCompliancePolicy(args.creator, args.account);
|
|
55
|
+
},
|
|
56
|
+
onSuccess: (_hash, variables) => {
|
|
57
|
+
const scope = { chainId, address: resolvedAddress };
|
|
58
|
+
void queryClient.invalidateQueries({
|
|
59
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.compliancePolicy(scope, variables.creator)
|
|
60
|
+
});
|
|
61
|
+
void queryClient.invalidateQueries({
|
|
62
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
63
|
+
...scope,
|
|
64
|
+
fn: "effectiveDelegateToCompliance",
|
|
65
|
+
args: [variables.creator]
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function useClearUpgradeabilityPolicy(options = {}) {
|
|
72
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
73
|
+
const queryClient = reactQuery.useQueryClient();
|
|
74
|
+
return reactQuery.useMutation({
|
|
75
|
+
mutationFn: async (args) => {
|
|
76
|
+
if (!client) {
|
|
77
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useClearUpgradeabilityPolicy", "factory");
|
|
78
|
+
}
|
|
79
|
+
return client.clearUpgradeabilityPolicy(args.creator, args.account);
|
|
80
|
+
},
|
|
81
|
+
onSuccess: (_hash, variables) => {
|
|
82
|
+
const scope = { chainId, address: resolvedAddress };
|
|
83
|
+
void queryClient.invalidateQueries({
|
|
84
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
85
|
+
...scope,
|
|
86
|
+
fn: "effectiveUpgradeable",
|
|
87
|
+
args: [variables.creator]
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
void queryClient.invalidateQueries({
|
|
91
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.upgradeabilityPolicy(scope, variables.creator)
|
|
92
|
+
});
|
|
93
|
+
void queryClient.invalidateQueries({
|
|
94
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.preflightCreateAll(scope)
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function useDisableCustomFee(options = {}) {
|
|
100
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
101
|
+
const queryClient = reactQuery.useQueryClient();
|
|
102
|
+
return reactQuery.useMutation({
|
|
103
|
+
mutationFn: async ({ creator, account }) => {
|
|
104
|
+
if (!client) {
|
|
105
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useDisableCustomFee", "factory");
|
|
106
|
+
}
|
|
107
|
+
return client.disableCustomFee(creator, account);
|
|
108
|
+
},
|
|
109
|
+
onSuccess: (_hash, variables) => {
|
|
110
|
+
void queryClient.invalidateQueries({
|
|
111
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.customFee({ chainId, address: resolvedAddress }, variables.creator)
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function useEcdsaInitCodeHash(args) {
|
|
117
|
+
const { params, mode, ...base } = args;
|
|
118
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
119
|
+
return reactQuery.useQuery({
|
|
120
|
+
...args.query,
|
|
121
|
+
// `params` is omitted for the same reason the predict hooks omit it: the
|
|
122
|
+
// ABI demands it but the factory ignores it, so only `mode` (plus the
|
|
123
|
+
// implementation pointer, which is what this read reports) moves the
|
|
124
|
+
// result. If a future factory version makes params hash-affecting, this
|
|
125
|
+
// key has to grow with it.
|
|
126
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
127
|
+
chainId,
|
|
128
|
+
address: resolvedAddress,
|
|
129
|
+
fn: "getEcdsaInitCodeHash",
|
|
130
|
+
args: [mode]
|
|
131
|
+
}),
|
|
132
|
+
queryFn: () => client.getEcdsaInitCodeHash({ params, mode }),
|
|
133
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function useFactoryComplianceDelegate(args = {}) {
|
|
137
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(args);
|
|
138
|
+
return reactQuery.useQuery({
|
|
139
|
+
...args.query,
|
|
140
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
141
|
+
chainId,
|
|
142
|
+
address: resolvedAddress,
|
|
143
|
+
fn: "complianceDelegate",
|
|
144
|
+
args: []
|
|
145
|
+
}),
|
|
146
|
+
queryFn: () => client.complianceDelegate(),
|
|
147
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function useFactoryCompliancePolicy(args = {}) {
|
|
151
|
+
const { creator, ...base } = args;
|
|
152
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
153
|
+
return reactQuery.useQuery({
|
|
154
|
+
...args.query,
|
|
155
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.compliancePolicy({ chainId, address: resolvedAddress }, creator),
|
|
156
|
+
queryFn: async () => {
|
|
157
|
+
const [policy, effective] = await Promise.all([
|
|
158
|
+
client.getCompliancePolicy(creator),
|
|
159
|
+
client.effectiveDelegateToCompliance(creator)
|
|
160
|
+
]);
|
|
161
|
+
return {
|
|
162
|
+
overridden: policy.overridden,
|
|
163
|
+
delegateToCompliance: policy.delegateToCompliance,
|
|
164
|
+
effective
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
enabled: Boolean(client && creator && (args.query?.enabled ?? true))
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function useFactoryCustomFee(args = {}) {
|
|
171
|
+
const { creator, ...base } = args;
|
|
172
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
173
|
+
return reactQuery.useQuery({
|
|
174
|
+
...args.query,
|
|
175
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.customFee({ chainId, address: resolvedAddress }, creator),
|
|
176
|
+
queryFn: () => client.getCustomFee(creator),
|
|
177
|
+
enabled: Boolean(client && creator && (args.query?.enabled ?? true))
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function useFactoryGrantRole(options = {}) {
|
|
181
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
182
|
+
const queryClient = reactQuery.useQueryClient();
|
|
183
|
+
return reactQuery.useMutation({
|
|
184
|
+
mutationFn: async (args) => {
|
|
185
|
+
if (!client) {
|
|
186
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useFactoryGrantRole", "factory");
|
|
187
|
+
}
|
|
188
|
+
return client.grantRole(args);
|
|
189
|
+
},
|
|
190
|
+
onSuccess: (_hash, variables) => {
|
|
191
|
+
const scope = { chainId, address: resolvedAddress };
|
|
192
|
+
void queryClient.invalidateQueries({
|
|
193
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryHasRole(scope, variables.role, variables.holder)
|
|
194
|
+
});
|
|
195
|
+
void queryClient.invalidateQueries({
|
|
196
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryRoleMembers(scope, variables.role)
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function useFactoryHasRole(args = {}) {
|
|
202
|
+
const { role, holder, ...base } = args;
|
|
203
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
204
|
+
return reactQuery.useQuery({
|
|
205
|
+
...args.query,
|
|
206
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryHasRole({ chainId, address: resolvedAddress }, role, holder),
|
|
207
|
+
queryFn: () => client.hasRole({ role, holder }),
|
|
208
|
+
enabled: Boolean(client && role && holder && (args.query?.enabled ?? true))
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function useFactoryImplementations(args = {}) {
|
|
212
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(args);
|
|
213
|
+
return reactQuery.useQuery({
|
|
214
|
+
...args.query,
|
|
215
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.implementations({ chainId, address: resolvedAddress }),
|
|
216
|
+
queryFn: async () => {
|
|
217
|
+
const [ecdsa, merkle, complianceManager] = await Promise.all([
|
|
218
|
+
client.ecdsaImplementation(),
|
|
219
|
+
client.merkleImplementation(),
|
|
220
|
+
client.complianceManagerImpl()
|
|
221
|
+
]);
|
|
222
|
+
return { ecdsa, merkle, complianceManager };
|
|
223
|
+
},
|
|
224
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function useFactoryRenounceRole(options = {}) {
|
|
228
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
229
|
+
const queryClient = reactQuery.useQueryClient();
|
|
230
|
+
return reactQuery.useMutation({
|
|
231
|
+
mutationFn: async (args) => {
|
|
232
|
+
if (!client) {
|
|
233
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useFactoryRenounceRole", "factory");
|
|
234
|
+
}
|
|
235
|
+
return client.renounceRole(args);
|
|
236
|
+
},
|
|
237
|
+
onSuccess: (_hash, variables) => {
|
|
238
|
+
const scope = { chainId, address: resolvedAddress };
|
|
239
|
+
void queryClient.invalidateQueries({ queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryHasRoleAll(scope) });
|
|
240
|
+
void queryClient.invalidateQueries({
|
|
241
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryRoleMembers(scope, variables.role)
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function useFactoryRevokeRole(options = {}) {
|
|
247
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
248
|
+
const queryClient = reactQuery.useQueryClient();
|
|
249
|
+
return reactQuery.useMutation({
|
|
250
|
+
mutationFn: async (args) => {
|
|
251
|
+
if (!client) {
|
|
252
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useFactoryRevokeRole", "factory");
|
|
253
|
+
}
|
|
254
|
+
return client.revokeRole(args);
|
|
255
|
+
},
|
|
256
|
+
onSuccess: (_hash, variables) => {
|
|
257
|
+
const scope = { chainId, address: resolvedAddress };
|
|
258
|
+
void queryClient.invalidateQueries({
|
|
259
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryHasRole(scope, variables.role, variables.holder)
|
|
260
|
+
});
|
|
261
|
+
void queryClient.invalidateQueries({
|
|
262
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryRoleMembers(scope, variables.role)
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function useFactoryRoleConstants(args = {}) {
|
|
268
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(args);
|
|
269
|
+
return reactQuery.useQuery({
|
|
270
|
+
// A default, not a lock: `query.staleTime` still wins if a consumer wants refetching.
|
|
271
|
+
staleTime: Infinity,
|
|
272
|
+
...args.query,
|
|
273
|
+
// `fn` label is unique to this hook, so it stays inline rather than in keys.ts.
|
|
274
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
275
|
+
chainId,
|
|
276
|
+
address: resolvedAddress,
|
|
277
|
+
fn: "factoryRoleConstants",
|
|
278
|
+
args: []
|
|
279
|
+
}),
|
|
280
|
+
queryFn: async () => {
|
|
281
|
+
const [
|
|
282
|
+
FEE_MANAGER_ROLE,
|
|
283
|
+
IMPL_MANAGER_ROLE,
|
|
284
|
+
COMPLIANCE_WIRING_ROLE,
|
|
285
|
+
UPGRADE_MANAGER_ROLE,
|
|
286
|
+
DEFAULT_ADMIN_ROLE
|
|
287
|
+
] = await Promise.all([
|
|
288
|
+
client.FEE_MANAGER_ROLE(),
|
|
289
|
+
client.IMPL_MANAGER_ROLE(),
|
|
290
|
+
client.COMPLIANCE_WIRING_ROLE(),
|
|
291
|
+
client.UPGRADE_MANAGER_ROLE(),
|
|
292
|
+
client.DEFAULT_ADMIN_ROLE()
|
|
293
|
+
]);
|
|
294
|
+
return {
|
|
295
|
+
FEE_MANAGER_ROLE,
|
|
296
|
+
IMPL_MANAGER_ROLE,
|
|
297
|
+
COMPLIANCE_WIRING_ROLE,
|
|
298
|
+
UPGRADE_MANAGER_ROLE,
|
|
299
|
+
DEFAULT_ADMIN_ROLE
|
|
300
|
+
};
|
|
301
|
+
},
|
|
302
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function useFactoryRoleMembers(args = {}) {
|
|
306
|
+
const { role, ...base } = args;
|
|
307
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
308
|
+
return reactQuery.useQuery({
|
|
309
|
+
...args.query,
|
|
310
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.factoryRoleMembers({ chainId, address: resolvedAddress }, role),
|
|
311
|
+
queryFn: async () => {
|
|
312
|
+
const [members, count] = await Promise.all([
|
|
313
|
+
client.getRoleMembers(role),
|
|
314
|
+
client.getRoleMemberCount(role)
|
|
315
|
+
]);
|
|
316
|
+
return { members, count };
|
|
317
|
+
},
|
|
318
|
+
enabled: Boolean(client && role && (args.query?.enabled ?? true))
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function useFactoryUpgradeabilityPolicy(args = {}) {
|
|
322
|
+
const { creator, ...base } = args;
|
|
323
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
324
|
+
return reactQuery.useQuery({
|
|
325
|
+
...args.query,
|
|
326
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.upgradeabilityPolicy({ chainId, address: resolvedAddress }, creator),
|
|
327
|
+
queryFn: async () => {
|
|
328
|
+
const [defaultUpgradeable, policy, effective] = await Promise.all([
|
|
329
|
+
client.defaultUpgradeable(),
|
|
330
|
+
client.getUpgradeabilityPolicy(creator),
|
|
331
|
+
client.effectiveUpgradeable(creator)
|
|
332
|
+
]);
|
|
333
|
+
return {
|
|
334
|
+
defaultUpgradeable,
|
|
335
|
+
overridden: policy.overridden,
|
|
336
|
+
allowed: policy.allowed,
|
|
337
|
+
effective
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
enabled: Boolean(client && creator && (args.query?.enabled ?? true))
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
function useMerkleInitCodeHash(args) {
|
|
344
|
+
const { params, mode, ...base } = args;
|
|
345
|
+
const { client, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(base);
|
|
346
|
+
return reactQuery.useQuery({
|
|
347
|
+
...args.query,
|
|
348
|
+
// `params` omitted deliberately — see useEcdsaInitCodeHash for why.
|
|
349
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
350
|
+
chainId,
|
|
351
|
+
address: resolvedAddress,
|
|
352
|
+
fn: "getMerkleInitCodeHash",
|
|
353
|
+
args: [mode]
|
|
354
|
+
}),
|
|
355
|
+
queryFn: () => client.getMerkleInitCodeHash({ params, mode }),
|
|
356
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
function useSetComplianceDelegate(options = {}) {
|
|
360
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
361
|
+
const queryClient = reactQuery.useQueryClient();
|
|
362
|
+
return reactQuery.useMutation({
|
|
363
|
+
mutationFn: async (args) => {
|
|
364
|
+
if (!client) {
|
|
365
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetComplianceDelegate", "factory");
|
|
366
|
+
}
|
|
367
|
+
return client.setComplianceDelegate(args.delegate, args.account);
|
|
368
|
+
},
|
|
369
|
+
onSuccess: () => {
|
|
370
|
+
void queryClient.invalidateQueries({
|
|
371
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
372
|
+
chainId,
|
|
373
|
+
address: resolvedAddress,
|
|
374
|
+
fn: "complianceDelegate",
|
|
375
|
+
args: []
|
|
376
|
+
})
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
function useSetComplianceManagerImpl(options = {}) {
|
|
382
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
383
|
+
const queryClient = reactQuery.useQueryClient();
|
|
384
|
+
return reactQuery.useMutation({
|
|
385
|
+
mutationFn: async (args) => {
|
|
386
|
+
if (!client) {
|
|
387
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetComplianceManagerImpl", "factory");
|
|
388
|
+
}
|
|
389
|
+
return client.setComplianceManagerImpl(args.implementation, args.account);
|
|
390
|
+
},
|
|
391
|
+
onSuccess: () => {
|
|
392
|
+
void queryClient.invalidateQueries({
|
|
393
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.implementations({ chainId, address: resolvedAddress })
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function useSetCompliancePolicy(options = {}) {
|
|
399
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
400
|
+
const queryClient = reactQuery.useQueryClient();
|
|
401
|
+
return reactQuery.useMutation({
|
|
402
|
+
mutationFn: async (args) => {
|
|
403
|
+
if (!client) {
|
|
404
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetCompliancePolicy", "factory");
|
|
405
|
+
}
|
|
406
|
+
return client.setCompliancePolicy(args.creator, args.delegateToCompliance, args.account);
|
|
407
|
+
},
|
|
408
|
+
onSuccess: (_hash, variables) => {
|
|
409
|
+
const scope = { chainId, address: resolvedAddress };
|
|
410
|
+
void queryClient.invalidateQueries({
|
|
411
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.compliancePolicy(scope, variables.creator)
|
|
412
|
+
});
|
|
413
|
+
void queryClient.invalidateQueries({
|
|
414
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
415
|
+
...scope,
|
|
416
|
+
fn: "effectiveDelegateToCompliance",
|
|
417
|
+
args: [variables.creator]
|
|
418
|
+
})
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
function useSetCustomFee(options = {}) {
|
|
424
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
425
|
+
const queryClient = reactQuery.useQueryClient();
|
|
426
|
+
return reactQuery.useMutation({
|
|
427
|
+
mutationFn: async ({ creator, gasFee, account }) => {
|
|
428
|
+
if (!client) {
|
|
429
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetCustomFee", "factory");
|
|
430
|
+
}
|
|
431
|
+
return client.setCustomFee(creator, gasFee, account);
|
|
432
|
+
},
|
|
433
|
+
onSuccess: (_hash, variables) => {
|
|
434
|
+
void queryClient.invalidateQueries({
|
|
435
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.customFee({ chainId, address: resolvedAddress }, variables.creator)
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function useSetDefaultDelegateToCompliance(options = {}) {
|
|
441
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
442
|
+
const queryClient = reactQuery.useQueryClient();
|
|
443
|
+
return reactQuery.useMutation({
|
|
444
|
+
mutationFn: async (args) => {
|
|
445
|
+
if (!client) {
|
|
446
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetDefaultDelegateToCompliance", "factory");
|
|
447
|
+
}
|
|
448
|
+
return client.setDefaultDelegateToCompliance(args.on, args.account);
|
|
449
|
+
},
|
|
450
|
+
onSuccess: () => {
|
|
451
|
+
void queryClient.invalidateQueries({
|
|
452
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKeyPrefix({
|
|
453
|
+
chainId,
|
|
454
|
+
address: resolvedAddress,
|
|
455
|
+
fn: "effectiveDelegateToCompliance"
|
|
456
|
+
})
|
|
457
|
+
});
|
|
458
|
+
void queryClient.invalidateQueries({
|
|
459
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.compliancePolicyAll({ chainId, address: resolvedAddress })
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
function useSetDefaultGasFee(options = {}) {
|
|
465
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
466
|
+
const queryClient = reactQuery.useQueryClient();
|
|
467
|
+
return reactQuery.useMutation({
|
|
468
|
+
mutationFn: async ({ gasFee, account }) => {
|
|
469
|
+
if (!client) {
|
|
470
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetDefaultGasFee", "factory");
|
|
471
|
+
}
|
|
472
|
+
return client.setDefaultGasFee(gasFee, account);
|
|
473
|
+
},
|
|
474
|
+
onSuccess: () => {
|
|
475
|
+
void queryClient.invalidateQueries({
|
|
476
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.fees({ chainId, address: resolvedAddress })
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
function useSetDefaultUpgradeable(options = {}) {
|
|
482
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
483
|
+
const queryClient = reactQuery.useQueryClient();
|
|
484
|
+
return reactQuery.useMutation({
|
|
485
|
+
mutationFn: async (args) => {
|
|
486
|
+
if (!client) {
|
|
487
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetDefaultUpgradeable", "factory");
|
|
488
|
+
}
|
|
489
|
+
return client.setDefaultUpgradeable(args.allowed, args.account);
|
|
490
|
+
},
|
|
491
|
+
onSuccess: () => {
|
|
492
|
+
const scope = { chainId, address: resolvedAddress };
|
|
493
|
+
void queryClient.invalidateQueries({
|
|
494
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKeyPrefix({ ...scope, fn: "effectiveUpgradeable" })
|
|
495
|
+
});
|
|
496
|
+
void queryClient.invalidateQueries({
|
|
497
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.upgradeabilityPolicyAll(scope)
|
|
498
|
+
});
|
|
499
|
+
void queryClient.invalidateQueries({
|
|
500
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.preflightCreateAll(scope)
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
function useSetEcdsaImplementation(options = {}) {
|
|
506
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
507
|
+
const queryClient = reactQuery.useQueryClient();
|
|
508
|
+
return reactQuery.useMutation({
|
|
509
|
+
mutationFn: async ({ implementation, account }) => {
|
|
510
|
+
if (!client) {
|
|
511
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetEcdsaImplementation", "factory");
|
|
512
|
+
}
|
|
513
|
+
return client.setEcdsaImplementation(implementation, account);
|
|
514
|
+
},
|
|
515
|
+
onSuccess: () => {
|
|
516
|
+
const scope = { chainId, address: resolvedAddress };
|
|
517
|
+
void queryClient.invalidateQueries({ queryKey: chunkEBLBPUPI_cjs.airdropKeys.implementations(scope) });
|
|
518
|
+
void queryClient.invalidateQueries({
|
|
519
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKeyPrefix({ ...scope, fn: "getEcdsaInitCodeHash" })
|
|
520
|
+
});
|
|
521
|
+
void queryClient.invalidateQueries({
|
|
522
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKeyPrefix({ ...scope, fn: "predictEcdsaAirdropAddress" })
|
|
523
|
+
});
|
|
524
|
+
void queryClient.invalidateQueries({
|
|
525
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.preflightCreateAll(scope)
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
function useSetFeeCollector(options = {}) {
|
|
531
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
532
|
+
const queryClient = reactQuery.useQueryClient();
|
|
533
|
+
return reactQuery.useMutation({
|
|
534
|
+
mutationFn: async ({ feeCollector, account }) => {
|
|
535
|
+
if (!client) {
|
|
536
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetFeeCollector", "factory");
|
|
537
|
+
}
|
|
538
|
+
return client.setFeeCollector(feeCollector, account);
|
|
539
|
+
},
|
|
540
|
+
onSuccess: () => {
|
|
541
|
+
void queryClient.invalidateQueries({
|
|
542
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.fees({ chainId, address: resolvedAddress })
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
function useSetMerkleImplementation(options = {}) {
|
|
548
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
549
|
+
const queryClient = reactQuery.useQueryClient();
|
|
550
|
+
return reactQuery.useMutation({
|
|
551
|
+
mutationFn: async ({ implementation, account }) => {
|
|
552
|
+
if (!client) {
|
|
553
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetMerkleImplementation", "factory");
|
|
554
|
+
}
|
|
555
|
+
return client.setMerkleImplementation(implementation, account);
|
|
556
|
+
},
|
|
557
|
+
onSuccess: () => {
|
|
558
|
+
const scope = { chainId, address: resolvedAddress };
|
|
559
|
+
void queryClient.invalidateQueries({ queryKey: chunkEBLBPUPI_cjs.airdropKeys.implementations(scope) });
|
|
560
|
+
void queryClient.invalidateQueries({
|
|
561
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKeyPrefix({ ...scope, fn: "getMerkleInitCodeHash" })
|
|
562
|
+
});
|
|
563
|
+
void queryClient.invalidateQueries({
|
|
564
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKeyPrefix({ ...scope, fn: "predictMerkleAirdropAddress" })
|
|
565
|
+
});
|
|
566
|
+
void queryClient.invalidateQueries({
|
|
567
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.preflightCreateAll(scope)
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
function useSetUpgradeabilityPolicy(options = {}) {
|
|
573
|
+
const { client, resolutionError, chainId, resolvedAddress } = chunkEBLBPUPI_cjs.useMemoAirdropFactoryClient(options);
|
|
574
|
+
const queryClient = reactQuery.useQueryClient();
|
|
575
|
+
return reactQuery.useMutation({
|
|
576
|
+
mutationFn: async (args) => {
|
|
577
|
+
if (!client) {
|
|
578
|
+
throw resolutionError ?? new chunk67OV5CX2_cjs.MissingClientError("useSetUpgradeabilityPolicy", "factory");
|
|
579
|
+
}
|
|
580
|
+
return client.setUpgradeabilityPolicy(args.creator, args.allowed, args.account);
|
|
581
|
+
},
|
|
582
|
+
onSuccess: (_hash, variables) => {
|
|
583
|
+
const scope = { chainId, address: resolvedAddress };
|
|
584
|
+
void queryClient.invalidateQueries({
|
|
585
|
+
queryKey: chunkEBLBPUPI_cjs.airdropQueryKey({
|
|
586
|
+
...scope,
|
|
587
|
+
fn: "effectiveUpgradeable",
|
|
588
|
+
args: [variables.creator]
|
|
589
|
+
})
|
|
590
|
+
});
|
|
591
|
+
void queryClient.invalidateQueries({
|
|
592
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.upgradeabilityPolicy(scope, variables.creator)
|
|
593
|
+
});
|
|
594
|
+
void queryClient.invalidateQueries({
|
|
595
|
+
queryKey: chunkEBLBPUPI_cjs.airdropKeys.preflightCreateAll(scope)
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
}
|
|
46
600
|
|
|
601
|
+
exports.useClearCompliancePolicy = useClearCompliancePolicy;
|
|
602
|
+
exports.useClearUpgradeabilityPolicy = useClearUpgradeabilityPolicy;
|
|
603
|
+
exports.useDisableCustomFee = useDisableCustomFee;
|
|
604
|
+
exports.useEcdsaInitCodeHash = useEcdsaInitCodeHash;
|
|
605
|
+
exports.useFactoryComplianceDelegate = useFactoryComplianceDelegate;
|
|
606
|
+
exports.useFactoryCompliancePolicy = useFactoryCompliancePolicy;
|
|
607
|
+
exports.useFactoryCustomFee = useFactoryCustomFee;
|
|
608
|
+
exports.useFactoryGrantRole = useFactoryGrantRole;
|
|
609
|
+
exports.useFactoryHasRole = useFactoryHasRole;
|
|
610
|
+
exports.useFactoryImplementations = useFactoryImplementations;
|
|
611
|
+
exports.useFactoryRenounceRole = useFactoryRenounceRole;
|
|
612
|
+
exports.useFactoryRevokeRole = useFactoryRevokeRole;
|
|
613
|
+
exports.useFactoryRoleConstants = useFactoryRoleConstants;
|
|
614
|
+
exports.useFactoryRoleMembers = useFactoryRoleMembers;
|
|
615
|
+
exports.useFactoryUpgradeabilityPolicy = useFactoryUpgradeabilityPolicy;
|
|
616
|
+
exports.useMerkleInitCodeHash = useMerkleInitCodeHash;
|
|
47
617
|
exports.usePredictEcdsaAirdropAddress = usePredictEcdsaAirdropAddress;
|
|
48
618
|
exports.usePredictMerkleAirdropAddress = usePredictMerkleAirdropAddress;
|
|
619
|
+
exports.useSetComplianceDelegate = useSetComplianceDelegate;
|
|
620
|
+
exports.useSetComplianceManagerImpl = useSetComplianceManagerImpl;
|
|
621
|
+
exports.useSetCompliancePolicy = useSetCompliancePolicy;
|
|
622
|
+
exports.useSetCustomFee = useSetCustomFee;
|
|
623
|
+
exports.useSetDefaultDelegateToCompliance = useSetDefaultDelegateToCompliance;
|
|
624
|
+
exports.useSetDefaultGasFee = useSetDefaultGasFee;
|
|
625
|
+
exports.useSetDefaultUpgradeable = useSetDefaultUpgradeable;
|
|
626
|
+
exports.useSetEcdsaImplementation = useSetEcdsaImplementation;
|
|
627
|
+
exports.useSetFeeCollector = useSetFeeCollector;
|
|
628
|
+
exports.useSetMerkleImplementation = useSetMerkleImplementation;
|
|
629
|
+
exports.useSetUpgradeabilityPolicy = useSetUpgradeabilityPolicy;
|
|
@@ -9,3 +9,37 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { usePredictEcdsaAirdropAddress, type UsePredictEcdsaAirdropAddressArgs, } from "./usePredictEcdsaAirdropAddress.js";
|
|
11
11
|
export { usePredictMerkleAirdropAddress, type UsePredictMerkleAirdropAddressArgs, } from "./usePredictMerkleAirdropAddress.js";
|
|
12
|
+
export { useClearCompliancePolicy, type ClearCompliancePolicyArgs, } from "./useClearCompliancePolicy.js";
|
|
13
|
+
export { useClearUpgradeabilityPolicy, type ClearUpgradeabilityPolicyArgs, } from "./useClearUpgradeabilityPolicy.js";
|
|
14
|
+
export { useDisableCustomFee, type DisableCustomFeeArgs } from "./useDisableCustomFee.js";
|
|
15
|
+
export { useEcdsaInitCodeHash, type UseEcdsaInitCodeHashArgs } from "./useEcdsaInitCodeHash.js";
|
|
16
|
+
export { useFactoryComplianceDelegate, type UseFactoryComplianceDelegateArgs, } from "./useFactoryComplianceDelegate.js";
|
|
17
|
+
export { useFactoryCompliancePolicy, type FactoryCompliancePolicy, type UseFactoryCompliancePolicyArgs, } from "./useFactoryCompliancePolicy.js";
|
|
18
|
+
export { useFactoryCustomFee, type UseFactoryCustomFeeArgs } from "./useFactoryCustomFee.js";
|
|
19
|
+
export { useFactoryGrantRole, type FactoryGrantRoleArgs } from "./useFactoryGrantRole.js";
|
|
20
|
+
export { useFactoryHasRole, type UseFactoryHasRoleArgs } from "./useFactoryHasRole.js";
|
|
21
|
+
export { useFactoryImplementations, type FactoryImplementations, type UseFactoryImplementationsArgs, } from "./useFactoryImplementations.js";
|
|
22
|
+
export { useFactoryRenounceRole, type FactoryRenounceRoleArgs } from "./useFactoryRenounceRole.js";
|
|
23
|
+
export { useFactoryRevokeRole, type FactoryRevokeRoleArgs } from "./useFactoryRevokeRole.js";
|
|
24
|
+
export { useFactoryRoleConstants, type FactoryRoleConstants, type UseFactoryRoleConstantsArgs, } from "./useFactoryRoleConstants.js";
|
|
25
|
+
export { useFactoryRoleMembers, type FactoryRoleMembership, type UseFactoryRoleMembersArgs, } from "./useFactoryRoleMembers.js";
|
|
26
|
+
export { useFactoryUpgradeabilityPolicy, type FactoryUpgradeabilityPolicy, type UseFactoryUpgradeabilityPolicyArgs, } from "./useFactoryUpgradeabilityPolicy.js";
|
|
27
|
+
export { useMerkleInitCodeHash, type UseMerkleInitCodeHashArgs } from "./useMerkleInitCodeHash.js";
|
|
28
|
+
export { useSetComplianceDelegate, type SetComplianceDelegateArgs, } from "./useSetComplianceDelegate.js";
|
|
29
|
+
export { useSetComplianceManagerImpl, type SetComplianceManagerImplArgs, } from "./useSetComplianceManagerImpl.js";
|
|
30
|
+
export { useSetCompliancePolicy, type SetCompliancePolicyArgs } from "./useSetCompliancePolicy.js";
|
|
31
|
+
export { useSetCustomFee, type SetCustomFeeArgs } from "./useSetCustomFee.js";
|
|
32
|
+
export { useSetDefaultDelegateToCompliance, type SetDefaultDelegateToComplianceArgs, } from "./useSetDefaultDelegateToCompliance.js";
|
|
33
|
+
export { useSetDefaultGasFee, type SetDefaultGasFeeArgs } from "./useSetDefaultGasFee.js";
|
|
34
|
+
export { useSetDefaultUpgradeable, type SetDefaultUpgradeableArgs, } from "./useSetDefaultUpgradeable.js";
|
|
35
|
+
export { useSetEcdsaImplementation, type SetEcdsaImplementationArgs, } from "./useSetEcdsaImplementation.js";
|
|
36
|
+
export { useSetFeeCollector, type SetFeeCollectorArgs } from "./useSetFeeCollector.js";
|
|
37
|
+
export { useSetMerkleImplementation, type SetMerkleImplementationArgs, } from "./useSetMerkleImplementation.js";
|
|
38
|
+
export { useSetUpgradeabilityPolicy, type SetUpgradeabilityPolicyArgs, } from "./useSetUpgradeabilityPolicy.js";
|
|
39
|
+
export type { AirdropClientOptions, AirdropHookOptions } from "../../react/_shared.js";
|
|
40
|
+
export type { WriteAccountOverride } from "../../airdrop-base.js";
|
|
41
|
+
export type { CustomFee } from "../../factory.js";
|
|
42
|
+
export type { DeploymentMode } from "../../constants.js";
|
|
43
|
+
export type { CommonAirdropParams, EcdsaAirdropParams, MerkleAirdropParams } from "../../types.js";
|
|
44
|
+
export type { DedupMode } from "../../constants.js";
|
|
45
|
+
export type { EncryptorSource } from "../../encryption.js";
|