@zama-fhe/sdk 3.2.0 → 3.3.0-alpha.10

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 (94) hide show
  1. package/dist/cjs/assertions.cjs +1 -1
  2. package/dist/cjs/assertions.cjs.map +1 -1
  3. package/dist/cjs/base-signer.cjs +1 -1
  4. package/dist/cjs/base-signer.cjs.map +1 -1
  5. package/dist/cjs/ethers/index.cjs +1 -1
  6. package/dist/cjs/index.cjs +1 -1
  7. package/dist/cjs/index.cjs.map +1 -1
  8. package/dist/cjs/query/index.cjs +1 -1
  9. package/dist/cjs/query/index.cjs.map +1 -1
  10. package/dist/cjs/relayer-cleartext.cjs +1 -1
  11. package/dist/cjs/relayer-cleartext.cjs.map +1 -1
  12. package/dist/cjs/relayer-sdk.worker.js +134 -34
  13. package/dist/cjs/relayer.cjs +1 -1
  14. package/dist/cjs/relayer.cjs.map +1 -1
  15. package/dist/cjs/timeout.cjs +2 -0
  16. package/dist/cjs/timeout.cjs.map +1 -0
  17. package/dist/cjs/token.cjs +1 -1
  18. package/dist/cjs/token.cjs.map +1 -1
  19. package/dist/cjs/viem/index.cjs +1 -1
  20. package/dist/cjs/viem/index.cjs.map +1 -1
  21. package/dist/cjs/web/index.cjs +136 -36
  22. package/dist/cjs/web/index.cjs.map +1 -1
  23. package/dist/cjs/wrappers-registry.cjs +1 -1
  24. package/dist/cjs/wrappers-registry.cjs.map +1 -1
  25. package/dist/esm/assertions-zYseN5Xz.js +2 -0
  26. package/dist/esm/assertions-zYseN5Xz.js.map +1 -0
  27. package/dist/esm/{base-signer-ByGw5ReU.d.ts → base-signer-C3Wc5oi9.d.ts} +2 -2
  28. package/dist/esm/base-signer-DjytqPkd.js +2 -0
  29. package/dist/esm/base-signer-DjytqPkd.js.map +1 -0
  30. package/dist/esm/cleartext/index.d.ts +1 -1
  31. package/dist/esm/cleartext/index.js +1 -1
  32. package/dist/esm/{cleartext-DMW5nK1M.d.ts → cleartext-DAkOTlrE.d.ts} +2 -2
  33. package/dist/esm/{cleartext-CTla3A3O.js → cleartext-rTWFctyd.js} +2 -2
  34. package/dist/esm/{cleartext-CTla3A3O.js.map → cleartext-rTWFctyd.js.map} +1 -1
  35. package/dist/esm/{encryption-BGmINekJ.js → encryption-x4Z_Icqk.js} +2 -2
  36. package/dist/esm/{encryption-BGmINekJ.js.map → encryption-x4Z_Icqk.js.map} +1 -1
  37. package/dist/esm/ethers/index.d.ts +4 -4
  38. package/dist/esm/ethers/index.js +1 -1
  39. package/dist/esm/ethers/index.js.map +1 -1
  40. package/dist/esm/{hex-CxtyupeQ.js → hex-A72GrTf9.js} +2 -2
  41. package/dist/esm/{hex-CxtyupeQ.js.map → hex-A72GrTf9.js.map} +1 -1
  42. package/dist/esm/{index-DoVo9J1n.d.ts → index-C1Mtc8Rw.d.ts} +450 -163
  43. package/dist/esm/index.d.ts +17 -13
  44. package/dist/esm/index.js +1 -1
  45. package/dist/esm/index.js.map +1 -1
  46. package/dist/esm/node/index.d.ts +25 -7
  47. package/dist/esm/node/index.js +1 -1
  48. package/dist/esm/node/index.js.map +1 -1
  49. package/dist/esm/node/relayer-sdk.node-worker.js +1 -1
  50. package/dist/esm/node/relayer-sdk.node-worker.js.map +1 -1
  51. package/dist/esm/query/index.d.ts +42 -4
  52. package/dist/esm/query/index.js +1 -1
  53. package/dist/esm/query/index.js.map +1 -1
  54. package/dist/esm/relayer-cleartext-Bp6jtxDd.js +2 -0
  55. package/dist/esm/relayer-cleartext-Bp6jtxDd.js.map +1 -0
  56. package/dist/esm/{relayer-cleartext-DkKKjfI6.d.ts → relayer-cleartext-CSeMlmGO.d.ts} +102 -13
  57. package/dist/esm/relayer-eavK5bfZ.js +2 -0
  58. package/dist/esm/relayer-eavK5bfZ.js.map +1 -0
  59. package/dist/esm/relayer-sdk.worker.js +134 -34
  60. package/dist/esm/timeout-CNVfiaJD.js +2 -0
  61. package/dist/esm/timeout-CNVfiaJD.js.map +1 -0
  62. package/dist/esm/token-Bt33g0zQ.js +2 -0
  63. package/dist/esm/token-Bt33g0zQ.js.map +1 -0
  64. package/dist/esm/{types-BjDu-RZg.d.ts → types-Gn5MeDsr.d.ts} +14 -2
  65. package/dist/esm/{types-Xg_On_yY.d.ts → types-OHIaPwCy.d.ts} +2 -2
  66. package/dist/esm/{types-DiZhtG8i.d.ts → types-piBsdTIP.d.ts} +2 -2
  67. package/dist/esm/{validation-DHZ3JPOn.js → validation-DLszOweh.js} +2 -2
  68. package/dist/esm/{validation-DHZ3JPOn.js.map → validation-DLszOweh.js.map} +1 -1
  69. package/dist/esm/viem/index.d.ts +4 -4
  70. package/dist/esm/viem/index.js +1 -1
  71. package/dist/esm/viem/index.js.map +1 -1
  72. package/dist/esm/web/index.d.ts +2 -2
  73. package/dist/esm/web/index.js +135 -35
  74. package/dist/esm/web/index.js.map +1 -1
  75. package/dist/esm/worker.base-client-BVnT4yJa.js +2 -0
  76. package/dist/esm/worker.base-client-BVnT4yJa.js.map +1 -0
  77. package/dist/esm/{wrappers-registry-BWWG0aze.js → wrappers-registry-C1oK8Bi6.js} +2 -2
  78. package/dist/esm/wrappers-registry-C1oK8Bi6.js.map +1 -0
  79. package/package.json +51 -51
  80. package/dist/esm/assertions-CnPIS0VN.js +0 -2
  81. package/dist/esm/assertions-CnPIS0VN.js.map +0 -1
  82. package/dist/esm/base-signer-BVqcM5jt.js +0 -2
  83. package/dist/esm/base-signer-BVqcM5jt.js.map +0 -1
  84. package/dist/esm/error-W1N-FGwV.js +0 -2
  85. package/dist/esm/error-W1N-FGwV.js.map +0 -1
  86. package/dist/esm/relayer-D-nicEYJ.js +0 -2
  87. package/dist/esm/relayer-D-nicEYJ.js.map +0 -1
  88. package/dist/esm/relayer-cleartext-DGcb5qtE.js +0 -2
  89. package/dist/esm/relayer-cleartext-DGcb5qtE.js.map +0 -1
  90. package/dist/esm/token-TQ-VFHS4.js +0 -2
  91. package/dist/esm/token-TQ-VFHS4.js.map +0 -1
  92. package/dist/esm/worker.base-client-x522sMBy.js +0 -2
  93. package/dist/esm/worker.base-client-x522sMBy.js.map +0 -1
  94. package/dist/esm/wrappers-registry-BWWG0aze.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { n as FheChain } from "./types-BgczXqW2.js";
2
- import { A as TransferCallbacks, D as TransferOptions, F as WalletAccount, J as WriteContractConfig, L as WalletAccountListener, M as GenericStorage, N as GenericProvider, O as UnshieldOptions, P as GenericSigner, T as ShieldOptions, V as TransactionResult, a as StoredTransportKeyPairWithPermits, d as EncryptParams, f as EncryptResult, ft as GenericLogger, g as PublicDecryptResult, j as UnshieldCallbacks, p as EncryptedValue, s as ClearValue } from "./relayer-cleartext-DkKKjfI6.js";
3
- import { E as TransactionOperation, P as ZamaSDKEventInput, a as ZamaConfig, n as RelayerConfig, s as ZamaConfigGeneric, u as RelayerDispatcher } from "./types-BjDu-RZg.js";
2
+ import { E as ShieldOptions, F as GenericSigner, H as TransactionResult, I as WalletAccount, M as UnshieldCallbacks, N as GenericStorage, O as TransferOptions, P as GenericProvider, R as WalletAccountListener, Y as WriteContractConfig, a as StoredTransportKeyPairWithPermits, d as EncryptParams, f as EncryptResult, g as PublicDecryptResult, j as TransferCallbacks, k as UnshieldOptions, p as EncryptedValue, pt as GenericLogger, s as ClearValue } from "./relayer-cleartext-CSeMlmGO.js";
3
+ import { E as TransactionOperation, P as ZamaSDKEventInput, a as ZamaConfig, n as RelayerConfig, s as ZamaConfigGeneric, u as RelayerDispatcher } from "./types-Gn5MeDsr.js";
4
4
  import { Address, Hex } from "viem";
5
5
  import { z } from "zod/mini";
6
6
  import { UserDecryptResults } from "@zama-fhe/relayer-sdk/bundle";
@@ -18567,6 +18567,12 @@ declare const zamaQueryKeys: {
18567
18567
  readonly tokenAddress: `0x${string}`;
18568
18568
  }];
18569
18569
  };
18570
+ readonly pendingUnshield: {
18571
+ readonly all: readonly ["zama.pendingUnshield"];
18572
+ readonly token: (tokenAddress: Address) => readonly ["zama.pendingUnshield", {
18573
+ readonly tokenAddress: `0x${string}`;
18574
+ }];
18575
+ };
18570
18576
  readonly hasPermit: {
18571
18577
  readonly all: readonly ["zama.hasPermit"];
18572
18578
  readonly scope: (contractAddresses: Address[], walletAccount?: WalletAccount) => readonly ["zama.hasPermit", {
@@ -18791,7 +18797,11 @@ declare const ZamaErrorCode: {
18791
18797
  readonly TransportKeyPairExpired: "KEYPAIR_EXPIRED"; /** Relayer rejected transport key pair (stale, expired, or malformed). */
18792
18798
  readonly InvalidTransportKeyPair: "INVALID_KEYPAIR"; /** No FHE ciphertext exists for this account (never shielded). */
18793
18799
  readonly NoCiphertext: "NO_CIPHERTEXT"; /** Relayer HTTP request failed. */
18794
- readonly RelayerRequestFailed: "RELAYER_REQUEST_FAILED"; /** SDK configuration is invalid (e.g. forbidden chain ID, unsupported type). */
18800
+ readonly RelayerRequestFailed: "RELAYER_REQUEST_FAILED"; /** The configured signer/account is not entitled (ACL) to decrypt this encrypted value. Don't retry wait for a grant. */
18801
+ readonly NotEntitled: "NOT_ENTITLED"; /** The consumer's RPC provider rate-limited an on-chain read (e.g. HTTP 429 / JSON-RPC -32005). Retryable. */
18802
+ readonly RpcRateLimited: "RPC_RATE_LIMITED"; /** A worker operation exceeded its configured timeout; the worker is recycled by default. Retryable. */
18803
+ readonly OperationTimeout: "OPERATION_TIMEOUT"; /** An in-flight worker operation was aborted as collateral of another operation's timeout recycle. Retryable. */
18804
+ readonly WorkerRecycled: "WORKER_RECYCLED"; /** SDK configuration is invalid (e.g. forbidden chain ID, unsupported type). */
18795
18805
  readonly Configuration: "CONFIGURATION"; /** Delegation cannot target self (delegate === msg.sender). */
18796
18806
  readonly DelegationSelfNotAllowed: "DELEGATION_SELF_NOT_ALLOWED"; /** Only one delegate/revoke per (delegator, delegate, contract) per block. */
18797
18807
  readonly DelegationCooldown: "DELEGATION_COOLDOWN"; /** No active delegation found for this (delegator, delegate, contract) tuple. */
@@ -18824,75 +18834,6 @@ declare class ZamaError extends Error {
18824
18834
  readonly code: ZamaErrorCode;
18825
18835
  constructor(code: ZamaErrorCode, message: string, options?: ErrorOptions);
18826
18836
  }
18827
- /**
18828
- * Pattern-match on a {@link ZamaError} by its error code.
18829
- * Falls through to the `_` wildcard handler if no specific handler matches.
18830
- * Returns `undefined` if the error is not a `ZamaError` and no `_` handler is provided.
18831
- *
18832
- * @example
18833
- * ```ts
18834
- * matchZamaError(error, {
18835
- * SIGNING_REJECTED: () => toast("Please approve in wallet"),
18836
- * TRANSACTION_REVERTED: (e) => toast(`Tx failed: ${e.message}`),
18837
- * _: () => toast("Unknown error"),
18838
- * });
18839
- * ```
18840
- */
18841
- declare function matchZamaError<R>(error: unknown, handlers: Partial<Record<ZamaErrorCode, (error: ZamaError) => R>> & {
18842
- _?: (error: unknown) => R;
18843
- }): R | undefined;
18844
- //#endregion
18845
- //#region src/errors/signing.d.ts
18846
- /** User rejected the wallet signature prompt. */
18847
- declare class SigningRejectedError extends ZamaError {
18848
- constructor(message: string, options?: ErrorOptions);
18849
- }
18850
- /** Wallet signature failed for a reason other than rejection. */
18851
- declare class SigningFailedError extends ZamaError {
18852
- constructor(message: string, options?: ErrorOptions);
18853
- }
18854
- //#endregion
18855
- //#region src/errors/encryption.d.ts
18856
- /** FHE encryption failed. */
18857
- declare class EncryptionFailedError extends ZamaError {
18858
- constructor(message: string, options?: ErrorOptions);
18859
- }
18860
- /** FHE decryption failed. */
18861
- declare class DecryptionFailedError extends ZamaError {
18862
- constructor(message: string, options?: ErrorOptions);
18863
- }
18864
- //#endregion
18865
- //#region src/errors/transaction.d.ts
18866
- /** On-chain transaction reverted. */
18867
- declare class TransactionRevertedError extends ZamaError {
18868
- constructor(message: string, options?: ErrorOptions);
18869
- }
18870
- //#endregion
18871
- //#region src/errors/credential.d.ts
18872
- /** Transport key pair has expired and needs regeneration. */
18873
- declare class TransportKeyPairExpiredError extends ZamaError {
18874
- constructor(message: string, options?: ErrorOptions);
18875
- }
18876
- /** Relayer rejected the transport key pair (stale, expired, or malformed). */
18877
- declare class InvalidTransportKeyPairError extends ZamaError {
18878
- constructor(message: string, options?: ErrorOptions);
18879
- }
18880
- /** No FHE ciphertext exists for this account (never shielded). */
18881
- declare class NoCiphertextError extends ZamaError {
18882
- constructor(message: string, options?: ErrorOptions);
18883
- }
18884
- //#endregion
18885
- //#region src/errors/relayer.d.ts
18886
- /** Relayer HTTP request failed. */
18887
- declare class RelayerRequestFailedError extends ZamaError {
18888
- /** HTTP status code from the relayer, if available. */
18889
- readonly statusCode: number | undefined;
18890
- constructor(message: string, statusCode?: number, options?: ErrorOptions);
18891
- }
18892
- /** SDK configuration is invalid (e.g. forbidden chain ID, unsupported type). */
18893
- declare class ConfigurationError extends ZamaError {
18894
- constructor(message: string, options?: ErrorOptions);
18895
- }
18896
18837
  //#endregion
18897
18838
  //#region src/errors/chain.d.ts
18898
18839
  /**
@@ -18931,41 +18872,18 @@ declare class ChainMismatchError extends ZamaError {
18931
18872
  }, options?: ErrorOptions);
18932
18873
  }
18933
18874
  //#endregion
18934
- //#region src/errors/signer.d.ts
18935
- /**
18936
- * Base class for signer/account readiness failures.
18937
- */
18938
- declare class SignerRequiredError extends ZamaError {
18939
- readonly operation: string;
18940
- constructor(code: ZamaErrorCode, operation: string, message: string, options?: ErrorOptions);
18941
- }
18942
- /**
18943
- * Thrown when an operation requires a signer but none is configured.
18944
- *
18945
- * The SDK can be constructed without a signer. Operations that need wallet
18946
- * authority throw this before probing wallet state.
18947
- *
18948
- * @example
18949
- * ```ts
18950
- * try {
18951
- * await token.confidentialTransfer("0xTo", 100n);
18952
- * } catch (e) {
18953
- * if (e instanceof SignerNotConfiguredError) {
18954
- * // Fix SDK/provider configuration.
18955
- * }
18956
- * }
18957
- * ```
18958
- */
18959
- declare class SignerNotConfiguredError extends SignerRequiredError {
18960
- constructor(operation: string, options?: ErrorOptions);
18875
+ //#region src/errors/credential.d.ts
18876
+ /** Transport key pair has expired and needs regeneration. */
18877
+ declare class TransportKeyPairExpiredError extends ZamaError {
18878
+ constructor(message: string, options?: ErrorOptions);
18961
18879
  }
18962
- /** Thrown when a signer exists but no wallet account is currently connected. */
18963
- declare class WalletNotConnectedError extends SignerRequiredError {
18964
- constructor(operation: string, options?: ErrorOptions);
18880
+ /** Relayer rejected the transport key pair (stale, expired, or malformed). */
18881
+ declare class InvalidTransportKeyPairError extends ZamaError {
18882
+ constructor(message: string, options?: ErrorOptions);
18965
18883
  }
18966
- /** Thrown when an async adapter has not resolved its initial wallet account yet. */
18967
- declare class WalletAccountNotReadyError extends SignerRequiredError {
18968
- constructor(operation: string, options?: ErrorOptions);
18884
+ /** No FHE ciphertext exists for this account (never shielded). */
18885
+ declare class NoCiphertextError extends ZamaError {
18886
+ constructor(message: string, options?: ErrorOptions);
18969
18887
  }
18970
18888
  //#endregion
18971
18889
  //#region src/errors/delegation.d.ts
@@ -19010,12 +18928,19 @@ declare class DelegationExpirationTooSoonError extends ZamaError {
19010
18928
  *
19011
18929
  * After calling `delegateForUserDecryption()`, the delegation is recorded on-chain
19012
18930
  * immediately. However, the gateway (deployed on Arbitrum) must sync this state
19013
- * via cross-chain event propagation, which typically takes 1–2 minutes.
18931
+ * via cross-chain event propagation, which usually completes within ~10 blocks
18932
+ * (a few seconds).
19014
18933
  *
19015
18934
  * Calling `decryptBalanceAs` during this window will fail because the gateway's
19016
18935
  * `isHandleDelegatedForUserDecryption()` check reads from its own synced copy
19017
18936
  * of the ACL state, which hasn't been updated yet.
19018
18937
  *
18938
+ * **You rarely need to handle this directly:** the delegated-decrypt path rides
18939
+ * out the propagation window with a bounded internal retry (~30s), so a decrypt
18940
+ * issued right after the grant simply waits for sync. This error only surfaces
18941
+ * if the window outlasts the retry budget, or when retries are disabled via
18942
+ * `waitForPropagation: false`.
18943
+ *
19019
18944
  * **Note:** This error is raised as a best-effort heuristic — when a delegated
19020
18945
  * decryption receives an HTTP 500 from the relayer, the most likely cause is a
19021
18946
  * propagation delay. However, the same status code can occur if the gateway or
@@ -19025,6 +18950,16 @@ declare class DelegationNotPropagatedError extends ZamaError {
19025
18950
  constructor(message: string, options?: ErrorOptions);
19026
18951
  }
19027
18952
  //#endregion
18953
+ //#region src/errors/encryption.d.ts
18954
+ /** FHE encryption failed. */
18955
+ declare class EncryptionFailedError extends ZamaError {
18956
+ constructor(message: string, options?: ErrorOptions);
18957
+ }
18958
+ /** FHE decryption failed. */
18959
+ declare class DecryptionFailedError extends ZamaError {
18960
+ constructor(message: string, options?: ErrorOptions);
18961
+ }
18962
+ //#endregion
19028
18963
  //#region src/errors/balance.d.ts
19029
18964
  /** Structured details shared by balance-related errors. */
19030
18965
  interface BalanceErrorDetails {
@@ -19061,6 +18996,294 @@ declare class ERC20ReadFailedError extends ZamaError {
19061
18996
  constructor(message: string, options?: ErrorOptions);
19062
18997
  }
19063
18998
  //#endregion
18999
+ //#region src/errors/relayer.d.ts
19000
+ /** Relayer HTTP request failed. */
19001
+ declare class RelayerRequestFailedError extends ZamaError {
19002
+ /** HTTP status code from the relayer, if available. */
19003
+ readonly statusCode: number | undefined;
19004
+ /**
19005
+ * Server-driven retry delay in **seconds** (the SDK's duration unit and the
19006
+ * header's own unit), from the relayer's `Retry-After` header. Set only on
19007
+ * back-pressure (HTTP 429) responses that carry the header; `undefined`
19008
+ * otherwise. Implies {@link retryable}.
19009
+ */
19010
+ readonly retryAfter: number | undefined;
19011
+ /**
19012
+ * Whether the request may be safely retried. `true` for relayer back-pressure
19013
+ * (HTTP 429); pair with {@link retryAfter} for the server's suggested delay.
19014
+ */
19015
+ readonly retryable: boolean;
19016
+ constructor(message: string, statusCode?: number, options?: ErrorOptions & {
19017
+ retryAfter?: number;
19018
+ });
19019
+ }
19020
+ /** SDK configuration is invalid (e.g. forbidden chain ID, unsupported type). */
19021
+ declare class ConfigurationError extends ZamaError {
19022
+ constructor(message: string, options?: ErrorOptions);
19023
+ }
19024
+ //#endregion
19025
+ //#region src/errors/entitlement.d.ts
19026
+ /**
19027
+ * The signer (or delegator) lacks ACL permission to decrypt the encrypted value —
19028
+ * `persistAllowed` returned `false`. Terminal and **non-retryable**: the fix is
19029
+ * an on-chain grant (`FHE.allow`), or for indexers, to wait for a backfill once
19030
+ * the grant lands. Distinct from transient failures like {@link RpcRateLimitError}.
19031
+ *
19032
+ * @example
19033
+ * ```ts
19034
+ * try {
19035
+ * await sdk.decryption.decryptValues([{ encryptedValue, contractAddress }]);
19036
+ * } catch (e) {
19037
+ * if (e instanceof NotEntitledError) {
19038
+ * // don't retry — wait for an ACL grant / backfill
19039
+ * }
19040
+ * }
19041
+ * ```
19042
+ */
19043
+ declare class NotEntitledError extends ZamaError {
19044
+ /** The encrypted value the actor is not entitled to decrypt. */
19045
+ readonly encryptedValue: string;
19046
+ /** The contract the encrypted value belongs to. */
19047
+ readonly contractAddress: string;
19048
+ /** The actor (signer or delegator) that lacks ACL permission. */
19049
+ readonly account: string;
19050
+ constructor(args: {
19051
+ encryptedValue: string;
19052
+ contractAddress: string;
19053
+ account: string;
19054
+ }, options?: ErrorOptions);
19055
+ }
19056
+ //#endregion
19057
+ //#region src/errors/rpc.d.ts
19058
+ /**
19059
+ * The consumer's RPC provider rate-limited an on-chain read the SDK performs
19060
+ * during decryption (e.g. the ACL check) — HTTP 429 or JSON-RPC `-32005`. An
19061
+ * RPC-endpoint problem, **not** a decryption/entitlement failure, and safe to
19062
+ * **retry**. Kept distinct from the relayer's own back-pressure
19063
+ * ({@link RelayerRequestFailedError}).
19064
+ *
19065
+ * Backoff for chain RPC is owned by the consumer's transport: viem/ethers
19066
+ * already honor the `Retry-After` header and retry internally before this error
19067
+ * surfaces, so it is configured on the transport you pass via `chain.network`
19068
+ * (not re-implemented here).
19069
+ *
19070
+ * @example
19071
+ * ```ts
19072
+ * try {
19073
+ * await sdk.decryption.decryptValues([{ encryptedValue, contractAddress }]);
19074
+ * } catch (e) {
19075
+ * if (e instanceof RpcRateLimitError) {
19076
+ * // back off and retry; consider a higher-throughput RPC endpoint
19077
+ * }
19078
+ * }
19079
+ * ```
19080
+ */
19081
+ declare class RpcRateLimitError extends ZamaError {
19082
+ /**
19083
+ * Suggested delay before retrying, in **seconds**, when a numeric `retryAfter`
19084
+ * is present on the error. Usually `undefined` for chain RPC: the `Retry-After`
19085
+ * header is consumed by the consumer's viem/ethers transport (which owns the
19086
+ * backoff), not surfaced here — see the class doc.
19087
+ */
19088
+ readonly retryAfter: number | undefined;
19089
+ constructor(message: string, options?: ErrorOptions & {
19090
+ retryAfter?: number;
19091
+ });
19092
+ }
19093
+ //#endregion
19094
+ //#region src/errors/signer.d.ts
19095
+ /**
19096
+ * Base class for signer/account readiness failures.
19097
+ */
19098
+ declare class SignerRequiredError extends ZamaError {
19099
+ readonly operation: string;
19100
+ constructor(code: ZamaErrorCode, operation: string, message: string, options?: ErrorOptions);
19101
+ }
19102
+ /**
19103
+ * Thrown when an operation requires a signer but none is configured.
19104
+ *
19105
+ * The SDK can be constructed without a signer. Operations that need wallet
19106
+ * authority throw this before probing wallet state.
19107
+ *
19108
+ * @example
19109
+ * ```ts
19110
+ * try {
19111
+ * await token.confidentialTransfer("0xTo", 100n);
19112
+ * } catch (e) {
19113
+ * if (e instanceof SignerNotConfiguredError) {
19114
+ * // Fix SDK/provider configuration.
19115
+ * }
19116
+ * }
19117
+ * ```
19118
+ */
19119
+ declare class SignerNotConfiguredError extends SignerRequiredError {
19120
+ constructor(operation: string, options?: ErrorOptions);
19121
+ }
19122
+ /** Thrown when a signer exists but no wallet account is currently connected. */
19123
+ declare class WalletNotConnectedError extends SignerRequiredError {
19124
+ constructor(operation: string, options?: ErrorOptions);
19125
+ }
19126
+ /** Thrown when an async adapter has not resolved its initial wallet account yet. */
19127
+ declare class WalletAccountNotReadyError extends SignerRequiredError {
19128
+ constructor(operation: string, options?: ErrorOptions);
19129
+ }
19130
+ //#endregion
19131
+ //#region src/errors/signing.d.ts
19132
+ /** User rejected the wallet signature prompt. */
19133
+ declare class SigningRejectedError extends ZamaError {
19134
+ constructor(message: string, options?: ErrorOptions);
19135
+ }
19136
+ /** Wallet signature failed for a reason other than rejection. */
19137
+ declare class SigningFailedError extends ZamaError {
19138
+ constructor(message: string, options?: ErrorOptions);
19139
+ }
19140
+ //#endregion
19141
+ //#region src/errors/transaction.d.ts
19142
+ /** On-chain transaction reverted. */
19143
+ declare class TransactionRevertedError extends ZamaError {
19144
+ constructor(message: string, options?: ErrorOptions);
19145
+ }
19146
+ //#endregion
19147
+ //#region src/errors/timeout.d.ts
19148
+ /**
19149
+ * A worker operation (encrypt / decrypt / EIP-712 / key fetch) did not complete
19150
+ * within its configured timeout — typically a stuck relayer or WASM call. On the
19151
+ * Node pool the SDK **recycles the affected worker** (terminating the hung
19152
+ * thread) so it self-heals; the operation itself is **retryable**.
19153
+ *
19154
+ * Configure the bound (seconds) via `node({ operationTimeout })`. Distinct from a
19155
+ * decryption/entitlement failure — a timeout is an infrastructure/latency
19156
+ * condition, so it no longer collapses into {@link DecryptionFailedError}.
19157
+ *
19158
+ * @example
19159
+ * ```ts
19160
+ * try {
19161
+ * await sdk.decryption.decryptValues([{ encryptedValue, contractAddress }]);
19162
+ * } catch (e) {
19163
+ * if (e instanceof WorkerTimeoutError) {
19164
+ * // retry (the worker was recycled); consider raising operationTimeout
19165
+ * }
19166
+ * }
19167
+ * ```
19168
+ */
19169
+ declare class WorkerTimeoutError extends ZamaError {
19170
+ /**
19171
+ * The worker operation that timed out. This is the internal worker op code
19172
+ * (e.g. `USER_DECRYPT`, `ENCRYPT`), not the public SDK method name.
19173
+ */
19174
+ readonly operation: string;
19175
+ /** The configured timeout that was exceeded, in **seconds** (the SDK's duration unit). */
19176
+ readonly timeout: number;
19177
+ /** Wall-clock time the operation ran before being abandoned, in **seconds** (may be fractional). */
19178
+ readonly elapsed: number;
19179
+ /** Label of the worker that stalled, when known (e.g. `node-worker-2`). */
19180
+ readonly worker: string | undefined;
19181
+ constructor(args: {
19182
+ operation: string;
19183
+ timeout: number;
19184
+ elapsed: number;
19185
+ worker?: string;
19186
+ }, options?: ErrorOptions);
19187
+ }
19188
+ /**
19189
+ * An in-flight worker operation was aborted as **collateral** when its worker was
19190
+ * recycled — the worker was torn down to recover from *another* operation's
19191
+ * timeout (Node pool self-healing), not because this operation itself timed out.
19192
+ *
19193
+ * The operation never reached a verdict, so it is **retryable**: the next call
19194
+ * lazily re-inits a fresh worker. It is intentionally distinct from
19195
+ * {@link WorkerTimeoutError} (this op did not exceed its own bound) and from
19196
+ * {@link DecryptionFailedError} (nothing actually failed to decrypt) — so a
19197
+ * consumer can retry it instead of surfacing a terminal failure.
19198
+ *
19199
+ * @example
19200
+ * ```ts
19201
+ * matchZamaError(error, {
19202
+ * WORKER_RECYCLED: () => retry(), // transient: the worker was replaced
19203
+ * });
19204
+ * ```
19205
+ */
19206
+ declare class WorkerRecycledError extends ZamaError {
19207
+ /**
19208
+ * The worker operation that was aborted. This is the internal worker op code
19209
+ * (e.g. `USER_DECRYPT`, `ENCRYPT`), not the public SDK method name.
19210
+ */
19211
+ readonly operation: string;
19212
+ /** Label of the recycled worker, when known (e.g. `node-worker-2`). */
19213
+ readonly worker: string | undefined;
19214
+ constructor(args: {
19215
+ operation: string;
19216
+ worker?: string;
19217
+ }, options?: ErrorOptions);
19218
+ }
19219
+ //#endregion
19220
+ //#region src/errors/match.d.ts
19221
+ /**
19222
+ * Identity type that fails to instantiate unless `T` maps every code to a `ZamaError`.
19223
+ * Guards presence + value type only: a wrong-but-valid mapping (a code pointing at a
19224
+ * structurally identical sibling class) still compiles — `errors.test-d.ts` backstops that.
19225
+ */
19226
+ type Complete<T extends Record<ZamaErrorCode, ZamaError>> = T;
19227
+ /**
19228
+ * Maps each {@link ZamaErrorCode} to the error class thrown with that code, so
19229
+ * {@link matchZamaError} handlers receive the matched subtype instead of the base
19230
+ * `ZamaError`. Hand-maintained; the `Complete` wrapper fails the build if a code is
19231
+ * added without an entry here (or mapped to a non-`ZamaError`).
19232
+ */
19233
+ type ErrorForCode = Complete<{
19234
+ [ZamaErrorCode.SigningRejected]: SigningRejectedError;
19235
+ [ZamaErrorCode.SigningFailed]: SigningFailedError;
19236
+ [ZamaErrorCode.EncryptionFailed]: EncryptionFailedError;
19237
+ [ZamaErrorCode.DecryptionFailed]: DecryptionFailedError;
19238
+ [ZamaErrorCode.TransactionReverted]: TransactionRevertedError;
19239
+ [ZamaErrorCode.TransportKeyPairExpired]: TransportKeyPairExpiredError;
19240
+ [ZamaErrorCode.InvalidTransportKeyPair]: InvalidTransportKeyPairError;
19241
+ [ZamaErrorCode.NoCiphertext]: NoCiphertextError;
19242
+ [ZamaErrorCode.RelayerRequestFailed]: RelayerRequestFailedError;
19243
+ [ZamaErrorCode.NotEntitled]: NotEntitledError;
19244
+ [ZamaErrorCode.RpcRateLimited]: RpcRateLimitError;
19245
+ [ZamaErrorCode.OperationTimeout]: WorkerTimeoutError;
19246
+ [ZamaErrorCode.WorkerRecycled]: WorkerRecycledError;
19247
+ [ZamaErrorCode.Configuration]: ConfigurationError;
19248
+ [ZamaErrorCode.DelegationSelfNotAllowed]: DelegationSelfNotAllowedError;
19249
+ [ZamaErrorCode.DelegationCooldown]: DelegationCooldownError;
19250
+ [ZamaErrorCode.DelegationNotFound]: DelegationNotFoundError;
19251
+ [ZamaErrorCode.DelegationExpired]: DelegationExpiredError;
19252
+ [ZamaErrorCode.InsufficientConfidentialBalance]: InsufficientConfidentialBalanceError;
19253
+ [ZamaErrorCode.InsufficientERC20Balance]: InsufficientERC20BalanceError;
19254
+ [ZamaErrorCode.BalanceCheckUnavailable]: BalanceCheckUnavailableError;
19255
+ [ZamaErrorCode.ERC20ReadFailed]: ERC20ReadFailedError;
19256
+ [ZamaErrorCode.DelegationExpiryUnchanged]: DelegationExpiryUnchangedError;
19257
+ [ZamaErrorCode.DelegationDelegateEqualsContract]: DelegationDelegateEqualsContractError;
19258
+ [ZamaErrorCode.DelegationContractIsSelf]: DelegationContractIsSelfError;
19259
+ [ZamaErrorCode.AclPaused]: AclPausedError;
19260
+ [ZamaErrorCode.DelegationExpirationTooSoon]: DelegationExpirationTooSoonError;
19261
+ [ZamaErrorCode.DelegationNotPropagated]: DelegationNotPropagatedError;
19262
+ [ZamaErrorCode.ChainMismatch]: ChainMismatchError;
19263
+ [ZamaErrorCode.SignerNotConfigured]: SignerNotConfiguredError;
19264
+ [ZamaErrorCode.WalletNotConnected]: WalletNotConnectedError;
19265
+ [ZamaErrorCode.WalletAccountNotReady]: WalletAccountNotReadyError;
19266
+ }>;
19267
+ /**
19268
+ * Pattern-match on a {@link ZamaError} by its error code. Each handler receives the
19269
+ * error class for its code, so subclass fields are available without a cast.
19270
+ * Falls through to the `_` wildcard handler if no specific handler matches.
19271
+ * Returns `undefined` if the error is not a `ZamaError` and no `_` handler is provided.
19272
+ *
19273
+ * @example
19274
+ * ```ts
19275
+ * matchZamaError(error, {
19276
+ * SIGNING_REJECTED: () => toast("Please approve in wallet"),
19277
+ * INSUFFICIENT_CONFIDENTIAL_BALANCE: (e) => toast(`Need ${e.requested}, have ${e.available}`),
19278
+ * RELAYER_REQUEST_FAILED: (e) => toast(`Relayer failed (${e.statusCode})`),
19279
+ * _: () => toast("Unknown error"),
19280
+ * });
19281
+ * ```
19282
+ */
19283
+ declare function matchZamaError<R>(error: unknown, handlers: { [K in ZamaErrorCode]?: (error: ErrorForCode[K]) => R } & {
19284
+ _?: (error: unknown) => R;
19285
+ }): R | undefined;
19286
+ //#endregion
19064
19287
  //#region src/services/caching-service.d.ts
19065
19288
  /**
19066
19289
  * Storage-backed cache for decrypted FHE plaintext values.
@@ -19131,6 +19354,16 @@ declare class DelegationService {
19131
19354
  }
19132
19355
  //#endregion
19133
19356
  //#region src/services/decryption-service.d.ts
19357
+ /** Options shared by the delegated-decrypt entry points. */
19358
+ interface DelegatedDecryptOptions {
19359
+ /**
19360
+ * Ride out the gateway propagation window: when a just-granted delegation
19361
+ * has not yet synced, the delegated decrypt is retried (bounded, ~30s) until
19362
+ * it lands instead of throwing {@link DelegationNotPropagatedError}. Defaults
19363
+ * to `true`. Pass `false` to fail fast on the first not-propagated response.
19364
+ */
19365
+ waitForPropagation?: boolean;
19366
+ }
19134
19367
  interface BatchDecryptItem {
19135
19368
  encryptedValue: EncryptedValue;
19136
19369
  contractAddress: Address;
@@ -19156,27 +19389,35 @@ declare class DecryptionService {
19156
19389
  emitEvent: (input: ZamaSDKEventInput) => void;
19157
19390
  });
19158
19391
  userDecrypt(handles: EncryptedInput[], signerAddress: Address): Promise<Record<EncryptedValue, ClearValue>>;
19159
- delegatedUserDecrypt(encryptedValues: EncryptedInput[], delegatorAddress: Address, delegateAddress: Address, accountAddress: Address): Promise<Record<EncryptedValue, ClearValue>>;
19392
+ delegatedUserDecrypt(encryptedValues: EncryptedInput[], delegatorAddress: Address, delegateAddress: Address, accountAddress: Address, options?: DelegatedDecryptOptions): Promise<Record<EncryptedValue, ClearValue>>;
19160
19393
  delegatedBatchDecryptHandlesAs({
19161
19394
  encryptedInputs,
19162
19395
  delegatorAddress,
19163
19396
  delegateAddress,
19164
19397
  accountAddress,
19165
- maxConcurrency
19398
+ maxConcurrency,
19399
+ waitForPropagation
19166
19400
  }: {
19167
19401
  encryptedInputs: EncryptedInput[];
19168
19402
  delegatorAddress: Address;
19169
19403
  delegateAddress: Address;
19170
19404
  accountAddress: Address;
19171
19405
  maxConcurrency?: number;
19406
+ waitForPropagation?: boolean;
19172
19407
  }): Promise<BatchDecryptResult>;
19173
19408
  }
19174
19409
  //#endregion
19175
19410
  //#region src/namespaces/decryption.d.ts
19176
19411
  /**
19177
- * Public namespace for FHE decryption.
19412
+ * Public namespace for FHE decryption — the canonical way to decrypt.
19413
+ *
19414
+ * Exposed as `sdk.decryption`. Prefer these methods over the low-level
19415
+ * `sdk.relayer.userDecrypt` / `delegatedUserDecrypt` / `publicDecrypt`: they
19416
+ * assemble the credential bundle (transport key pair, EIP-712 permit) for you,
19417
+ * cache results, and wrap relayer errors. Reach for `sdk.relayer.*` only when
19418
+ * you must control credential assembly by hand.
19178
19419
  *
19179
- * Exposed as `sdk.decryption`. Owns the SDK-level guards (signer requirement on
19420
+ * Owns the SDK-level guards (signer requirement on
19180
19421
  * `decryptValues` and `delegatedDecryptValues`, empty-array
19181
19422
  * short-circuit on `decryptPublicValues`, relayer error wrapping) and delegates the
19182
19423
  * actual work to the internal {@link DecryptionService} or the relayer directly for
@@ -19231,6 +19472,9 @@ declare class Decryption {
19231
19472
  * dimension. Defaults to `delegatorAddress`. Pass the actual account address
19232
19473
  * when decrypting on behalf of someone whose balance is stored under a
19233
19474
  * different address (e.g. `decryptBalanceAs` with an explicit `accountAddress`).
19475
+ * @param options - Delegated-decrypt options. By default the call rides out the
19476
+ * gateway propagation window ({@link DelegatedDecryptOptions.waitForPropagation});
19477
+ * pass `{ waitForPropagation: false }` to fail fast instead.
19234
19478
  * @returns Map of encrypted value → clear-text value.
19235
19479
  *
19236
19480
  * @example
@@ -19241,7 +19485,7 @@ declare class Decryption {
19241
19485
  * console.log(values[balance]); // 1000n
19242
19486
  * ```
19243
19487
  */
19244
- delegatedDecryptValues(encryptedInputs: EncryptedInput[], delegatorAddress: Address, accountAddress?: Address): Promise<Record<EncryptedValue, ClearValue>>;
19488
+ delegatedDecryptValues(encryptedInputs: EncryptedInput[], delegatorAddress: Address, accountAddress?: Address, options?: DelegatedDecryptOptions): Promise<Record<EncryptedValue, ClearValue>>;
19245
19489
  /**
19246
19490
  * Publicly decrypt one or more FHE encrypted values.
19247
19491
  *
@@ -19271,6 +19515,8 @@ declare class Decryption {
19271
19515
  * @param delegatorAddress - The address that granted delegation rights.
19272
19516
  * @param accountAddress - The account on whose behalf decryption is performed. Defaults to `delegatorAddress`.
19273
19517
  * @param maxConcurrency - Maximum parallel decrypt calls during per-entry fallback.
19518
+ * @param waitForPropagation - Ride out the gateway propagation window on the
19519
+ * initial batch attempt (default `true`). See {@link DelegatedDecryptOptions.waitForPropagation}.
19274
19520
  * @returns Per-entry results, each with a value or an error.
19275
19521
  * @throws if no signer is configured. {@link SignerNotConfiguredError}
19276
19522
  * @throws if signer and provider are on different chains. {@link ChainMismatchError}
@@ -19295,13 +19541,14 @@ declare class Decryption {
19295
19541
  encryptedInputs,
19296
19542
  delegatorAddress,
19297
19543
  accountAddress,
19298
- maxConcurrency
19544
+ maxConcurrency,
19545
+ waitForPropagation
19299
19546
  }: {
19300
19547
  encryptedInputs: EncryptedInput[];
19301
19548
  delegatorAddress: Address;
19302
19549
  accountAddress?: Address;
19303
19550
  maxConcurrency?: number;
19304
- }): Promise<BatchDecryptResult>;
19551
+ } & DelegatedDecryptOptions): Promise<BatchDecryptResult>;
19305
19552
  }
19306
19553
  //#endregion
19307
19554
  //#region src/namespaces/delegations.d.ts
@@ -19313,8 +19560,9 @@ declare class Decryption {
19313
19560
  * actual work to the internal {@link DelegationService}.
19314
19561
  *
19315
19562
  * Delegation operations write to the host chain ACL; after a delegation is mined,
19316
- * allow **1–2 minutes** before attempting delegated decryption to let the gateway
19317
- * sync the ACL state via cross-chain event propagation.
19563
+ * the gateway syncs the ACL state via cross-chain event propagation — usually
19564
+ * within ~10 blocks (a few seconds). Delegated decryption rides out that window
19565
+ * with a bounded internal retry, so callers can decrypt right after granting.
19318
19566
  */
19319
19567
  declare class Delegations {
19320
19568
  #private;
@@ -19328,9 +19576,11 @@ declare class Delegations {
19328
19576
  * Delegate decryption rights for a confidential contract to another address.
19329
19577
  * Calls `ACL.delegateForUserDecryption()` on-chain.
19330
19578
  *
19331
- * **Important:** After the transaction is mined, allow **1–2 minutes** before
19332
- * attempting delegated decryption. The delegation is recorded on L1 immediately,
19333
- * but the gateway must sync the ACL state via cross-chain event propagation.
19579
+ * The delegation is recorded on L1 immediately, but the gateway must sync the
19580
+ * ACL state via cross-chain event propagation usually within ~10 blocks (a
19581
+ * few seconds). You do not need to wait: delegated decryption rides out that
19582
+ * window with a bounded internal retry, so you can decrypt right after this
19583
+ * resolves.
19334
19584
  *
19335
19585
  * @param contractAddress - The confidential contract address to delegate on.
19336
19586
  * @param delegateAddress - Address to delegate decryption rights to.
@@ -19706,6 +19956,60 @@ declare class Token {
19706
19956
  * ```
19707
19957
  */
19708
19958
  confidentialTransferFrom(from: Address, to: Address, amount: bigint, callbacks?: TransferCallbacks): Promise<TransactionResult>;
19959
+ /**
19960
+ * ERC-7984 `confidentialTransferAndCall`: encrypted transfer that also invokes
19961
+ * the recipient's receiver hook (`onConfidentialTransferReceived`) in a single
19962
+ * transaction. The caller crafts the opaque `data` payload — the SDK does not
19963
+ * encode, validate, or interpret it.
19964
+ *
19965
+ * Balance validation follows the same rules as {@link Token.confidentialTransfer}.
19966
+ *
19967
+ * @param to - Recipient address. Must implement the ERC-7984 receiver hook.
19968
+ * @param amount - Plaintext amount to transfer (encrypted automatically via FHE).
19969
+ * @param data - Opaque bytes forwarded to the recipient's receiver hook.
19970
+ * @param options - Optional: `skipBalanceCheck` (default `false`).
19971
+ * @returns The transaction hash and mined receipt.
19972
+ *
19973
+ * @throws if signer and provider are on different chains. {@link ChainMismatchError}
19974
+ * @throws if the balance is less than `amount`. {@link InsufficientConfidentialBalanceError}
19975
+ * @throws if balance validation requires decryption that is not possible. {@link BalanceCheckUnavailableError}
19976
+ * @throws if FHE encryption fails. {@link EncryptionFailedError}
19977
+ * @throws if the on-chain transfer reverts. {@link TransactionRevertedError}
19978
+ *
19979
+ * @example
19980
+ * ```ts
19981
+ * const txHash = await token.confidentialTransferAndCall(
19982
+ * "0xRecipient",
19983
+ * 1000n,
19984
+ * "0xabcd", // caller-encoded payload forwarded to the receiver hook
19985
+ * );
19986
+ * ```
19987
+ */
19988
+ confidentialTransferAndCall(to: Address, amount: bigint, data: Hex, options?: TransferOptions): Promise<TransactionResult>;
19989
+ /**
19990
+ * ERC-7984 `confidentialTransferFromAndCall`: operator-initiated encrypted
19991
+ * transfer that also invokes the recipient's receiver hook in a single
19992
+ * transaction. The caller must be an approved operator for `from` and crafts
19993
+ * the opaque `data` payload — the SDK does not encode or interpret it.
19994
+ *
19995
+ * @param from - The address to transfer from (caller must be an approved operator).
19996
+ * @param to - Recipient address. Must implement the ERC-7984 receiver hook.
19997
+ * @param amount - Plaintext amount to transfer (encrypted automatically via FHE).
19998
+ * @param data - Opaque bytes forwarded to the recipient's receiver hook.
19999
+ * @param callbacks - Optional progress callbacks.
20000
+ * @returns The transaction hash and mined receipt.
20001
+ *
20002
+ * @example
20003
+ * ```ts
20004
+ * const txHash = await token.confidentialTransferFromAndCall(
20005
+ * "0xFrom",
20006
+ * "0xRecipient",
20007
+ * 500n,
20008
+ * "0xabcd",
20009
+ * );
20010
+ * ```
20011
+ */
20012
+ confidentialTransferFromAndCall(from: Address, to: Address, amount: bigint, data: Hex, callbacks?: TransferCallbacks): Promise<TransactionResult>;
19709
20013
  /**
19710
20014
  * Set operator approval for the confidential token.
19711
20015
  * Defaults to 1 hour from now if `until` is not specified.
@@ -19898,6 +20202,25 @@ declare class WrappedToken extends Token {
19898
20202
  * ```
19899
20203
  */
19900
20204
  resumeUnshield(unwrapTxHash: Hex, callbacks?: UnshieldCallbacks): Promise<TransactionResult>;
20205
+ /**
20206
+ * Return the unwrap tx hash of an unshield that was interrupted between its
20207
+ * two phases, or `null` if none is pending for this wrapper.
20208
+ *
20209
+ * The SDK persists this automatically when {@link unshield}/{@link unshieldAll}
20210
+ * submit phase 1, and clears it once phase 2 finalizes. Use the returned hash
20211
+ * to surface a "resume" affordance, then pass it to {@link resumeUnshield}.
20212
+ * Resuming is intentionally caller-driven — auto-resuming on load would fire a
20213
+ * wallet transaction unprompted.
20214
+ *
20215
+ * @returns The pending unwrap tx hash, or `null`.
20216
+ *
20217
+ * @example
20218
+ * ```ts
20219
+ * const unwrapTxHash = await wrappedToken.getPendingUnshield();
20220
+ * if (unwrapTxHash) await wrappedToken.resumeUnshield(unwrapTxHash);
20221
+ * ```
20222
+ */
20223
+ getPendingUnshield(): Promise<Hex | null>;
19901
20224
  /**
19902
20225
  * Request an unwrap for a specific amount. Encrypts the amount first.
19903
20226
  * Call {@link finalizeUnwrap} after the request is processed on-chain.
@@ -19945,6 +20268,9 @@ declare class WrappedToken extends Token {
19945
20268
  /**
19946
20269
  * Default wrappers registry addresses for known chains.
19947
20270
  * Only includes chains where a registry is deployed (excludes Hardhat).
20271
+ *
20272
+ * @deprecated Read `registryAddress` from the chain presets instead (e.g.
20273
+ * `sepolia.registryAddress`). Will be removed in the next major version.
19948
20274
  */
19949
20275
  declare const DefaultRegistryAddresses: Record<number, Address>;
19950
20276
  /** Configuration for {@link WrappersRegistry}. */
@@ -20163,6 +20489,7 @@ declare class WrappersRegistry {
20163
20489
  */
20164
20490
  declare class ZamaSDK {
20165
20491
  #private;
20492
+ /** @internal */
20166
20493
  readonly relayer: RelayerDispatcher;
20167
20494
  readonly provider: GenericProvider;
20168
20495
  readonly signer: GenericSigner | undefined;
@@ -20212,14 +20539,15 @@ declare class ZamaSDK {
20212
20539
  emitEvent(input: ZamaSDKEventInput, tokenAddress?: Address): void;
20213
20540
  /**
20214
20541
  * Create a {@link WrappersRegistry} instance bound to this SDK's provider.
20215
- * On Mainnet and Sepolia the registry address is resolved automatically.
20542
+ * Inherits the registry addresses derived from the SDK's chain configs, so
20543
+ * the result is consistent with {@link ZamaSDK.registry}.
20216
20544
  *
20217
20545
  * @param registryAddresses - Optional per-chain overrides for this registry instance.
20218
20546
  * @returns A {@link WrappersRegistry} instance.
20219
20547
  *
20220
20548
  * @example
20221
20549
  * ```ts
20222
- * // Mainnet / Sepolia resolved automatically
20550
+ * // Addresses resolved from the SDK's chain configs
20223
20551
  * const registry = sdk.createWrappersRegistry();
20224
20552
  *
20225
20553
  * // Hardhat or custom chain — override per chain for this registry instance
@@ -20304,46 +20632,5 @@ declare class ZamaSDK {
20304
20632
  [Symbol.dispose](): void;
20305
20633
  }
20306
20634
  //#endregion
20307
- //#region src/token/pending-unshield.d.ts
20308
- /**
20309
- * Persisted state for an in-progress unshield request.
20310
- * Used to resume an interrupted unshield after page reload.
20311
- */
20312
- interface PendingUnshieldRequest {
20313
- /** Transaction hash of the original unwrap call. */
20314
- readonly unwrapTxHash: Hex;
20315
- /**
20316
- * Request identifier from the `UnwrapRequested` event.
20317
- * Always populated for entries persisted by this SDK version; pass it as
20318
- * `unwrapRequestId` to `finalizeUnwrap`. Absent only when re-loading a
20319
- * pending unshield serialized by an older SDK version that did not
20320
- * record this field — in that case pass the `encryptedAmount` from the
20321
- * `UnwrapRequested` event to `finalizeUnwrap` instead.
20322
- */
20323
- readonly unwrapRequestId?: EncryptedValue;
20324
- }
20325
- /**
20326
- * Persist the unwrap tx hash so an interrupted unshield can be resumed later
20327
- * (e.g. after a page reload).
20328
- */
20329
- declare function savePendingUnshield(storage: GenericStorage, wrapperAddress: Address, unwrapTxHash: Hex, unwrapRequestId?: EncryptedValue): Promise<void>;
20330
- /**
20331
- * Load a previously saved unwrap tx hash, or `null` if none exists.
20332
- */
20333
- declare function loadPendingUnshield(storage: GenericStorage, wrapperAddress: Address): Promise<Hex | null>;
20334
- /**
20335
- * Load a previously saved unwrap request, including `unwrapRequestId` when available.
20336
- *
20337
- * `resumeUnshield()` only needs `unwrapTxHash`: it reloads the transaction receipt and
20338
- * rediscovers the right finalize input from the emitted `UnwrapRequested` event.
20339
- * Use `unwrapRequestId` directly only for custom flows that call `finalizeUnwrap()`
20340
- * without reloading the original unwrap receipt.
20341
- */
20342
- declare function loadPendingUnshieldRequest(storage: GenericStorage, wrapperAddress: Address): Promise<PendingUnshieldRequest | null>;
20343
- /**
20344
- * Clear the saved unwrap tx hash after a successful finalization.
20345
- */
20346
- declare function clearPendingUnshield(storage: GenericStorage, wrapperAddress: Address): Promise<void>;
20347
- //#endregion
20348
- export { DecryptResult as $, DelegationExpiredError as A, decimalsContract as At, ConfigurationError as B, rateContract as Bt, InsufficientConfidentialBalanceError as C, ERC7984_WRAPPER_INTERFACE_ID as Ct, DelegationCooldownError as D, allowanceContract as Dt, DelegationContractIsSelfError as E, supportsInterfaceContract as Et, SignerNotConfiguredError as F, confidentialTransferContract as Ft, TransactionRevertedError as G, wrapContract as Gt, InvalidTransportKeyPairError as H, underlyingContract as Ht, SignerRequiredError as I, confidentialTransferFromContract as It, SigningFailedError as J, resolveStorage as Jt, DecryptionFailedError as K, ResolvedChainRelayer as Kt, WalletAccountNotReadyError as L, finalizeUnwrapContract as Lt, DelegationNotFoundError as M, symbolContract as Mt, DelegationNotPropagatedError as N, confidentialBalanceOfContract as Nt, DelegationDelegateEqualsContractError as O, approveContract as Ot, DelegationSelfNotAllowedError as P, confidentialTotalSupplyContract as Pt, matchZamaError as Q, WalletNotConnectedError as R, inferredTotalSupplyContract as Rt, ERC20ReadFailedError as S, ERC7984_INTERFACE_ID as St, AclPausedError as T, isConfidentialWrapperContract as Tt, NoCiphertextError as U, unwrapContract as Ut, RelayerRequestFailedError as V, setOperatorContract as Vt, TransportKeyPairExpiredError as W, unwrapFromBalanceContract as Wt, ZamaError as X, SigningRejectedError as Y, createConfig as Yt, ZamaErrorCode as Z, Decryption as _, getDelegationExpiryContract as _t, savePendingUnshield as a, QueryFactoryOptions as at, BalanceCheckUnavailableError as b, transferAndCallContract as bt, ListPairsOptions as c, TokenWrapperPairWithMetadata as ct, WrappedToken as d, getTokenPairContract as dt, EncryptedInput as et, BatchBalancesResult as f, getTokenPairsContract as ft, Delegations as g, delegateForUserDecryptionContract as gt, Permits as h, isConfidentialTokenValidContract as ht, loadPendingUnshieldRequest as i, MutationFactoryOptions as it, DelegationExpiryUnchangedError as j, nameContract as jt, DelegationExpirationTooSoonError as k, balanceOfContract as kt, WrappersRegistry as l, getConfidentialTokenAddressContract as lt, Token as m, getTokenPairsSliceContract as mt, clearPendingUnshield as n, SignerQueryContext as nt, ZamaSDK as o, PaginatedResult as ot, BatchDecryptAsOptions as p, getTokenPairsLengthContract as pt, EncryptionFailedError as q, resolveChainRelayers as qt, loadPendingUnshield as r, zamaQueryKeys as rt, DefaultRegistryAddresses as s, TokenWrapperPair as st, PendingUnshieldRequest as t, decryptValuesQueryOptions as tt, WrappersRegistryConfig as u, getTokenAddressContract as ut, BatchDecryptItem as v, isHandleDelegatedContract as vt, InsufficientERC20BalanceError as w, isConfidentialTokenContract as wt, BalanceErrorDetails as x, ERC1363_INTERFACE_ID as xt, BatchDecryptResult as y, revokeDelegationContract as yt, ChainMismatchError as z, isOperatorContract as zt };
20349
- //# sourceMappingURL=index-DoVo9J1n.d.ts.map
20635
+ export { DecryptResult as $, BalanceCheckUnavailableError as A, decimalsContract as At, DelegationDelegateEqualsContractError as B, rateContract as Bt, SignerRequiredError as C, ERC7984_WRAPPER_INTERFACE_ID as Ct, NotEntitledError as D, allowanceContract as Dt, RpcRateLimitError as E, supportsInterfaceContract as Et, DecryptionFailedError as F, confidentialTransferContract as Ft, DelegationNotPropagatedError as G, wrapContract as Gt, DelegationExpiredError as H, underlyingContract as Ht, EncryptionFailedError as I, confidentialTransferFromContract as It, NoCiphertextError as J, resolveStorage as Jt, DelegationSelfNotAllowedError as K, ResolvedChainRelayer as Kt, AclPausedError as L, finalizeUnwrapContract as Lt, ERC20ReadFailedError as M, symbolContract as Mt, InsufficientConfidentialBalanceError as N, confidentialBalanceOfContract as Nt, ConfigurationError as O, approveContract as Ot, InsufficientERC20BalanceError as P, confidentialTotalSupplyContract as Pt, ZamaErrorCode as Q, DelegationContractIsSelfError as R, inferredTotalSupplyContract as Rt, SignerNotConfiguredError as S, ERC7984_INTERFACE_ID as St, WalletNotConnectedError as T, isConfidentialWrapperContract as Tt, DelegationExpiryUnchangedError as U, unwrapContract as Ut, DelegationExpirationTooSoonError as V, setOperatorContract as Vt, DelegationNotFoundError as W, unwrapFromBalanceContract as Wt, ChainMismatchError as X, TransportKeyPairExpiredError as Y, createConfig as Yt, ZamaError as Z, WorkerRecycledError as _, getDelegationExpiryContract as _t, WrappersRegistryConfig as a, QueryFactoryOptions as at, SigningFailedError as b, transferAndCallContract as bt, BatchDecryptAsOptions as c, TokenWrapperPairWithMetadata as ct, Delegations as d, getTokenPairContract as dt, EncryptedInput as et, Decryption as f, getTokenPairsContract as ft, matchZamaError as g, delegateForUserDecryptionContract as gt, DelegatedDecryptOptions as h, isConfidentialTokenValidContract as ht, WrappersRegistry as i, MutationFactoryOptions as it, BalanceErrorDetails as j, nameContract as jt, RelayerRequestFailedError as k, balanceOfContract as kt, Token as l, getConfidentialTokenAddressContract as lt, BatchDecryptResult as m, getTokenPairsSliceContract as mt, DefaultRegistryAddresses as n, SignerQueryContext as nt, WrappedToken as o, PaginatedResult as ot, BatchDecryptItem as p, getTokenPairsLengthContract as pt, InvalidTransportKeyPairError as q, resolveChainRelayers as qt, ListPairsOptions as r, zamaQueryKeys as rt, BatchBalancesResult as s, TokenWrapperPair as st, ZamaSDK as t, decryptValuesQueryOptions as tt, Permits as u, getTokenAddressContract as ut, WorkerTimeoutError as v, isHandleDelegatedContract as vt, WalletAccountNotReadyError as w, isConfidentialTokenContract as wt, SigningRejectedError as x, ERC1363_INTERFACE_ID as xt, TransactionRevertedError as y, revokeDelegationContract as yt, DelegationCooldownError as z, isOperatorContract as zt };
20636
+ //# sourceMappingURL=index-C1Mtc8Rw.d.ts.map