Reference

Error Reference

Every Zama SDK error code, whether it is retryable, and how ShadowLine maps it to a message.

Use matchZamaError from @zama-fhe/sdk to classify SDK errors into user-friendly messages. ShadowLine re-exports this via the classifyError(err) utility in src/lib/errors.ts.

usage
import { matchZamaError } from '@zama-fhe/sdk';

try {
  await shield({ amount });
} catch (err) {
  const result = matchZamaError(err, {
    SIGNING_REJECTED: () => ({ title: 'Declined', message: 'You cancelled the signature.' }),
    INSUFFICIENT_ERC20_BALANCE: () => ({ title: 'Low Balance', message: 'Not enough tokens.' }),
    _: (e) => ({ title: 'Error', message: e.message }),
  });
  showToast(result);
}
Error CodeTitleDescriptionRetry?
SIGNING_REJECTEDSignature DeclinedUser declined the EIP-712 permit request in their wallet.Retryable
SIGNING_FAILEDWallet Signing FailedWallet could not complete the signature — connection issue or wrong account.Retryable
ENCRYPTION_FAILEDEncryption FailedFHE encryption failed client-side. Browser may not support WebAssembly.Retryable
DECRYPTION_FAILEDDecryption FailedSession permit may have expired. Request a new permit.Retryable
TRANSACTION_REVERTEDTransaction RevertedOn-chain transaction reverted — check balance, allowance, or contract state.Retryable
INVALID_KEYPAIRSession Key RejectedSession key was rejected by the relayer. Generate a fresh key.Retryable
KEYPAIR_EXPIREDSession ExpiredSession key has expired. Sign again to refresh.Retryable
NO_CIPHERTEXTNo Confidential BalanceThis account has no confidential balance for this wrapper. Shield first.Terminal
RELAYER_REQUEST_FAILEDRelayer UnavailableZama relayer is temporarily unavailable. Retry in a few seconds.Retryable
CONFIGURATIONConfiguration ErrorSDK misconfiguration — likely a bug in the integration.Terminal
INSUFFICIENT_CONFIDENTIAL_BALANCEInsufficient BalanceConfidential balance is lower than the unshield/transfer amount.Terminal
INSUFFICIENT_ERC20_BALANCEInsufficient TokensPublic token balance is lower than the shield amount.Terminal
BALANCE_CHECK_UNAVAILABLEBalance Check UnavailableCannot verify balance — sign a permit first.Retryable
ERC20_READ_FAILEDToken Read FailedCould not read token balance from chain — network issue.Retryable
ACL_PAUSEDProtocol PausedThe FHE access-control layer is temporarily paused for maintenance.Terminal
APPROVAL_FAILEDApproval FailedERC-20 approval transaction failed — check allowance and balance.Retryable
Wallet errors (non-SDK): common rejection strings like user rejected, User denied, ACTION_REJECTED, and user cancelled are caught by the fallback in classifyError()and mapped to "Request Cancelled."