@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.
Files changed (155) hide show
  1. package/CHANGELOG.md +67 -2
  2. package/README.md +14 -8
  3. package/dist/{chunk-PUX5VXDB.cjs → chunk-4AWQJQXY.cjs} +1415 -69
  4. package/dist/{chunk-74QFZ5MK.js → chunk-4IB4IY5Y.js} +1 -1
  5. package/dist/{chunk-DZHYSUGY.js → chunk-6HCT4QIX.js} +12 -5
  6. package/dist/{chunk-FGEB7RMY.cjs → chunk-6XOAYDC6.cjs} +4 -4
  7. package/dist/{chunk-XAYGD4E4.cjs → chunk-AHU2HMNE.cjs} +3 -3
  8. package/dist/{chunk-6NAVMWZQ.js → chunk-BPIVVCSQ.js} +2 -2
  9. package/dist/{chunk-GKKDAW44.js → chunk-BXX5TETM.js} +1401 -59
  10. package/dist/{chunk-456VDDA3.js → chunk-GCJFAY4X.js} +78 -25
  11. package/dist/{chunk-CTED3MTR.cjs → chunk-GKYZQJGP.cjs} +82 -29
  12. package/dist/{chunk-JZLGCTGK.cjs → chunk-IEKTGJ4J.cjs} +2 -2
  13. package/dist/{chunk-6PXXGACR.cjs → chunk-JVNJSDQ4.cjs} +2 -2
  14. package/dist/{chunk-O5676ZWY.js → chunk-LEYYG4RF.js} +232 -6
  15. package/dist/{chunk-335Z2W67.js → chunk-NGU4JYIR.js} +1 -1
  16. package/dist/{chunk-5576FRT3.cjs → chunk-PG3WXT3K.cjs} +12 -5
  17. package/dist/{chunk-H5POPGOZ.js → chunk-PK6Q6J5F.js} +1 -1
  18. package/dist/chunk-TND5NDV7.cjs +263 -0
  19. package/dist/chunk-U3TBQRT7.js +253 -0
  20. package/dist/{chunk-EAJ7SYHE.js → chunk-WRWRA4TN.js} +1 -1
  21. package/dist/{chunk-JQYC66TO.cjs → chunk-YABHXJNH.cjs} +5 -5
  22. package/dist/{chunk-M4IT6DNJ.cjs → chunk-YTIYTV4K.cjs} +236 -4
  23. package/dist/core/addresses.d.ts +4 -4
  24. package/dist/core/errors.d.ts +1 -1
  25. package/dist/fhe/types.d.ts +2 -2
  26. package/dist/fhe-airdrop/abis/airdrop-base.d.ts +19 -0
  27. package/dist/fhe-airdrop/abis/ecdsa.d.ts +19 -0
  28. package/dist/fhe-airdrop/abis/factory.d.ts +113 -0
  29. package/dist/fhe-airdrop/abis/merkle.d.ts +43 -12
  30. package/dist/fhe-airdrop/advanced/index.cjs +4 -4
  31. package/dist/fhe-airdrop/advanced/index.js +1 -1
  32. package/dist/fhe-airdrop/advanced/react/index.cjs +620 -9
  33. package/dist/fhe-airdrop/advanced/react/index.d.cts +35 -0
  34. package/dist/fhe-airdrop/advanced/react/index.d.ts +35 -0
  35. package/dist/fhe-airdrop/advanced/react/index.js +590 -7
  36. package/dist/fhe-airdrop/advanced/react/useClearCompliancePolicy.d.ts +28 -0
  37. package/dist/fhe-airdrop/advanced/react/useClearUpgradeabilityPolicy.d.ts +26 -0
  38. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +26 -0
  39. package/dist/fhe-airdrop/advanced/react/useEcdsaInitCodeHash.d.ts +30 -0
  40. package/dist/fhe-airdrop/advanced/react/useFactoryComplianceDelegate.d.ts +25 -0
  41. package/dist/fhe-airdrop/advanced/react/useFactoryCompliancePolicy.d.ts +38 -0
  42. package/dist/fhe-airdrop/advanced/react/useFactoryCustomFee.d.ts +24 -0
  43. package/dist/fhe-airdrop/advanced/react/useFactoryGrantRole.d.ts +32 -0
  44. package/dist/fhe-airdrop/advanced/react/useFactoryHasRole.d.ts +27 -0
  45. package/dist/fhe-airdrop/advanced/react/useFactoryImplementations.d.ts +33 -0
  46. package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +37 -0
  47. package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +37 -0
  48. package/dist/fhe-airdrop/advanced/react/useFactoryRoleConstants.d.ts +46 -0
  49. package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +48 -0
  50. package/dist/fhe-airdrop/advanced/react/useFactoryUpgradeabilityPolicy.d.ts +39 -0
  51. package/dist/fhe-airdrop/advanced/react/useMerkleInitCodeHash.d.ts +24 -0
  52. package/dist/fhe-airdrop/advanced/react/useSetComplianceDelegate.d.ts +33 -0
  53. package/dist/fhe-airdrop/advanced/react/useSetComplianceManagerImpl.d.ts +27 -0
  54. package/dist/fhe-airdrop/advanced/react/useSetCompliancePolicy.d.ts +28 -0
  55. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +29 -0
  56. package/dist/fhe-airdrop/advanced/react/useSetDefaultDelegateToCompliance.d.ts +31 -0
  57. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +30 -0
  58. package/dist/fhe-airdrop/advanced/react/useSetDefaultUpgradeable.d.ts +27 -0
  59. package/dist/fhe-airdrop/advanced/react/useSetEcdsaImplementation.d.ts +34 -0
  60. package/dist/fhe-airdrop/advanced/react/useSetFeeCollector.d.ts +27 -0
  61. package/dist/fhe-airdrop/advanced/react/useSetMaxGasFee.d.ts +33 -0
  62. package/dist/fhe-airdrop/advanced/react/useSetMerkleImplementation.d.ts +30 -0
  63. package/dist/fhe-airdrop/advanced/react/useSetUpgradeabilityPolicy.d.ts +31 -0
  64. package/dist/fhe-airdrop/airdrop-base.d.ts +55 -8
  65. package/dist/fhe-airdrop/campaign.d.ts +61 -20
  66. package/dist/fhe-airdrop/constants.d.ts +9 -1
  67. package/dist/fhe-airdrop/ecdsa.d.ts +13 -0
  68. package/dist/fhe-airdrop/errors.d.ts +87 -0
  69. package/dist/fhe-airdrop/factory.d.ts +62 -22
  70. package/dist/fhe-airdrop/guards.d.ts +133 -4
  71. package/dist/fhe-airdrop/index.cjs +86 -971
  72. package/dist/fhe-airdrop/index.d.cts +4 -4
  73. package/dist/fhe-airdrop/index.d.ts +4 -4
  74. package/dist/fhe-airdrop/index.js +8 -927
  75. package/dist/fhe-airdrop/merkle-tree.d.ts +32 -38
  76. package/dist/fhe-airdrop/merkle.d.ts +52 -31
  77. package/dist/fhe-airdrop/react/_shared.d.ts +13 -0
  78. package/dist/fhe-airdrop/react/index.cjs +997 -87
  79. package/dist/fhe-airdrop/react/index.d.cts +53 -4
  80. package/dist/fhe-airdrop/react/index.d.ts +53 -4
  81. package/dist/fhe-airdrop/react/index.js +887 -27
  82. package/dist/fhe-airdrop/react/keys.d.ts +98 -0
  83. package/dist/fhe-airdrop/react/useAccessEcdsaClaimAmount.d.ts +26 -0
  84. package/dist/fhe-airdrop/react/useAccessMerkleClaimAmount.d.ts +27 -0
  85. package/dist/fhe-airdrop/react/useAddComplianceDelegate.d.ts +37 -0
  86. package/dist/fhe-airdrop/react/useAdminBatchDiscloseBalanceToParties.d.ts +36 -0
  87. package/dist/fhe-airdrop/react/useAdminDiscloseBalanceToParty.d.ts +31 -0
  88. package/dist/fhe-airdrop/react/useAdminGetCurrentBalance.d.ts +27 -0
  89. package/dist/fhe-airdrop/react/useAirdropConfig.d.ts +49 -0
  90. package/dist/fhe-airdrop/react/useAirdropDeploymentMode.d.ts +28 -0
  91. package/dist/fhe-airdrop/react/useAirdropGrantRole.d.ts +35 -0
  92. package/dist/fhe-airdrop/react/useAirdropRenounceRole.d.ts +36 -0
  93. package/dist/fhe-airdrop/react/useAirdropRevokeRole.d.ts +33 -0
  94. package/dist/fhe-airdrop/react/useAirdropRoleAdmin.d.ts +28 -0
  95. package/dist/fhe-airdrop/react/useAirdropRoleConstants.d.ts +67 -0
  96. package/dist/fhe-airdrop/react/useAirdropRoleMembers.d.ts +49 -0
  97. package/dist/fhe-airdrop/react/useAirdropUpgradeToAndCall.d.ts +45 -0
  98. package/dist/fhe-airdrop/react/useBatchDiscloseHandlesToParty.d.ts +32 -0
  99. package/dist/fhe-airdrop/react/useBuildMerkleCampaign.d.ts +68 -0
  100. package/dist/fhe-airdrop/react/useComplianceGrantRole.d.ts +32 -0
  101. package/dist/fhe-airdrop/react/useComplianceHasRole.d.ts +37 -0
  102. package/dist/fhe-airdrop/react/useComplianceInfo.d.ts +50 -0
  103. package/dist/fhe-airdrop/react/useComplianceManagerOf.d.ts +32 -0
  104. package/dist/fhe-airdrop/react/useComplianceRenounceRole.d.ts +38 -0
  105. package/dist/fhe-airdrop/react/useComplianceRevokeRole.d.ts +36 -0
  106. package/dist/fhe-airdrop/react/useComplianceRoleConstants.d.ts +41 -0
  107. package/dist/fhe-airdrop/react/useComplianceRoleMembers.d.ts +45 -0
  108. package/dist/fhe-airdrop/react/useCreateAndFundEcdsaAirdrop.d.ts +55 -0
  109. package/dist/fhe-airdrop/react/useCreateAndFundMerkleAirdrop.d.ts +52 -0
  110. package/dist/fhe-airdrop/react/useDiscloseHandleToParty.d.ts +35 -0
  111. package/dist/fhe-airdrop/react/useEcdsaClaim.d.ts +4 -3
  112. package/dist/fhe-airdrop/react/useEcdsaClaimAndUnwrap.d.ts +27 -0
  113. package/dist/fhe-airdrop/react/useEcdsaDomain.d.ts +41 -0
  114. package/dist/fhe-airdrop/react/useEffectiveDelegateToCompliance.d.ts +26 -0
  115. package/dist/fhe-airdrop/react/useEncryptCampaignAmounts.d.ts +59 -0
  116. package/dist/fhe-airdrop/react/useFactoryFees.d.ts +11 -4
  117. package/dist/fhe-airdrop/react/useIsActiveDelegate.d.ts +29 -0
  118. package/dist/fhe-airdrop/react/useIsAirdrop.d.ts +44 -0
  119. package/dist/fhe-airdrop/react/useIsMerkleRootMutable.d.ts +21 -0
  120. package/dist/fhe-airdrop/react/useIsSignatureValid.d.ts +46 -0
  121. package/dist/fhe-airdrop/react/useMerkleClaim.d.ts +7 -19
  122. package/dist/fhe-airdrop/react/useMerkleClaimAndUnwrap.d.ts +29 -0
  123. package/dist/fhe-airdrop/react/usePlanMerkleCampaign.d.ts +53 -0
  124. package/dist/fhe-airdrop/react/usePreflightClaim.d.ts +46 -0
  125. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +67 -0
  126. package/dist/fhe-airdrop/react/useRefreshComplianceBalance.d.ts +36 -0
  127. package/dist/fhe-airdrop/react/useRescueERC20.d.ts +30 -0
  128. package/dist/fhe-airdrop/react/useRescueOtherConfidentialToken.d.ts +34 -0
  129. package/dist/fhe-airdrop/react/useResolveGasFee.d.ts +30 -0
  130. package/dist/fhe-airdrop/react/useRevokeComplianceDelegate.d.ts +37 -0
  131. package/dist/fhe-airdrop/react/useRotateMerkleRoot.d.ts +52 -0
  132. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +42 -0
  133. package/dist/fhe-airdrop/react/useWithdrawGasFee.d.ts +37 -0
  134. package/dist/fhe-airdrop/types.d.ts +27 -1
  135. package/dist/fhe-disperse/index.cjs +21 -21
  136. package/dist/fhe-disperse/index.js +2 -2
  137. package/dist/fhe-disperse/react/index.cjs +22 -22
  138. package/dist/fhe-disperse/react/index.js +3 -3
  139. package/dist/fhe-vesting/advanced/index.cjs +5 -5
  140. package/dist/fhe-vesting/advanced/index.js +3 -3
  141. package/dist/fhe-vesting/advanced/react/index.cjs +7 -7
  142. package/dist/fhe-vesting/advanced/react/index.js +4 -4
  143. package/dist/fhe-vesting/index.cjs +8 -8
  144. package/dist/fhe-vesting/index.js +2 -2
  145. package/dist/fhe-vesting/react/index.cjs +114 -114
  146. package/dist/fhe-vesting/react/index.js +3 -3
  147. package/dist/index.cjs +18 -18
  148. package/dist/index.js +1 -1
  149. package/dist/testnet-faucet/index.cjs +14 -14
  150. package/dist/testnet-faucet/index.js +2 -2
  151. package/dist/testnet-faucet/react/index.cjs +8 -8
  152. package/dist/testnet-faucet/react/index.js +3 -3
  153. package/package.json +1 -1
  154. package/dist/chunk-NCVX3K2N.cjs +0 -161
  155. package/dist/chunk-VP2B4WM2.js +0 -154
@@ -1,6 +1,6 @@
1
1
  import { SDK_VERSION } from './chunk-NWFMBLSQ.js';
2
2
  import { isContractRevert, mapContractRevert } from './chunk-4RAAATVY.js';
3
- import { getConfidentialTestTokenAddress, getTestTokenAddress } from './chunk-DZHYSUGY.js';
3
+ import { getConfidentialTestTokenAddress, getTestTokenAddress } from './chunk-6HCT4QIX.js';
4
4
  import { normaliseAddress } from './chunk-ZA673I3O.js';
5
5
  import { asEncryptedHandle, asTxHash } from './chunk-KWFFIJYX.js';
6
6
  import { TokenOpsSdkError, UnsupportedChainError, DeploymentAddressUnavailableError, TokenOpsContractError, ReceiptEventNotFoundError, ReceiptEventAmbiguousError, MissingWalletClientError, MissingAccountError, InvalidArgumentError } from './chunk-QBJ7O2B4.js';
@@ -8,22 +8,29 @@ var DEPLOYED_ADDRESSES = {
8
8
  // mainnet omitted — not deployed.
9
9
  }
10
10
  },
11
- // Airdrop v2 (tokenops-fhe-airdrop-v2 @ 8e5b144). The four contracts deploy
11
+ // Airdrop v2 (tokenops-fhe-airdrop-v2 @ c5c12c2). The four contracts deploy
12
12
  // together in one scripted run, so a chain either has all of them or none —
13
13
  // which is what `chainsWithDeployment` assumes.
14
+ //
15
+ // Every address moved again at c5c12c2. The internal-audit round changed the
16
+ // factory and all three implementations, and CREATE3 returns a consumed salt's
17
+ // EXISTING address without comparing codehashes - so the run bumps the canonical
18
+ // salt version (2.0.0 → 2.0.2) rather than redeploying over itself. A campaign
19
+ // planned against the previous factory therefore predicts an address the new
20
+ // factory will never produce; `PredictionDriftError` is what catches that.
14
21
  fheAirdrop: {
15
22
  airdropFactory: {
16
- [sepolia.id]: "0x383083B6f13a0ee513596A6750B511c5E482d2d1"
23
+ [sepolia.id]: "0xA10ff713cfeE5348313Cda0B2CA1b190A1194cab"
17
24
  // mainnet omitted — ZamaConfig-gated, not deployed.
18
25
  },
19
26
  ecdsaImplementation: {
20
- [sepolia.id]: "0xefE40570C1837210f8E4Ae938635e11bd1ae788E"
27
+ [sepolia.id]: "0x8d4E8F379f73D5488a76B6C3CC8a2fD489936BDe"
21
28
  },
22
29
  merkleImplementation: {
23
- [sepolia.id]: "0x9f3156546744F3ceE98Dc44bed817d98A8b8ae74"
30
+ [sepolia.id]: "0x4B4F43Ed9aB3F9D10468b59C03d14f55A9d4E82F"
24
31
  },
25
32
  complianceManagerImplementation: {
26
- [sepolia.id]: "0x6adA841250C048364d1d3027958C662Dd4E62136"
33
+ [sepolia.id]: "0x14bdE71e6b32b50dF1a5Dca1bccD150a319168e2"
27
34
  }
28
35
  },
29
36
  fheDisperse: {
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunk6PXXGACR_cjs = require('./chunk-6PXXGACR.cjs');
3
+ var chunkJVNJSDQ4_cjs = require('./chunk-JVNJSDQ4.cjs');
4
4
 
5
5
  // src/fhe-vesting/advanced/factory-advanced.ts
6
- var ConfidentialVestingFactoryAdvancedClient = class extends chunk6PXXGACR_cjs.ConfidentialVestingFactoryClient {
6
+ var ConfidentialVestingFactoryAdvancedClient = class extends chunkJVNJSDQ4_cjs.ConfidentialVestingFactoryClient {
7
7
  /**
8
8
  * Compute the deterministic CREATE2 clone address as the factory would have
9
9
  * computed it at `args.blockNumber`.
@@ -20,7 +20,7 @@ var ConfidentialVestingFactoryAdvancedClient = class extends chunk6PXXGACR_cjs.C
20
20
  if (hasOptions) {
21
21
  return this.publicClient.readContract({
22
22
  address: this.address,
23
- abi: chunk6PXXGACR_cjs.confidentialVestingFactoryAbi,
23
+ abi: chunkJVNJSDQ4_cjs.confidentialVestingFactoryAbi,
24
24
  functionName: "predictManagerAddressWithOptions",
25
25
  args: [
26
26
  args.token,
@@ -34,7 +34,7 @@ var ConfidentialVestingFactoryAdvancedClient = class extends chunk6PXXGACR_cjs.C
34
34
  }
35
35
  return this.publicClient.readContract({
36
36
  address: this.address,
37
- abi: chunk6PXXGACR_cjs.confidentialVestingFactoryAbi,
37
+ abi: chunkJVNJSDQ4_cjs.confidentialVestingFactoryAbi,
38
38
  functionName: "predictManagerAddress",
39
39
  args: [args.token, args.userSalt, args.deployer],
40
40
  blockNumber: args.blockNumber
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkUG5RKLU2_cjs = require('./chunk-UG5RKLU2.cjs');
4
4
  var chunkMVDQMV25_cjs = require('./chunk-MVDQMV25.cjs');
5
- var chunk5576FRT3_cjs = require('./chunk-5576FRT3.cjs');
5
+ var chunkPG3WXT3K_cjs = require('./chunk-PG3WXT3K.cjs');
6
6
  var chunkJK4XMMKM_cjs = require('./chunk-JK4XMMKM.cjs');
7
7
  var chunk66IHPTOK_cjs = require('./chunk-66IHPTOK.cjs');
8
8
  var chunk67OV5CX2_cjs = require('./chunk-67OV5CX2.cjs');
@@ -1826,7 +1826,7 @@ var TestnetFaucetClient = class {
1826
1826
  this.#chainId = chainId;
1827
1827
  assertTestnetFaucetChain(chainId);
1828
1828
  const addressOverride = config.address ? chunkJK4XMMKM_cjs.normaliseAddress(config.address) : void 0;
1829
- const resolved = addressOverride ?? (chainId === void 0 ? void 0 : chunk5576FRT3_cjs.getConfidentialTestTokenAddress(chainId));
1829
+ const resolved = addressOverride ?? (chainId === void 0 ? void 0 : chunkPG3WXT3K_cjs.getConfidentialTestTokenAddress(chainId));
1830
1830
  if (!resolved) {
1831
1831
  throw new chunk67OV5CX2_cjs.DeploymentAddressUnavailableError({
1832
1832
  reason: chainId === void 0 ? "chain-id-missing" : "registry-not-deployed",
@@ -1864,7 +1864,7 @@ var TestnetFaucetClient = class {
1864
1864
  */
1865
1865
  async underlyingToken() {
1866
1866
  if (this.#cachedUnderlying) return this.#cachedUnderlying;
1867
- const fromRegistry = this.#cttAddressIsOverride || this.#chainId === void 0 ? void 0 : chunk5576FRT3_cjs.getTestTokenAddress(this.#chainId);
1867
+ const fromRegistry = this.#cttAddressIsOverride || this.#chainId === void 0 ? void 0 : chunkPG3WXT3K_cjs.getTestTokenAddress(this.#chainId);
1868
1868
  const resolved = fromRegistry ?? await this.#readCtt("underlying");
1869
1869
  this.#cachedUnderlying = chunkJK4XMMKM_cjs.normaliseAddress(resolved);
1870
1870
  return this.#cachedUnderlying;
@@ -1,7 +1,7 @@
1
1
  import { createConfidentialVestingManagerClient } from './chunk-TWT3STIX.js';
2
2
  import { resolveEncryptor } from './chunk-6GNR22OV.js';
3
- import { createConfidentialVestingFactoryClient } from './chunk-EAJ7SYHE.js';
4
- import { getFheVestingFactoryAddress } from './chunk-DZHYSUGY.js';
3
+ import { createConfidentialVestingFactoryClient } from './chunk-WRWRA4TN.js';
4
+ import { getFheVestingFactoryAddress } from './chunk-6HCT4QIX.js';
5
5
  import { DeploymentAddressUnavailableError } from './chunk-QBJ7O2B4.js';
6
6
  import { useMemo, useRef, useEffect } from 'react';
7
7
  import { usePublicClient, useWalletClient } from 'wagmi';