@tokenops/sdk 2.0.0-alpha.1 → 2.0.0-alpha.3
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 +67 -2
- package/README.md +14 -8
- package/dist/{chunk-PUX5VXDB.cjs → chunk-4AWQJQXY.cjs} +1415 -69
- package/dist/{chunk-74QFZ5MK.js → chunk-4IB4IY5Y.js} +1 -1
- package/dist/{chunk-DZHYSUGY.js → chunk-6HCT4QIX.js} +12 -5
- package/dist/{chunk-FGEB7RMY.cjs → chunk-6XOAYDC6.cjs} +4 -4
- package/dist/{chunk-XAYGD4E4.cjs → chunk-AHU2HMNE.cjs} +3 -3
- package/dist/{chunk-6NAVMWZQ.js → chunk-BPIVVCSQ.js} +2 -2
- package/dist/{chunk-GKKDAW44.js → chunk-BXX5TETM.js} +1401 -59
- package/dist/{chunk-456VDDA3.js → chunk-GCJFAY4X.js} +78 -25
- package/dist/{chunk-CTED3MTR.cjs → chunk-GKYZQJGP.cjs} +82 -29
- package/dist/{chunk-JZLGCTGK.cjs → chunk-IEKTGJ4J.cjs} +2 -2
- package/dist/{chunk-6PXXGACR.cjs → chunk-JVNJSDQ4.cjs} +2 -2
- package/dist/{chunk-O5676ZWY.js → chunk-LEYYG4RF.js} +232 -6
- package/dist/{chunk-335Z2W67.js → chunk-NGU4JYIR.js} +1 -1
- package/dist/{chunk-5576FRT3.cjs → chunk-PG3WXT3K.cjs} +12 -5
- package/dist/{chunk-H5POPGOZ.js → chunk-PK6Q6J5F.js} +1 -1
- package/dist/chunk-TND5NDV7.cjs +263 -0
- package/dist/chunk-U3TBQRT7.js +253 -0
- package/dist/{chunk-EAJ7SYHE.js → chunk-WRWRA4TN.js} +1 -1
- package/dist/{chunk-JQYC66TO.cjs → chunk-YABHXJNH.cjs} +5 -5
- package/dist/{chunk-M4IT6DNJ.cjs → chunk-YTIYTV4K.cjs} +236 -4
- 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/airdrop-base.d.ts +19 -0
- package/dist/fhe-airdrop/abis/ecdsa.d.ts +19 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +113 -0
- package/dist/fhe-airdrop/abis/merkle.d.ts +43 -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 +620 -9
- package/dist/fhe-airdrop/advanced/react/index.d.cts +35 -0
- package/dist/fhe-airdrop/advanced/react/index.d.ts +35 -0
- package/dist/fhe-airdrop/advanced/react/index.js +590 -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 +26 -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 +37 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +37 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +48 -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 +29 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
- package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +30 -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/useSetMaxGasFee.d.ts +33 -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 +55 -8
- package/dist/fhe-airdrop/campaign.d.ts +61 -20
- package/dist/fhe-airdrop/constants.d.ts +9 -1
- package/dist/fhe-airdrop/ecdsa.d.ts +13 -0
- package/dist/fhe-airdrop/errors.d.ts +87 -0
- package/dist/fhe-airdrop/factory.d.ts +62 -22
- package/dist/fhe-airdrop/guards.d.ts +133 -4
- package/dist/fhe-airdrop/index.cjs +86 -971
- package/dist/fhe-airdrop/index.d.cts +4 -4
- package/dist/fhe-airdrop/index.d.ts +4 -4
- 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 +997 -87
- package/dist/fhe-airdrop/react/index.d.cts +53 -4
- package/dist/fhe-airdrop/react/index.d.ts +53 -4
- package/dist/fhe-airdrop/react/index.js +887 -27
- package/dist/fhe-airdrop/react/keys.d.ts +98 -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/useFactoryFees.d.ts +11 -4
- package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
- package/dist/fhe-airdrop/react/useIsAirdrop.d.ts +44 -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/useRefreshComplianceBalance.d.ts +36 -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/useResolveGasFee.d.ts +30 -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 +27 -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
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,71 @@ All notable changes to `@tokenops/sdk` will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.0-alpha.3] - 2026-09-16
|
|
9
|
+
|
|
10
|
+
> **Pre-release built against internally-audited, externally-unaudited contracts.** Continues the `2.0.0-alpha` line. `/fhe-airdrop` in this build targets `tokenops-fhe-airdrop-v2` at commit `c5c12c2087f61bcd5bd1daa802563ed3cd68f002`, which closes the internal audit round (audit-03 through audit-16) but has not completed an external security audit. Every Sepolia `fheAirdrop` address moved again in this build. 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.**
|
|
11
|
+
>
|
|
12
|
+
> Migration guide: [`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md). Support policy: [`SUPPORT.md`](SUPPORT.md).
|
|
13
|
+
|
|
14
|
+
### Changed - BREAKING
|
|
15
|
+
|
|
16
|
+
- **`CommonAirdropParams` gains a required `maxAcceptedGasFee`.** The factory resolves the creator's per-claim fee at execution time and reverts `GasFeeNotAccepted` above this bound (audit-09). It is required rather than defaulted because the fee is frozen into the instance for its lifetime and the value that resolves is chosen by the factory's fee manager, not the creator - a default would hand that decision back to whoever is not making it. Pass `UINT96_MAX` (newly exported) to keep the previous behaviour of accepting any fee.
|
|
17
|
+
- **Every Sepolia `fheAirdrop` address moved.** CREATE3 returns a consumed salt's existing address without comparing codehashes, so the audit redeploy bumped the canonical salt version `2.0.0` → `2.0.2` rather than redeploying over itself. Instances created through the previous factory are unreachable from this release; a campaign planned against it fails `PredictionDriftError`.
|
|
18
|
+
- **`AirdropInitialized` gained a `uint256 gasFee` argument.** The SDK resolves creates from `ConfidentialAirdropCreated` and is unaffected, but any consumer filtering the old topic must re-derive it.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **`factory.isAirdrop(candidate)`** and **`useIsAirdrop`** - the genuineness check (audit-10). Nothing readable at an instance proves which factory deployed it, and a claim against a look-alike **succeeds** and delivers nothing rather than reverting. `preflightClaim` gains an optional `factory` that folds the check in alongside every other blocker; supplying it turns the check on, omitting it leaves the existing call shape untouched. New `UnrecognisedAirdropError` (`TOKENOPS_UNRECOGNISED_AIRDROP`).
|
|
23
|
+
- **`refreshComplianceBalance()`** and **`useRefreshComplianceBalance`** - permissionless restoration of the compliance clone's live-balance grant (audit-04). The token rotates the instance's balance handle on every incoming transfer, including a direct one no airdrop code observes, so without this a campaign can be left with a clone that cannot read the pool and no admin around to fix it. The handle it returns is granted to the CLONE, not the caller.
|
|
24
|
+
- **`factory.setMaxGasFee` / `maxGasFee()`**, the factory's own ceiling on every configurable fee, gated by `DEFAULT_ADMIN_ROLE` rather than `FEE_MANAGER_ROLE` (audit-09). `useFactoryFees` now returns `maxGasFee` alongside `feeCollector` and `defaultGasFee`.
|
|
25
|
+
- **`factory.resolveGasFee(creator)`** - the number `maxAcceptedGasFee` is actually checked against, folding a per-creator override over the default. `GasFeeNotAcceptedError` carries it next to the declared bound, so a raised default is distinguishable from a custom override the creator did not know they had.
|
|
26
|
+
- **`useSetMaxGasFee`** (advanced/react) and **`useResolveGasFee`** (react). Every other factory fee control already had a hook; the ceiling did not, and composing the resolved fee by hand meant re-implementing the override-over-default rule in each consumer. `useSetDefaultGasFee`, `useSetCustomFee` and `useDisableCustomFee` now invalidate the resolved-fee key too.
|
|
27
|
+
- Revert mapping for `GasFeeNotAccepted`, `GasFeeExceedsMaximum` and `ZeroUnwrapRequestId`; `LastAdmin` and `ZeroAdminGrant` are now reachable from the factory as well as the instances.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- **`getClaimAmount` was documented as a free, repeatable preview.** It now reverts once the claim is consumed, raising the consuming path's own error in the consuming path's own order (audit-07). The docs point availability checks at `isSignatureValid`, which never reverts.
|
|
32
|
+
- **`discloseHandleToParty` gate #1 now demands PERSISTENT user-decryption ACL on both legs** (audit-06). A handle fresh out of an FHE op carries only a transient allowance and no longer passes; the TSDoc names that trap rather than leaving it to be discovered.
|
|
33
|
+
- **`rescueERC20` refuses the campaign token** (audit-05). Our doc claimed it was out of reach because the pool is ERC-7984 - but a wrapper token answers both interfaces, so that was an assumption, not a guarantee.
|
|
34
|
+
- **The factory admin set can no longer be emptied** (audit-14). A test asserted the opposite; it and the `LastAdmin` message, which said "instance", are corrected.
|
|
35
|
+
- **`ContractCommonParams` is derived from the vendored ABI** instead of being a hand-written mirror. It carried a comment promising a struct change would surface as a type error - it did not, because every write path passes `unknown[]` at the viem edge. The next struct change now fails the build.
|
|
36
|
+
- `useCreateEcdsaAirdrop` and `useCreateMerkleAirdrop` spelled the registry query key inline rather than through `airdropKeys`, the drift `keys.ts` exists to prevent. All four create hooks now go through it and also invalidate `isAirdropAll`.
|
|
37
|
+
- **`preflightCreate` could reject instead of collecting.** An out-of-range `maxAcceptedGasFee` was collected as a blocker and then encoded anyway by the next read, so viem's `IntegerOutOfRangeError` escaped from a function documented never to throw. The range check now short-circuits before any ABI-dependent read, and the regression test uses a real viem client because the suite's mock harness bypasses encoding entirely.
|
|
38
|
+
- **The provenance check had no chain identity.** `preflightClaim` could be handed an instance on one chain and a factory on another, and a registry hit over there would read as a clean `true`. `AirdropRegistry` now carries `chainId` and a mismatch is refused before the registry is consulted.
|
|
39
|
+
- **`useIsAirdrop` cached a negative answer forever.** The registry is append-only so `true` is immutable, but `false` is not: the address can be created later by a process the hook never hears from. Only positive answers are cached now. The `address` override is also documented as what it is - the trust root for a security check.
|
|
40
|
+
- Factory role documentation still described the pre-audit-14 behaviour in four places (`factory.renounceRole`, `useFactoryRenounceRole`, `useFactoryRevokeRole`, `useFactoryRoleMembers`), telling UIs to plan for a state the factory now rejects. The compliance clone genuinely has no floor and is unchanged.
|
|
41
|
+
- `refreshComplianceBalance` was described as making the clone's read permanent. Append-only ACL keeps the returned handle readable, but the next incoming transfer rotates the instance onto a handle the clone was never granted on - it is a snapshot, not a subscription. Pinned by a local test that funds between two refreshes.
|
|
42
|
+
- Restored the create methods' error labels. A blanket ABI-name replacement had changed `error.context.method` from `createEcdsaAirdrop` / `createMerkleAirdrop` to the Solidity entrypoint names, pointing callers at methods they cannot call; a test now pins them.
|
|
43
|
+
|
|
44
|
+
## [2.0.0-alpha.2] - 2026-09-10
|
|
45
|
+
|
|
46
|
+
> **Pre-release built against unaudited contracts.** Continues the `2.0.0-alpha` line. `/fhe-airdrop` in this build targets `tokenops-fhe-airdrop-v2`, frozen at commit `7175ac82f467f0f88c05aba1a4536892999b4251`, which has not completed a final security audit. Every Sepolia `fheAirdrop` address moved in this build, 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.**
|
|
47
|
+
>
|
|
48
|
+
> Migration guide: [`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md). Support policy: [`SUPPORT.md`](SUPPORT.md).
|
|
49
|
+
|
|
50
|
+
### Changed - BREAKING
|
|
51
|
+
|
|
52
|
+
- **`MerkleAirdropClient.claim` and `.getClaimAmount` submit an explicit claim identity.** The contracts gained a leading `address account`, which decoupled the leaf/accounting identity from the address the FHE input proof binds to. A relayer can now settle a leaf on a recipient's behalf.
|
|
53
|
+
- **`CampaignEntry` is `{ account, boundTo, handle, inputProof, merkleProof }`.** `recipient` is removed with **no alias**, as are `MerkleLeafInput.recipient` and `LeafOfArgs.recipient`. The field meant "leaf identity and submitter" at once and those are now different addresses, so an alias would have kept compiling while meaning something else. Entries serialised under `2.0.0-alpha.1` must be re-keyed; their handles remain valid, since leaf hashing did not change.
|
|
54
|
+
- **Every Sepolia `fheAirdrop` address moved.** `claim`'s breaking signature forced a fresh Merkle implementation and the deploy script redeploys the whole system, factory included. Instances created through the previous factory are unreachable from this release, and a campaign planned against it now fails `PredictionDriftError`.
|
|
55
|
+
- `claimAndUnwrap` is deliberately **unchanged** and remains submitted for the caller: publishing an allocation as a plain ERC-20 transfer is the recipient's own choice, so a relayed unwrap is unrepresentable rather than rejected. A `submitter`-bound campaign therefore has no unwrap path.
|
|
56
|
+
- `SenderNotAllowedToUseHandle` is gone from the Merkle ABI — that path no longer calls `FHE.fromExternal`.
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- **Batched relayed rosters are chunked at 32 recipients**, the 2048-bit input-ciphertext limit for `euint64`. `@zama-fhe/sdk` does not enforce it client-side, so an unchunked batch would have failed inside the prover; each chunk's proof is bound to the same submitter, so claims are unaffected.
|
|
61
|
+
- **`submitter?: Address` on every campaign builder** (`CampaignSubmitterOption`, accepted by `buildMerkleCampaign`, `encryptCampaignAmounts`, `planMerkleCampaign` and `rotateMerkleRoot`). Omitted keeps per-recipient binding; set binds the whole roster to one address under a single `encryptUint64Batch` call with one shared `inputProof`. The two shapes are mutually exclusive because an input proof carries exactly one `userAddress`, which is why bulk distribution needs a relayer. Shaped so a per-recipient `submitters?: Address[]` stays additive.
|
|
62
|
+
- **`UnauthorizedRedirectError`** (`TOKENOPS_UNAUTHORIZED_REDIRECT`), carrying `account`, `to` and `submitter` — the relation is the error, so blaming a single argument would mislead. Thrown before the write and mapped from the contract revert. `ZeroAccount` maps to `InvalidArgumentError`.
|
|
63
|
+
- **72 React hooks**, completing parity with the headless surface. Recipient, creator, campaign-owner and compliance-manager tiers on `@tokenops/sdk/fhe-airdrop/react`; the factory-admin tier (fee setters, implementation pointers, policy setters) on `@tokenops/sdk/fhe-airdrop/advanced/react`. Includes the encrypted-view mutations (`useAccessMerkleClaimAmount`, `useAccessEcdsaClaimAmount`, `useAdminGetCurrentBalance` and the disclosure family) that submit a transaction and return a handle recovered from the receipt.
|
|
64
|
+
- `useMemoComplianceManagerClient`, so the compliance-manager surface has a hook path at all.
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- **`useMerkleClaim` invalidated the wrong account.** It keyed `getClaimedAmount` on the transaction sender; the contract keys `claimedAmount` on the claim identity, so every relayed claim invalidated the relayer's cache entry and left the recipient's read stale.
|
|
69
|
+
- **`getClaimAmount` extracted the ACL handle for the wrong grantee.** The contract grants the outstanding handle to `account`, never the caller, so a relayed preview threw `ReceiptEventNotFoundError` after its transaction had already been mined. Silent on the self-preview path.
|
|
70
|
+
- The vendored local-fixture bytecode was a commit behind the vendored ABIs, so local Merkle suites deployed an implementation carrying the old `claim` selector.
|
|
71
|
+
- The ABI generator now emits `@alpha` itself, instead of relying on a hand-added tag that every regeneration silently dropped.
|
|
72
|
+
|
|
8
73
|
## [1.6.0](https://github.com/VestingLabs/tokenops-sdk/compare/v1.5.1...v1.6.0) (2026-07-28)
|
|
9
74
|
|
|
10
75
|
### Features
|
|
@@ -24,7 +89,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
24
89
|
>
|
|
25
90
|
> Migration guide: [`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md). Support policy: [`SUPPORT.md`](SUPPORT.md).
|
|
26
91
|
|
|
27
|
-
### Changed
|
|
92
|
+
### Changed - BREAKING
|
|
28
93
|
|
|
29
94
|
- **`/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
95
|
- **`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.
|
|
@@ -198,7 +263,7 @@ _Tagged but never published — the release workflow failed on this tag; the con
|
|
|
198
263
|
- **`ConfidentialVestingFactoryClient.createManager`, `ConfidentialAirdropFactoryClient.createConfidentialAirdrop`, and `ConfidentialAirdropFactoryClient.createAndFundConfidentialAirdrop` now block on `waitForTransactionReceipt` + `parseEventLogs` internally before resolving.** The returned `Create*Result` carries a fully-parsed `manager` / `airdrop` address when the promise resolves — callers no longer need a separate `waitForTransactionReceipt` + event-log scan after the call. Consumer-visible behavior change: if your code was doing `const { hash } = await createManager(...); const receipt = await waitForTransactionReceipt(hash)` you will now double-wait (harmless, but an extra round-trip). Drop the extra `waitForTransactionReceipt` call.
|
|
199
264
|
- **`createManagerAndGetAddress` and `createConfidentialAirdropAndGetAddress` are now passthroughs** — they no longer add a second wait step on top of the base creator. They remain exported as convenience aliases for consumers who discovered them first, but the base methods are the canonical entry point.
|
|
200
265
|
|
|
201
|
-
### Changed
|
|
266
|
+
### Changed - BREAKING (pre-1.0 publish)
|
|
202
267
|
|
|
203
268
|
The package has not been published to npm yet (`npm view @tokenops/sdk` returns 404), so the entries below land as direct shape changes rather than additive `*AndGetX` helpers.
|
|
204
269
|
|
package/README.md
CHANGED
|
@@ -32,9 +32,9 @@ All subpaths are independently tree-shakeable. The `/react` paths keep React dep
|
|
|
32
32
|
| `@tokenops/sdk/fhe-vesting/advanced` | stable | Pre-mine address prediction (`predictManagerAddress`) |
|
|
33
33
|
| `@tokenops/sdk/fhe-vesting/advanced/react` | stable | React hooks for advanced vesting flows |
|
|
34
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
|
|
35
|
+
| `@tokenops/sdk/fhe-airdrop/react` | **v2, unaudited** | React/wagmi hooks for recipients, campaign creators, campaign owners and the compliance manager |
|
|
36
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** |
|
|
37
|
+
| `@tokenops/sdk/fhe-airdrop/advanced/react` | **v2, unaudited** | Address-prediction hooks plus the factory-admin tier (fee setters, implementation pointers, policy setters) |
|
|
38
38
|
| `@tokenops/sdk/fhe-disperse` | singleton live on mainnet + Sepolia | DisperseConfidential (singleton + per-user wallet-pair clones) |
|
|
39
39
|
| `@tokenops/sdk/fhe-disperse/react` | stable | React/wagmi hooks for confidential disperse |
|
|
40
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 |
|
|
@@ -46,10 +46,16 @@ The canonical exports map is in [`package.json`](https://github.com/VestingLabs/
|
|
|
46
46
|
|
|
47
47
|
Which contract generation a given SDK version talks to, and where that generation is deployed:
|
|
48
48
|
|
|
49
|
-
| SDK
|
|
50
|
-
|
|
|
51
|
-
| `2.0.0-alpha.
|
|
52
|
-
| `1.
|
|
49
|
+
| SDK | Airdrop contracts | Contract commit | Chains |
|
|
50
|
+
| ------------------------- | ------------------------ | --------------- | ------- |
|
|
51
|
+
| `2.0.0-alpha.3` | v2 (internal audit only) | `c5c12c2` | Sepolia |
|
|
52
|
+
| `2.0.0-alpha.1`-`alpha.2` | v2 (unaudited) | `7175ac8` | Sepolia |
|
|
53
|
+
| `1.x` | v1 | n/a | Sepolia |
|
|
54
|
+
|
|
55
|
+
Alpha builds are pinned to a contract generation, and every generation so far has moved every
|
|
56
|
+
deployed address. An instance created through one generation's factory is unreachable from a
|
|
57
|
+
build pinned to another - read `AIRDROP_CONTRACTS_COMMIT` at runtime to confirm which one you
|
|
58
|
+
have.
|
|
53
59
|
|
|
54
60
|
`2.x`'s `/fhe-airdrop` is a full replacement of v1, not an extension — see
|
|
55
61
|
[`docs/migration/airdrop-v1-to-v2.md`](docs/migration/airdrop-v1-to-v2.md) for the symbol-by-symbol
|
|
@@ -284,7 +290,7 @@ See [Confidential Vesting — React hooks on docs.tokenops.xyz](https://docs.tok
|
|
|
284
290
|
|
|
285
291
|
## Quickstart — confidential airdrop
|
|
286
292
|
|
|
287
|
-
> **v2,
|
|
293
|
+
> **v2, internally audited only.** `/fhe-airdrop` targets `tokenops-fhe-airdrop-v2` (`c5c12c2`, 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
294
|
|
|
289
295
|
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
296
|
|
|
@@ -524,7 +530,7 @@ function RecipientClaim({
|
|
|
524
530
|
}
|
|
525
531
|
```
|
|
526
532
|
|
|
527
|
-
See [`docs/fhe-airdrop/README.md`](docs/fhe-airdrop/README.md) for the full hook catalogue
|
|
533
|
+
See [`docs/fhe-airdrop/README.md`](docs/fhe-airdrop/README.md) for the full hook catalogue across both import paths (`/fhe-airdrop/react` for recipients, creators, owners and compliance; `/fhe-airdrop/advanced/react` for prediction and factory admin), encryptor wiring, address overrides, and query-key reference.
|
|
528
534
|
|
|
529
535
|
## Quickstart — confidential disperse
|
|
530
536
|
|