@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
package/CHANGELOG.md
CHANGED
|
@@ -7,20 +7,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [1.6.0](https://github.com/VestingLabs/tokenops-sdk/compare/v1.5.1...v1.6.0) (2026-07-28)
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
### Features
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
- **fhe:** add operator prerequisite DX helpers (S2, TOK-75) ([#63](https://github.com/VestingLabs/tokenops-sdk/issues/63)) ([ef45c2e](https://github.com/VestingLabs/tokenops-sdk/commit/ef45c2e61529f57a2b2338c7573b466e57fbf2cf))
|
|
15
13
|
|
|
16
14
|
### Bug Fixes
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
- **airdrop:** stop preflightCreateAirdrop throwing on a non-ERC7984 token (TOK-436) ([b650324](https://github.com/VestingLabs/tokenops-sdk/commit/b6503243cb430fe224913fbbb39251586a4d4925))
|
|
17
|
+
- correct operator-deadline guidance in SECURITY.md, record advisory rationale ([b09273d](https://github.com/VestingLabs/tokenops-sdk/commit/b09273d7d911a4dcfdfe8e2ae7f4e3a24c2130e8))
|
|
18
|
+
- **fhe-vesting:** point Sepolia factory at the redeployed address ([0888404](https://github.com/VestingLabs/tokenops-sdk/commit/08884040987d0ebb4326d1fb80a2c2d630a6e3a6))
|
|
19
|
+
- **vesting:** stop preflightCreateVesting throwing on a non-ERC7984 token ([dfbc795](https://github.com/VestingLabs/tokenops-sdk/commit/dfbc795fa7f0fd2aee9e1abfb711e82bca22ec4c))
|
|
20
|
+
|
|
21
|
+
## [2.0.0-alpha.1] - 2026-09-07
|
|
22
|
+
|
|
23
|
+
> **Pre-release built against unaudited contracts.** `/fhe-airdrop` in this build targets `tokenops-fhe-airdrop-v2`, frozen at commit `8e5b144bdbcdf35b9f36b62f5257d795bf954e8e`, which has not completed a final security audit. Deployed addresses may change before `2.0.0` GA, and breaking changes may land between any two alpha builds without a major bump (SemVer prerelease semantics). Published on the `alpha` dist-tag; `latest` stays on `1.6.0`. **For internal testing, not production value.**
|
|
24
|
+
>
|
|
25
|
+
> Migration guide: [`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md). Support policy: [`SUPPORT.md`](SUPPORT.md).
|
|
26
|
+
|
|
27
|
+
### Changed — BREAKING
|
|
28
|
+
|
|
29
|
+
- **`/fhe-airdrop` now targets confidential airdrop v2.** The subpath name is unchanged; everything behind it is new. v1 and v2 are different contract systems, not two versions of one — there is no in-place upgrade path for a deployed v1 airdrop. `AIRDROP_CONTRACTS_COMMIT` pins the contract commit the vendored ABIs were generated from.
|
|
30
|
+
- **`DEPLOYED_ADDRESSES.fheAirdrop` reshaped from one key to four.** Previously a single `confidentialAirdropFactory`; now `{ airdropFactory, ecdsaImplementation, merkleImplementation, complianceManagerImplementation }`. Code reading `DEPLOYED_ADDRESSES.fheAirdrop[chainId]` must read `.airdropFactory[chainId]`. Note this member is `@public`, not `@alpha` — it is the one breaking change outside the alpha-tagged surface.
|
|
31
|
+
- **The EIP-712 claim typehash gained two fields.** A v1 signature will not verify against a v2 instance, or vice versa. Re-issue authorizations from the v2 signing surface; do not port stored signatures.
|
|
32
|
+
- **Claim entrypoints take an explicit `signer`.** The claiming account is no longer inferred from the wallet client, because a Merkle leaf commits the _claimant_ — inferring it silently produced proofs bound to the wrong address.
|
|
33
|
+
- **Role-constant getters renamed to SCREAMING_SNAKE** across all five clients (`DEFAULT_ADMIN_ROLE`, `PAUSER_ROLE`, `MERKLE_ADMIN_ROLE`, `DISCLOSURE_ADMIN_ROLE`, `DELEGATION_ADMIN_ROLE`, `COMPLIANCE_WIRING_ROLE`, `FEE_MANAGER_ROLE`, `FEE_COLLECTOR_ROLE`, `IMPL_MANAGER_ROLE`, `RESCUER_ROLE`). They are contract function names and now read as such.
|
|
34
|
+
|
|
35
|
+
### Removed — BREAKING
|
|
36
|
+
|
|
37
|
+
- **The entire v1 `/fhe-airdrop` module** — clients, types, errors, ABIs, advanced surface and examples. There is no deprecation window on the v1 _shape_: it is deleted, not aliased. `1.x` remains fully supported for consumers not ready to migrate; see [`SUPPORT.md`](SUPPORT.md).
|
|
38
|
+
- **44 airdrop-specific React hooks** — 43 from `@tokenops/sdk/fhe-airdrop/react`, and `usePredictAirdropAddress` from `@tokenops/sdk/fhe-airdrop/advanced/react`. The v2 surface is 23 hooks (21 + 2 advanced); the reduction is deliberate, since several v1 hooks wrapped a single contract read with no added value.
|
|
39
|
+
- **`useIsOperator` and `useEnsureOperator` are NOT removed.** They live at `@tokenops/sdk/fhe/react` and are unaffected. If you imported them _via_ `@tokenops/sdk/fhe-airdrop/react`, change the import path; the hooks themselves are unchanged.
|
|
40
|
+
|
|
41
|
+
### Added — confidential airdrop v2
|
|
42
|
+
|
|
43
|
+
- **Split clients per variant.** `EcdsaAirdropClient` (signature-authorized claims) and `MerkleAirdropClient` (proof-authorized claims) over a shared `AirdropBaseClient`, plus `ConfidentialAirdropFactoryClient` for creation, funding, fee administration and address prediction.
|
|
44
|
+
- **Merkle campaign construction, in two independently usable stages.** `encryptCampaignAmounts()` is the relayer-only half — one request per recipient, no tree. `buildMerkleTree()` is the pure half: no relayer, no chain access, deterministic, and generic over its leaf type (`L extends MerkleLeafInput`), so an `inputProof` or any caller-defined field rides through onto the returned entry at the same index with no re-correlation. `buildMerkleCampaign()` is unchanged in signature and behaviour and is now the composition of the two. This is what lets a consumer who already holds encrypted handles build a claimable campaign without re-encrypting — necessary because FHE encryption is randomised, so re-encrypting produces a tree committing to handles nobody holds.
|
|
45
|
+
- **`planMerkleCampaign()`** for the immutable-root path, which is otherwise circular: the root must exist before creation, yet every ciphertext binds to the instance address creation has not produced. It uses the factory's CREATE2 prediction and brackets that prediction with two init-code-hash reads, throwing `PredictionDriftError` rather than returning a plan bound to a stale address.
|
|
46
|
+
- **`rotateMerkleRoot()`** — re-encrypt and republish as a top-up. A claim pays `total − min(total, alreadyDelivered)`, so `recipients` must carry each account's new _cumulative_ total, never an increment.
|
|
47
|
+
- **`ComplianceManagerClient`** for the compliance clone: wiring, party disclosure, and role administration.
|
|
48
|
+
- **Instance role splitting and full role administration** — `planInstanceRoleSplit()` and `grantInstanceRoles()`, which confirms each step's receipt before advancing so a dependent revoke cannot be simulated against state that lacks the preceding grant.
|
|
49
|
+
- **Guardrails and preflights** — typed, pre-transaction failures for salt collisions, wrapper assumptions and window state, instead of an opaque revert.
|
|
50
|
+
- **`deploymentMode()`** on `AirdropBaseClient`, reading the ERC-1967 implementation slot. Necessary because `proxiableUUID()` cannot discriminate a clone from a UUPS proxy: OpenZeppelin's `notDelegated` makes it revert through _any_ proxy.
|
|
51
|
+
- **`upgradeToAndCall()`** on `AirdropBaseClient`, and **`eip712Domain()`** on `EcdsaAirdropClient` (EIP-5267 domain discovery).
|
|
52
|
+
- **23 React hooks** across `/fhe-airdrop/react` and `/fhe-airdrop/advanced/react`, wagmi + TanStack Query, sharing the `"tokenops-sdk"` query-key prefix used by every sibling subpath.
|
|
53
|
+
- **Typed error mapping** from v2 revert selectors, and encrypted-view reads that extract handles from the executed receipt's ACL `Allowed` event rather than from `simulateContract()` — a simulated handle carries no ACL and fails later, at the decrypt, far from its cause.
|
|
54
|
+
- **Docs and examples** — [`docs/fhe-airdrop/README.md`](docs/fhe-airdrop/README.md) with measured live-relayer throughput, per-recipient storage sizing, and a "bring your own handles" guide; [`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md); a README compatibility matrix; and three runnable examples (`fhe-airdrop-merkle-campaign.ts`, `fhe-airdrop-external-handles.ts`, `fhe-airdrop-ecdsa-claim.ts`).
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- **`release.yml` no longer defaults a prerelease onto the `latest` dist-tag.** The npm dist-tag is derived from the package version (`alpha` / `beta` / `rc` / `next` / `latest`), and the `workflow_dispatch` override input now defaults to blank so it cannot mask that derivation.
|
|
59
|
+
- **`useAirdropPause` invalidates the `window` query as well as `paused`.** `isClaimWindowActive()` ANDs the pause flag with the window check, so mounted `useAirdropWindow` consumers previously kept a stale `isActive` after either pause transition.
|
|
60
|
+
|
|
61
|
+
---
|
|
22
62
|
|
|
23
|
-
|
|
63
|
+
_The sections below were developed against `1.x` and had not yet shipped when `2.0.0-alpha.1` was cut. They are unrelated to the airdrop rewrite, and none of them are breaking._
|
|
24
64
|
|
|
25
65
|
### Added — operator prerequisite DX helpers (TOK-75)
|
|
26
66
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -108,6 +108,8 @@ Pattern: `<type>(<scope>): <imperative description>`. Scope is optional; use the
|
|
|
108
108
|
|
|
109
109
|
## Claude Code Setup
|
|
110
110
|
|
|
111
|
-
The `claude-setup/` directory contains a `settings.json` and skill definitions that configure Claude Code for this repository.
|
|
111
|
+
The `claude-setup/` directory contains a `settings.json` and skill definitions (jsdoc, tanstack-best-practices, fhevm-security) that configure Claude Code for this repository. Run `pnpm setup:claude` to install them into your local `.claude/`. It copies on a first run and merges on later ones, so re-running after a pull picks up repo changes without discarding your own settings.
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
`.claude/` is gitignored, so adoption is opt-in and nothing you put there is shared. `.codex/` and `.agents/` are ignored on the same basis - this repo does not assume which agent you use.
|
|
114
|
+
|
|
115
|
+
See the `claude-setup/` directory and Anthropic's [Claude Code plugin model](https://docs.claude.ai/en/docs/claude-code) for details.
|
package/README.md
CHANGED
|
@@ -21,27 +21,43 @@ Node `>= 22` is required (constraint from `@zama-fhe/sdk`).
|
|
|
21
21
|
|
|
22
22
|
All subpaths are independently tree-shakeable. The `/react` paths keep React deps out of the server bundle.
|
|
23
23
|
|
|
24
|
-
| Subpath | Status
|
|
25
|
-
| ------------------------------------------ |
|
|
26
|
-
| `@tokenops/sdk` | stable
|
|
27
|
-
| `@tokenops/sdk/telemetry` | stable
|
|
28
|
-
| `@tokenops/sdk/fhe` | stable
|
|
29
|
-
| `@tokenops/sdk/fhe/react` | stable
|
|
30
|
-
| `@tokenops/sdk/fhe-vesting` | factory live on Sepolia
|
|
31
|
-
| `@tokenops/sdk/fhe-vesting/react` | stable
|
|
32
|
-
| `@tokenops/sdk/fhe-vesting/advanced` | stable
|
|
33
|
-
| `@tokenops/sdk/fhe-vesting/advanced/react` | stable
|
|
34
|
-
| `@tokenops/sdk/fhe-airdrop` | factory live on Sepolia
|
|
35
|
-
| `@tokenops/sdk/fhe-airdrop/react` |
|
|
36
|
-
| `@tokenops/sdk/fhe-airdrop/advanced` |
|
|
37
|
-
| `@tokenops/sdk/fhe-airdrop/advanced/react` |
|
|
38
|
-
| `@tokenops/sdk/fhe-disperse` | singleton live on mainnet + Sepolia
|
|
39
|
-
| `@tokenops/sdk/fhe-disperse/react` | stable
|
|
40
|
-
| `@tokenops/sdk/testnet-faucet` | token pair live on Sepolia
|
|
41
|
-
| `@tokenops/sdk/testnet-faucet/react` | stable
|
|
24
|
+
| Subpath | Status | Description |
|
|
25
|
+
| ------------------------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| `@tokenops/sdk` | stable | Root re-exports (version, core error types) |
|
|
27
|
+
| `@tokenops/sdk/telemetry` | stable | Telemetry sink adapters (`NoopTelemetry`, `ConsoleTelemetry`, `TokenOpsTelemetry`) |
|
|
28
|
+
| `@tokenops/sdk/fhe` | stable | FHE utility helpers (ratio scaling, encrypted-input types, operator helpers) |
|
|
29
|
+
| `@tokenops/sdk/fhe/react` | stable | React hooks for shared FHE utilities |
|
|
30
|
+
| `@tokenops/sdk/fhe-vesting` | factory live on Sepolia | Confidential vesting (LibClone + packed immutable args) |
|
|
31
|
+
| `@tokenops/sdk/fhe-vesting/react` | stable | React/wagmi hooks for confidential vesting |
|
|
32
|
+
| `@tokenops/sdk/fhe-vesting/advanced` | stable | Pre-mine address prediction (`predictManagerAddress`) |
|
|
33
|
+
| `@tokenops/sdk/fhe-vesting/advanced/react` | stable | React hooks for advanced vesting flows |
|
|
34
|
+
| `@tokenops/sdk/fhe-airdrop` | **v2, unaudited** — `alpha` dist-tag, factory live on Sepolia | ECDSA + Merkle confidential airdrop campaigns — see [Compatibility](#compatibility) |
|
|
35
|
+
| `@tokenops/sdk/fhe-airdrop/react` | **v2, unaudited** | React/wagmi hooks for confidential airdrops |
|
|
36
|
+
| `@tokenops/sdk/fhe-airdrop/advanced` | **v2, unaudited** | Prediction-freshness / salt-availability guards for CREATE2 address prediction (prediction itself is on the headline `ConfidentialAirdropFactoryClient`) |
|
|
37
|
+
| `@tokenops/sdk/fhe-airdrop/advanced/react` | **v2, unaudited** | `usePredictEcdsaAirdropAddress` / `usePredictMerkleAirdropAddress` |
|
|
38
|
+
| `@tokenops/sdk/fhe-disperse` | singleton live on mainnet + Sepolia | DisperseConfidential (singleton + per-user wallet-pair clones) |
|
|
39
|
+
| `@tokenops/sdk/fhe-disperse/react` | stable | React/wagmi hooks for confidential disperse |
|
|
40
|
+
| `@tokenops/sdk/testnet-faucet` | token pair live on Sepolia | Testnet faucet for the TokenOps test-token pair — TTT (plain ERC-20) + CTTT (ERC-7984 wrapper); open mint |
|
|
41
|
+
| `@tokenops/sdk/testnet-faucet/react` | stable | React/wagmi hooks for the testnet faucet |
|
|
42
42
|
|
|
43
43
|
The canonical exports map is in [`package.json`](https://github.com/VestingLabs/tokenops-sdk/blob/main/package.json) under `"exports"`.
|
|
44
44
|
|
|
45
|
+
## Compatibility
|
|
46
|
+
|
|
47
|
+
Which contract generation a given SDK version talks to, and where that generation is deployed:
|
|
48
|
+
|
|
49
|
+
| SDK | Airdrop contracts | Contract commit | Chains |
|
|
50
|
+
| --------------- | ------------------ | --------------- | ------- |
|
|
51
|
+
| `2.0.0-alpha.x` | v2 (**unaudited**) | `8e5b144` | Sepolia |
|
|
52
|
+
| `1.x` | v1 | n/a | Sepolia |
|
|
53
|
+
|
|
54
|
+
`2.x`'s `/fhe-airdrop` is a full replacement of v1, not an extension — see
|
|
55
|
+
[`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md) for the symbol-by-symbol
|
|
56
|
+
delta and [`SUPPORT.md`](SUPPORT.md) for how long `1.x` keeps receiving fixes. The v1 Sepolia
|
|
57
|
+
factory (`0xbE6A3B78B36684fFee48De77d47Bc3393F5Acd4c`) stays live on-chain; `2.x` simply stops
|
|
58
|
+
addressing it. `/fhe-vesting` and `/fhe-disperse` are unaffected by this table — both are on their
|
|
59
|
+
usual SemVer track regardless of which `/fhe-airdrop` line you install.
|
|
60
|
+
|
|
45
61
|
## Quickstart — confidential vesting
|
|
46
62
|
|
|
47
63
|
```ts
|
|
@@ -268,17 +284,22 @@ See [Confidential Vesting — React hooks on docs.tokenops.xyz](https://docs.tok
|
|
|
268
284
|
|
|
269
285
|
## Quickstart — confidential airdrop
|
|
270
286
|
|
|
287
|
+
> **v2, unaudited.** `/fhe-airdrop` targets `tokenops-fhe-airdrop-v2` (`8e5b144`, Sepolia only, `alpha` dist-tag) — see [Compatibility](#compatibility). Migrating from `1.x`? See [`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md).
|
|
288
|
+
|
|
289
|
+
Two claim-authorisation variants share one factory: **ECDSA** (an off-chain signature from a `SIGNER_ROLE` holder) and **Merkle** (inclusion in a published tree). The example below is ECDSA — see [`docs/fhe-airdrop/README.md`](docs/fhe-airdrop/README.md#quickstart--merkle-campaign) for the Merkle flow.
|
|
290
|
+
|
|
271
291
|
```ts
|
|
272
|
-
import { createPublicClient, createWalletClient, http } from "viem";
|
|
292
|
+
import { createPublicClient, createWalletClient, http, zeroAddress } from "viem";
|
|
273
293
|
import { sepolia } from "viem/chains";
|
|
274
294
|
import { privateKeyToAccount } from "viem/accounts";
|
|
275
295
|
import { RelayerNode, SepoliaConfig } from "@zama-fhe/sdk/node";
|
|
276
296
|
import {
|
|
277
297
|
createConfidentialAirdropFactoryClient,
|
|
278
|
-
|
|
298
|
+
createEcdsaAirdropClient,
|
|
279
299
|
encryptUint64,
|
|
280
300
|
signClaimAuthorization,
|
|
281
301
|
} from "@tokenops/sdk/fhe-airdrop";
|
|
302
|
+
import { setOperator } from "@tokenops/sdk/fhe";
|
|
282
303
|
|
|
283
304
|
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
|
|
284
305
|
const rpcUrl = process.env.RPC_URL!;
|
|
@@ -291,80 +312,98 @@ const encryptor = new RelayerNode({
|
|
|
291
312
|
});
|
|
292
313
|
|
|
293
314
|
// Factory address resolves automatically from DEPLOYED_ADDRESSES on Sepolia.
|
|
294
|
-
const factory = createConfidentialAirdropFactoryClient({
|
|
295
|
-
publicClient,
|
|
296
|
-
walletClient,
|
|
297
|
-
encryptor,
|
|
298
|
-
});
|
|
315
|
+
const factory = createConfidentialAirdropFactoryClient({ publicClient, walletClient, encryptor });
|
|
299
316
|
|
|
300
317
|
const now = Math.floor(Date.now() / 1000);
|
|
301
318
|
const userSalt = "0x0000000000000000000000000000000000000000000000000000000000000001" as const;
|
|
302
319
|
const token = process.env.TOKEN as `0x${string}`;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
320
|
+
|
|
321
|
+
// Create. There is no `admin` field — the factory injects `admin = msg.sender`.
|
|
322
|
+
// `dedupMode` is required and cannot be read back from the chain later; record
|
|
323
|
+
// it yourself alongside the deployed address.
|
|
324
|
+
const { airdrop: airdropAddress } = await factory.createEcdsaAirdrop({
|
|
325
|
+
params: {
|
|
326
|
+
common: {
|
|
327
|
+
token,
|
|
328
|
+
startTime: now + 60,
|
|
329
|
+
endTime: now + 30 * 86400,
|
|
330
|
+
canExtendClaimWindow: false,
|
|
331
|
+
unwrappable: false,
|
|
332
|
+
complianceAdmin: zeroAddress, // zero => msg.sender
|
|
333
|
+
},
|
|
334
|
+
signer: account.address, // SIGNER_ROLE holder authorising claims
|
|
335
|
+
dedupMode: "perAddress",
|
|
336
|
+
},
|
|
337
|
+
mode: "clone",
|
|
316
338
|
userSalt,
|
|
317
339
|
});
|
|
318
340
|
|
|
319
|
-
//
|
|
320
|
-
//
|
|
321
|
-
//
|
|
341
|
+
// Fund. Requires the factory to hold ERC-7984 operator approval first — the
|
|
342
|
+
// FACTORY calls FHE.fromExternal on the pool amount, so the operator grant
|
|
343
|
+
// and the encryption both bind to the factory, not to the airdrop instance.
|
|
344
|
+
await setOperator({ publicClient, walletClient, token, spender: factory.address });
|
|
345
|
+
await factory.fundAirdrop({ airdrop: airdropAddress, amount: 1_000_000n });
|
|
346
|
+
|
|
347
|
+
// Admin: sign a claim authorization for a recipient. Bind the input proof to
|
|
348
|
+
// the RECIPIENT and to the AIRDROP INSTANCE — Zama proofs commit to
|
|
349
|
+
// (contractAddress, userAddress) at encrypt time, and a claim binds to
|
|
350
|
+
// (instance, claimant), not (factory, funder). Get the pair wrong and
|
|
351
|
+
// `FHE.fromExternal` reverts; it does not silently decrypt to zero.
|
|
322
352
|
// amount is raw token units; ERC-7984 uses 6 decimals, so 1_000_000n = 1 token.
|
|
323
353
|
const recipient = "0xRecipientAddress" as `0x${string}`;
|
|
324
|
-
const
|
|
354
|
+
const encryptedInput = await encryptUint64({
|
|
325
355
|
encryptor,
|
|
326
356
|
contractAddress: airdropAddress,
|
|
327
357
|
userAddress: recipient,
|
|
328
358
|
value: 1_000_000n,
|
|
329
359
|
});
|
|
360
|
+
const dedupId = "0x0000000000000000000000000000000000000000000000000000000000000001" as const;
|
|
361
|
+
const deadline = BigInt(now + 3600); // signature expires in 1 hour
|
|
330
362
|
const signature = await signClaimAuthorization({
|
|
331
363
|
walletClient,
|
|
332
|
-
airdropAddress,
|
|
364
|
+
airdrop: airdropAddress,
|
|
365
|
+
chainId: sepolia.id,
|
|
333
366
|
recipient,
|
|
334
|
-
encryptedAmountHandle:
|
|
367
|
+
encryptedAmountHandle: encryptedInput.handle,
|
|
368
|
+
dedupId,
|
|
369
|
+
deadline,
|
|
335
370
|
});
|
|
336
|
-
// Deliver { encryptedInput:
|
|
371
|
+
// Deliver { encryptedInput, dedupId, deadline, signer: account.address, signature }
|
|
372
|
+
// to the recipient via API / email / etc.
|
|
337
373
|
|
|
338
374
|
// User: claim tokens. The SDK submits the admin-issued pair verbatim — no
|
|
339
|
-
// re-encryption.
|
|
340
|
-
|
|
375
|
+
// re-encryption. The exact-equality gas fee (0 on the live Sepolia deployment
|
|
376
|
+
// today) is fetched fresh and attached as msg.value automatically.
|
|
377
|
+
const airdrop = createEcdsaAirdropClient({
|
|
341
378
|
publicClient,
|
|
342
379
|
walletClient,
|
|
343
380
|
address: airdropAddress,
|
|
381
|
+
dedupMode: "perAddress", // must match what was passed at create — no getter exists
|
|
344
382
|
});
|
|
345
|
-
await airdrop.claim({
|
|
383
|
+
await airdrop.claim({ encryptedInput, dedupId, deadline, signer: account.address, signature });
|
|
346
384
|
```
|
|
347
385
|
|
|
348
|
-
See [
|
|
386
|
+
See [`docs/fhe-airdrop/README.md`](docs/fhe-airdrop/README.md) for the full API reference, the Merkle campaign flow, guardrails, and the unaudited-contracts warning.
|
|
349
387
|
|
|
350
388
|
### Quickstart — confidential airdrop (React hooks)
|
|
351
389
|
|
|
352
|
-
Uses `@tokenops/sdk/fhe-airdrop/react`. Requires `wagmi`, `@tanstack/react-query`, and `@zama-fhe/react-sdk` as additional peer deps.
|
|
390
|
+
Uses `@tokenops/sdk/fhe-airdrop/react`. Requires `wagmi`, `@tanstack/react-query`, and `@zama-fhe/react-sdk` as additional peer deps. `signClaimAuthorization` is re-exported as a plain function (not a mutation hook) — signing is a synchronous `walletClient.signTypedData` call with no chain state to invalidate.
|
|
353
391
|
|
|
354
392
|
```tsx
|
|
355
|
-
import {
|
|
393
|
+
import { useWalletClient } from "wagmi";
|
|
356
394
|
import { useZamaSDK } from "@zama-fhe/react-sdk";
|
|
357
395
|
import {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
396
|
+
useCreateEcdsaAirdrop,
|
|
397
|
+
useFundAirdrop,
|
|
398
|
+
useEcdsaClaim,
|
|
361
399
|
encryptUint64,
|
|
400
|
+
signClaimAuthorization,
|
|
362
401
|
} from "@tokenops/sdk/fhe-airdrop/react";
|
|
363
402
|
|
|
364
403
|
// Wrap your app in wagmi's <WagmiProvider> + <QueryClientProvider> +
|
|
365
404
|
// @zama-fhe/react-sdk's <ZamaProvider> before rendering these components.
|
|
366
405
|
|
|
367
|
-
// --- Admin: deploy a campaign and issue a claim authorization ---
|
|
406
|
+
// --- Admin: deploy a campaign, fund it, and issue a claim authorization ---
|
|
368
407
|
|
|
369
408
|
function AdminPanel({
|
|
370
409
|
token,
|
|
@@ -379,58 +418,79 @@ function AdminPanel({
|
|
|
379
418
|
airdrop: `0x${string}`,
|
|
380
419
|
payload: {
|
|
381
420
|
encryptedInput: { handle: `0x${string}`; inputProof: `0x${string}` };
|
|
421
|
+
dedupId: `0x${string}`;
|
|
422
|
+
deadline: bigint;
|
|
423
|
+
signer: `0x${string}`;
|
|
382
424
|
signature: `0x${string}`;
|
|
383
425
|
},
|
|
384
426
|
) => void;
|
|
385
427
|
}) {
|
|
386
|
-
const queryClient = useQueryClient();
|
|
387
428
|
const zamaSDK = useZamaSDK();
|
|
429
|
+
const { data: walletClient } = useWalletClient();
|
|
388
430
|
|
|
389
431
|
// Factory address resolves automatically from DEPLOYED_ADDRESSES on Sepolia.
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
const sign = useSignClaimAuthorization();
|
|
432
|
+
// `useCreateEcdsaAirdrop` invalidates the factory registry reads for you.
|
|
433
|
+
const create = useCreateEcdsaAirdrop({ encryptor: () => zamaSDK.relayer });
|
|
434
|
+
const fund = useFundAirdrop({ encryptor: () => zamaSDK.relayer });
|
|
394
435
|
|
|
395
436
|
const now = Math.floor(Date.now() / 1000);
|
|
396
437
|
|
|
397
438
|
async function handleLaunch() {
|
|
398
439
|
const { airdrop } = await create.mutateAsync({
|
|
399
440
|
params: {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
441
|
+
common: {
|
|
442
|
+
token,
|
|
443
|
+
startTime: now + 60,
|
|
444
|
+
endTime: now + 30 * 86400,
|
|
445
|
+
canExtendClaimWindow: false,
|
|
446
|
+
unwrappable: false,
|
|
447
|
+
complianceAdmin: "0x0000000000000000000000000000000000000000",
|
|
448
|
+
},
|
|
449
|
+
signer: "0xYourSignerAddress" as `0x${string}`,
|
|
450
|
+
dedupMode: "perAddress", // record this — no on-chain getter exists later
|
|
405
451
|
},
|
|
452
|
+
mode: "clone",
|
|
406
453
|
userSalt:
|
|
407
454
|
"0x0000000000000000000000000000000000000000000000000000000000000001" as `0x${string}`,
|
|
408
455
|
});
|
|
409
456
|
|
|
410
|
-
|
|
457
|
+
await fund.mutateAsync({ airdrop, amount });
|
|
411
458
|
|
|
412
|
-
// Encrypt
|
|
413
|
-
const
|
|
459
|
+
// Encrypt bound to (airdrop instance, recipient) — not the factory.
|
|
460
|
+
const encryptedInput = await encryptUint64({
|
|
414
461
|
encryptor: zamaSDK.relayer,
|
|
415
462
|
contractAddress: airdrop,
|
|
416
463
|
userAddress: recipient,
|
|
417
464
|
value: amount,
|
|
418
465
|
});
|
|
419
466
|
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
|
|
467
|
+
const dedupId = "0x0000000000000000000000000000000000000000000000000000000000000001" as const;
|
|
468
|
+
const deadline = BigInt(now + 3600);
|
|
469
|
+
|
|
470
|
+
// Sign is a plain async function here — walletClient comes from wagmi.
|
|
471
|
+
const signature = await signClaimAuthorization({
|
|
472
|
+
walletClient: walletClient!,
|
|
473
|
+
airdrop,
|
|
474
|
+
chainId: walletClient!.chain.id,
|
|
423
475
|
recipient,
|
|
424
|
-
encryptedAmountHandle:
|
|
476
|
+
encryptedAmountHandle: encryptedInput.handle,
|
|
477
|
+
dedupId,
|
|
478
|
+
deadline,
|
|
425
479
|
});
|
|
426
480
|
|
|
427
|
-
// Deliver
|
|
428
|
-
onCampaignReady(airdrop, {
|
|
481
|
+
// Deliver this payload to the recipient via your API / email.
|
|
482
|
+
onCampaignReady(airdrop, {
|
|
483
|
+
encryptedInput,
|
|
484
|
+
dedupId,
|
|
485
|
+
deadline,
|
|
486
|
+
signer: "0xYourSignerAddress" as `0x${string}`,
|
|
487
|
+
signature,
|
|
488
|
+
});
|
|
429
489
|
}
|
|
430
490
|
|
|
431
491
|
return (
|
|
432
|
-
<button onClick={handleLaunch} disabled={create.isPending ||
|
|
433
|
-
{create.isPending ? "Deploying…" :
|
|
492
|
+
<button onClick={handleLaunch} disabled={create.isPending || fund.isPending}>
|
|
493
|
+
{create.isPending ? "Deploying…" : fund.isPending ? "Funding…" : "Launch airdrop"}
|
|
434
494
|
</button>
|
|
435
495
|
);
|
|
436
496
|
}
|
|
@@ -442,33 +502,29 @@ function RecipientClaim({
|
|
|
442
502
|
claimPayload,
|
|
443
503
|
}: {
|
|
444
504
|
airdropAddress: `0x${string}`;
|
|
445
|
-
// The admin-issued payload — encryption bound to this recipient
|
|
446
|
-
// committed to by the signature.
|
|
505
|
+
// The admin-issued payload — encryption bound to this recipient and this
|
|
506
|
+
// instance, handle committed to by the signature. Submitted verbatim.
|
|
447
507
|
claimPayload: {
|
|
448
508
|
encryptedInput: { handle: `0x${string}`; inputProof: `0x${string}` };
|
|
509
|
+
dedupId: `0x${string}`;
|
|
510
|
+
deadline: bigint;
|
|
511
|
+
signer: `0x${string}`;
|
|
449
512
|
signature: `0x${string}`;
|
|
450
513
|
};
|
|
451
514
|
}) {
|
|
452
|
-
|
|
453
|
-
|
|
515
|
+
// `dedupMode` must match what the campaign was created with — the contract
|
|
516
|
+
// has no on-chain getter, so a consumer must already know it.
|
|
517
|
+
const claim = useEcdsaClaim({ address: airdropAddress, dedupMode: "perAddress" });
|
|
454
518
|
|
|
455
519
|
return (
|
|
456
|
-
<button
|
|
457
|
-
onClick={() =>
|
|
458
|
-
claim.mutate(claimPayload, {
|
|
459
|
-
onSuccess: () =>
|
|
460
|
-
queryClient.invalidateQueries({ queryKey: ["tokenops-sdk", "fhe-airdrop"] }),
|
|
461
|
-
})
|
|
462
|
-
}
|
|
463
|
-
disabled={claim.isPending}
|
|
464
|
-
>
|
|
520
|
+
<button onClick={() => claim.mutate(claimPayload)} disabled={claim.isPending}>
|
|
465
521
|
{claim.isPending ? "Claiming…" : "Claim tokens"}
|
|
466
522
|
</button>
|
|
467
523
|
);
|
|
468
524
|
}
|
|
469
525
|
```
|
|
470
526
|
|
|
471
|
-
See [
|
|
527
|
+
See [`docs/fhe-airdrop/README.md`](docs/fhe-airdrop/README.md) for the full hook catalogue (including the Merkle-side `useCreateMerkleAirdrop` / `useMerkleClaim` / `useSetMerkleRoot`), encryptor wiring, address overrides, and query-key reference.
|
|
472
528
|
|
|
473
529
|
## Quickstart — confidential disperse
|
|
474
530
|
|
package/SUPPORT.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Support policy
|
|
2
|
+
|
|
3
|
+
This document states what level of support each `@tokenops/sdk` release line receives. It exists
|
|
4
|
+
because `2.0.0` is a major version driven by a full replacement of the `/fhe-airdrop` module
|
|
5
|
+
(v1 deleted, v2 takes the subpath) — see
|
|
6
|
+
[`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md) for the technical
|
|
7
|
+
delta.
|
|
8
|
+
|
|
9
|
+
## `1.x`
|
|
10
|
+
|
|
11
|
+
- **Critical security and correctness fixes only, for 90 days after `2.0.0` reaches `latest`
|
|
12
|
+
(GA).** After that window, `1.x` receives no further fixes of any kind.
|
|
13
|
+
- **No feature work on `1.x` from the day `release/v2` was opened (2026-09-05).** Every new
|
|
14
|
+
capability lands on the `2.x` line only, starting from that date.
|
|
15
|
+
- `1.x` is what you stay on if you depend on the v1 `/fhe-airdrop` shape and are not ready to
|
|
16
|
+
migrate — nothing about `1.x` breaks or is withdrawn by `2.0.0` shipping. Consumers that do not
|
|
17
|
+
import `/fhe-airdrop` are unaffected by the replacement and can move on their own schedule.
|
|
18
|
+
- The v1 contracts stay live on-chain throughout and beyond this window. This policy governs the
|
|
19
|
+
SDK's code, not contract uptime.
|
|
20
|
+
|
|
21
|
+
## `2.x`
|
|
22
|
+
|
|
23
|
+
- `2.0.0-alpha.x` and `2.0.0-beta.x` are pre-release channels for the airdrop v2 rewrite. No
|
|
24
|
+
stability promise between alpha builds; breaking changes may land between any two alpha
|
|
25
|
+
versions without a major bump, per SemVer's prerelease semantics. See the compatibility matrix
|
|
26
|
+
in [`README.md`](README.md#compatibility) for which contract commit each build speaks to.
|
|
27
|
+
- `2.0.0` (GA, `latest` dist-tag) ships once `tokenops-fhe-airdrop-v2` is audited and its
|
|
28
|
+
addresses are final. From GA onward, `2.x` follows the SDK's normal SemVer + Conventional
|
|
29
|
+
Commits support model — the same one `1.x` operated under before this document existed.
|
|
30
|
+
|
|
31
|
+
## Why `npm deprecate` is not used on the `1.x` range
|
|
32
|
+
|
|
33
|
+
`npm deprecate` operates on the package as a whole, scoped by version range — it has no concept
|
|
34
|
+
of "deprecate this subpath only." Running it against the `1.x` range would print a deprecation
|
|
35
|
+
warning on every install of `@tokenops/sdk@1.x`, including installs that use only `/fhe-vesting`
|
|
36
|
+
or `/fhe-disperse` — modules that are not being replaced and are not affected by this migration.
|
|
37
|
+
A package-wide deprecation notice would misrepresent the status of code that isn't changing. The
|
|
38
|
+
`1.x` line is fully supported per the window above; only the `/fhe-airdrop` _shape_ is superseded,
|
|
39
|
+
and that message belongs in the migration guide and the module README, not in an npm-wide flag
|
|
40
|
+
that cannot be scoped to one subpath.
|
|
41
|
+
|
|
42
|
+
## Getting help
|
|
43
|
+
|
|
44
|
+
- Migrating off v1 `/fhe-airdrop`: [`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md).
|
|
45
|
+
- Module docs (v2, unaudited): [`docs/fhe-airdrop/README.md`](docs/fhe-airdrop/README.md).
|
|
46
|
+
- Security issues: see [`SECURITY.md`](SECURITY.md).
|
|
47
|
+
- Everything else: open an issue against `VestingLabs/tokenops-sdk`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfidentialVestingFactoryClient, confidentialVestingFactoryAbi } from './chunk-
|
|
1
|
+
import { ConfidentialVestingFactoryClient, confidentialVestingFactoryAbi } from './chunk-EAJ7SYHE.js';
|
|
2
2
|
|
|
3
3
|
// src/fhe-vesting/advanced/factory-advanced.ts
|
|
4
4
|
var ConfidentialVestingFactoryAdvancedClient = class extends ConfidentialVestingFactoryClient {
|