@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,5 +1,82 @@
1
1
  import type { Abi, Address } from "viem";
2
2
  import { TokenOpsSdkError } from "./errors.js";
3
+ /**
4
+ * ERC-7984 (Confidential Token) standard error signatures, from the reference
5
+ * implementation the TokenOps tokens vendor
6
+ * (`openzeppelin-confidential/ERC7984.sol`). None of the product contracts
7
+ * declare these in their own ABIs — the revert originates in the *token*, not
8
+ * the product contract — so {@link mapContractRevert} merges this set into
9
+ * every decode. Without it, `decodeErrorResult` fails and consumers see a raw
10
+ * selector hex string (`ContractRevertError: "… reverted with 0x79f2cb38."`).
11
+ *
12
+ * Selectors (keccak-256 of the signature, first 4 bytes):
13
+ *
14
+ * - `ERC7984UnauthorizedSpender(address,address)` → `0x79f2cb38`
15
+ * - `ERC7984UnauthorizedCaller(address)` → `0x782c6ffd`
16
+ * - `ERC7984UnauthorizedUseOfEncryptedAmount(bytes32,address)` → `0x67cfe805`
17
+ * - `ERC7984InvalidReceiver(address)` → `0x8d518801`
18
+ * - `ERC7984InvalidSender(address)` → `0xee457ebf`
19
+ * - `ERC7984ZeroBalance(address)` → `0x5ff91cdc`
20
+ * - `ERC7984InvalidGatewayRequest(uint256)` → `0x05c5b389`
21
+ *
22
+ * `euint64` parameters are `bytes32` at the ABI boundary.
23
+ */
24
+ export declare const ERC7984_ERRORS_ABI: readonly [{
25
+ readonly type: "error";
26
+ readonly name: "ERC7984UnauthorizedSpender";
27
+ readonly inputs: readonly [{
28
+ readonly name: "holder";
29
+ readonly type: "address";
30
+ }, {
31
+ readonly name: "spender";
32
+ readonly type: "address";
33
+ }];
34
+ }, {
35
+ readonly type: "error";
36
+ readonly name: "ERC7984UnauthorizedCaller";
37
+ readonly inputs: readonly [{
38
+ readonly name: "caller";
39
+ readonly type: "address";
40
+ }];
41
+ }, {
42
+ readonly type: "error";
43
+ readonly name: "ERC7984UnauthorizedUseOfEncryptedAmount";
44
+ readonly inputs: readonly [{
45
+ readonly name: "amount";
46
+ readonly type: "bytes32";
47
+ }, {
48
+ readonly name: "user";
49
+ readonly type: "address";
50
+ }];
51
+ }, {
52
+ readonly type: "error";
53
+ readonly name: "ERC7984InvalidReceiver";
54
+ readonly inputs: readonly [{
55
+ readonly name: "receiver";
56
+ readonly type: "address";
57
+ }];
58
+ }, {
59
+ readonly type: "error";
60
+ readonly name: "ERC7984InvalidSender";
61
+ readonly inputs: readonly [{
62
+ readonly name: "sender";
63
+ readonly type: "address";
64
+ }];
65
+ }, {
66
+ readonly type: "error";
67
+ readonly name: "ERC7984ZeroBalance";
68
+ readonly inputs: readonly [{
69
+ readonly name: "holder";
70
+ readonly type: "address";
71
+ }];
72
+ }, {
73
+ readonly type: "error";
74
+ readonly name: "ERC7984InvalidGatewayRequest";
75
+ readonly inputs: readonly [{
76
+ readonly name: "requestId";
77
+ readonly type: "uint256";
78
+ }];
79
+ }];
3
80
  /** Per-product mapping: contract error name → typed SDK error constructor. */
4
81
  export type RevertNameMapper = (name: string, args: readonly unknown[] | undefined, ctx: RevertMapperContext) => TokenOpsSdkError | undefined;
5
82
  /** Context passed into product mappers. `productContext` lets the call site forward args (vestingId, user, etc.) for the mapper to embed in the typed error. */
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Internal wagmi v2/v3 compatibility layer.
3
+ *
4
+ * The SDK supports both wagmi majors (`peerDependencies.wagmi: "^2.0.0 || ^3.0.0"`).
5
+ * wagmi v3 renamed `useAccount` → `useConnection` (official v2→v3 migration
6
+ * guide); `usePublicClient` and `useWalletClient` survive unchanged, so hooks
7
+ * import those from `"wagmi"` directly. Only the account hook needs resolving.
8
+ *
9
+ * The fields the SDK reads are shape-identical across both majors: `address`
10
+ * lives at the top level of both `useAccount()` (v2) and `useConnection()`
11
+ * (v3) return values, typed `Address | undefined` until connected.
12
+ *
13
+ * This module is intentionally NOT exported from any public subpath — it is an
14
+ * internal helper for the `src/<product>/react/` hook files. We namespace-import
15
+ * wagmi so the module typechecks against either major: a named import of
16
+ * `useAccount` would fail `tsc --noEmit` under v3 (and vice versa for
17
+ * `useConnection` under v2).
18
+ */
19
+ import type { Address } from "viem";
20
+ /**
21
+ * Minimal slice of the wagmi account-hook return value the SDK reads.
22
+ *
23
+ * Deliberately narrow: widening this to the full upstream shape would force
24
+ * this module to pick one major's type surface and break typechecking against
25
+ * the other. Every field listed here has been verified shape-identical in
26
+ * wagmi v2 `useAccount()` and wagmi v3 `useConnection()`.
27
+ */
28
+ export interface WagmiAccountResult {
29
+ /** Connected address from the active connector; `undefined` while disconnected. */
30
+ address: Address | undefined;
31
+ }
32
+ /**
33
+ * The installed wagmi major's account hook: `useConnection` (v3) when present,
34
+ * else `useAccount` (v2). Resolved once at module load — the installed wagmi
35
+ * major cannot change at runtime.
36
+ *
37
+ * This IS a React hook (it aliases one) — the rules of hooks apply at every
38
+ * call site.
39
+ */
40
+ export declare const useWagmiAccount: () => WagmiAccountResult;
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkITQ7WKVC_cjs = require('../chunk-ITQ7WKVC.cjs');
3
+ var chunk4ZCXK4VI_cjs = require('../chunk-4ZCXK4VI.cjs');
4
+ var chunkBD4LZBVF_cjs = require('../chunk-BD4LZBVF.cjs');
5
+ var chunkSYHNZSZZ_cjs = require('../chunk-SYHNZSZZ.cjs');
4
6
  var chunkFWHYQZ5E_cjs = require('../chunk-FWHYQZ5E.cjs');
5
- var chunk5SGMJADP_cjs = require('../chunk-5SGMJADP.cjs');
6
- var chunkQ7ARQSUH_cjs = require('../chunk-Q7ARQSUH.cjs');
7
- var chunkCQIPRNS7_cjs = require('../chunk-CQIPRNS7.cjs');
7
+ var chunkVR3FREBX_cjs = require('../chunk-VR3FREBX.cjs');
8
+ var chunk2RNW4MIJ_cjs = require('../chunk-2RNW4MIJ.cjs');
8
9
  var chunkVJKZWYYJ_cjs = require('../chunk-VJKZWYYJ.cjs');
9
- var chunk56UI7LUR_cjs = require('../chunk-56UI7LUR.cjs');
10
10
  var sdk = require('@zama-fhe/sdk');
11
11
 
12
12
  // src/fhe/mock-encryptor.ts
@@ -23,7 +23,8 @@ async function requirePeerDep(spec, hint) {
23
23
  throw new Error(
24
24
  `@tokenops/sdk: peer dependency "${spec}" is required for createMockEncryptor.
25
25
  install it with: ${hint}
26
- underlying error: ${String(err)}`
26
+ underlying error: ${String(err)}`,
27
+ { cause: err }
27
28
  );
28
29
  }
29
30
  }
@@ -216,18 +217,18 @@ var MOCK_ERC7984_MINT_ABI = [
216
217
  var UINT64_MAX = (1n << 64n) - 1n;
217
218
  async function mintMockERC7984(args) {
218
219
  const { publicClient, walletClient, account, waitForReceipt = true, telemetry } = args;
219
- const token = chunkCQIPRNS7_cjs.normaliseAddress(args.token);
220
- const to = chunkCQIPRNS7_cjs.normaliseAddress(args.to);
220
+ const token = chunkVR3FREBX_cjs.normaliseAddress(args.token);
221
+ const to = chunkVR3FREBX_cjs.normaliseAddress(args.to);
221
222
  return chunkVJKZWYYJ_cjs.withTelemetry(telemetry, "fhe.mintMockERC7984", async () => {
222
223
  const fromAccount = account ?? walletClient.account;
223
224
  if (!fromAccount) {
224
- throw new chunk56UI7LUR_cjs.TokenOpsContractError(
225
+ throw new chunk2RNW4MIJ_cjs.TokenOpsContractError(
225
226
  "mintMockERC7984: no account available \u2014 pass `account` explicitly or attach an account to the walletClient",
226
227
  { contract: "ERC7984", call: "mint" }
227
228
  );
228
229
  }
229
230
  if (args.amount < 0n || args.amount > UINT64_MAX) {
230
- throw new chunk56UI7LUR_cjs.TokenOpsContractError(
231
+ throw new chunk2RNW4MIJ_cjs.TokenOpsContractError(
231
232
  `mintMockERC7984: amount ${args.amount} out of uint64 range [0, ${UINT64_MAX}]`,
232
233
  { contract: "ERC7984", call: "mint", amount: args.amount.toString() }
233
234
  );
@@ -245,7 +246,7 @@ async function mintMockERC7984(args) {
245
246
  chain: walletClient.chain
246
247
  });
247
248
  } catch (err) {
248
- throw new chunk56UI7LUR_cjs.TokenOpsContractError(
249
+ throw new chunk2RNW4MIJ_cjs.TokenOpsContractError(
249
250
  `mintMockERC7984: writeContract failed (token=${token}, to=${to})`,
250
251
  {
251
252
  contract: "ERC7984",
@@ -262,7 +263,7 @@ async function mintMockERC7984(args) {
262
263
  const receipt = await publicClient.waitForTransactionReceipt({ hash });
263
264
  blockNumber = receipt.blockNumber;
264
265
  } catch (err) {
265
- throw new chunk56UI7LUR_cjs.TokenOpsContractError(`mintMockERC7984: receipt wait failed (tx=${hash})`, {
266
+ throw new chunk2RNW4MIJ_cjs.TokenOpsContractError(`mintMockERC7984: receipt wait failed (tx=${hash})`, {
266
267
  contract: "ERC7984",
267
268
  call: "mint",
268
269
  tx: hash,
@@ -274,7 +275,7 @@ async function mintMockERC7984(args) {
274
275
  });
275
276
  }
276
277
  function createMockErc7984Client(args) {
277
- const address = chunkCQIPRNS7_cjs.normaliseAddress(args.address);
278
+ const address = chunkVR3FREBX_cjs.normaliseAddress(args.address);
278
279
  const { publicClient, walletClient, telemetry } = args;
279
280
  return {
280
281
  address,
@@ -303,12 +304,21 @@ async function requirePeerDep2(spec, hint) {
303
304
  throw new Error(
304
305
  `@tokenops/sdk: peer dependency "${spec}" is required for createSepoliaEncryptor.
305
306
  install it with: ${hint}
306
- underlying error: ${String(err)}`
307
+ underlying error: ${String(err)}`,
308
+ { cause: err }
307
309
  );
308
310
  }
309
311
  }
310
312
  async function createSepoliaEncryptor(options = {}) {
311
313
  const chainId = options.chainId ?? SEPOLIA_CHAIN_ID;
314
+ const firePhase = (phase) => {
315
+ if (!options.onPhase) return;
316
+ try {
317
+ options.onPhase(phase);
318
+ } catch {
319
+ }
320
+ };
321
+ firePhase("initializing");
312
322
  const zamaSdkNode = await requirePeerDep2(
313
323
  "@zama-fhe/sdk/node",
314
324
  "pnpm add @zama-fhe/sdk@^3"
@@ -337,11 +347,29 @@ async function createSepoliaEncryptor(options = {}) {
337
347
  fheArtifactStorage: options.fheArtifactStorage,
338
348
  fheArtifactCacheTTL: options.fheArtifactCacheTTL
339
349
  });
350
+ let initState = "idle";
340
351
  return {
341
352
  instance,
342
353
  chainId,
343
354
  async encrypt({ values, contractAddress, userAddress }) {
344
- return instance.encrypt({ values, contractAddress, userAddress });
355
+ const startedInit = initState === "idle";
356
+ if (startedInit) {
357
+ initState = "in-flight";
358
+ firePhase("downloading-params");
359
+ }
360
+ try {
361
+ const result = await instance.encrypt({ values, contractAddress, userAddress });
362
+ if (initState !== "ready") {
363
+ initState = "ready";
364
+ firePhase("ready");
365
+ }
366
+ return result;
367
+ } catch (err) {
368
+ if (startedInit && initState === "in-flight") {
369
+ initState = "idle";
370
+ }
371
+ throw err;
372
+ }
345
373
  },
346
374
  terminate() {
347
375
  instance.terminate();
@@ -375,10 +403,36 @@ function createSepoliaEncryptorWeb(opts) {
375
403
  },
376
404
  ...opts.logger
377
405
  } : void 0;
406
+ const firePhase = (phase) => {
407
+ if (!opts.onPhase) return;
408
+ try {
409
+ opts.onPhase(phase);
410
+ } catch {
411
+ }
412
+ };
413
+ firePhase("initializing");
414
+ const onStatusChange = opts.onPhase ? (status) => {
415
+ if (status === "initializing") {
416
+ firePhase("downloading-params");
417
+ } else if (status === "ready") {
418
+ firePhase("ready");
419
+ }
420
+ } : void 0;
421
+ if (opts.threads !== void 0 && opts.threads > 1) {
422
+ const isolated = globalThis.crossOriginIsolated === true;
423
+ if (!isolated) {
424
+ const warn = safeLogger?.warn ?? console.warn;
425
+ warn(
426
+ `@tokenops/sdk: createSepoliaEncryptorWeb({ threads: ${opts.threads} }) \u2014 this page is NOT cross-origin isolated, so SharedArrayBuffer is unavailable and encryption will run single-threaded. Serve \`Cross-Origin-Opener-Policy: same-origin\` + \`Cross-Origin-Embedder-Policy: require-corp\` to enable the worker pool, or omit \`threads\`.`
427
+ );
428
+ }
429
+ }
378
430
  const instance = new sdk.RelayerWeb({
379
431
  transports: { [chainId]: transportConfig },
380
432
  getChainId: () => Promise.resolve(chainId),
381
- logger: safeLogger
433
+ logger: safeLogger,
434
+ onStatusChange,
435
+ ...opts.threads !== void 0 ? { threads: opts.threads } : {}
382
436
  });
383
437
  return Promise.resolve({
384
438
  instance,
@@ -394,199 +448,211 @@ function createSepoliaEncryptorWeb(opts) {
394
448
 
395
449
  Object.defineProperty(exports, "ERC7984_OPERATOR_MAX_DEADLINE", {
396
450
  enumerable: true,
397
- get: function () { return chunkITQ7WKVC_cjs.ERC7984_OPERATOR_MAX_DEADLINE; }
451
+ get: function () { return chunk4ZCXK4VI_cjs.ERC7984_OPERATOR_MAX_DEADLINE; }
398
452
  });
399
453
  Object.defineProperty(exports, "ERC7984_SET_OPERATOR_ABI", {
400
454
  enumerable: true,
401
- get: function () { return chunkITQ7WKVC_cjs.ERC7984_SET_OPERATOR_ABI; }
455
+ get: function () { return chunk4ZCXK4VI_cjs.ERC7984_SET_OPERATOR_ABI; }
402
456
  });
403
- Object.defineProperty(exports, "revokeOperator", {
457
+ Object.defineProperty(exports, "ensureOperator", {
404
458
  enumerable: true,
405
- get: function () { return chunkITQ7WKVC_cjs.revokeOperator; }
459
+ get: function () { return chunk4ZCXK4VI_cjs.ensureOperator; }
406
460
  });
407
- Object.defineProperty(exports, "setOperator", {
461
+ Object.defineProperty(exports, "isOperator", {
408
462
  enumerable: true,
409
- get: function () { return chunkITQ7WKVC_cjs.setOperator; }
463
+ get: function () { return chunk4ZCXK4VI_cjs.isOperator; }
410
464
  });
411
- Object.defineProperty(exports, "erc7984OperatorAbi", {
465
+ Object.defineProperty(exports, "revokeOperator", {
412
466
  enumerable: true,
413
- get: function () { return chunkFWHYQZ5E_cjs.erc7984OperatorAbi; }
467
+ get: function () { return chunk4ZCXK4VI_cjs.revokeOperator; }
468
+ });
469
+ Object.defineProperty(exports, "setOperator", {
470
+ enumerable: true,
471
+ get: function () { return chunk4ZCXK4VI_cjs.setOperator; }
414
472
  });
415
473
  Object.defineProperty(exports, "FHE_SPLIT_DENOMINATOR", {
416
474
  enumerable: true,
417
- get: function () { return chunk5SGMJADP_cjs.FHE_SPLIT_DENOMINATOR; }
475
+ get: function () { return chunkBD4LZBVF_cjs.FHE_SPLIT_DENOMINATOR; }
418
476
  });
419
477
  Object.defineProperty(exports, "scaleRatio", {
420
478
  enumerable: true,
421
- get: function () { return chunk5SGMJADP_cjs.scaleRatio; }
479
+ get: function () { return chunkBD4LZBVF_cjs.scaleRatio; }
422
480
  });
423
481
  Object.defineProperty(exports, "share", {
424
482
  enumerable: true,
425
- get: function () { return chunk5SGMJADP_cjs.share; }
483
+ get: function () { return chunkBD4LZBVF_cjs.share; }
426
484
  });
427
485
  Object.defineProperty(exports, "ACL_ALLOWED_EVENT", {
428
486
  enumerable: true,
429
- get: function () { return chunkQ7ARQSUH_cjs.ACL_ALLOWED_EVENT; }
487
+ get: function () { return chunkSYHNZSZZ_cjs.ACL_ALLOWED_EVENT; }
430
488
  });
431
489
  Object.defineProperty(exports, "FHEVM_ACL_ADDRESS_BY_CHAIN", {
432
490
  enumerable: true,
433
- get: function () { return chunkQ7ARQSUH_cjs.FHEVM_ACL_ADDRESS_BY_CHAIN; }
491
+ get: function () { return chunkSYHNZSZZ_cjs.FHEVM_ACL_ADDRESS_BY_CHAIN; }
434
492
  });
435
493
  Object.defineProperty(exports, "getFhevmAclAddress", {
436
494
  enumerable: true,
437
- get: function () { return chunkQ7ARQSUH_cjs.getFhevmAclAddress; }
495
+ get: function () { return chunkSYHNZSZZ_cjs.getFhevmAclAddress; }
438
496
  });
439
497
  Object.defineProperty(exports, "requireFhevmAclAddress", {
440
498
  enumerable: true,
441
- get: function () { return chunkQ7ARQSUH_cjs.requireFhevmAclAddress; }
499
+ get: function () { return chunkSYHNZSZZ_cjs.requireFhevmAclAddress; }
500
+ });
501
+ Object.defineProperty(exports, "erc7984OperatorAbi", {
502
+ enumerable: true,
503
+ get: function () { return chunkFWHYQZ5E_cjs.erc7984OperatorAbi; }
442
504
  });
443
505
  Object.defineProperty(exports, "AccessDeniedError", {
444
506
  enumerable: true,
445
- get: function () { return chunk56UI7LUR_cjs.AccessDeniedError; }
507
+ get: function () { return chunk2RNW4MIJ_cjs.AccessDeniedError; }
446
508
  });
447
509
  Object.defineProperty(exports, "AlreadyInitializedError", {
448
510
  enumerable: true,
449
- get: function () { return chunk56UI7LUR_cjs.AlreadyInitializedError; }
511
+ get: function () { return chunk2RNW4MIJ_cjs.AlreadyInitializedError; }
450
512
  });
451
513
  Object.defineProperty(exports, "BatchTooLargeError", {
452
514
  enumerable: true,
453
- get: function () { return chunk56UI7LUR_cjs.BatchTooLargeError; }
515
+ get: function () { return chunk2RNW4MIJ_cjs.BatchTooLargeError; }
454
516
  });
455
517
  Object.defineProperty(exports, "ContractRevertError", {
456
518
  enumerable: true,
457
- get: function () { return chunk56UI7LUR_cjs.ContractRevertError; }
519
+ get: function () { return chunk2RNW4MIJ_cjs.ContractRevertError; }
458
520
  });
459
521
  Object.defineProperty(exports, "DecryptionFailedError", {
460
522
  enumerable: true,
461
- get: function () { return chunk56UI7LUR_cjs.DecryptionFailedError; }
523
+ get: function () { return chunk2RNW4MIJ_cjs.DecryptionFailedError; }
462
524
  });
463
525
  Object.defineProperty(exports, "DeploymentAddressUnavailableError", {
464
526
  enumerable: true,
465
- get: function () { return chunk56UI7LUR_cjs.DeploymentAddressUnavailableError; }
527
+ get: function () { return chunk2RNW4MIJ_cjs.DeploymentAddressUnavailableError; }
466
528
  });
467
529
  Object.defineProperty(exports, "EncryptionFailedError", {
468
530
  enumerable: true,
469
- get: function () { return chunk56UI7LUR_cjs.EncryptionFailedError; }
531
+ get: function () { return chunk2RNW4MIJ_cjs.EncryptionFailedError; }
470
532
  });
471
533
  Object.defineProperty(exports, "FeatureDisabledError", {
472
534
  enumerable: true,
473
- get: function () { return chunk56UI7LUR_cjs.FeatureDisabledError; }
535
+ get: function () { return chunk2RNW4MIJ_cjs.FeatureDisabledError; }
474
536
  });
475
537
  Object.defineProperty(exports, "FheHandleNotAllowedError", {
476
538
  enumerable: true,
477
- get: function () { return chunk56UI7LUR_cjs.FheHandleNotAllowedError; }
539
+ get: function () { return chunk2RNW4MIJ_cjs.FheHandleNotAllowedError; }
478
540
  });
479
541
  Object.defineProperty(exports, "InsufficientBalanceError", {
480
542
  enumerable: true,
481
- get: function () { return chunk56UI7LUR_cjs.InsufficientBalanceError; }
543
+ get: function () { return chunk2RNW4MIJ_cjs.InsufficientBalanceError; }
482
544
  });
483
545
  Object.defineProperty(exports, "InsufficientFeeError", {
484
546
  enumerable: true,
485
- get: function () { return chunk56UI7LUR_cjs.InsufficientFeeError; }
547
+ get: function () { return chunk2RNW4MIJ_cjs.InsufficientFeeError; }
486
548
  });
487
549
  Object.defineProperty(exports, "InsufficientGasFundsError", {
488
550
  enumerable: true,
489
- get: function () { return chunk56UI7LUR_cjs.InsufficientGasFundsError; }
551
+ get: function () { return chunk2RNW4MIJ_cjs.InsufficientGasFundsError; }
490
552
  });
491
553
  Object.defineProperty(exports, "InvalidArgumentError", {
492
554
  enumerable: true,
493
- get: function () { return chunk56UI7LUR_cjs.InvalidArgumentError; }
555
+ get: function () { return chunk2RNW4MIJ_cjs.InvalidArgumentError; }
494
556
  });
495
557
  Object.defineProperty(exports, "InvalidSignatureError", {
496
558
  enumerable: true,
497
- get: function () { return chunk56UI7LUR_cjs.InvalidSignatureError; }
559
+ get: function () { return chunk2RNW4MIJ_cjs.InvalidSignatureError; }
498
560
  });
499
561
  Object.defineProperty(exports, "MissingAccountError", {
500
562
  enumerable: true,
501
- get: function () { return chunk56UI7LUR_cjs.MissingAccountError; }
563
+ get: function () { return chunk2RNW4MIJ_cjs.MissingAccountError; }
502
564
  });
503
565
  Object.defineProperty(exports, "MissingClientError", {
504
566
  enumerable: true,
505
- get: function () { return chunk56UI7LUR_cjs.MissingClientError; }
567
+ get: function () { return chunk2RNW4MIJ_cjs.MissingClientError; }
506
568
  });
507
569
  Object.defineProperty(exports, "MissingEncryptorError", {
508
570
  enumerable: true,
509
- get: function () { return chunk56UI7LUR_cjs.MissingEncryptorError; }
571
+ get: function () { return chunk2RNW4MIJ_cjs.MissingEncryptorError; }
510
572
  });
511
573
  Object.defineProperty(exports, "MissingPublicClientError", {
512
574
  enumerable: true,
513
- get: function () { return chunk56UI7LUR_cjs.MissingPublicClientError; }
575
+ get: function () { return chunk2RNW4MIJ_cjs.MissingPublicClientError; }
514
576
  });
515
577
  Object.defineProperty(exports, "MissingWalletClientError", {
516
578
  enumerable: true,
517
- get: function () { return chunk56UI7LUR_cjs.MissingWalletClientError; }
579
+ get: function () { return chunk2RNW4MIJ_cjs.MissingWalletClientError; }
518
580
  });
519
581
  Object.defineProperty(exports, "NetworkError", {
520
582
  enumerable: true,
521
- get: function () { return chunk56UI7LUR_cjs.NetworkError; }
583
+ get: function () { return chunk2RNW4MIJ_cjs.NetworkError; }
584
+ });
585
+ Object.defineProperty(exports, "OperatorNotApprovedError", {
586
+ enumerable: true,
587
+ get: function () { return chunk2RNW4MIJ_cjs.OperatorNotApprovedError; }
522
588
  });
523
589
  Object.defineProperty(exports, "PausedError", {
524
590
  enumerable: true,
525
- get: function () { return chunk56UI7LUR_cjs.PausedError; }
591
+ get: function () { return chunk2RNW4MIJ_cjs.PausedError; }
526
592
  });
527
593
  Object.defineProperty(exports, "ReceiptEventAmbiguousError", {
528
594
  enumerable: true,
529
- get: function () { return chunk56UI7LUR_cjs.ReceiptEventAmbiguousError; }
595
+ get: function () { return chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError; }
530
596
  });
531
597
  Object.defineProperty(exports, "ReceiptEventNotFoundError", {
532
598
  enumerable: true,
533
- get: function () { return chunk56UI7LUR_cjs.ReceiptEventNotFoundError; }
599
+ get: function () { return chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError; }
534
600
  });
535
601
  Object.defineProperty(exports, "ReentrancyError", {
536
602
  enumerable: true,
537
- get: function () { return chunk56UI7LUR_cjs.ReentrancyError; }
603
+ get: function () { return chunk2RNW4MIJ_cjs.ReentrancyError; }
538
604
  });
539
605
  Object.defineProperty(exports, "RelayerUnreachableError", {
540
606
  enumerable: true,
541
- get: function () { return chunk56UI7LUR_cjs.RelayerUnreachableError; }
607
+ get: function () { return chunk2RNW4MIJ_cjs.RelayerUnreachableError; }
542
608
  });
543
609
  Object.defineProperty(exports, "SigningFailedError", {
544
610
  enumerable: true,
545
- get: function () { return chunk56UI7LUR_cjs.SigningFailedError; }
611
+ get: function () { return chunk2RNW4MIJ_cjs.SigningFailedError; }
546
612
  });
547
613
  Object.defineProperty(exports, "TokenOpsContractError", {
548
614
  enumerable: true,
549
- get: function () { return chunk56UI7LUR_cjs.TokenOpsContractError; }
615
+ get: function () { return chunk2RNW4MIJ_cjs.TokenOpsContractError; }
550
616
  });
551
617
  Object.defineProperty(exports, "TokenOpsSdkError", {
552
618
  enumerable: true,
553
- get: function () { return chunk56UI7LUR_cjs.TokenOpsSdkError; }
619
+ get: function () { return chunk2RNW4MIJ_cjs.TokenOpsSdkError; }
554
620
  });
555
621
  Object.defineProperty(exports, "TokenOpsValidationError", {
556
622
  enumerable: true,
557
- get: function () { return chunk56UI7LUR_cjs.TokenOpsValidationError; }
623
+ get: function () { return chunk2RNW4MIJ_cjs.TokenOpsValidationError; }
558
624
  });
559
625
  Object.defineProperty(exports, "TransferFailedError", {
560
626
  enumerable: true,
561
- get: function () { return chunk56UI7LUR_cjs.TransferFailedError; }
627
+ get: function () { return chunk2RNW4MIJ_cjs.TransferFailedError; }
562
628
  });
563
629
  Object.defineProperty(exports, "UnknownWriteFailureError", {
564
630
  enumerable: true,
565
- get: function () { return chunk56UI7LUR_cjs.UnknownWriteFailureError; }
631
+ get: function () { return chunk2RNW4MIJ_cjs.UnknownWriteFailureError; }
566
632
  });
567
633
  Object.defineProperty(exports, "UnsupportedChainError", {
568
634
  enumerable: true,
569
- get: function () { return chunk56UI7LUR_cjs.UnsupportedChainError; }
635
+ get: function () { return chunk2RNW4MIJ_cjs.UnsupportedChainError; }
570
636
  });
571
637
  Object.defineProperty(exports, "UserDecryptNotAllowedError", {
572
638
  enumerable: true,
573
- get: function () { return chunk56UI7LUR_cjs.UserDecryptNotAllowedError; }
639
+ get: function () { return chunk2RNW4MIJ_cjs.UserDecryptNotAllowedError; }
574
640
  });
575
641
  Object.defineProperty(exports, "UserRejectedSignatureError", {
576
642
  enumerable: true,
577
- get: function () { return chunk56UI7LUR_cjs.UserRejectedSignatureError; }
643
+ get: function () { return chunk2RNW4MIJ_cjs.UserRejectedSignatureError; }
578
644
  });
579
645
  Object.defineProperty(exports, "WalletChainMismatchError", {
580
646
  enumerable: true,
581
- get: function () { return chunk56UI7LUR_cjs.WalletChainMismatchError; }
647
+ get: function () { return chunk2RNW4MIJ_cjs.WalletChainMismatchError; }
582
648
  });
583
649
  Object.defineProperty(exports, "WalletRejectedError", {
584
650
  enumerable: true,
585
- get: function () { return chunk56UI7LUR_cjs.WalletRejectedError; }
651
+ get: function () { return chunk2RNW4MIJ_cjs.WalletRejectedError; }
586
652
  });
587
653
  Object.defineProperty(exports, "isTokenOpsSdkError", {
588
654
  enumerable: true,
589
- get: function () { return chunk56UI7LUR_cjs.isTokenOpsSdkError; }
655
+ get: function () { return chunk2RNW4MIJ_cjs.isTokenOpsSdkError; }
590
656
  });
591
657
  exports.MAINNET_CHAIN_ID = MAINNET_CHAIN_ID;
592
658
  exports.MOCK_ERC7984_MINT_ABI = MOCK_ERC7984_MINT_ABI;
@@ -7,5 +7,6 @@ export * from "./sepolia-encryptor.js";
7
7
  export * from "./sepolia-encryptor-web.js";
8
8
  export * from "./types.js";
9
9
  export { erc7984OperatorAbi } from "./erc7984-abi.js";
10
- export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
10
+ export { type Encryptor, type EncryptorSource, type FheValueInput, } from "../fhe-vesting/encryption.js";
11
+ export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
11
12
  export { type PreflightResult } from "../core/preflight.js";
@@ -7,5 +7,6 @@ export * from "./sepolia-encryptor.js";
7
7
  export * from "./sepolia-encryptor-web.js";
8
8
  export * from "./types.js";
9
9
  export { erc7984OperatorAbi } from "./erc7984-abi.js";
10
- export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
10
+ export { type Encryptor, type EncryptorSource, type FheValueInput, } from "../fhe-vesting/encryption.js";
11
+ export { TokenOpsSdkError, isTokenOpsSdkError, DeploymentAddressUnavailableError, UnsupportedChainError, MissingAccountError, MissingClientError, MissingEncryptorError, MissingPublicClientError, MissingWalletClientError, InvalidArgumentError, ReceiptEventAmbiguousError, ReceiptEventNotFoundError, TokenOpsValidationError, ContractRevertError, TokenOpsContractError, PausedError, AccessDeniedError, OperatorNotApprovedError, InsufficientFeeError, InsufficientBalanceError, BatchTooLargeError, FeatureDisabledError, TransferFailedError, FheHandleNotAllowedError, AlreadyInitializedError, ReentrancyError, InvalidSignatureError, WalletRejectedError, WalletChainMismatchError, NetworkError, InsufficientGasFundsError, UnknownWriteFailureError, UserRejectedSignatureError, SigningFailedError, RelayerUnreachableError, EncryptionFailedError, DecryptionFailedError, UserDecryptNotAllowedError, type DeploymentAddressUnavailableReason, type TokenOpsSdkErrorCode, } from "../core/errors.js";
11
12
  export { type PreflightResult } from "../core/preflight.js";