@tokenops/sdk 1.1.1 → 1.6.0

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 (163) hide show
  1. package/CHANGELOG.md +158 -2
  2. package/README.md +18 -8
  3. package/SECURITY.md +7 -1
  4. package/dist/{chunk-56UI7LUR.cjs → chunk-2RNW4MIJ.cjs} +37 -0
  5. package/dist/{chunk-VDXVNZCO.cjs → chunk-43RFBQ73.cjs} +85 -29
  6. package/dist/{chunk-BE2AIZ3K.js → chunk-46T67CE2.js} +1 -1
  7. package/dist/{chunk-WRCUDSUJ.js → chunk-4KJ66YRH.js} +61 -3
  8. package/dist/{chunk-ITQ7WKVC.cjs → chunk-4ZCXK4VI.cjs} +68 -8
  9. package/dist/{chunk-JFLEEXKP.js → chunk-6WSNS3UV.js} +58 -2
  10. package/dist/{chunk-W7JHOK7G.cjs → chunk-7G7UOQV4.cjs} +4 -4
  11. package/dist/{chunk-5KHIQG7Y.cjs → chunk-AYGRYDBX.cjs} +35 -36
  12. package/dist/{chunk-5SGMJADP.cjs → chunk-BD4LZBVF.cjs} +85 -9
  13. package/dist/{chunk-OYLZEEHF.cjs → chunk-BK7YIVLK.cjs} +304 -179
  14. package/dist/{chunk-SEKC7H5Y.cjs → chunk-CBRL2PJA.cjs} +12 -11
  15. package/dist/{chunk-XWDVPV42.js → chunk-CNP4L3GF.js} +4 -4
  16. package/dist/{chunk-IVE3QEGD.js → chunk-DRSPMIZ7.js} +28 -1
  17. package/dist/{chunk-SAGJIEQK.cjs → chunk-EUKPOXWR.cjs} +15 -16
  18. package/dist/chunk-FT4LNBOS.js +11 -0
  19. package/dist/{chunk-ITQBDRWX.js → chunk-HETNKZEE.js} +1 -1
  20. package/dist/{chunk-JJ4R5QXF.js → chunk-KSDSXJ34.js} +1 -1
  21. package/dist/{chunk-SYHXDHWX.cjs → chunk-LBWRFZR3.cjs} +218 -31
  22. package/dist/{chunk-ZXCOJY2Z.js → chunk-NFW7AUEX.js} +1 -1
  23. package/dist/{chunk-FPQBFIUW.cjs → chunk-OL6SHN3D.cjs} +3 -3
  24. package/dist/{chunk-XSNLAS5M.js → chunk-PD7ME2BT.js} +75 -2
  25. package/dist/{chunk-FXCW7LVB.js → chunk-QET3Q4JP.js} +94 -9
  26. package/dist/{chunk-M7V2EDPB.js → chunk-QKKBBH7I.js} +2 -2
  27. package/dist/{chunk-XXXDQSHE.js → chunk-S2XD75JM.js} +12 -3
  28. package/dist/{chunk-5SA2HF2W.cjs → chunk-SPGSO5SO.cjs} +31 -22
  29. package/dist/{chunk-Q7ARQSUH.cjs → chunk-SYHNZSZZ.cjs} +3 -3
  30. package/dist/{chunk-X56UVEXS.js → chunk-TN65XNTI.js} +248 -120
  31. package/dist/chunk-U57COLUE.js +56 -0
  32. package/dist/{chunk-OQZAZIAS.js → chunk-UE5XK2SY.js} +193 -6
  33. package/dist/{chunk-NS44KBV5.cjs → chunk-UJS4N2XM.cjs} +12 -12
  34. package/dist/{chunk-IR5AK5U5.js → chunk-V5D7BHW3.js} +4 -5
  35. package/dist/{chunk-3PQ2RFPC.js → chunk-VHSNYUYV.js} +5 -4
  36. package/dist/{chunk-CQIPRNS7.cjs → chunk-VR3FREBX.cjs} +3 -3
  37. package/dist/{chunk-G7G75C46.cjs → chunk-WO72UBQD.cjs} +11 -11
  38. package/dist/chunk-WOEETTH7.cjs +59 -0
  39. package/dist/{chunk-QE7ZONJ2.js → chunk-WTK6JDSI.js} +4 -5
  40. package/dist/{chunk-3ZRHDTEX.cjs → chunk-WUXUWTFW.cjs} +3 -3
  41. package/dist/{chunk-23F7JIK5.cjs → chunk-YFIWCYHC.cjs} +141 -54
  42. package/dist/{chunk-FYQ2UW4T.js → chunk-YPYCWLYP.js} +1 -1
  43. package/dist/chunk-ZQUE2B3Q.cjs +33 -0
  44. package/dist/core/addresses.d.ts +1 -1
  45. package/dist/core/errors.d.ts +41 -1
  46. package/dist/core/revert-mapper.d.ts +77 -0
  47. package/dist/core/wagmi-compat.d.ts +40 -0
  48. package/dist/fhe/index.cjs +134 -68
  49. package/dist/fhe/index.d.cts +2 -1
  50. package/dist/fhe/index.d.ts +2 -1
  51. package/dist/fhe/index.js +64 -10
  52. package/dist/fhe/mock-erc7984.d.ts +4 -4
  53. package/dist/fhe/operators.d.ts +142 -2
  54. package/dist/fhe/react/index.cjs +21 -8
  55. package/dist/fhe/react/index.d.cts +2 -0
  56. package/dist/fhe/react/index.d.ts +2 -0
  57. package/dist/fhe/react/index.js +8 -3
  58. package/dist/fhe/react/useEnsureOperator.d.ts +56 -0
  59. package/dist/fhe/react/useIsOperator.d.ts +54 -0
  60. package/dist/fhe/sepolia-encryptor-web.d.ts +45 -4
  61. package/dist/fhe/sepolia-encryptor.d.ts +38 -0
  62. package/dist/fhe-airdrop/advanced/index.cjs +9 -9
  63. package/dist/fhe-airdrop/advanced/index.js +7 -7
  64. package/dist/fhe-airdrop/advanced/react/index.cjs +14 -14
  65. package/dist/fhe-airdrop/advanced/react/index.js +10 -10
  66. package/dist/fhe-airdrop/airdrop.d.ts +9 -0
  67. package/dist/fhe-airdrop/encryption.d.ts +8 -0
  68. package/dist/fhe-airdrop/factory.d.ts +86 -1
  69. package/dist/fhe-airdrop/index.cjs +69 -66
  70. package/dist/fhe-airdrop/index.d.cts +3 -3
  71. package/dist/fhe-airdrop/index.d.ts +3 -3
  72. package/dist/fhe-airdrop/index.js +7 -8
  73. package/dist/fhe-airdrop/react/index.cjs +176 -135
  74. package/dist/fhe-airdrop/react/index.d.cts +7 -4
  75. package/dist/fhe-airdrop/react/index.d.ts +7 -4
  76. package/dist/fhe-airdrop/react/index.js +43 -16
  77. package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +17 -11
  78. package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +3 -2
  79. package/dist/fhe-airdrop/react/useClaim.d.ts +10 -0
  80. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +8 -0
  81. package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +8 -0
  82. package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +8 -0
  83. package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +51 -0
  84. package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +1 -1
  85. package/dist/fhe-airdrop/types.d.ts +56 -0
  86. package/dist/fhe-disperse/encryption.d.ts +8 -0
  87. package/dist/fhe-disperse/errors.d.ts +55 -0
  88. package/dist/fhe-disperse/index.cjs +77 -66
  89. package/dist/fhe-disperse/index.d.cts +2 -2
  90. package/dist/fhe-disperse/index.d.ts +2 -2
  91. package/dist/fhe-disperse/index.js +8 -9
  92. package/dist/fhe-disperse/react/index.cjs +108 -87
  93. package/dist/fhe-disperse/react/index.d.cts +4 -2
  94. package/dist/fhe-disperse/react/index.d.ts +4 -2
  95. package/dist/fhe-disperse/react/index.js +12 -11
  96. package/dist/fhe-disperse/react/useCalculateFee.d.ts +7 -0
  97. package/dist/fhe-disperse/react/useDisperse.d.ts +9 -0
  98. package/dist/fhe-disperse/react/usePreflightDisperse.d.ts +7 -0
  99. package/dist/fhe-disperse/react/useSingletonCalculateFee.d.ts +7 -0
  100. package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +6 -0
  101. package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +6 -0
  102. package/dist/fhe-disperse/singleton.d.ts +29 -0
  103. package/dist/fhe-disperse/subtotals.d.ts +6 -0
  104. package/dist/fhe-vesting/advanced/index.cjs +8 -9
  105. package/dist/fhe-vesting/advanced/index.js +6 -7
  106. package/dist/fhe-vesting/advanced/react/index.cjs +15 -15
  107. package/dist/fhe-vesting/advanced/react/index.js +12 -12
  108. package/dist/fhe-vesting/encryption.d.ts +8 -0
  109. package/dist/fhe-vesting/index.cjs +82 -79
  110. package/dist/fhe-vesting/index.d.cts +2 -2
  111. package/dist/fhe-vesting/index.d.ts +2 -2
  112. package/dist/fhe-vesting/index.js +9 -10
  113. package/dist/fhe-vesting/manager.d.ts +119 -1
  114. package/dist/fhe-vesting/react/index.cjs +264 -224
  115. package/dist/fhe-vesting/react/index.d.cts +9 -6
  116. package/dist/fhe-vesting/react/index.d.ts +9 -6
  117. package/dist/fhe-vesting/react/index.js +44 -21
  118. package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +11 -3
  119. package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +11 -3
  120. package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +11 -3
  121. package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +11 -3
  122. package/dist/fhe-vesting/react/useAdminClaim.d.ts +2 -0
  123. package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +1 -1
  124. package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +1 -1
  125. package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +1 -1
  126. package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +1 -1
  127. package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +10 -0
  128. package/dist/fhe-vesting/react/useBatchCreateVesting.d.ts +8 -0
  129. package/dist/fhe-vesting/react/useClaim.d.ts +3 -1
  130. package/dist/fhe-vesting/react/useCreateVesting.d.ts +8 -0
  131. package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +1 -1
  132. package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +1 -1
  133. package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +6 -0
  134. package/dist/fhe-vesting/react/usePartialClaim.d.ts +9 -1
  135. package/dist/fhe-vesting/react/usePreflightCreateVesting.d.ts +37 -0
  136. package/dist/fhe-vesting/react/useVestingClaim.d.ts +2 -0
  137. package/dist/fhe-vesting/react/useVestingInfo.d.ts +1 -1
  138. package/dist/fhe-vesting/react/useWithdrawAdmin.d.ts +6 -0
  139. package/dist/fhe-vesting/react/useWithdrawTokenFee.d.ts +6 -0
  140. package/dist/fhe-vesting/types.d.ts +45 -0
  141. package/dist/index.cjs +93 -86
  142. package/dist/index.d.cts +1 -1
  143. package/dist/index.d.ts +1 -1
  144. package/dist/index.js +2 -3
  145. package/dist/testnet-faucet/index.cjs +58 -55
  146. package/dist/testnet-faucet/index.d.cts +1 -1
  147. package/dist/testnet-faucet/index.d.ts +1 -1
  148. package/dist/testnet-faucet/index.js +5 -6
  149. package/dist/testnet-faucet/react/index.cjs +60 -56
  150. package/dist/testnet-faucet/react/index.d.cts +3 -2
  151. package/dist/testnet-faucet/react/index.d.ts +3 -2
  152. package/dist/testnet-faucet/react/index.js +11 -11
  153. package/dist/testnet-faucet/react/useConfidentialBalance.d.ts +3 -2
  154. package/dist/testnet-faucet/react/useUnderlyingBalance.d.ts +2 -2
  155. package/package.json +14 -8
  156. package/dist/chunk-66IHPTOK.cjs +0 -20
  157. package/dist/chunk-KWFFIJYX.js +0 -11
  158. package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +0 -25
  159. package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +0 -30
  160. package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +0 -13
  161. package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +0 -14
  162. package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +0 -13
  163. package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +0 -25
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkNS44KBV5_cjs = require('./chunk-NS44KBV5.cjs');
4
- var chunk5SGMJADP_cjs = require('./chunk-5SGMJADP.cjs');
5
- var chunkQ7ARQSUH_cjs = require('./chunk-Q7ARQSUH.cjs');
6
- var chunkVDXVNZCO_cjs = require('./chunk-VDXVNZCO.cjs');
7
- var chunkCQIPRNS7_cjs = require('./chunk-CQIPRNS7.cjs');
3
+ var chunkUJS4N2XM_cjs = require('./chunk-UJS4N2XM.cjs');
4
+ var chunkBD4LZBVF_cjs = require('./chunk-BD4LZBVF.cjs');
5
+ var chunkSYHNZSZZ_cjs = require('./chunk-SYHNZSZZ.cjs');
6
+ var chunkFWHYQZ5E_cjs = require('./chunk-FWHYQZ5E.cjs');
7
+ var chunk43RFBQ73_cjs = require('./chunk-43RFBQ73.cjs');
8
+ var chunkVR3FREBX_cjs = require('./chunk-VR3FREBX.cjs');
9
+ var chunk2RNW4MIJ_cjs = require('./chunk-2RNW4MIJ.cjs');
8
10
  var chunkVJKZWYYJ_cjs = require('./chunk-VJKZWYYJ.cjs');
9
- var chunk66IHPTOK_cjs = require('./chunk-66IHPTOK.cjs');
10
- var chunk56UI7LUR_cjs = require('./chunk-56UI7LUR.cjs');
11
11
  var viem = require('viem');
12
12
 
13
13
  // src/fhe-vesting/abis/manager.ts
@@ -988,81 +988,9 @@ var confidentialVestingManagerAbi = [
988
988
  type: "function"
989
989
  }
990
990
  ];
991
- function resolveEncryptor(source) {
992
- if (source === void 0) return void 0;
993
- return typeof source === "function" ? source() : source;
994
- }
995
- var MAX_UINT64 = (1n << 64n) - 1n;
996
- function assertUint64(value, label) {
997
- if (value < 0n || value > MAX_UINT64) {
998
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
999
- method: "encryptUint64",
1000
- argument: label,
1001
- reason: `does not fit in uint64 (0..2^64-1)`,
1002
- value
1003
- });
1004
- }
1005
- }
1006
- async function encryptUint64({
1007
- encryptor,
1008
- contractAddress,
1009
- userAddress,
1010
- value
1011
- }) {
1012
- assertUint64(value, "value");
1013
- const { handles, inputProof } = await encryptor.encrypt({
1014
- values: [{ value, type: "euint64" }],
1015
- contractAddress,
1016
- userAddress
1017
- });
1018
- if (handles.length !== 1) {
1019
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1020
- method: "encryptUint64",
1021
- argument: "handles",
1022
- reason: `expected 1 handle, got ${handles.length}`,
1023
- value: handles.length
1024
- });
1025
- }
1026
- return {
1027
- handle: chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(handles[0])),
1028
- inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
1029
- };
1030
- }
1031
- async function encryptUint64Batch({
1032
- encryptor,
1033
- contractAddress,
1034
- userAddress,
1035
- values
1036
- }) {
1037
- if (values.length === 0) {
1038
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1039
- method: "encryptUint64Batch",
1040
- argument: "values",
1041
- reason: "must be non-empty"
1042
- });
1043
- }
1044
- values.forEach((v, i) => assertUint64(v, `values[${i}]`));
1045
- const { handles, inputProof } = await encryptor.encrypt({
1046
- values: values.map((value) => ({ value, type: "euint64" })),
1047
- contractAddress,
1048
- userAddress
1049
- });
1050
- if (handles.length !== values.length) {
1051
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1052
- method: "encryptUint64Batch",
1053
- argument: "handles",
1054
- reason: `expected ${values.length} handles, got ${handles.length}`,
1055
- value: handles.length
1056
- });
1057
- }
1058
- return {
1059
- handles: handles.map((h) => chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(h))),
1060
- inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
1061
- };
1062
- }
1063
991
 
1064
992
  // src/fhe-vesting/errors.ts
1065
- var VestingNotFoundError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
993
+ var VestingNotFoundError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1066
994
  name = "VestingNotFoundError";
1067
995
  constructor(args) {
1068
996
  super(`${args.method}: no vesting schedule found for ${args.vestingId}.`, {
@@ -1076,7 +1004,7 @@ var VestingNotFoundError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1076
1004
  });
1077
1005
  }
1078
1006
  };
1079
- var NotVestingRecipientError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1007
+ var NotVestingRecipientError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1080
1008
  name = "NotVestingRecipientError";
1081
1009
  constructor(args) {
1082
1010
  super(`${args.method}: caller is not the recipient of vesting ${args.vestingId}.`, {
@@ -1092,7 +1020,7 @@ var NotVestingRecipientError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError
1092
1020
  });
1093
1021
  }
1094
1022
  };
1095
- var ClaimLockedError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1023
+ var ClaimLockedError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1096
1024
  name = "ClaimLockedError";
1097
1025
  constructor(args) {
1098
1026
  const detail = args.unlocksAt !== void 0 ? ` Unlocks at unix timestamp ${args.unlocksAt}.` : "";
@@ -1108,7 +1036,7 @@ var ClaimLockedError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1108
1036
  });
1109
1037
  }
1110
1038
  };
1111
- var VestingRevokedError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1039
+ var VestingRevokedError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1112
1040
  name = "VestingRevokedError";
1113
1041
  constructor(args) {
1114
1042
  const detail = args.revokedAt !== void 0 ? ` at unix timestamp ${args.revokedAt}` : "";
@@ -1124,7 +1052,7 @@ var VestingRevokedError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1124
1052
  });
1125
1053
  }
1126
1054
  };
1127
- var VestingNotRevocableError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1055
+ var VestingNotRevocableError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1128
1056
  name = "VestingNotRevocableError";
1129
1057
  constructor(args) {
1130
1058
  super(`${args.method}: vesting ${args.vestingId} was created as non-revocable.`, {
@@ -1138,7 +1066,7 @@ var VestingNotRevocableError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError
1138
1066
  });
1139
1067
  }
1140
1068
  };
1141
- var VestingExpiredError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1069
+ var VestingExpiredError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1142
1070
  name = "VestingExpiredError";
1143
1071
  constructor(args) {
1144
1072
  super(`${args.method}: vesting ${args.vestingId} has already ended.`, {
@@ -1153,7 +1081,7 @@ var VestingExpiredError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1153
1081
  });
1154
1082
  }
1155
1083
  };
1156
- var TransferAlreadyPendingError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1084
+ var TransferAlreadyPendingError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1157
1085
  name = "TransferAlreadyPendingError";
1158
1086
  constructor(args) {
1159
1087
  super(`${args.method}: a transfer is already pending for vesting ${args.vestingId}.`, {
@@ -1169,7 +1097,7 @@ var TransferAlreadyPendingError = class extends chunk56UI7LUR_cjs.TokenOpsSdkErr
1169
1097
  });
1170
1098
  }
1171
1099
  };
1172
- var NoPendingTransferError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1100
+ var NoPendingTransferError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1173
1101
  name = "NoPendingTransferError";
1174
1102
  constructor(args) {
1175
1103
  super(`${args.method}: no pending transfer for vesting ${args.vestingId}.`, {
@@ -1183,7 +1111,7 @@ var NoPendingTransferError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1183
1111
  });
1184
1112
  }
1185
1113
  };
1186
- var NotPendingRecipientError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1114
+ var NotPendingRecipientError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1187
1115
  name = "NotPendingRecipientError";
1188
1116
  constructor(args) {
1189
1117
  super(`${args.method}: caller is not the pending recipient of vesting ${args.vestingId}.`, {
@@ -1199,7 +1127,7 @@ var NotPendingRecipientError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError
1199
1127
  });
1200
1128
  }
1201
1129
  };
1202
- var TransferExpiredError = class extends chunk56UI7LUR_cjs.TokenOpsSdkError {
1130
+ var TransferExpiredError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
1203
1131
  name = "TransferExpiredError";
1204
1132
  constructor(args) {
1205
1133
  super(`${args.method}: pending transfer for vesting ${args.vestingId} has expired.`, {
@@ -1252,7 +1180,7 @@ var ConfidentialVestingManagerClient = class {
1252
1180
  constructor(config) {
1253
1181
  this.publicClient = config.publicClient;
1254
1182
  this.walletClient = config.walletClient;
1255
- this.address = chunkCQIPRNS7_cjs.normaliseAddress(config.address);
1183
+ this.address = chunkVR3FREBX_cjs.normaliseAddress(config.address);
1256
1184
  this.encryptor = config.encryptor;
1257
1185
  this.#telemetry = config.telemetry;
1258
1186
  this.#aclAddressOverride = config.aclAddress;
@@ -1261,8 +1189,8 @@ var ConfidentialVestingManagerClient = class {
1261
1189
  surface: "manager",
1262
1190
  chainId: chainIdForInit ?? null,
1263
1191
  hasWallet: !!this.walletClient,
1264
- aclResolved: !!config.aclAddress || chainIdForInit !== void 0 && !!chunkQ7ARQSUH_cjs.getFhevmAclAddress(chainIdForInit),
1265
- sdkVersion: chunkVDXVNZCO_cjs.SDK_VERSION
1192
+ aclResolved: !!config.aclAddress || chainIdForInit !== void 0 && !!chunkSYHNZSZZ_cjs.getFhevmAclAddress(chainIdForInit),
1193
+ sdkVersion: chunk43RFBQ73_cjs.SDK_VERSION
1266
1194
  });
1267
1195
  }
1268
1196
  /**
@@ -1273,7 +1201,7 @@ var ConfidentialVestingManagerClient = class {
1273
1201
  */
1274
1202
  get aclAddress() {
1275
1203
  if (this.#cachedAclAddress) return this.#cachedAclAddress;
1276
- this.#cachedAclAddress = this.#aclAddressOverride ?? chunkQ7ARQSUH_cjs.requireFhevmAclAddress(this.publicClient.chain?.id, "ConfidentialVestingManagerClient");
1204
+ this.#cachedAclAddress = this.#aclAddressOverride ?? chunkSYHNZSZZ_cjs.requireFhevmAclAddress(this.publicClient.chain?.id, "ConfidentialVestingManagerClient");
1277
1205
  return this.#cachedAclAddress;
1278
1206
  }
1279
1207
  // ============================================================
@@ -1516,11 +1444,11 @@ var ConfidentialVestingManagerClient = class {
1516
1444
  );
1517
1445
  }
1518
1446
  if (paused) {
1519
- blockers.push(new chunk56UI7LUR_cjs.PausedError({ method: "claim", contractAddress: this.address }));
1447
+ blockers.push(new chunk2RNW4MIJ_cjs.PausedError({ method: "claim", contractAddress: this.address }));
1520
1448
  }
1521
1449
  if (feeInfo.feeType === 0 /* Gas */ && callerBalance < feeInfo.fee) {
1522
1450
  blockers.push(
1523
- new chunk56UI7LUR_cjs.InsufficientFeeError({
1451
+ new chunk2RNW4MIJ_cjs.InsufficientFeeError({
1524
1452
  method: "claim",
1525
1453
  contractAddress: this.address,
1526
1454
  feeKind: "gas",
@@ -1531,6 +1459,118 @@ var ConfidentialVestingManagerClient = class {
1531
1459
  }
1532
1460
  return { ready: blockers.length === 0, blockers };
1533
1461
  }
1462
+ /**
1463
+ * Read-only preflight for {@link createVesting} / {@link batchCreateVesting}.
1464
+ * Runs the deterministic-from-off-chain checks and reports blockers both as
1465
+ * human-readable strings (`blockers`) and as typed {@link TokenOpsSdkError}s
1466
+ * (`blockerErrors`), index-aligned.
1467
+ *
1468
+ * Preflight is **opt-in**. Consumers who have already validated state can
1469
+ * skip this call and invoke the write directly — they'll receive the same
1470
+ * typed errors at write time via the revert mapper.
1471
+ *
1472
+ * Report fields: `token`, `hasCreatorRole`, `isOperatorSet`, `ready`,
1473
+ * `blockers`, `blockerErrors` — see {@link CreateVestingPreflightReport} for
1474
+ * the meaning of each.
1475
+ *
1476
+ * Checks performed (all read-only, no gas):
1477
+ * - Structural `params` validation mirroring the contract's
1478
+ * `_validateVestingParams` (`InvalidArgumentError` blockers): recipient is
1479
+ * a checksummed non-zero address, `startTimestamp < endTimestamp`, cliff
1480
+ * within the window, `initialUnlockBps + cliffAmountBps ≤ 10000`.
1481
+ * - Role: creator holds `VESTING_CREATOR_ROLE`
1482
+ * ({@link AccessDeniedError} blocker).
1483
+ * - Operator: creator has approved this manager as an ERC-7984 operator on
1484
+ * the distribution token, required for the manager's
1485
+ * `confidentialTransferFrom` pull ({@link OperatorNotApprovedError} blocker).
1486
+ * If the bound `token` does not implement the ERC-7984 `isOperator`
1487
+ * view — a revert, or a zero-data response for an EOA / undeployed
1488
+ * address — operator status is undetermined rather than the call
1489
+ * throwing: `isOperatorSet` reports `false` and the read failure becomes
1490
+ * an {@link InvalidArgumentError} blocker on `token` instead (TOK-436).
1491
+ *
1492
+ * **Not preflight-detectable — read before trusting `ready: true`:**
1493
+ * - The creator's confidential token balance is an encrypted `euint64` the
1494
+ * SDK cannot read in plaintext. An underfunded create does **not** revert:
1495
+ * the contract's all-or-nothing `FHE.select` pattern silently zeroes the
1496
+ * vesting amounts instead. Confirm the creator's balance covers the total
1497
+ * before submitting.
1498
+ * - `batchCreateVesting` additionally enforces `items.length ≤ maxBatchSize()`
1499
+ * on-chain; check {@link maxBatchSize} for batches.
1500
+ *
1501
+ * Pausing the manager does NOT block vesting creation (only claims), so
1502
+ * paused state is intentionally not a blocker here.
1503
+ *
1504
+ * @param args.params The vesting schedule parameters to validate.
1505
+ * @param args.creator The address that will send the create transaction.
1506
+ * @returns A {@link CreateVestingPreflightReport}.
1507
+ */
1508
+ async preflightCreateVesting(args) {
1509
+ const blockers = [];
1510
+ const blockerErrors = [];
1511
+ const pushBlocker = (err) => {
1512
+ blockerErrors.push(err);
1513
+ blockers.push(err.message);
1514
+ };
1515
+ for (const err of collectVestingParamsErrors(args.params, "createVesting")) {
1516
+ pushBlocker(err);
1517
+ }
1518
+ const [token, creatorRole] = await Promise.all([
1519
+ this.token(),
1520
+ this.#read("VESTING_CREATOR_ROLE")
1521
+ ]);
1522
+ const [hasCreatorRole, operatorRead] = await Promise.all([
1523
+ this.hasRole(creatorRole, args.creator),
1524
+ this.publicClient.readContract({
1525
+ address: token,
1526
+ abi: chunkFWHYQZ5E_cjs.erc7984OperatorAbi,
1527
+ functionName: "isOperator",
1528
+ args: [args.creator, this.address]
1529
+ }).then((v) => ({ ok: true, value: v })).catch((err) => {
1530
+ if (isNotErc7984Failure(err)) return { ok: false, err };
1531
+ throw err;
1532
+ })
1533
+ ]);
1534
+ const isOperatorSet = operatorRead.ok ? operatorRead.value : false;
1535
+ if (!hasCreatorRole) {
1536
+ pushBlocker(
1537
+ new chunk2RNW4MIJ_cjs.AccessDeniedError({
1538
+ method: "createVesting",
1539
+ contractAddress: this.address,
1540
+ account: args.creator,
1541
+ role: creatorRole
1542
+ })
1543
+ );
1544
+ }
1545
+ if (!operatorRead.ok) {
1546
+ pushBlocker(
1547
+ new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1548
+ method: "createVesting",
1549
+ argument: "token",
1550
+ reason: "does not implement the ERC-7984 `isOperator(address,address)` view \u2014 it is not a confidential token (or the address holds no contract on this chain)",
1551
+ value: token
1552
+ })
1553
+ );
1554
+ } else if (!isOperatorSet) {
1555
+ pushBlocker(
1556
+ new chunk2RNW4MIJ_cjs.OperatorNotApprovedError({
1557
+ method: "createVesting",
1558
+ contractAddress: this.address,
1559
+ tokenAddress: token,
1560
+ holder: args.creator,
1561
+ spender: this.address
1562
+ })
1563
+ );
1564
+ }
1565
+ return {
1566
+ token,
1567
+ hasCreatorRole,
1568
+ isOperatorSet,
1569
+ ready: blockers.length === 0,
1570
+ blockers,
1571
+ blockerErrors
1572
+ };
1573
+ }
1534
1574
  // ============================================================
1535
1575
  // ENCRYPTED VIEWS (TX)
1536
1576
  // ============================================================
@@ -1596,6 +1636,21 @@ var ConfidentialVestingManagerClient = class {
1596
1636
  *
1597
1637
  * Pass `encryptedInput` to bypass the encryptor when you manage encryption yourself.
1598
1638
  *
1639
+ * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
1640
+ *
1641
+ * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
1642
+ * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
1643
+ * ERC-20. Amount parameters are base units of the token's actual decimals:
1644
+ * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
1645
+ * transparent TTT test token uses 18 decimals.
1646
+ *
1647
+ * Prerequisites: caller must have set this manager as an operator on the
1648
+ * token: `token.setOperator(managerAddress, deadline)` — or use
1649
+ * `ensureOperator()` from `@tokenops/sdk/fhe`. Skipping it fails with
1650
+ * {@link OperatorNotApprovedError} (the SDK's mapping of the on-chain
1651
+ * `ERC7984UnauthorizedSpender` revert, whose message is the canonical
1652
+ * `OPERATOR_NOT_APPROVED_REMEDIATION` copy).
1653
+ *
1599
1654
  * @returns Transaction hash. Parse the `VestingCreated` event to extract the `vestingId`.
1600
1655
  * @example
1601
1656
  * const hash = await manager.createVesting({
@@ -1637,12 +1692,27 @@ var ConfidentialVestingManagerClient = class {
1637
1692
  *
1638
1693
  * Respects `maxBatchSize` — check before calling on large lists.
1639
1694
  *
1695
+ * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
1696
+ *
1697
+ * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
1698
+ * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
1699
+ * ERC-20. Amount parameters are base units of the token's actual decimals:
1700
+ * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
1701
+ * transparent TTT test token uses 18 decimals.
1702
+ *
1703
+ * Prerequisites: caller must have set this manager as an operator on the
1704
+ * token: `token.setOperator(managerAddress, deadline)` — or use
1705
+ * `ensureOperator()` from `@tokenops/sdk/fhe`. Skipping it fails with
1706
+ * {@link OperatorNotApprovedError} (the SDK's mapping of the on-chain
1707
+ * `ERC7984UnauthorizedSpender` revert, whose message is the canonical
1708
+ * `OPERATOR_NOT_APPROVED_REMEDIATION` copy).
1709
+ *
1640
1710
  * @returns Transaction hash.
1641
1711
  */
1642
1712
  async batchCreateVesting(args) {
1643
1713
  return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-vesting.manager.batchCreateVesting", async () => {
1644
1714
  if (args.items.length === 0) {
1645
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1715
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1646
1716
  method: "batchCreateVesting",
1647
1717
  argument: "items",
1648
1718
  reason: "must be non-empty"
@@ -1653,21 +1723,21 @@ var ConfidentialVestingManagerClient = class {
1653
1723
  );
1654
1724
  const wallet = this.#requireWallet("batchCreateVesting");
1655
1725
  const account = this.#resolveAccount(wallet, args.account, "batchCreateVesting");
1656
- const encryptor = args.encryptor ?? resolveEncryptor(this.encryptor);
1726
+ const encryptor = args.encryptor ?? chunkBD4LZBVF_cjs.resolveEncryptor(this.encryptor);
1657
1727
  if (!encryptor) {
1658
- throw new chunk56UI7LUR_cjs.MissingEncryptorError("batchCreateVesting");
1728
+ throw new chunk2RNW4MIJ_cjs.MissingEncryptorError("batchCreateVesting");
1659
1729
  }
1660
1730
  const userAddress = accountAddress(account);
1661
1731
  let batch;
1662
1732
  try {
1663
- batch = await encryptUint64Batch({
1733
+ batch = await chunkBD4LZBVF_cjs.encryptUint64Batch({
1664
1734
  encryptor,
1665
1735
  contractAddress: this.address,
1666
1736
  userAddress,
1667
1737
  values: args.items.map((it) => it.amount)
1668
1738
  });
1669
1739
  } catch (err) {
1670
- throw chunkNS44KBV5_cjs.mapZamaError(err, { method: "batchCreateVesting", operation: "encrypt" });
1740
+ throw chunkUJS4N2XM_cjs.mapZamaError(err, { method: "batchCreateVesting", operation: "encrypt" });
1671
1741
  }
1672
1742
  try {
1673
1743
  return await wallet.writeContract({
@@ -1687,6 +1757,9 @@ var ConfidentialVestingManagerClient = class {
1687
1757
  /**
1688
1758
  * Claim all currently vested tokens for `vestingId`.
1689
1759
  * For `FeeType.Gas` managers, pass `value` (gas fee in wei from `getFeeInfo()`).
1760
+ *
1761
+ * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
1762
+ *
1690
1763
  * @param args Discriminated by `feeType`: pass `{ feeType, vestingId, value }` for Gas, `{ feeType, vestingId }` for DistributionToken.
1691
1764
  * @returns Transaction hash.
1692
1765
  * @example
@@ -1715,6 +1788,9 @@ var ConfidentialVestingManagerClient = class {
1715
1788
  /**
1716
1789
  * Admin variant of `claim` — callable by the manager admin on behalf of any recipient.
1717
1790
  * Useful for gas-sponsored claim flows. Same fee rules as `claim`.
1791
+ *
1792
+ * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
1793
+ *
1718
1794
  * @param args Same discriminated union as `claim`.
1719
1795
  * @returns Transaction hash.
1720
1796
  */
@@ -1743,6 +1819,15 @@ var ConfidentialVestingManagerClient = class {
1743
1819
  /**
1744
1820
  * Claim a specific encrypted amount from a vesting schedule rather than the full claimable balance.
1745
1821
  * The SDK encrypts `amount` — pass plaintext. Alternatively pass `encryptedInput` to bypass encryption.
1822
+ *
1823
+ * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
1824
+ *
1825
+ * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
1826
+ * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
1827
+ * ERC-20. Amount parameters are base units of the token's actual decimals:
1828
+ * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
1829
+ * transparent TTT test token uses 18 decimals.
1830
+ *
1746
1831
  * @param args Includes `vestingId`, `amount` or `encryptedInput`, and optional `value` for Gas-fee managers.
1747
1832
  * @returns Transaction hash.
1748
1833
  */
@@ -1777,6 +1862,15 @@ var ConfidentialVestingManagerClient = class {
1777
1862
  }
1778
1863
  /**
1779
1864
  * Admin variant of `partialClaim` — callable by the manager admin on behalf of any recipient.
1865
+ *
1866
+ * **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
1867
+ *
1868
+ * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
1869
+ * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
1870
+ * ERC-20. Amount parameters are base units of the token's actual decimals:
1871
+ * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
1872
+ * transparent TTT test token uses 18 decimals.
1873
+ *
1780
1874
  * @param args Same as `partialClaim`.
1781
1875
  * @returns Transaction hash.
1782
1876
  */
@@ -1827,7 +1921,7 @@ var ConfidentialVestingManagerClient = class {
1827
1921
  */
1828
1922
  async batchRevokeVesting(vestingIds, account) {
1829
1923
  if (vestingIds.length === 0) {
1830
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1924
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1831
1925
  method: "batchRevokeVesting",
1832
1926
  argument: "vestingIds",
1833
1927
  reason: "must be non-empty"
@@ -1883,7 +1977,7 @@ var ConfidentialVestingManagerClient = class {
1883
1977
  async splitVesting(args) {
1884
1978
  const wallet = this.#requireWallet("splitVesting");
1885
1979
  const account = this.#resolveAccount(wallet, args.account, "splitVesting");
1886
- const { numerator, denominator } = args.preScaled ? { numerator: args.numerator, denominator: args.denominator } : chunk5SGMJADP_cjs.scaleRatio({
1980
+ const { numerator, denominator } = args.preScaled ? { numerator: args.numerator, denominator: args.denominator } : chunkBD4LZBVF_cjs.scaleRatio({
1887
1981
  numerator: args.numerator,
1888
1982
  denominator: args.denominator,
1889
1983
  // The encrypted numerator is submitted via `encryptUint64`, so
@@ -1893,7 +1987,7 @@ var ConfidentialVestingManagerClient = class {
1893
1987
  width: "uint64"
1894
1988
  });
1895
1989
  if (denominator < 10000n) {
1896
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1990
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1897
1991
  method: "splitVesting",
1898
1992
  argument: "denominator",
1899
1993
  reason: "must be \u2265 10000 (the contract's MIN_SPLIT_DENOMINATOR floor)",
@@ -1901,7 +1995,7 @@ var ConfidentialVestingManagerClient = class {
1901
1995
  });
1902
1996
  }
1903
1997
  if (args.newRecipient === ZERO_ADDRESS) {
1904
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
1998
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1905
1999
  method: "splitVesting",
1906
2000
  argument: "newRecipient",
1907
2001
  reason: "must not be the zero address"
@@ -1941,7 +2035,7 @@ var ConfidentialVestingManagerClient = class {
1941
2035
  (ev) => ev.args.originalVestingId.toLowerCase() === args.vestingId.toLowerCase() && ev.args.newRecipient.toLowerCase() === args.newRecipient.toLowerCase()
1942
2036
  );
1943
2037
  if (matches.length === 0) {
1944
- throw new chunk56UI7LUR_cjs.ReceiptEventNotFoundError({
2038
+ throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
1945
2039
  method: "splitVesting",
1946
2040
  eventName: "VestingSplit",
1947
2041
  contractAddress: this.address,
@@ -1950,7 +2044,7 @@ var ConfidentialVestingManagerClient = class {
1950
2044
  });
1951
2045
  }
1952
2046
  if (matches.length > 1) {
1953
- throw new chunk56UI7LUR_cjs.ReceiptEventAmbiguousError({
2047
+ throw new chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError({
1954
2048
  method: "splitVesting",
1955
2049
  eventName: "VestingSplit",
1956
2050
  contractAddress: this.address,
@@ -1971,7 +2065,7 @@ var ConfidentialVestingManagerClient = class {
1971
2065
  */
1972
2066
  async initiateVestingTransfer(args) {
1973
2067
  if (!viem.isAddress(args.newRecipient, { strict: true })) {
1974
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2068
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1975
2069
  method: "initiateVestingTransfer",
1976
2070
  argument: "newRecipient",
1977
2071
  reason: "must be a valid EIP-55 checksummed address",
@@ -1979,14 +2073,14 @@ var ConfidentialVestingManagerClient = class {
1979
2073
  });
1980
2074
  }
1981
2075
  if (args.newRecipient === ZERO_ADDRESS) {
1982
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2076
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1983
2077
  method: "initiateVestingTransfer",
1984
2078
  argument: "newRecipient",
1985
2079
  reason: "must not be the zero address"
1986
2080
  });
1987
2081
  }
1988
2082
  if (args.transferDurationSeconds <= 0) {
1989
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2083
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
1990
2084
  method: "initiateVestingTransfer",
1991
2085
  argument: "transferDurationSeconds",
1992
2086
  reason: "must be > 0",
@@ -2025,7 +2119,7 @@ var ConfidentialVestingManagerClient = class {
2025
2119
  */
2026
2120
  async directVestingTransfer(vestingId, newOwner, account) {
2027
2121
  if (!viem.isAddress(newOwner, { strict: true })) {
2028
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2122
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2029
2123
  method: "directVestingTransfer",
2030
2124
  argument: "newOwner",
2031
2125
  reason: "must be a valid EIP-55 checksummed address",
@@ -2033,7 +2127,7 @@ var ConfidentialVestingManagerClient = class {
2033
2127
  });
2034
2128
  }
2035
2129
  if (newOwner === ZERO_ADDRESS) {
2036
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2130
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2037
2131
  method: "directVestingTransfer",
2038
2132
  argument: "newOwner",
2039
2133
  reason: "must not be the zero address"
@@ -2073,14 +2167,14 @@ var ConfidentialVestingManagerClient = class {
2073
2167
  */
2074
2168
  async batchDiscloseToParty(args) {
2075
2169
  if (args.vestingIds.length === 0) {
2076
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2170
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2077
2171
  method: "batchDiscloseToParty",
2078
2172
  argument: "vestingIds",
2079
2173
  reason: "must be non-empty"
2080
2174
  });
2081
2175
  }
2082
2176
  if (args.vestingIds.length !== args.disclosureTypes.length) {
2083
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2177
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2084
2178
  method: "batchDiscloseToParty",
2085
2179
  argument: "disclosureTypes",
2086
2180
  reason: `length mismatch: vestingIds=${args.vestingIds.length}, disclosureTypes=${args.disclosureTypes.length}`
@@ -2113,14 +2207,14 @@ var ConfidentialVestingManagerClient = class {
2113
2207
  */
2114
2208
  async adminBatchDiscloseToParty(args) {
2115
2209
  if (args.vestingIds.length === 0) {
2116
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2210
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2117
2211
  method: "adminBatchDiscloseToParty",
2118
2212
  argument: "vestingIds",
2119
2213
  reason: "must be non-empty"
2120
2214
  });
2121
2215
  }
2122
2216
  if (args.vestingIds.length !== args.disclosureTypes.length) {
2123
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2217
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2124
2218
  method: "adminBatchDiscloseToParty",
2125
2219
  argument: "disclosureTypes",
2126
2220
  reason: `length mismatch: vestingIds=${args.vestingIds.length}, disclosureTypes=${args.disclosureTypes.length}`
@@ -2152,7 +2246,7 @@ var ConfidentialVestingManagerClient = class {
2152
2246
  */
2153
2247
  async batchDiscloseHandlesToParty(handles, party, account) {
2154
2248
  if (handles.length === 0) {
2155
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2249
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2156
2250
  method: "batchDiscloseHandlesToParty",
2157
2251
  argument: "handles",
2158
2252
  reason: "must be non-empty"
@@ -2166,6 +2260,13 @@ var ConfidentialVestingManagerClient = class {
2166
2260
  /**
2167
2261
  * Withdraw a confidential token amount from the manager's balance back to the admin.
2168
2262
  * The SDK encrypts `amount` — pass plaintext. Alternatively pass `encryptedInput`.
2263
+ *
2264
+ * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
2265
+ * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
2266
+ * ERC-20. Amount parameters are base units of the token's actual decimals:
2267
+ * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
2268
+ * transparent TTT test token uses 18 decimals.
2269
+ *
2169
2270
  * @param args `{ amount }` (plaintext, SDK encrypts) or `{ encryptedInput }` (pre-encrypted).
2170
2271
  * @returns Transaction hash.
2171
2272
  */
@@ -2222,12 +2323,19 @@ var ConfidentialVestingManagerClient = class {
2222
2323
  /**
2223
2324
  * Withdraw accumulated token fees from a `FeeType.DistributionToken` manager. Admin only.
2224
2325
  * The SDK encrypts `amount` — pass plaintext. Alternatively pass `encryptedInput`.
2326
+ *
2327
+ * **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
2328
+ * convention (1 token = 1_000_000 base units), not the 18 decimals typical of
2329
+ * ERC-20. Amount parameters are base units of the token's actual decimals:
2330
+ * for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
2331
+ * transparent TTT test token uses 18 decimals.
2332
+ *
2225
2333
  * @param args `{ to, amount }` (plaintext, SDK encrypts) or `{ to, encryptedInput }` (pre-encrypted).
2226
2334
  * @returns Transaction hash.
2227
2335
  */
2228
2336
  async withdrawTokenFee(args) {
2229
2337
  if (args.to === ZERO_ADDRESS) {
2230
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2338
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2231
2339
  method: "withdrawTokenFee",
2232
2340
  argument: "to",
2233
2341
  reason: "must not be the zero address"
@@ -2392,33 +2500,33 @@ var ConfidentialVestingManagerClient = class {
2392
2500
  // ============================================================
2393
2501
  #requireWallet(method) {
2394
2502
  if (!this.walletClient) {
2395
- throw new chunk56UI7LUR_cjs.MissingWalletClientError(method);
2503
+ throw new chunk2RNW4MIJ_cjs.MissingWalletClientError(method);
2396
2504
  }
2397
2505
  return this.walletClient;
2398
2506
  }
2399
2507
  #resolveAccount(wallet, override, method) {
2400
2508
  const acct = override ?? wallet.account;
2401
2509
  if (!acct) {
2402
- throw new chunk56UI7LUR_cjs.MissingAccountError(method);
2510
+ throw new chunk2RNW4MIJ_cjs.MissingAccountError(method);
2403
2511
  }
2404
2512
  return acct;
2405
2513
  }
2406
2514
  async #encryptUint64(value, encryptor, account) {
2407
- const enc = encryptor ?? resolveEncryptor(this.encryptor);
2515
+ const enc = encryptor ?? chunkBD4LZBVF_cjs.resolveEncryptor(this.encryptor);
2408
2516
  if (!enc) {
2409
- throw new chunk56UI7LUR_cjs.MissingEncryptorError("encryptUint64", {
2517
+ throw new chunk2RNW4MIJ_cjs.MissingEncryptorError("encryptUint64", {
2410
2518
  hint: "Pass `encryptor` to the call or the client config (eager or lazy factory)."
2411
2519
  });
2412
2520
  }
2413
2521
  try {
2414
- return await encryptUint64({
2522
+ return await chunkBD4LZBVF_cjs.encryptUint64({
2415
2523
  encryptor: enc,
2416
2524
  contractAddress: this.address,
2417
2525
  userAddress: accountAddress(account),
2418
2526
  value
2419
2527
  });
2420
2528
  } catch (err) {
2421
- throw chunkNS44KBV5_cjs.mapZamaError(err, { method: "encryptUint64", operation: "encrypt" });
2529
+ throw chunkUJS4N2XM_cjs.mapZamaError(err, { method: "encryptUint64", operation: "encrypt" });
2422
2530
  }
2423
2531
  }
2424
2532
  /**
@@ -2432,14 +2540,14 @@ var ConfidentialVestingManagerClient = class {
2432
2540
  const hasAmount = args.amount !== void 0;
2433
2541
  const hasInput = args.encryptedInput !== void 0;
2434
2542
  if (hasAmount && hasInput) {
2435
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2543
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2436
2544
  method: args.method,
2437
2545
  argument: "amount/encryptedInput",
2438
2546
  reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got both"
2439
2547
  });
2440
2548
  }
2441
2549
  if (!hasAmount && !hasInput) {
2442
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2550
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2443
2551
  method: args.method,
2444
2552
  argument: "amount/encryptedInput",
2445
2553
  reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got neither"
@@ -2455,7 +2563,7 @@ var ConfidentialVestingManagerClient = class {
2455
2563
  * the offending schedule id in its context.
2456
2564
  */
2457
2565
  #mapRevert(method, err, productContext, account) {
2458
- return chunkVDXVNZCO_cjs.mapContractRevert(err, {
2566
+ return chunk43RFBQ73_cjs.mapContractRevert(err, {
2459
2567
  method,
2460
2568
  contractAddress: this.address,
2461
2569
  abi: confidentialVestingManagerAbi,
@@ -2501,7 +2609,7 @@ var ConfidentialVestingManagerClient = class {
2501
2609
  ...value !== void 0 ? { value } : {}
2502
2610
  });
2503
2611
  } catch (err) {
2504
- if (chunkVDXVNZCO_cjs.isContractRevert(err)) {
2612
+ if (chunk43RFBQ73_cjs.isContractRevert(err)) {
2505
2613
  throw this.#mapRevert(method, err, productContext, accountAddress(account));
2506
2614
  }
2507
2615
  }
@@ -2514,7 +2622,7 @@ var ConfidentialVestingManagerClient = class {
2514
2622
  */
2515
2623
  async #discloseSingleWithReceipt(input) {
2516
2624
  if (!viem.isAddress(input.party, { strict: true })) {
2517
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2625
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2518
2626
  method: input.functionName,
2519
2627
  argument: "party",
2520
2628
  reason: "must be a valid EIP-55 checksummed address",
@@ -2551,7 +2659,7 @@ var ConfidentialVestingManagerClient = class {
2551
2659
  (ev) => ev.args.vestingId.toLowerCase() === input.vestingId.toLowerCase() && ev.args.discloser.toLowerCase() === callerAddress && ev.args.party.toLowerCase() === input.party.toLowerCase()
2552
2660
  );
2553
2661
  if (matches.length === 0) {
2554
- throw new chunk56UI7LUR_cjs.ReceiptEventNotFoundError({
2662
+ throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
2555
2663
  method: input.functionName,
2556
2664
  eventName: "AmountDisclosed",
2557
2665
  contractAddress: this.address,
@@ -2560,7 +2668,7 @@ var ConfidentialVestingManagerClient = class {
2560
2668
  });
2561
2669
  }
2562
2670
  if (matches.length > 1) {
2563
- throw new chunk56UI7LUR_cjs.ReceiptEventAmbiguousError({
2671
+ throw new chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError({
2564
2672
  method: input.functionName,
2565
2673
  eventName: "AmountDisclosed",
2566
2674
  contractAddress: this.address,
@@ -2577,7 +2685,7 @@ var ConfidentialVestingManagerClient = class {
2577
2685
  */
2578
2686
  async #discloseBatchWithReceipt(input) {
2579
2687
  if (!viem.isAddress(input.party, { strict: true })) {
2580
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2688
+ throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2581
2689
  method: input.functionName,
2582
2690
  argument: "party",
2583
2691
  reason: "must be a valid EIP-55 checksummed address",
@@ -2616,7 +2724,7 @@ var ConfidentialVestingManagerClient = class {
2616
2724
  for (const id of input.vestingIds) {
2617
2725
  const handle = byVestingId.get(id.toLowerCase());
2618
2726
  if (handle === void 0) {
2619
- throw new chunk56UI7LUR_cjs.ReceiptEventNotFoundError({
2727
+ throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
2620
2728
  method: input.functionName,
2621
2729
  eventName: "AmountDisclosed",
2622
2730
  contractAddress: this.address,
@@ -2635,45 +2743,8 @@ var ConfidentialVestingManagerClient = class {
2635
2743
  * than wait for the on-chain revert.
2636
2744
  */
2637
2745
  #validateVestingParams(params, where) {
2638
- if (!viem.isAddress(params.recipient, { strict: true })) {
2639
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2640
- method: where,
2641
- argument: "recipient",
2642
- reason: "must be a valid EIP-55 checksummed address",
2643
- value: params.recipient
2644
- });
2645
- }
2646
- if (params.recipient === ZERO_ADDRESS) {
2647
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2648
- method: where,
2649
- argument: "recipient",
2650
- reason: "must not be the zero address"
2651
- });
2652
- }
2653
- if (params.startTimestamp >= params.endTimestamp) {
2654
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2655
- method: where,
2656
- argument: "startTimestamp/endTimestamp",
2657
- reason: "startTimestamp must be strictly less than endTimestamp",
2658
- value: { startTimestamp: params.startTimestamp, endTimestamp: params.endTimestamp }
2659
- });
2660
- }
2661
- if (params.startTimestamp + params.cliffSeconds > params.endTimestamp) {
2662
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2663
- method: where,
2664
- argument: "cliffSeconds",
2665
- reason: "cliff cannot extend past endTimestamp",
2666
- value: params.cliffSeconds
2667
- });
2668
- }
2669
- if (params.initialUnlockBps + params.cliffAmountBps > 1e4) {
2670
- throw new chunk56UI7LUR_cjs.InvalidArgumentError({
2671
- method: where,
2672
- argument: "initialUnlockBps + cliffAmountBps",
2673
- reason: "must be \u2264 10000 (100%)",
2674
- value: { initialUnlockBps: params.initialUnlockBps, cliffAmountBps: params.cliffAmountBps }
2675
- });
2676
- }
2746
+ const [first] = collectVestingParamsErrors(params, where);
2747
+ if (first) throw first;
2677
2748
  }
2678
2749
  async #read(functionName, args = []) {
2679
2750
  const result = await this.publicClient.readContract({
@@ -2719,12 +2790,12 @@ var ConfidentialVestingManagerClient = class {
2719
2790
  const aclLogs = receipt.logs.filter(
2720
2791
  (log) => log.address.toLowerCase() === this.aclAddress.toLowerCase()
2721
2792
  );
2722
- const events = viem.parseEventLogs({ abi: [chunkQ7ARQSUH_cjs.ACL_ALLOWED_EVENT], logs: aclLogs });
2793
+ const events = viem.parseEventLogs({ abi: [chunkSYHNZSZZ_cjs.ACL_ALLOWED_EVENT], logs: aclLogs });
2723
2794
  const granted = events.filter(
2724
2795
  (ev) => ev.args.account.toLowerCase() === callerAddress && ev.args.caller.toLowerCase() === this.address.toLowerCase()
2725
2796
  );
2726
2797
  if (granted.length === 0) {
2727
- throw new chunk56UI7LUR_cjs.ReceiptEventNotFoundError({
2798
+ throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
2728
2799
  method: functionName,
2729
2800
  eventName: "Allowed",
2730
2801
  contractAddress: this.aclAddress,
@@ -2733,7 +2804,7 @@ var ConfidentialVestingManagerClient = class {
2733
2804
  });
2734
2805
  }
2735
2806
  if (granted.length > 1) {
2736
- throw new chunk56UI7LUR_cjs.ReceiptEventAmbiguousError({
2807
+ throw new chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError({
2737
2808
  method: functionName,
2738
2809
  eventName: "Allowed",
2739
2810
  contractAddress: this.aclAddress,
@@ -2741,17 +2812,74 @@ var ConfidentialVestingManagerClient = class {
2741
2812
  count: granted.length
2742
2813
  });
2743
2814
  }
2744
- const handle = chunk66IHPTOK_cjs.asEncryptedHandle(granted[0].args.handle);
2745
- return { handle, hash: chunk66IHPTOK_cjs.asTxHash(hash) };
2815
+ const handle = chunk2RNW4MIJ_cjs.asEncryptedHandle(granted[0].args.handle);
2816
+ return { handle, hash: chunk2RNW4MIJ_cjs.asTxHash(hash) };
2746
2817
  }
2747
2818
  };
2748
2819
  function createConfidentialVestingManagerClient(config) {
2749
2820
  return new ConfidentialVestingManagerClient(config);
2750
2821
  }
2822
+ function isNotErc7984Failure(err) {
2823
+ if (chunk43RFBQ73_cjs.isContractRevert(err)) return true;
2824
+ if (!(err instanceof viem.BaseError)) return false;
2825
+ return err.walk((e) => e instanceof viem.ContractFunctionZeroDataError) instanceof viem.ContractFunctionZeroDataError;
2826
+ }
2751
2827
  function accountAddress(account) {
2752
2828
  return typeof account === "string" ? account : account.address;
2753
2829
  }
2754
2830
  var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
2831
+ function collectVestingParamsErrors(params, where) {
2832
+ const errors = [];
2833
+ if (!viem.isAddress(params.recipient, { strict: true })) {
2834
+ errors.push(
2835
+ new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2836
+ method: where,
2837
+ argument: "recipient",
2838
+ reason: "must be a valid EIP-55 checksummed address",
2839
+ value: params.recipient
2840
+ })
2841
+ );
2842
+ } else if (params.recipient === ZERO_ADDRESS) {
2843
+ errors.push(
2844
+ new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2845
+ method: where,
2846
+ argument: "recipient",
2847
+ reason: "must not be the zero address"
2848
+ })
2849
+ );
2850
+ }
2851
+ if (params.startTimestamp >= params.endTimestamp) {
2852
+ errors.push(
2853
+ new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2854
+ method: where,
2855
+ argument: "startTimestamp/endTimestamp",
2856
+ reason: "startTimestamp must be strictly less than endTimestamp",
2857
+ value: { startTimestamp: params.startTimestamp, endTimestamp: params.endTimestamp }
2858
+ })
2859
+ );
2860
+ }
2861
+ if (params.startTimestamp < params.endTimestamp && params.startTimestamp + params.cliffSeconds > params.endTimestamp) {
2862
+ errors.push(
2863
+ new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2864
+ method: where,
2865
+ argument: "cliffSeconds",
2866
+ reason: "cliff cannot extend past endTimestamp",
2867
+ value: params.cliffSeconds
2868
+ })
2869
+ );
2870
+ }
2871
+ if (params.initialUnlockBps + params.cliffAmountBps > 1e4) {
2872
+ errors.push(
2873
+ new chunk2RNW4MIJ_cjs.InvalidArgumentError({
2874
+ method: where,
2875
+ argument: "initialUnlockBps + cliffAmountBps",
2876
+ reason: "must be \u2264 10000 (100%)",
2877
+ value: { initialUnlockBps: params.initialUnlockBps, cliffAmountBps: params.cliffAmountBps }
2878
+ })
2879
+ );
2880
+ }
2881
+ return errors;
2882
+ }
2755
2883
 
2756
2884
  exports.ClaimLockedError = ClaimLockedError;
2757
2885
  exports.ConfidentialVestingManagerClient = ConfidentialVestingManagerClient;
@@ -2766,6 +2894,3 @@ exports.VestingNotRevocableError = VestingNotRevocableError;
2766
2894
  exports.VestingRevokedError = VestingRevokedError;
2767
2895
  exports.confidentialVestingManagerAbi = confidentialVestingManagerAbi;
2768
2896
  exports.createConfidentialVestingManagerClient = createConfidentialVestingManagerClient;
2769
- exports.encryptUint64 = encryptUint64;
2770
- exports.encryptUint64Batch = encryptUint64Batch;
2771
- exports.resolveEncryptor = resolveEncryptor;