@tokenops/sdk 1.6.0 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -8
- package/CONTRIBUTING.md +4 -2
- package/README.md +146 -90
- package/SUPPORT.md +47 -0
- package/dist/{chunk-HETNKZEE.js → chunk-335Z2W67.js} +1 -1
- package/dist/{chunk-BD4LZBVF.cjs → chunk-3QHNYEQD.cjs} +18 -17
- package/dist/chunk-456VDDA3.js +370 -0
- package/dist/{chunk-6WSNS3UV.js → chunk-4RAAATVY.js} +2 -4
- package/dist/{chunk-4KJ66YRH.js → chunk-4TSDNZQ3.js} +2 -2
- package/dist/{chunk-WUXUWTFW.cjs → chunk-5576FRT3.cjs} +31 -7
- package/dist/chunk-66IHPTOK.cjs +20 -0
- package/dist/{chunk-2RNW4MIJ.cjs → chunk-67OV5CX2.cjs} +0 -18
- package/dist/{chunk-PD7ME2BT.js → chunk-6GNR22OV.js} +2 -1
- package/dist/{chunk-VHSNYUYV.js → chunk-6NAVMWZQ.js} +5 -5
- package/dist/{chunk-EUKPOXWR.cjs → chunk-6PXXGACR.cjs} +17 -15
- package/dist/{chunk-WTK6JDSI.js → chunk-74QFZ5MK.js} +6 -4
- package/dist/{chunk-WOEETTH7.cjs → chunk-7AFPOE7N.cjs} +6 -6
- package/dist/{chunk-U57COLUE.js → chunk-AXIPOR3C.js} +2 -2
- package/dist/chunk-CTED3MTR.cjs +380 -0
- package/dist/{chunk-QKKBBH7I.js → chunk-DZHYSUGY.js} +28 -7
- package/dist/{chunk-V5D7BHW3.js → chunk-EAJ7SYHE.js} +6 -4
- package/dist/{chunk-SYHNZSZZ.cjs → chunk-FAXIIH5R.cjs} +3 -3
- package/dist/{chunk-7G7UOQV4.cjs → chunk-FGEB7RMY.cjs} +4 -4
- package/dist/chunk-GKKDAW44.js +8823 -0
- package/dist/{chunk-QET3Q4JP.js → chunk-H5POPGOZ.js} +8 -6
- package/dist/{chunk-VR3FREBX.cjs → chunk-JK4XMMKM.cjs} +3 -3
- package/dist/{chunk-CBRL2PJA.cjs → chunk-JQYC66TO.cjs} +12 -12
- package/dist/{chunk-YFIWCYHC.cjs → chunk-JZLGCTGK.cjs} +56 -54
- package/dist/{chunk-4ZCXK4VI.cjs → chunk-KFRDLKMA.cjs} +14 -14
- package/dist/chunk-KWFFIJYX.js +11 -0
- package/dist/chunk-M4IT6DNJ.cjs +608 -0
- package/dist/{chunk-43RFBQ73.cjs → chunk-MVDQMV25.cjs} +29 -32
- package/dist/chunk-NCVX3K2N.cjs +161 -0
- package/dist/chunk-NWFMBLSQ.js +4 -0
- package/dist/chunk-O5676ZWY.js +585 -0
- package/dist/chunk-PUX5VXDB.cjs +8845 -0
- package/dist/{chunk-DRSPMIZ7.js → chunk-QBJ7O2B4.js} +1 -11
- package/dist/{chunk-UJS4N2XM.cjs → chunk-TEBM66WA.cjs} +12 -12
- package/dist/{chunk-TN65XNTI.js → chunk-TWT3STIX.js} +8 -6
- package/dist/chunk-UG5RKLU2.cjs +6 -0
- package/dist/chunk-VP2B4WM2.js +154 -0
- package/dist/{chunk-BK7YIVLK.cjs → chunk-WJLECC22.cjs} +75 -73
- package/dist/{chunk-NFW7AUEX.js → chunk-WMACINXO.js} +1 -1
- package/dist/{chunk-AYGRYDBX.cjs → chunk-XAYGD4E4.cjs} +37 -35
- package/dist/{chunk-46T67CE2.js → chunk-ZA673I3O.js} +1 -1
- package/dist/{chunk-YPYCWLYP.js → chunk-ZWXJTBZO.js} +1 -1
- package/dist/core/addresses.d.ts +14 -2
- package/dist/core/brands.d.ts +8 -2
- package/dist/core/errors.d.ts +71 -10
- package/dist/core/preflight.d.ts +1 -0
- package/dist/fhe/erc7984-abi.d.ts +1 -0
- package/dist/fhe/index.cjs +64 -63
- package/dist/fhe/index.js +7 -6
- package/dist/fhe/operators.d.ts +22 -5
- package/dist/fhe/react/index.cjs +13 -12
- package/dist/fhe/react/index.js +6 -5
- package/dist/fhe/types.d.ts +6 -0
- package/dist/fhe-airdrop/abis/{cloneable.d.ts → airdrop-base.d.ts} +254 -396
- package/dist/fhe-airdrop/abis/compliance.d.ts +422 -0
- package/dist/fhe-airdrop/abis/ecdsa.d.ts +1316 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +1319 -190
- package/dist/fhe-airdrop/abis/index.d.ts +5 -2
- package/dist/fhe-airdrop/abis/merkle.d.ts +1238 -0
- package/dist/fhe-airdrop/advanced/index.cjs +11 -12
- package/dist/fhe-airdrop/advanced/index.d.cts +34 -11
- package/dist/fhe-airdrop/advanced/index.d.ts +34 -11
- package/dist/fhe-airdrop/advanced/index.js +3 -8
- package/dist/fhe-airdrop/advanced/react/index.cjs +37 -50
- package/dist/fhe-airdrop/advanced/react/index.d.cts +9 -3
- package/dist/fhe-airdrop/advanced/react/index.d.ts +9 -3
- package/dist/fhe-airdrop/advanced/react/index.js +36 -50
- package/dist/fhe-airdrop/advanced/react/usePredictEcdsaAirdropAddress.d.ts +33 -0
- package/dist/fhe-airdrop/advanced/react/usePredictMerkleAirdropAddress.d.ts +27 -0
- package/dist/fhe-airdrop/airdrop-base.d.ts +600 -0
- package/dist/fhe-airdrop/campaign.d.ts +297 -0
- package/dist/fhe-airdrop/compliance.d.ts +302 -0
- package/dist/fhe-airdrop/constants.d.ts +33 -0
- package/dist/fhe-airdrop/ecdsa.d.ts +263 -0
- package/dist/fhe-airdrop/encryption.d.ts +92 -14
- package/dist/fhe-airdrop/errors.d.ts +245 -15
- package/dist/fhe-airdrop/factory.d.ts +533 -274
- package/dist/fhe-airdrop/guards.d.ts +273 -0
- package/dist/fhe-airdrop/index.cjs +1131 -74
- package/dist/fhe-airdrop/index.d.cts +46 -8
- package/dist/fhe-airdrop/index.d.ts +46 -8
- package/dist/fhe-airdrop/index.js +931 -8
- package/dist/fhe-airdrop/merkle-tree.d.ts +103 -0
- package/dist/fhe-airdrop/merkle.d.ts +180 -0
- package/dist/fhe-airdrop/react/_shared.d.ts +144 -71
- package/dist/fhe-airdrop/react/index.cjs +399 -459
- package/dist/fhe-airdrop/react/index.d.cts +53 -74
- package/dist/fhe-airdrop/react/index.d.ts +53 -74
- package/dist/fhe-airdrop/react/index.js +261 -374
- package/dist/fhe-airdrop/react/useAirdropGasFee.d.ts +10 -5
- package/dist/fhe-airdrop/react/useAirdropHasRole.d.ts +15 -6
- package/dist/fhe-airdrop/react/useAirdropPause.d.ts +30 -0
- package/dist/fhe-airdrop/react/useAirdropPaused.d.ts +17 -0
- package/dist/fhe-airdrop/react/useAirdropToken.d.ts +11 -4
- package/dist/fhe-airdrop/react/useAirdropWindow.d.ts +37 -0
- package/dist/fhe-airdrop/react/useClaimedAmount.d.ts +29 -0
- package/dist/fhe-airdrop/react/useComplianceManager.d.ts +16 -0
- package/dist/fhe-airdrop/react/useCreateEcdsaAirdrop.d.ts +28 -0
- package/dist/fhe-airdrop/react/useCreateMerkleAirdrop.d.ts +25 -0
- package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +23 -0
- package/dist/fhe-airdrop/react/useEffectiveUpgradeable.d.ts +20 -0
- package/dist/fhe-airdrop/react/useExtendClaimWindow.d.ts +17 -12
- package/dist/fhe-airdrop/react/useFactoryFees.d.ts +28 -0
- package/dist/fhe-airdrop/react/useFactoryRegistry.d.ts +35 -0
- package/dist/fhe-airdrop/react/useFundAirdrop.d.ts +35 -0
- package/dist/fhe-airdrop/react/useGrantInstanceRoles.d.ts +35 -0
- package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +34 -0
- package/dist/fhe-airdrop/react/useMerkleRoot.d.ts +15 -0
- package/dist/fhe-airdrop/react/useSetMerkleRoot.d.ts +22 -0
- package/dist/fhe-airdrop/react/useWithdrawConfidential.d.ts +23 -0
- package/dist/fhe-airdrop/roles.d.ts +147 -0
- package/dist/fhe-airdrop/types.d.ts +67 -65
- package/dist/fhe-disperse/index.cjs +70 -68
- package/dist/fhe-disperse/index.js +10 -8
- package/dist/fhe-disperse/react/index.cjs +94 -92
- package/dist/fhe-disperse/react/index.js +13 -11
- package/dist/fhe-vesting/advanced/index.cjs +10 -8
- package/dist/fhe-vesting/advanced/index.js +8 -6
- package/dist/fhe-vesting/advanced/react/index.cjs +16 -14
- package/dist/fhe-vesting/advanced/react/index.js +13 -11
- package/dist/fhe-vesting/index.cjs +74 -72
- package/dist/fhe-vesting/index.js +11 -9
- package/dist/fhe-vesting/react/index.cjs +228 -226
- package/dist/fhe-vesting/react/index.js +15 -13
- package/dist/index.cjs +100 -87
- package/dist/index.js +3 -2
- package/dist/testnet-faucet/index.cjs +57 -55
- package/dist/testnet-faucet/index.js +7 -5
- package/dist/testnet-faucet/react/index.cjs +55 -53
- package/dist/testnet-faucet/react/index.js +9 -7
- package/package.json +6 -2
- package/dist/chunk-CNP4L3GF.js +0 -105
- package/dist/chunk-KSDSXJ34.js +0 -41
- package/dist/chunk-LBWRFZR3.cjs +0 -1681
- package/dist/chunk-OL6SHN3D.cjs +0 -44
- package/dist/chunk-S2XD75JM.js +0 -1637
- package/dist/chunk-SPGSO5SO.cjs +0 -1644
- package/dist/chunk-UE5XK2SY.js +0 -1673
- package/dist/chunk-WO72UBQD.cjs +0 -109
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +0 -53
- package/dist/fhe-airdrop/advanced/react/usePredictAirdropAddress.d.ts +0 -49
- package/dist/fhe-airdrop/airdrop.d.ts +0 -317
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +0 -37
- package/dist/fhe-airdrop/react/useAirdropCanExtendClaimWindow.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropClaimTypehash.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropClaimedSignatures.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropDeploymentBlockNumber.d.ts +0 -6
- package/dist/fhe-airdrop/react/useAirdropDomainSeparator.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropEndTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropFactoryDisableCustomFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useAirdropFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useAirdropFactorySetDefaultGasFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropFactorySetFeeCollector.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +0 -16
- package/dist/fhe-airdrop/react/useAirdropHasClaimEnded.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropHasClaimStarted.d.ts +0 -7
- package/dist/fhe-airdrop/react/useAirdropIsClaimWindowActive.d.ts +0 -9
- package/dist/fhe-airdrop/react/useAirdropIsPaused.d.ts +0 -8
- package/dist/fhe-airdrop/react/useAirdropIsSignatureClaimed.d.ts +0 -22
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +0 -51
- package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropStartTime.d.ts +0 -10
- package/dist/fhe-airdrop/react/useAirdropWithdrawGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherConfidentialToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useAirdropWithdrawOtherToken.d.ts +0 -14
- package/dist/fhe-airdrop/react/useClaim.d.ts +0 -39
- package/dist/fhe-airdrop/react/useConfidentialAirdropFactoryImplementation.d.ts +0 -11
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +0 -41
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +0 -48
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdrop.d.ts +0 -29
- package/dist/fhe-airdrop/react/useCreateConfidentialAirdropAndGetAddress.d.ts +0 -31
- package/dist/fhe-airdrop/react/useDisableCustomFee.d.ts +0 -14
- package/dist/fhe-airdrop/react/useFactoryCustomFee.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFactoryDefaultGasFee.d.ts +0 -10
- package/dist/fhe-airdrop/react/useFactoryFeeCollector.d.ts +0 -11
- package/dist/fhe-airdrop/react/useFactoryInitCodeHash.d.ts +0 -17
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +0 -33
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +0 -51
- package/dist/fhe-airdrop/react/useSetCustomFee.d.ts +0 -16
- package/dist/fhe-airdrop/react/useSetDefaultGasFee.d.ts +0 -15
- package/dist/fhe-airdrop/react/useSetFeeCollector.d.ts +0 -14
- package/dist/fhe-airdrop/react/useSetPaused.d.ts +0 -14
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +0 -31
- package/dist/fhe-airdrop/react/useWithdraw.d.ts +0 -12
- package/dist/fhe-airdrop/react/useWithdrawOtherConfidentialToken.d.ts +0 -13
- package/dist/fhe-airdrop/react/useWithdrawOtherToken.d.ts +0 -13
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-43RFBQ73.cjs');
|
|
7
|
-
require('../../chunk-WUXUWTFW.cjs');
|
|
8
|
-
require('../../chunk-VR3FREBX.cjs');
|
|
9
|
-
require('../../chunk-2RNW4MIJ.cjs');
|
|
10
|
-
require('../../chunk-VJKZWYYJ.cjs');
|
|
3
|
+
var chunkM4IT6DNJ_cjs = require('../../chunk-M4IT6DNJ.cjs');
|
|
4
|
+
require('../../chunk-MVDQMV25.cjs');
|
|
5
|
+
require('../../chunk-67OV5CX2.cjs');
|
|
11
6
|
|
|
12
7
|
|
|
13
8
|
|
|
14
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "DEPLOYMENT_MODE", {
|
|
15
10
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkM4IT6DNJ_cjs.DEPLOYMENT_MODE; }
|
|
17
12
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "assertPredictionFresh", {
|
|
19
14
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkM4IT6DNJ_cjs.assertPredictionFresh; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "assertSaltAvailable", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkM4IT6DNJ_cjs.assertSaltAvailable; }
|
|
21
20
|
});
|
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
2
|
+
* `@tokenops/sdk/fhe-airdrop/advanced` - CREATE2 address prediction and the
|
|
3
|
+
* two guards that keep a prediction trustworthy.
|
|
4
|
+
*
|
|
5
|
+
* The headline subpath already runs both guards inside `createEcdsaAirdrop` /
|
|
6
|
+
* `createMerkleAirdrop`, and `preflightCreate` reports them read-only. This
|
|
7
|
+
* subpath is for callers driving prediction themselves: precomputing a
|
|
8
|
+
* campaign address to publish, binding Merkle ciphertexts to an instance that
|
|
9
|
+
* does not exist yet, or reconciling addresses across a deploy pipeline.
|
|
10
|
+
*
|
|
11
|
+
* **What a prediction commits to.** `(implementation, mode, deployer,
|
|
12
|
+
* userSalt)` and nothing else. The oracles take the params struct and ignore
|
|
13
|
+
* it - `predictECDSAAirdropAddress` does not even name that argument - so two
|
|
14
|
+
* campaigns differing in token, window, signer or root still land on one
|
|
15
|
+
* address. That makes `userSalt` the only thing separating them, and
|
|
16
|
+
* {@link assertSaltAvailable} the check that catches a reused one before the
|
|
17
|
+
* create is sent.
|
|
18
|
+
*
|
|
19
|
+
* **What can invalidate one.** The factory's implementation pointer. It moves
|
|
20
|
+
* under `IMPL_MANAGER_ROLE`, changes the init-code hash, and so changes every
|
|
21
|
+
* future predicted address. {@link assertPredictionFresh} judges the two
|
|
22
|
+
* `get*InitCodeHash` observations taken on either side of whatever work the
|
|
23
|
+
* prediction was used for.
|
|
24
|
+
*
|
|
25
|
+
* The prediction reads themselves (`predictEcdsaAirdropAddress`,
|
|
26
|
+
* `predictMerkleAirdropAddress`, `getEcdsaInitCodeHash`,
|
|
27
|
+
* `getMerkleInitCodeHash`) are methods on `ConfidentialAirdropFactoryClient`,
|
|
28
|
+
* exported from the headline `@tokenops/sdk/fhe-airdrop` subpath; their
|
|
29
|
+
* argument types are re-exported below so this subpath is self-contained.
|
|
11
30
|
*/
|
|
12
|
-
export {
|
|
13
|
-
|
|
31
|
+
export type { InitCodeHashArgs, PredictArgs } from "../factory.js";
|
|
32
|
+
/** @alpha */
|
|
33
|
+
export { DEPLOYMENT_MODE } from "../constants.js";
|
|
34
|
+
export type { DeploymentMode } from "../constants.js";
|
|
35
|
+
export { assertPredictionFresh, assertSaltAvailable, type AssertPredictionFreshArgs, type AssertSaltAvailableArgs, } from "../guards.js";
|
|
36
|
+
export type { AirdropVariant } from "../errors.js";
|
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
2
|
+
* `@tokenops/sdk/fhe-airdrop/advanced` - CREATE2 address prediction and the
|
|
3
|
+
* two guards that keep a prediction trustworthy.
|
|
4
|
+
*
|
|
5
|
+
* The headline subpath already runs both guards inside `createEcdsaAirdrop` /
|
|
6
|
+
* `createMerkleAirdrop`, and `preflightCreate` reports them read-only. This
|
|
7
|
+
* subpath is for callers driving prediction themselves: precomputing a
|
|
8
|
+
* campaign address to publish, binding Merkle ciphertexts to an instance that
|
|
9
|
+
* does not exist yet, or reconciling addresses across a deploy pipeline.
|
|
10
|
+
*
|
|
11
|
+
* **What a prediction commits to.** `(implementation, mode, deployer,
|
|
12
|
+
* userSalt)` and nothing else. The oracles take the params struct and ignore
|
|
13
|
+
* it - `predictECDSAAirdropAddress` does not even name that argument - so two
|
|
14
|
+
* campaigns differing in token, window, signer or root still land on one
|
|
15
|
+
* address. That makes `userSalt` the only thing separating them, and
|
|
16
|
+
* {@link assertSaltAvailable} the check that catches a reused one before the
|
|
17
|
+
* create is sent.
|
|
18
|
+
*
|
|
19
|
+
* **What can invalidate one.** The factory's implementation pointer. It moves
|
|
20
|
+
* under `IMPL_MANAGER_ROLE`, changes the init-code hash, and so changes every
|
|
21
|
+
* future predicted address. {@link assertPredictionFresh} judges the two
|
|
22
|
+
* `get*InitCodeHash` observations taken on either side of whatever work the
|
|
23
|
+
* prediction was used for.
|
|
24
|
+
*
|
|
25
|
+
* The prediction reads themselves (`predictEcdsaAirdropAddress`,
|
|
26
|
+
* `predictMerkleAirdropAddress`, `getEcdsaInitCodeHash`,
|
|
27
|
+
* `getMerkleInitCodeHash`) are methods on `ConfidentialAirdropFactoryClient`,
|
|
28
|
+
* exported from the headline `@tokenops/sdk/fhe-airdrop` subpath; their
|
|
29
|
+
* argument types are re-exported below so this subpath is self-contained.
|
|
11
30
|
*/
|
|
12
|
-
export {
|
|
13
|
-
|
|
31
|
+
export type { InitCodeHashArgs, PredictArgs } from "../factory.js";
|
|
32
|
+
/** @alpha */
|
|
33
|
+
export { DEPLOYMENT_MODE } from "../constants.js";
|
|
34
|
+
export type { DeploymentMode } from "../constants.js";
|
|
35
|
+
export { assertPredictionFresh, assertSaltAvailable, type AssertPredictionFreshArgs, type AssertSaltAvailableArgs, } from "../guards.js";
|
|
36
|
+
export type { AirdropVariant } from "../errors.js";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-6WSNS3UV.js';
|
|
5
|
-
import '../../chunk-QKKBBH7I.js';
|
|
6
|
-
import '../../chunk-46T67CE2.js';
|
|
7
|
-
import '../../chunk-DRSPMIZ7.js';
|
|
8
|
-
import '../../chunk-Q2GP5UDC.js';
|
|
1
|
+
export { DEPLOYMENT_MODE, assertPredictionFresh, assertSaltAvailable } from '../../chunk-O5676ZWY.js';
|
|
2
|
+
import '../../chunk-4RAAATVY.js';
|
|
3
|
+
import '../../chunk-QBJ7O2B4.js';
|
|
@@ -1,61 +1,48 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../../chunk-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
require('../../../chunk-
|
|
8
|
-
require('../../../chunk-
|
|
9
|
-
require('../../../chunk-
|
|
10
|
-
|
|
11
|
-
require('../../../chunk-
|
|
12
|
-
require('../../../chunk-
|
|
3
|
+
var chunkNCVX3K2N_cjs = require('../../../chunk-NCVX3K2N.cjs');
|
|
4
|
+
require('../../../chunk-PUX5VXDB.cjs');
|
|
5
|
+
require('../../../chunk-M4IT6DNJ.cjs');
|
|
6
|
+
require('../../../chunk-FAXIIH5R.cjs');
|
|
7
|
+
require('../../../chunk-UG5RKLU2.cjs');
|
|
8
|
+
require('../../../chunk-MVDQMV25.cjs');
|
|
9
|
+
require('../../../chunk-5576FRT3.cjs');
|
|
10
|
+
require('../../../chunk-JK4XMMKM.cjs');
|
|
11
|
+
require('../../../chunk-66IHPTOK.cjs');
|
|
12
|
+
require('../../../chunk-67OV5CX2.cjs');
|
|
13
13
|
require('../../../chunk-VJKZWYYJ.cjs');
|
|
14
|
-
var react = require('react');
|
|
15
14
|
var reactQuery = require('@tanstack/react-query');
|
|
16
|
-
var wagmi = require('wagmi');
|
|
17
15
|
|
|
18
|
-
function
|
|
19
|
-
const { params,
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
|
|
26
|
-
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : chunkWUXUWTFW_cjs.DEPLOYED_ADDRESSES.fheAirdrop?.confidentialAirdropFactory?.[resolvedChainId] ?? void 0);
|
|
27
|
-
const encryptorSourceRef = react.useRef(encryptor);
|
|
28
|
-
encryptorSourceRef.current = encryptor;
|
|
29
|
-
const client = react.useMemo(() => {
|
|
30
|
-
if (!resolvedPublicClient) return void 0;
|
|
31
|
-
if (!resolvedAddress) return void 0;
|
|
32
|
-
return chunkOL6SHN3D_cjs.createConfidentialAirdropFactoryAdvancedClient({
|
|
33
|
-
publicClient: resolvedPublicClient,
|
|
34
|
-
...walletClient ? { walletClient } : {},
|
|
16
|
+
function usePredictEcdsaAirdropAddress(args) {
|
|
17
|
+
const { params, mode, deployer, userSalt, ...base } = args;
|
|
18
|
+
const { client, chainId, resolvedAddress } = chunkNCVX3K2N_cjs.useMemoAirdropFactoryClient(base);
|
|
19
|
+
return reactQuery.useQuery({
|
|
20
|
+
...args.query,
|
|
21
|
+
queryKey: chunkNCVX3K2N_cjs.airdropQueryKey({
|
|
22
|
+
chainId,
|
|
35
23
|
address: resolvedAddress,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
|
|
24
|
+
fn: "predictEcdsaAirdropAddress",
|
|
25
|
+
args: [mode, deployer, userSalt]
|
|
26
|
+
}),
|
|
27
|
+
queryFn: () => client.predictEcdsaAirdropAddress({ params, mode, deployer, userSalt }),
|
|
28
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function usePredictMerkleAirdropAddress(args) {
|
|
32
|
+
const { params, mode, deployer, userSalt, ...base } = args;
|
|
33
|
+
const { client, chainId, resolvedAddress } = chunkNCVX3K2N_cjs.useMemoAirdropFactoryClient(base);
|
|
40
34
|
return reactQuery.useQuery({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
resolvedAddress,
|
|
45
|
-
|
|
46
|
-
userSalt
|
|
47
|
-
deployer,
|
|
48
|
-
gasFee
|
|
49
|
-
),
|
|
50
|
-
queryFn: () => client.predictAirdropAddress({
|
|
51
|
-
params,
|
|
52
|
-
userSalt,
|
|
53
|
-
deployer,
|
|
54
|
-
gasFee
|
|
35
|
+
...args.query,
|
|
36
|
+
queryKey: chunkNCVX3K2N_cjs.airdropQueryKey({
|
|
37
|
+
chainId,
|
|
38
|
+
address: resolvedAddress,
|
|
39
|
+
fn: "predictMerkleAirdropAddress",
|
|
40
|
+
args: [mode, deployer, userSalt]
|
|
55
41
|
}),
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
queryFn: () => client.predictMerkleAirdropAddress({ params, mode, deployer, userSalt }),
|
|
43
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
58
44
|
});
|
|
59
45
|
}
|
|
60
46
|
|
|
61
|
-
exports.
|
|
47
|
+
exports.usePredictEcdsaAirdropAddress = usePredictEcdsaAirdropAddress;
|
|
48
|
+
exports.usePredictMerkleAirdropAddress = usePredictMerkleAirdropAddress;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React hooks for `@tokenops/sdk/fhe-airdrop/advanced`.
|
|
3
|
-
*
|
|
2
|
+
* React hooks for `@tokenops/sdk/fhe-airdrop/advanced`.
|
|
3
|
+
*
|
|
4
|
+
* Unlike `/fhe-vesting/advanced/react` (which needs a separate
|
|
5
|
+
* block-dependent `*AdvancedClient` subclass), the airdrop v2 factory already
|
|
6
|
+
* exposes `predictEcdsaAirdropAddress` / `predictMerkleAirdropAddress` on its
|
|
7
|
+
* headline `ConfidentialAirdropFactoryClient` — so these hooks reuse the
|
|
8
|
+
* headline React subpath's factory-client memoization directly.
|
|
4
9
|
*/
|
|
5
|
-
export {
|
|
10
|
+
export { usePredictEcdsaAirdropAddress, type UsePredictEcdsaAirdropAddressArgs, } from "./usePredictEcdsaAirdropAddress.js";
|
|
11
|
+
export { usePredictMerkleAirdropAddress, type UsePredictMerkleAirdropAddressArgs, } from "./usePredictMerkleAirdropAddress.js";
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* React hooks for `@tokenops/sdk/fhe-airdrop/advanced`.
|
|
3
|
-
*
|
|
2
|
+
* React hooks for `@tokenops/sdk/fhe-airdrop/advanced`.
|
|
3
|
+
*
|
|
4
|
+
* Unlike `/fhe-vesting/advanced/react` (which needs a separate
|
|
5
|
+
* block-dependent `*AdvancedClient` subclass), the airdrop v2 factory already
|
|
6
|
+
* exposes `predictEcdsaAirdropAddress` / `predictMerkleAirdropAddress` on its
|
|
7
|
+
* headline `ConfidentialAirdropFactoryClient` — so these hooks reuse the
|
|
8
|
+
* headline React subpath's factory-client memoization directly.
|
|
4
9
|
*/
|
|
5
|
-
export {
|
|
10
|
+
export { usePredictEcdsaAirdropAddress, type UsePredictEcdsaAirdropAddressArgs, } from "./usePredictEcdsaAirdropAddress.js";
|
|
11
|
+
export { usePredictMerkleAirdropAddress, type UsePredictMerkleAirdropAddressArgs, } from "./usePredictMerkleAirdropAddress.js";
|
|
@@ -1,59 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '../../../chunk-
|
|
6
|
-
import '../../../chunk-
|
|
7
|
-
import '../../../chunk-
|
|
8
|
-
import
|
|
9
|
-
import '../../../chunk-
|
|
10
|
-
import '../../../chunk-
|
|
1
|
+
import { useMemoAirdropFactoryClient, airdropQueryKey } from '../../../chunk-VP2B4WM2.js';
|
|
2
|
+
import '../../../chunk-GKKDAW44.js';
|
|
3
|
+
import '../../../chunk-O5676ZWY.js';
|
|
4
|
+
import '../../../chunk-ZWXJTBZO.js';
|
|
5
|
+
import '../../../chunk-NWFMBLSQ.js';
|
|
6
|
+
import '../../../chunk-4RAAATVY.js';
|
|
7
|
+
import '../../../chunk-DZHYSUGY.js';
|
|
8
|
+
import '../../../chunk-ZA673I3O.js';
|
|
9
|
+
import '../../../chunk-KWFFIJYX.js';
|
|
10
|
+
import '../../../chunk-QBJ7O2B4.js';
|
|
11
11
|
import '../../../chunk-Q2GP5UDC.js';
|
|
12
|
-
import { useRef, useMemo } from 'react';
|
|
13
12
|
import { useQuery } from '@tanstack/react-query';
|
|
14
|
-
import { usePublicClient, useWalletClient } from 'wagmi';
|
|
15
13
|
|
|
16
|
-
function
|
|
17
|
-
const { params,
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
|
|
24
|
-
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : DEPLOYED_ADDRESSES.fheAirdrop?.confidentialAirdropFactory?.[resolvedChainId] ?? void 0);
|
|
25
|
-
const encryptorSourceRef = useRef(encryptor);
|
|
26
|
-
encryptorSourceRef.current = encryptor;
|
|
27
|
-
const client = useMemo(() => {
|
|
28
|
-
if (!resolvedPublicClient) return void 0;
|
|
29
|
-
if (!resolvedAddress) return void 0;
|
|
30
|
-
return createConfidentialAirdropFactoryAdvancedClient({
|
|
31
|
-
publicClient: resolvedPublicClient,
|
|
32
|
-
...walletClient ? { walletClient } : {},
|
|
14
|
+
function usePredictEcdsaAirdropAddress(args) {
|
|
15
|
+
const { params, mode, deployer, userSalt, ...base } = args;
|
|
16
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
|
|
17
|
+
return useQuery({
|
|
18
|
+
...args.query,
|
|
19
|
+
queryKey: airdropQueryKey({
|
|
20
|
+
chainId,
|
|
33
21
|
address: resolvedAddress,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
|
|
22
|
+
fn: "predictEcdsaAirdropAddress",
|
|
23
|
+
args: [mode, deployer, userSalt]
|
|
24
|
+
}),
|
|
25
|
+
queryFn: () => client.predictEcdsaAirdropAddress({ params, mode, deployer, userSalt }),
|
|
26
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function usePredictMerkleAirdropAddress(args) {
|
|
30
|
+
const { params, mode, deployer, userSalt, ...base } = args;
|
|
31
|
+
const { client, chainId, resolvedAddress } = useMemoAirdropFactoryClient(base);
|
|
38
32
|
return useQuery({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
resolvedAddress,
|
|
43
|
-
|
|
44
|
-
userSalt
|
|
45
|
-
deployer,
|
|
46
|
-
gasFee
|
|
47
|
-
),
|
|
48
|
-
queryFn: () => client.predictAirdropAddress({
|
|
49
|
-
params,
|
|
50
|
-
userSalt,
|
|
51
|
-
deployer,
|
|
52
|
-
gasFee
|
|
33
|
+
...args.query,
|
|
34
|
+
queryKey: airdropQueryKey({
|
|
35
|
+
chainId,
|
|
36
|
+
address: resolvedAddress,
|
|
37
|
+
fn: "predictMerkleAirdropAddress",
|
|
38
|
+
args: [mode, deployer, userSalt]
|
|
53
39
|
}),
|
|
54
|
-
|
|
55
|
-
|
|
40
|
+
queryFn: () => client.predictMerkleAirdropAddress({ params, mode, deployer, userSalt }),
|
|
41
|
+
enabled: Boolean(client && (args.query?.enabled ?? true))
|
|
56
42
|
});
|
|
57
43
|
}
|
|
58
44
|
|
|
59
|
-
export {
|
|
45
|
+
export { usePredictEcdsaAirdropAddress, usePredictMerkleAirdropAddress };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex } from "viem";
|
|
3
|
+
import type { DeploymentMode } from "../../constants.js";
|
|
4
|
+
import type { EcdsaAirdropParams } from "../../types.js";
|
|
5
|
+
import { type AirdropHookOptions } from "../../react/_shared.js";
|
|
6
|
+
/** @alpha */
|
|
7
|
+
export interface UsePredictEcdsaAirdropAddressArgs extends AirdropHookOptions<Address> {
|
|
8
|
+
params: EcdsaAirdropParams;
|
|
9
|
+
mode: DeploymentMode;
|
|
10
|
+
deployer: Address;
|
|
11
|
+
userSalt: Hex;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Where an ECDSA `create*` from `deployer` with this `(mode, userSalt)` pair
|
|
15
|
+
* would land.
|
|
16
|
+
*
|
|
17
|
+
* **What a prediction commits to.** Only `(implementation, mode, deployer,
|
|
18
|
+
* userSalt)` — `params` is required because the ABI declares it, but the
|
|
19
|
+
* factory ignores it for this variant's oracle. Changing the token, window
|
|
20
|
+
* or signer does NOT move the predicted address.
|
|
21
|
+
*
|
|
22
|
+
* A returned address is not evidence the create will succeed — prediction is
|
|
23
|
+
* a pure oracle that answers even for a deployer not currently allowed to
|
|
24
|
+
* deploy the requested `mode`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const { data: predicted } = usePredictEcdsaAirdropAddress({
|
|
28
|
+
* params, mode: "clone", deployer, userSalt,
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* @alpha
|
|
32
|
+
*/
|
|
33
|
+
export declare function usePredictEcdsaAirdropAddress(args: UsePredictEcdsaAirdropAddressArgs): UseQueryResult<Address, Error>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import type { Address, Hex } from "viem";
|
|
3
|
+
import type { DeploymentMode } from "../../constants.js";
|
|
4
|
+
import type { MerkleAirdropParams } from "../../types.js";
|
|
5
|
+
import { type AirdropHookOptions } from "../../react/_shared.js";
|
|
6
|
+
/** @alpha */
|
|
7
|
+
export interface UsePredictMerkleAirdropAddressArgs extends AirdropHookOptions<Address> {
|
|
8
|
+
params: MerkleAirdropParams;
|
|
9
|
+
mode: DeploymentMode;
|
|
10
|
+
deployer: Address;
|
|
11
|
+
userSalt: Hex;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Where a Merkle `create*` from `deployer` with this `(mode, userSalt)` pair
|
|
15
|
+
* would land.
|
|
16
|
+
*
|
|
17
|
+
* Same "only `(implementation, mode, deployer, userSalt)` matters" contract
|
|
18
|
+
* as {@link usePredictEcdsaAirdropAddress} — see its TSDoc.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const { data: predicted } = usePredictMerkleAirdropAddress({
|
|
22
|
+
* params, mode: "clone", deployer, userSalt,
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* @alpha
|
|
26
|
+
*/
|
|
27
|
+
export declare function usePredictMerkleAirdropAddress(args: UsePredictMerkleAirdropAddressArgs): UseQueryResult<Address, Error>;
|