@tokenops/sdk 2.0.0-alpha.2 → 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 (80) hide show
  1. package/CHANGELOG.md +39 -3
  2. package/README.md +11 -5
  3. package/dist/{chunk-PZZK3O3S.cjs → chunk-4AWQJQXY.cjs} +391 -43
  4. package/dist/{chunk-SPLNGUFF.js → chunk-4IB4IY5Y.js} +1 -1
  5. package/dist/{chunk-A4DCEE33.js → chunk-6HCT4QIX.js} +11 -10
  6. package/dist/{chunk-MM5BV5CS.cjs → chunk-6XOAYDC6.cjs} +4 -4
  7. package/dist/{chunk-FEDX7B6T.cjs → chunk-AHU2HMNE.cjs} +3 -3
  8. package/dist/{chunk-IGO5XSPS.js → chunk-BPIVVCSQ.js} +2 -2
  9. package/dist/{chunk-X7WBPCEU.js → chunk-BXX5TETM.js} +375 -27
  10. package/dist/{chunk-GADGBQJO.js → chunk-GCJFAY4X.js} +2 -2
  11. package/dist/{chunk-IUKKNJ2R.cjs → chunk-GKYZQJGP.cjs} +7 -7
  12. package/dist/{chunk-3YHBO2DL.cjs → chunk-IEKTGJ4J.cjs} +2 -2
  13. package/dist/{chunk-UHHMVBLU.cjs → chunk-JVNJSDQ4.cjs} +2 -2
  14. package/dist/{chunk-VW356KR3.js → chunk-LEYYG4RF.js} +126 -3
  15. package/dist/{chunk-PYYSB5ZN.js → chunk-NGU4JYIR.js} +1 -1
  16. package/dist/{chunk-FT5H2Q7Y.cjs → chunk-PG3WXT3K.cjs} +11 -10
  17. package/dist/{chunk-44YJPMQC.js → chunk-PK6Q6J5F.js} +1 -1
  18. package/dist/{chunk-EBLBPUPI.cjs → chunk-TND5NDV7.cjs} +18 -10
  19. package/dist/{chunk-EYDA6Q6C.js → chunk-U3TBQRT7.js} +10 -2
  20. package/dist/{chunk-WJMEBBU7.js → chunk-WRWRA4TN.js} +1 -1
  21. package/dist/{chunk-FHWSBGWE.cjs → chunk-YABHXJNH.cjs} +5 -5
  22. package/dist/{chunk-AREQJHKA.cjs → chunk-YTIYTV4K.cjs} +129 -2
  23. package/dist/core/addresses.d.ts +4 -4
  24. package/dist/core/errors.d.ts +1 -1
  25. package/dist/fhe-airdrop/abis/airdrop-base.d.ts +19 -0
  26. package/dist/fhe-airdrop/abis/ecdsa.d.ts +19 -0
  27. package/dist/fhe-airdrop/abis/factory.d.ts +113 -0
  28. package/dist/fhe-airdrop/abis/merkle.d.ts +19 -0
  29. package/dist/fhe-airdrop/advanced/index.cjs +4 -4
  30. package/dist/fhe-airdrop/advanced/index.js +1 -1
  31. package/dist/fhe-airdrop/advanced/react/index.cjs +110 -80
  32. package/dist/fhe-airdrop/advanced/react/index.d.cts +1 -0
  33. package/dist/fhe-airdrop/advanced/react/index.d.ts +1 -0
  34. package/dist/fhe-airdrop/advanced/react/index.js +34 -5
  35. package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +2 -1
  36. package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +4 -3
  37. package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +9 -7
  38. package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +6 -5
  39. package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +2 -1
  40. package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +5 -3
  41. package/dist/fhe-airdrop/advanced/react/useSetMaxGasFee.d.ts +33 -0
  42. package/dist/fhe-airdrop/airdrop-base.d.ts +47 -8
  43. package/dist/fhe-airdrop/constants.d.ts +9 -1
  44. package/dist/fhe-airdrop/ecdsa.d.ts +13 -0
  45. package/dist/fhe-airdrop/errors.d.ts +59 -0
  46. package/dist/fhe-airdrop/factory.d.ts +62 -22
  47. package/dist/fhe-airdrop/guards.d.ts +87 -2
  48. package/dist/fhe-airdrop/index.cjs +67 -55
  49. package/dist/fhe-airdrop/index.d.cts +3 -3
  50. package/dist/fhe-airdrop/index.d.ts +3 -3
  51. package/dist/fhe-airdrop/index.js +4 -4
  52. package/dist/fhe-airdrop/react/index.cjs +237 -177
  53. package/dist/fhe-airdrop/react/index.d.cts +4 -1
  54. package/dist/fhe-airdrop/react/index.d.ts +4 -1
  55. package/dist/fhe-airdrop/react/index.js +72 -15
  56. package/dist/fhe-airdrop/react/keys.d.ts +8 -0
  57. package/dist/fhe-airdrop/react/useFactoryFees.d.ts +11 -4
  58. package/dist/fhe-airdrop/react/useIsAirdrop.d.ts +44 -0
  59. package/dist/fhe-airdrop/react/useRefreshComplianceBalance.d.ts +36 -0
  60. package/dist/fhe-airdrop/react/useResolveGasFee.d.ts +30 -0
  61. package/dist/fhe-airdrop/types.d.ts +13 -0
  62. package/dist/fhe-disperse/index.cjs +21 -21
  63. package/dist/fhe-disperse/index.js +2 -2
  64. package/dist/fhe-disperse/react/index.cjs +22 -22
  65. package/dist/fhe-disperse/react/index.js +3 -3
  66. package/dist/fhe-vesting/advanced/index.cjs +5 -5
  67. package/dist/fhe-vesting/advanced/index.js +3 -3
  68. package/dist/fhe-vesting/advanced/react/index.cjs +7 -7
  69. package/dist/fhe-vesting/advanced/react/index.js +4 -4
  70. package/dist/fhe-vesting/index.cjs +8 -8
  71. package/dist/fhe-vesting/index.js +2 -2
  72. package/dist/fhe-vesting/react/index.cjs +114 -114
  73. package/dist/fhe-vesting/react/index.js +3 -3
  74. package/dist/index.cjs +18 -18
  75. package/dist/index.js +1 -1
  76. package/dist/testnet-faucet/index.cjs +14 -14
  77. package/dist/testnet-faucet/index.js +2 -2
  78. package/dist/testnet-faucet/react/index.cjs +8 -8
  79. package/dist/testnet-faucet/react/index.js +3 -3
  80. package/package.json +1 -1
@@ -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-A4DCEE33.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,28 +8,29 @@ var DEPLOYED_ADDRESSES = {
8
8
  // mainnet omitted — not deployed.
9
9
  }
10
10
  },
11
- // Airdrop v2 (tokenops-fhe-airdrop-v2 @ 7175ac8). 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
14
  //
15
- // Every address moved at 7175ac8: `claim`'s breaking signature change forced a
16
- // fresh Merkle implementation, and the run redeploys the whole system rather
17
- // than repointing one implementation slot. A campaign planned against the old
18
- // factory therefore predicts an address the new factory will never produce —
19
- // `PredictionDriftError` is what catches that.
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.
20
21
  fheAirdrop: {
21
22
  airdropFactory: {
22
- [sepolia.id]: "0x174A7CB40F64aBC4C95CecB4172A066Cf531e4E9"
23
+ [sepolia.id]: "0xA10ff713cfeE5348313Cda0B2CA1b190A1194cab"
23
24
  // mainnet omitted — ZamaConfig-gated, not deployed.
24
25
  },
25
26
  ecdsaImplementation: {
26
- [sepolia.id]: "0xDeD7AB391f87B8F891F89AaEC64C7c9C800C6645"
27
+ [sepolia.id]: "0x8d4E8F379f73D5488a76B6C3CC8a2fD489936BDe"
27
28
  },
28
29
  merkleImplementation: {
29
- [sepolia.id]: "0x815E65Cdd707F07F09332537b47C530d0E87aAf5"
30
+ [sepolia.id]: "0x4B4F43Ed9aB3F9D10468b59C03d14f55A9d4E82F"
30
31
  },
31
32
  complianceManagerImplementation: {
32
- [sepolia.id]: "0x885474FA494748C85410482244a406C6Ad570CCe"
33
+ [sepolia.id]: "0x14bdE71e6b32b50dF1a5Dca1bccD150a319168e2"
33
34
  }
34
35
  },
35
36
  fheDisperse: {
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkUHHMVBLU_cjs = require('./chunk-UHHMVBLU.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 chunkUHHMVBLU_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 chunkUHHMVBLU_cjs.C
20
20
  if (hasOptions) {
21
21
  return this.publicClient.readContract({
22
22
  address: this.address,
23
- abi: chunkUHHMVBLU_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 chunkUHHMVBLU_cjs.C
34
34
  }
35
35
  return this.publicClient.readContract({
36
36
  address: this.address,
37
- abi: chunkUHHMVBLU_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 chunkFT5H2Q7Y_cjs = require('./chunk-FT5H2Q7Y.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 : chunkFT5H2Q7Y_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 : chunkFT5H2Q7Y_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-WJMEBBU7.js';
4
- import { getFheVestingFactoryAddress } from './chunk-A4DCEE33.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';