Skip to main content

index

Classes

TokenOpsSdkError

Defined in: core/errors.ts:87

Base class for every error the SDK throws. Carries a stable code discriminator (machine contract), a typed context payload (structured data for logs / UI), and the standard cause chain (set via ErrorOptions, so loggers and devtools follow it natively).

Subclasses narrow context to a concrete shape and pin code to a single literal — if (error.code === "TOKENOPS_MISSING_ENCRYPTOR") error.context.method typechecks.

Extends

  • Error

Extended by

Constructors

Constructor
new TokenOpsSdkError(message, init?): TokenOpsSdkError;

Defined in: core/errors.ts:93

Parameters
ParameterType
messagestring
init?... | ...
Returns

TokenOpsSdkError

Overrides
Error.constructor

Properties

PropertyModifierTypeDefault valueOverridesDefined in
namereadonlystring"TokenOpsSdkError"Error.namecore/errors.ts:88
codereadonlyTokenOpsSdkErrorCodeundefined-core/errors.ts:89
contextreadonlyRecord<..., ...>undefined-core/errors.ts:90
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-core/errors.ts:91

UnsupportedChainError

Defined in: core/errors.ts:117

Base class for every error the SDK throws. Carries a stable code discriminator (machine contract), a typed context payload (structured data for logs / UI), and the standard cause chain (set via ErrorOptions, so loggers and devtools follow it natively).

Subclasses narrow context to a concrete shape and pin code to a single literal — if (error.code === "TOKENOPS_MISSING_ENCRYPTOR") error.context.method typechecks.

Extends

Constructors

Constructor
new UnsupportedChainError(chainId, options?): UnsupportedChainError;

Defined in: core/errors.ts:121

Parameters
ParameterType
chainIdnumber
options?... | ...
Returns

UnsupportedChainError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"UnsupportedChainError""UnsupportedChainError"TokenOpsSdkError.name-core/errors.ts:118
contextreadonly{ chainId: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:119
context.chainIdpublic...undefined--core/errors.ts:119

DeploymentAddressUnavailableError

Defined in: core/errors.ts:147

Thrown when the SDK cannot resolve a deployed contract address for the caller's chain. context.reason tells you why — branch UI on it:

  • chain-id-missing — caller didn't pass chainId and publicClient.chain was undefined.
  • registry-not-deployed — chain is known to the SDK but the product isn't deployed there yet (null in registry).
  • registry-unknown-chain — chain id absent from the registry entirely.

context.overrideName names the client-config knob the caller should set to bypass the registry (defaults to "address"). Infra contracts whose override lives under a different key — e.g. aclAddress on the FHE clients — set this so the error message points users at the right field.

Extends

Constructors

Constructor
new DeploymentAddressUnavailableError(args): DeploymentAddressUnavailableError;

Defined in: core/errors.ts:158

Parameters
ParameterType
args{ reason: ...; product?: ...; contract?: ...; chainId?: ...; clientLabel?: ...; overrideName?: ...; cause?: ...; }
args.reason...
args.product?...
args.contract?...
args.chainId?...
args.clientLabel?...
args.overrideName?...
args.cause?...
Returns

DeploymentAddressUnavailableError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"DeploymentAddressUnavailableError""DeploymentAddressUnavailableError"TokenOpsSdkError.name-core/errors.ts:148
contextreadonly{ reason: ...; product?: ...; contract?: ...; chainId?: ...; clientLabel?: ...; overrideName?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:149
context.reasonpublic...undefined--core/errors.ts:150
context.product?public...undefined--core/errors.ts:151
context.contract?public...undefined--core/errors.ts:152
context.chainId?public...undefined--core/errors.ts:153
context.clientLabel?public...undefined--core/errors.ts:154
context.overrideName?public...undefined--core/errors.ts:155

MissingPublicClientError

Defined in: core/errors.ts:199

Base class for every error the SDK throws. Carries a stable code discriminator (machine contract), a typed context payload (structured data for logs / UI), and the standard cause chain (set via ErrorOptions, so loggers and devtools follow it natively).

Subclasses narrow context to a concrete shape and pin code to a single literal — if (error.code === "TOKENOPS_MISSING_ENCRYPTOR") error.context.method typechecks.

Extends

Constructors

Constructor
new MissingPublicClientError(method, options?): MissingPublicClientError;

Defined in: core/errors.ts:203

Parameters
ParameterType
methodstring
options?... | ...
Returns

MissingPublicClientError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"MissingPublicClientError""MissingPublicClientError"TokenOpsSdkError.name-core/errors.ts:200
contextreadonly{ method: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:201
context.methodpublic...undefined--core/errors.ts:201

MissingWalletClientError

Defined in: core/errors.ts:212

Base class for every error the SDK throws. Carries a stable code discriminator (machine contract), a typed context payload (structured data for logs / UI), and the standard cause chain (set via ErrorOptions, so loggers and devtools follow it natively).

Subclasses narrow context to a concrete shape and pin code to a single literal — if (error.code === "TOKENOPS_MISSING_ENCRYPTOR") error.context.method typechecks.

Extends

Constructors

Constructor
new MissingWalletClientError(method, options?): MissingWalletClientError;

Defined in: core/errors.ts:216

Parameters
ParameterType
methodstring
options?... | ...
Returns

MissingWalletClientError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"MissingWalletClientError""MissingWalletClientError"TokenOpsSdkError.name-core/errors.ts:213
contextreadonly{ method: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:214
context.methodpublic...undefined--core/errors.ts:214

MissingAccountError

Defined in: core/errors.ts:225

Base class for every error the SDK throws. Carries a stable code discriminator (machine contract), a typed context payload (structured data for logs / UI), and the standard cause chain (set via ErrorOptions, so loggers and devtools follow it natively).

Subclasses narrow context to a concrete shape and pin code to a single literal — if (error.code === "TOKENOPS_MISSING_ENCRYPTOR") error.context.method typechecks.

Extends

Constructors

Constructor
new MissingAccountError(method, options?): MissingAccountError;

Defined in: core/errors.ts:229

Parameters
ParameterType
methodstring
options?... | ...
Returns

MissingAccountError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"MissingAccountError""MissingAccountError"TokenOpsSdkError.name-core/errors.ts:226
contextreadonly{ method: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:227
context.methodpublic...undefined--core/errors.ts:227

MissingEncryptorError

Defined in: core/errors.ts:238

Base class for every error the SDK throws. Carries a stable code discriminator (machine contract), a typed context payload (structured data for logs / UI), and the standard cause chain (set via ErrorOptions, so loggers and devtools follow it natively).

Subclasses narrow context to a concrete shape and pin code to a single literal — if (error.code === "TOKENOPS_MISSING_ENCRYPTOR") error.context.method typechecks.

Extends

Constructors

Constructor
new MissingEncryptorError(method, options?): MissingEncryptorError;

Defined in: core/errors.ts:242

Parameters
ParameterType
methodstring
options?... | ...
Returns

MissingEncryptorError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"MissingEncryptorError""MissingEncryptorError"TokenOpsSdkError.name-core/errors.ts:239
contextreadonly{ method: ...; hint?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:240
context.methodpublic...undefined--core/errors.ts:240
context.hint?public...undefined--core/errors.ts:240

MissingClientError

Defined in: core/errors.ts:258

Thrown by React hooks when their headless client (factory / manager / airdrop / disperse) could not be constructed — usually because the wagmi publicClient isn't ready yet or the chain id has no resolvable address. Tests gate on enabled: !!client, so this fires only on the mutation path.

Extends

Constructors

Constructor
new MissingClientError(
hook,
clientKind,
options?): MissingClientError;

Defined in: core/errors.ts:262

Parameters
ParameterType
hookstring
clientKindstring
options?... | ...
Returns

MissingClientError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"MissingClientError""MissingClientError"TokenOpsSdkError.name-core/errors.ts:259
contextreadonly{ hook: ...; clientKind: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:260
context.hookpublic...undefined--core/errors.ts:260
context.clientKindpublic...undefined--core/errors.ts:260

InvalidArgumentError

Defined in: core/errors.ts:281

Thrown when an argument fails an SDK-side precondition (non-empty array, uint range, matching lengths, valid address, etc.). context.argument names the offending parameter; context.reason is the short explanation that's also embedded in the message.

Extends

Constructors

Constructor
new InvalidArgumentError(args): InvalidArgumentError;

Defined in: core/errors.ts:290

Parameters
ParameterType
args{ method: ...; argument: ...; reason: ...; value?: ...; cause?: ...; }
args.method...
args.argument...
args.reason...
args.value?...
args.cause?...
Returns

InvalidArgumentError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"InvalidArgumentError""InvalidArgumentError"TokenOpsSdkError.name-core/errors.ts:282
contextreadonly{ method: ...; argument: ...; reason: ...; value?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:283
context.methodpublic...undefined--core/errors.ts:284
context.argumentpublic...undefined--core/errors.ts:285
context.reasonpublic...undefined--core/errors.ts:286
context.value?public...undefined--core/errors.ts:287

ReceiptEventNotFoundError

Defined in: core/errors.ts:324

Thrown when extracting an event from a transaction receipt finds zero matching entries — typically a silent revert, a misrouted log, or (most commonly for FHE flows) an ACL Allowed grant that didn't fire because the contract entrypoint took an early return path.

Wraps the receipt-based handle extraction pattern described in CLAUDE.md Pitfall #1: SDK methods that return an encrypted handle MUST parse the receipt's ACL Allowed event, never simulateContract().result.

Extends

Constructors

Constructor
new ReceiptEventNotFoundError(args): ReceiptEventNotFoundError;

Defined in: core/errors.ts:334

Parameters
ParameterType
args{ method: ...; eventName: ...; contractAddress: ...; txHash: ...; hint?: ...; cause?: ...; }
args.method...
args.eventName...
args.contractAddress...
args.txHash...
args.hint?...
args.cause?...
Returns

ReceiptEventNotFoundError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"ReceiptEventNotFoundError""ReceiptEventNotFoundError"TokenOpsSdkError.name-core/errors.ts:325
contextreadonly{ method: ...; eventName: ...; contractAddress: ...; txHash: ...; hint?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:326
context.methodpublic...undefined--core/errors.ts:327
context.eventNamepublic...undefined--core/errors.ts:328
context.contractAddresspublic...undefined--core/errors.ts:329
context.txHashpublic...undefined--core/errors.ts:330
context.hint?public...undefined--core/errors.ts:331

ReceiptEventAmbiguousError

Defined in: core/errors.ts:372

Thrown when receipt-event extraction finds more than one matching event from the target contract. Indicates either a re-entrancy surprise or an SDK bug in the filter shape — the SDK errs on the side of refusing to guess which entry is authoritative.

What to do. This is not a retry candidate. Inspect the failing tx (context.txHash) on a block explorer: if multiple Allowed events appear, either a compound view emitted several or two encrypted views landed in the same tx. File a bug with the tx hash so the SDK can add a caller-specific helper rather than picking heuristically.

Extends

Constructors

Constructor
new ReceiptEventAmbiguousError(args): ReceiptEventAmbiguousError;

Defined in: core/errors.ts:382

Parameters
ParameterType
args{ method: ...; eventName: ...; contractAddress: ...; txHash: ...; count: ...; cause?: ...; }
args.method...
args.eventName...
args.contractAddress...
args.txHash...
args.count...
args.cause?...
Returns

ReceiptEventAmbiguousError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"ReceiptEventAmbiguousError""ReceiptEventAmbiguousError"TokenOpsSdkError.name-core/errors.ts:373
contextreadonly{ method: ...; eventName: ...; contractAddress: ...; txHash: ...; count: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:374
context.methodpublic...undefined--core/errors.ts:375
context.eventNamepublic...undefined--core/errors.ts:376
context.contractAddresspublic...undefined--core/errors.ts:377
context.txHashpublic...undefined--core/errors.ts:378
context.countpublic...undefined--core/errors.ts:379

ContractRevertError

Defined in: core/errors.ts:432

Generic wrapper for any on-chain revert the SDK decodes but does not have a more specific typed subclass for. Always preferred over bubbling raw viem errors. context.revertName and context.revertSelector let consumers branch on specific contract errors without needing to import the contract's ABI; context.revertArgs carries the decoded arg tuple as-is.

If the revert could not be decoded against the SDK's ABIs (custom error not in the ABI, raw revert() with no data, etc.), all three fields stay undefined and context.rawRevertData holds the original calldata. Always prefer this over letting viem's ContractFunctionExecutionError escape.

Extends

Constructors

Constructor
new ContractRevertError(args): ContractRevertError;

Defined in: core/errors.ts:444

Parameters
ParameterType
args{ method: ...; contractAddress: ...; revertName?: ...; revertSelector?: ...; revertArgs?: ...; revertReason?: ...; rawRevertData?: ...; message?: ...; cause?: ...; }
args.method...
args.contractAddress...
args.revertName?...
args.revertSelector?...
args.revertArgs?...
args.revertReason?...
args.rawRevertData?...
args.message?...
args.cause?...
Returns

ContractRevertError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"ContractRevertError""ContractRevertError"TokenOpsSdkError.name-core/errors.ts:433
contextreadonly{ method: ...; contractAddress: ...; revertName?: ...; revertSelector?: ...; revertArgs?: ...; revertReason?: ...; rawRevertData?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:434
context.methodpublic...undefined--core/errors.ts:435
context.contractAddresspublic...undefined--core/errors.ts:436
context.revertName?public...undefined--core/errors.ts:437
context.revertSelector?public...undefined--core/errors.ts:438
context.revertArgs?public...undefined--core/errors.ts:439
context.revertReason?public...undefined--core/errors.ts:440
context.rawRevertData?public...undefined--core/errors.ts:441

PausedError

Defined in: core/errors.ts:477

Contract is paused. Read paused() before retrying.

Extends

Constructors

Constructor
new PausedError(args): PausedError;

Defined in: core/errors.ts:481

Parameters
ParameterType
args{ method: ...; contractAddress: ...; cause?: ...; }
args.method...
args.contractAddress...
args.cause?...
Returns

PausedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"PausedError""PausedError"TokenOpsSdkError.name-core/errors.ts:478
contextreadonly{ method: ...; contractAddress: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:479
context.methodpublic...undefined--core/errors.ts:479
context.contractAddresspublic...undefined--core/errors.ts:479

AccessDeniedError

Defined in: core/errors.ts:496

OpenZeppelin AccessControl rejected the caller. context.role is the bytes32 role selector when the SDK can decode it (AccessControlUnauthorizedAccount carries (account, role)); otherwise undefined. Callers can map the role selector back to a human name via the client's roleConstants() helper.

Extends

Constructors

Constructor
new AccessDeniedError(args): AccessDeniedError;

Defined in: core/errors.ts:505

Parameters
ParameterType
args{ method: ...; contractAddress: ...; account?: ...; role?: ...; cause?: ...; }
args.method...
args.contractAddress...
args.account?...
args.role?...
args.cause?...
Returns

AccessDeniedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"AccessDeniedError""AccessDeniedError"TokenOpsSdkError.name-core/errors.ts:497
contextreadonly{ method: ...; contractAddress: ...; account?: ...; role?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:498
context.methodpublic...undefined--core/errors.ts:499
context.contractAddresspublic...undefined--core/errors.ts:500
context.account?public...undefined--core/errors.ts:501
context.role?public...undefined--core/errors.ts:502

InsufficientFeeError

Defined in: core/errors.ts:535

Native ETH (gas) fee or token fee did not match what the contract requires. feeKind === "gas" means the msg.value was wrong; "token" means the encrypted token-fee BPS did not produce a matching encrypted total.

The SDK does not echo plaintext FHE values — provided and required are populated only for the gas case where both sides are public.

Extends

Constructors

Constructor
new InsufficientFeeError(args): InsufficientFeeError;

Defined in: core/errors.ts:545

Parameters
ParameterType
args{ method: ...; contractAddress: ...; feeKind: ...; required?: ...; provided?: ...; cause?: ...; }
args.method...
args.contractAddress...
args.feeKind...
args.required?...
args.provided?...
args.cause?...
Returns

InsufficientFeeError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"InsufficientFeeError""InsufficientFeeError"TokenOpsSdkError.name-core/errors.ts:536
contextreadonly{ method: ...; contractAddress: ...; feeKind: ...; required?: ...; provided?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:537
context.methodpublic...undefined--core/errors.ts:538
context.contractAddresspublic...undefined--core/errors.ts:539
context.feeKindpublic...undefined--core/errors.ts:540
context.required?public...undefined--core/errors.ts:541
context.provided?public...undefined--core/errors.ts:542

InsufficientBalanceError

Defined in: core/errors.ts:577

Balance is too low to cover the requested operation. balanceKind picks the asset class. For confidential balances the underlying value is encrypted, so requested / available stay undefined — the SDK never echoes plaintext FHE values into context.

Extends

Constructors

Constructor
new InsufficientBalanceError(args): InsufficientBalanceError;

Defined in: core/errors.ts:587

Parameters
ParameterType
args{ method: ...; contractAddress: ...; balanceKind: ...; requested?: ...; available?: ...; cause?: ...; }
args.method...
args.contractAddress...
args.balanceKind...
args.requested?...
args.available?...
args.cause?...
Returns

InsufficientBalanceError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"InsufficientBalanceError""InsufficientBalanceError"TokenOpsSdkError.name-core/errors.ts:578
contextreadonly{ method: ...; contractAddress: ...; balanceKind: ...; requested?: ...; available?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:579
context.methodpublic...undefined--core/errors.ts:580
context.contractAddresspublic...undefined--core/errors.ts:581
context.balanceKindpublic...undefined--core/errors.ts:582
context.requested?public...undefined--core/errors.ts:583
context.available?public...undefined--core/errors.ts:584

BatchTooLargeError

Defined in: core/errors.ts:622

Batch size exceeds the contract's configured maximum.

Note: context.max is bigint (the contract returns uint256 for batch limits, even though realistic values fit comfortably in Number). Call Number(error.context.max) or .toString() before string-interpolating.

Extends

Constructors

Constructor
new BatchTooLargeError(args): BatchTooLargeError;

Defined in: core/errors.ts:632

Parameters
ParameterType
args{ method: ...; contractAddress: ...; requested: ...; max: ...; cause?: ...; }
args.method...
args.contractAddress...
args.requested...
args.max...
args.cause?...
Returns

BatchTooLargeError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueDescriptionOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined--TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue--TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"BatchTooLargeError""BatchTooLargeError"-TokenOpsSdkError.name-core/errors.ts:623
contextreadonly{ method: ...; contractAddress: ...; requested: ...; max: ...; }undefined-TokenOpsSdkError.context-core/errors.ts:624
context.methodpublic...undefined---core/errors.ts:625
context.contractAddresspublic...undefined---core/errors.ts:626
context.requestedpublic...undefined---core/errors.ts:627
context.maxpublic...undefinedbigint — call Number(max) or max.toString() before string interpolation.--core/errors.ts:629

FeatureDisabledError

Defined in: core/errors.ts:660

A feature toggle baked into the contract clone is off. For LibClone deployments these toggles are immutable (set at clone time) — the user cannot enable them after the fact and must deploy a new clone.

Extends

Constructors

Constructor
new FeatureDisabledError(args): FeatureDisabledError;

Defined in: core/errors.ts:668

Parameters
ParameterType
args{ method: ...; contractAddress: ...; feature: ...; cause?: ...; }
args.method...
args.contractAddress...
args.feature...
args.cause?...
Returns

FeatureDisabledError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"FeatureDisabledError""FeatureDisabledError"TokenOpsSdkError.name-core/errors.ts:661
contextreadonly{ method: ...; contractAddress: ...; feature: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:662
context.methodpublic...undefined--core/errors.ts:663
context.contractAddresspublic...undefined--core/errors.ts:664
context.featurepublic...undefined--core/errors.ts:665

TransferFailedError

Defined in: core/errors.ts:691

Native ETH or ERC-20 transfer failed at the contract layer (e.g. recipient is a contract that rejects receive(), or the underlying ERC-20 returned false from transfer).

Extends

Constructors

Constructor
new TransferFailedError(args): TransferFailedError;

Defined in: core/errors.ts:699

Parameters
ParameterType
args{ method: ...; contractAddress: ...; asset: ...; cause?: ...; }
args.method...
args.contractAddress...
args.asset...
args.cause?...
Returns

TransferFailedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"TransferFailedError""TransferFailedError"TokenOpsSdkError.name-core/errors.ts:692
contextreadonly{ method: ...; contractAddress: ...; asset: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:693
context.methodpublic...undefined--core/errors.ts:694
context.contractAddresspublic...undefined--core/errors.ts:695
context.assetpublic...undefined--core/errors.ts:696

FheHandleNotAllowedError

Defined in: core/errors.ts:736

Caller does not hold an FHEVM ACL grant on the encrypted handle they're trying to use (e.g. disclosure, re-share).

This is the on-chain side of the same logical problem as UserDecryptNotAllowedError. Both mean "you don't have permission on this encrypted value"; they differ in when the SDK detects it:

  • FheHandleNotAllowedError (this class) fires when a contract entrypoint calls FHE.isSenderAllowed(handle) on-chain and reverts. The tx made it to the EVM but the contract refused.
  • UserDecryptNotAllowedError fires when the Zama relayer's user-decrypt flow refuses to issue a decryption response. No on-chain tx was sent.

context.handle is the offending handle (the public 32-byte ciphertext identifier), when extractable from the revert args. The SDK never decodes the underlying plaintext.

Extends

Constructors

Constructor
new FheHandleNotAllowedError(args): FheHandleNotAllowedError;

Defined in: core/errors.ts:745

Parameters
ParameterType
args{ method: ...; contractAddress: ...; handle?: ...; account?: ...; cause?: ...; }
args.method...
args.contractAddress...
args.handle?...
args.account?...
args.cause?...
Returns

FheHandleNotAllowedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"FheHandleNotAllowedError""FheHandleNotAllowedError"TokenOpsSdkError.name-core/errors.ts:737
contextreadonly{ method: ...; contractAddress: ...; handle?: ...; account?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:738
context.methodpublic...undefined--core/errors.ts:739
context.contractAddresspublic...undefined--core/errors.ts:740
context.handle?public...undefined--core/errors.ts:741
context.account?public...undefined--core/errors.ts:742

AlreadyInitializedError

Defined in: core/errors.ts:768

Contract has already been initialized — initialize() may only run once.

Extends

Constructors

Constructor
new AlreadyInitializedError(args): AlreadyInitializedError;

Defined in: core/errors.ts:772

Parameters
ParameterType
args{ method: ...; contractAddress: ...; cause?: ...; }
args.method...
args.contractAddress...
args.cause?...
Returns

AlreadyInitializedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"AlreadyInitializedError""AlreadyInitializedError"TokenOpsSdkError.name-core/errors.ts:769
contextreadonly{ method: ...; contractAddress: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:770
context.methodpublic...undefined--core/errors.ts:770
context.contractAddresspublic...undefined--core/errors.ts:770

ReentrancyError

Defined in: core/errors.ts:782

OpenZeppelin ReentrancyGuardTransient blocked a nested call.

Extends

Constructors

Constructor
new ReentrancyError(args): ReentrancyError;

Defined in: core/errors.ts:786

Parameters
ParameterType
args{ method: ...; contractAddress: ...; cause?: ...; }
args.method...
args.contractAddress...
args.cause?...
Returns

ReentrancyError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"ReentrancyError""ReentrancyError"TokenOpsSdkError.name-core/errors.ts:783
contextreadonly{ method: ...; contractAddress: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:784
context.methodpublic...undefined--core/errors.ts:784
context.contractAddresspublic...undefined--core/errors.ts:784

InvalidSignatureError

Defined in: core/errors.ts:800

EIP-712 signature was malformed or did not recover to an authorized signer. Used by airdrop claims where the admin signs a Claim(recipient, encryptedAmount) struct off-chain.

Extends

Constructors

Constructor
new InvalidSignatureError(args): InvalidSignatureError;

Defined in: core/errors.ts:804

Parameters
ParameterType
args{ method: ...; contractAddress: ...; cause?: ...; }
args.method...
args.contractAddress...
args.cause?...
Returns

InvalidSignatureError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"InvalidSignatureError""InvalidSignatureError"TokenOpsSdkError.name-core/errors.ts:801
contextreadonly{ method: ...; contractAddress: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:802
context.methodpublic...undefined--core/errors.ts:802
context.contractAddresspublic...undefined--core/errors.ts:802

WalletRejectedError

Defined in: core/errors.ts:832

Wallet UI cancelled the request — e.g. the user clicked "Reject" on the transaction prompt, or the wallet bridge returned EIP-1193 code 4001. Retrying is safe; the underlying tx never reached the network.

Extends

Constructors

Constructor
new WalletRejectedError(args): WalletRejectedError;

Defined in: core/errors.ts:836

Parameters
ParameterType
args{ method: ...; contractAddress?: ...; cause?: ...; }
args.method...
args.contractAddress?...
args.cause?...
Returns

WalletRejectedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"WalletRejectedError""WalletRejectedError"TokenOpsSdkError.name-core/errors.ts:833
contextreadonly{ method: ...; contractAddress?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:834
context.methodpublic...undefined--core/errors.ts:834
context.contractAddress?public...undefined--core/errors.ts:834

WalletChainMismatchError

Defined in: core/errors.ts:849

The connected wallet is on a different chain than the contract we tried to call. The user must switch networks before retrying.

Extends

Constructors

Constructor
new WalletChainMismatchError(args): WalletChainMismatchError;

Defined in: core/errors.ts:853

Parameters
ParameterType
args{ method: ...; contractAddress?: ...; cause?: ...; }
args.method...
args.contractAddress?...
args.cause?...
Returns

WalletChainMismatchError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"WalletChainMismatchError""WalletChainMismatchError"TokenOpsSdkError.name-core/errors.ts:850
contextreadonly{ method: ...; contractAddress?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:851
context.methodpublic...undefined--core/errors.ts:851
context.contractAddress?public...undefined--core/errors.ts:851

NetworkError

Defined in: core/errors.ts:867

Network-level failure reaching the RPC endpoint (HTTP non-2xx, timeout, DNS, socket close). statusCode is set when the underlying viem HttpRequestError exposed an HTTP status. No on-chain state changed.

Extends

Constructors

Constructor
new NetworkError(args): NetworkError;

Defined in: core/errors.ts:871

Parameters
ParameterType
args{ method: ...; contractAddress?: ...; statusCode?: ...; cause?: ...; }
args.method...
args.contractAddress?...
args.statusCode?...
args.cause?...
Returns

NetworkError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"NetworkError""NetworkError"TokenOpsSdkError.name-core/errors.ts:868
contextreadonly{ method: ...; contractAddress?: ...; statusCode?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:869
context.methodpublic...undefined--core/errors.ts:869
context.contractAddress?public...undefined--core/errors.ts:869
context.statusCode?public...undefined--core/errors.ts:869

InsufficientGasFundsError

Defined in: core/errors.ts:895

Wallet account does not hold enough native balance to cover the transaction's gas estimate. Distinct from InsufficientFeeError, which fires when the contract itself enforces a fee.

Extends

Constructors

Constructor
new InsufficientGasFundsError(args): InsufficientGasFundsError;

Defined in: core/errors.ts:899

Parameters
ParameterType
args{ method: ...; contractAddress?: ...; cause?: ...; }
args.method...
args.contractAddress?...
args.cause?...
Returns

InsufficientGasFundsError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"InsufficientGasFundsError""InsufficientGasFundsError"TokenOpsSdkError.name-core/errors.ts:896
contextreadonly{ method: ...; contractAddress?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:897
context.methodpublic...undefined--core/errors.ts:897
context.contractAddress?public...undefined--core/errors.ts:897

UnknownWriteFailureError

Defined in: core/errors.ts:913

Fallback for write failures the SDK could not classify against either an on-chain revert frame or a known viem non-revert error class. Inspect error.cause for diagnostics; this is the case to file a bug for.

Extends

Constructors

Constructor
new UnknownWriteFailureError(args): UnknownWriteFailureError;

Defined in: core/errors.ts:917

Parameters
ParameterType
args{ method: ...; contractAddress?: ...; cause?: ...; }
args.method...
args.contractAddress?...
args.cause?...
Returns

UnknownWriteFailureError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"UnknownWriteFailureError""UnknownWriteFailureError"TokenOpsSdkError.name-core/errors.ts:914
contextreadonly{ method: ...; contractAddress?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:915
context.methodpublic...undefined--core/errors.ts:915
context.contractAddress?public...undefined--core/errors.ts:915

UserRejectedSignatureError

Defined in: core/errors.ts:936

User cancelled the wallet signature prompt.

Extends

Constructors

Constructor
new UserRejectedSignatureError(args): UserRejectedSignatureError;

Defined in: core/errors.ts:940

Parameters
ParameterType
args{ method: ...; operation: ...; cause?: ...; }
args.method...
args.operation...
args.cause?...
Returns

UserRejectedSignatureError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"UserRejectedSignatureError""UserRejectedSignatureError"TokenOpsSdkError.name-core/errors.ts:937
contextreadonly{ method: ...; operation: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:938
context.methodpublic...undefined--core/errors.ts:938
context.operationpublic...undefined--core/errors.ts:938

SigningFailedError

Defined in: core/errors.ts:953

Wallet signature failed for a reason other than the user explicitly rejecting it (timeout, wallet crash, malformed request, etc.).

Extends

Constructors

Constructor
new SigningFailedError(args): SigningFailedError;

Defined in: core/errors.ts:957

Parameters
ParameterType
args{ method: ...; operation: ...; cause?: ...; }
args.method...
args.operation...
args.cause?...
Returns

SigningFailedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"SigningFailedError""SigningFailedError"TokenOpsSdkError.name-core/errors.ts:954
contextreadonly{ method: ...; operation: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:955
context.methodpublic...undefined--core/errors.ts:955
context.operationpublic...undefined--core/errors.ts:955

RelayerUnreachableError

Defined in: core/errors.ts:970

Network call to the Zama relayer failed (HTTP non-2xx, timeout, DNS, etc.). statusCode is set when the underlying error exposed it.

Extends

Constructors

Constructor
new RelayerUnreachableError(args): RelayerUnreachableError;

Defined in: core/errors.ts:974

Parameters
ParameterType
args{ method: ...; operation: ...; statusCode?: ...; cause?: ...; }
args.method...
args.operation...
args.statusCode?...
args.cause?...
Returns

RelayerUnreachableError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"RelayerUnreachableError""RelayerUnreachableError"TokenOpsSdkError.name-core/errors.ts:971
contextreadonly{ method: ...; operation: ...; statusCode?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:972
context.methodpublic...undefined--core/errors.ts:972
context.operationpublic...undefined--core/errors.ts:972
context.statusCode?public...undefined--core/errors.ts:972

EncryptionFailedError

Defined in: core/errors.ts:989

Encryption flow (input proof generation) failed.

Extends

Constructors

Constructor
new EncryptionFailedError(args): EncryptionFailedError;

Defined in: core/errors.ts:993

Parameters
ParameterType
args{ method: ...; operation: ...; cause?: ...; }
args.method...
args.operation...
args.cause?...
Returns

EncryptionFailedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"EncryptionFailedError""EncryptionFailedError"TokenOpsSdkError.name-core/errors.ts:990
contextreadonly{ method: ...; operation: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:991
context.methodpublic...undefined--core/errors.ts:991
context.operationpublic...undefined--core/errors.ts:991

DecryptionFailedError

Defined in: core/errors.ts:1003

Decryption flow (user-decrypt, public-decrypt) failed.

Extends

Constructors

Constructor
new DecryptionFailedError(args): DecryptionFailedError;

Defined in: core/errors.ts:1007

Parameters
ParameterType
args{ method: ...; operation: ...; cause?: ...; }
args.method...
args.operation...
args.cause?...
Returns

DecryptionFailedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"DecryptionFailedError""DecryptionFailedError"TokenOpsSdkError.name-core/errors.ts:1004
contextreadonly{ method: ...; operation: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:1005
context.methodpublic...undefined--core/errors.ts:1005
context.operationpublic...undefined--core/errors.ts:1005

UserDecryptNotAllowedError

Defined in: core/errors.ts:1031

Zama ACL refused to grant decryption for the caller on the requested handle.

This is the off-chain side of the same logical problem as FheHandleNotAllowedError. Both mean "you don't have permission on this encrypted value"; they differ in when the SDK detects it:

  • UserDecryptNotAllowedError (this class) fires before any chain interaction — the Zama relayer / ACL precompile refused to issue a decryption response, typically because no FHE.allow(handle, sender) ever fired for this caller.
  • FheHandleNotAllowedError fires when a contract entrypoint calls FHE.isSenderAllowed(handle) on-chain and reverts. The tx made it to the EVM but the contract refused.

Extends

Constructors

Constructor
new UserDecryptNotAllowedError(args): UserDecryptNotAllowedError;

Defined in: core/errors.ts:1039

Parameters
ParameterType
args{ method: ...; handle?: ...; userAddress?: ...; cause?: ...; }
args.method...
args.handle?...
args.userAddress?...
args.cause?...
Returns

UserDecryptNotAllowedError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"UserDecryptNotAllowedError""UserDecryptNotAllowedError"TokenOpsSdkError.name-core/errors.ts:1032
contextreadonly{ method: ...; handle?: ...; userAddress?: ...; }undefinedTokenOpsSdkError.context-core/errors.ts:1033
context.methodpublic...undefined--core/errors.ts:1034
context.handle?public...undefined--core/errors.ts:1035
context.userAddress?public...undefined--core/errors.ts:1036

TokenOpsValidationError

Defined in: core/errors.ts:1061

Free-form validation error thrown by SDK helpers that don't have a more specific typed subclass yet (e.g. normaliseAddress). Accepts a free-form context object so call sites can attach whatever per-throw metadata they need; consumers branch on error.code === "TOKENOPS_INVALID_ARGUMENT" (the same code InvalidArgumentError uses).

Extends

Constructors

Constructor
new TokenOpsValidationError(message, context?): TokenOpsValidationError;

Defined in: core/errors.ts:1063

Parameters
ParameterType
messagestring
contextRecord<..., ...>
Returns

TokenOpsValidationError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
contextreadonlyRecord<..., ...>undefined-TokenOpsSdkError.contextcore/errors.ts:90
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"TokenOpsValidationError""TokenOpsValidationError"TokenOpsSdkError.name-core/errors.ts:1062

TokenOpsContractError

Defined in: core/errors.ts:1075

Generic contract-interaction error thrown by SDK helpers that wrap writeContract + receipt-wait (e.g. setOperator, mintMockERC7984) outside the typed revert-mapper path. Accepts a free-form context object; consumers branch on error.code === "TOKENOPS_CONTRACT_REVERT".

Extends

Constructors

Constructor
new TokenOpsContractError(message, context?): TokenOpsContractError;

Defined in: core/errors.ts:1077

Parameters
ParameterType
messagestring
contextRecord<..., ...>
Returns

TokenOpsContractError

Overrides

TokenOpsSdkError.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
codereadonlyTokenOpsSdkErrorCodeundefined-TokenOpsSdkError.codecore/errors.ts:89
contextreadonlyRecord<..., ...>undefined-TokenOpsSdkError.contextcore/errors.ts:90
[TOKENOPS_SDK_ERROR_BRAND]readonlytruetrue-TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND]core/errors.ts:91
namereadonly"TokenOpsContractError""TokenOpsContractError"TokenOpsSdkError.name-core/errors.ts:1076

Interfaces

TokenOpsSdkErrorInit

Defined in: core/errors.ts:72

Properties

PropertyTypeDefined in
codeTokenOpsSdkErrorCodecore/errors.ts:73
cause?unknowncore/errors.ts:74
context?... | ...core/errors.ts:75

PreflightResult

Defined in: core/preflight.ts:17

Result of a read-only preflight on a write operation.

The SDK exposes opt-in preflight helpers (preflightClaim, preflightDisperse, etc.) that run the deterministic-from-off-chain checks in parallel — array length / fee balance / claim window / batch limit / role membership — and return whether the write is safe to submit. blockers carries the typed errors that would have been thrown at write time: same code, same context, just collected instead of thrown. UIs can render them with the same branching they use in onError.

Preflight is opt-in. Consumers who have already validated state can skip the preflight and call the write directly.

Properties

PropertyTypeDescriptionDefined in
readybooleantrue when no blockers were detected — green light to submit the write.core/preflight.ts:19
blockers...[]Typed errors that would otherwise be thrown at write time. Empty when ready === true. Branch on error.code to render UI; the same code values appear here that the write path would throw.core/preflight.ts:25

SdkTelemetry

Defined in: core/telemetry.ts:10

Methods

event()
event(name, props?): void;

Defined in: core/telemetry.ts:12

Fire-and-forget event. Implementations must not throw.

Parameters
ParameterType
namestring
props?... | ...
Returns

void

span()
span<T>(name, fn): Promise<...>;

Defined in: core/telemetry.ts:14

Wrap an async operation; implementations decide what to time/log.

Type Parameters
Type Parameter
T
Parameters
ParameterType
namestring
fn() => ...
Returns

Promise<...>

error()
error(err, context?): void;

Defined in: core/telemetry.ts:16

Report an error. Implementations must not re-throw.

Parameters
ParameterType
errError
context?... | ...
Returns

void

scope()?
optional scope(tags): SdkTelemetry;

Defined in: core/telemetry.ts:34

Return a child telemetry that automatically prepends tags to every subsequent event / span / error call.

Pattern parity with pino's logger.child(bindings) and winston's logger.child(meta). Lets a server build a per-request telemetry (telemetry.scope({ requestId, userId })) without monkey-patching.

Optional on the interface — adapters that don't carry scope context (NoopTelemetry, third-party adapters where child-loggers aren't a fit) can omit. The SDK never calls .scope internally; it's a consumer-side affordance for downstream correlation.

Adapters that DO implement it should return a NEW telemetry instance — mutating this would leak tags across unrelated consumers sharing the same SDK client.

Parameters
ParameterType
tagsSdkTelemetryTags
Returns

SdkTelemetry


ClientPair

Defined in: core/types.ts:5

Properties

PropertyTypeDefined in
publicClient{ }core/types.ts:6
walletClient?... | ...core/types.ts:7

Type Aliases

DeployedAddresses

type DeployedAddresses = typeof DEPLOYED_ADDRESSES;

Defined in: core/addresses.ts:47


ProductKey

type ProductKey = keyof ...;

Defined in: core/addresses.ts:48


ContractKey

type ContractKey<P> = keyof ...;

Defined in: core/addresses.ts:49

Type Parameters

Type Parameter
P extends ProductKey

EncryptedHandle

type EncryptedHandle = Hex;

Defined in: core/brands.ts:44

bytes32 handle for an externalEuint* ciphertext. Returned by the Zama relayer / MockFhevmInstance encrypt() call, consumed by FHE-aware contracts as the off-chain side of FHE.fromExternal.


ExternalInputProof

type ExternalInputProof = Hex;

Defined in: core/brands.ts:51

KMS-issued input proof binding an EncryptedHandle to a (contractAddress, userAddress) pair. Re-using a proof across contracts / users is rejected by FHE.fromExternal on-chain.


TxHash

type TxHash = Hex;

Defined in: core/brands.ts:54

Transaction hash returned by eth_sendRawTransaction / walletClient.writeContract.


VestingId

type VestingId = Hex;

Defined in: core/brands.ts:57

bytes32 vesting schedule id, emitted in VestingCreated.


AirdropId

type AirdropId = Hex;

Defined in: core/brands.ts:60

bytes32 airdrop id, emitted in AirdropCreated.


DisperseId

type DisperseId = Hex;

Defined in: core/brands.ts:63

bytes32 disperse id, emitted in DisperseExecuted.


Role

type Role = Hex;

Defined in: core/brands.ts:66

bytes32 role identifier — the keccak256("ROLE_NAME") hash AccessControl uses.


Signature

type Signature = Hex;

Defined in: core/brands.ts:75

65-byte ECDSA signature returned by walletClient.signTypedData (EIP-712) or walletClient.signMessage (EIP-191). NOT a transaction hash — these bytes are never broadcast directly; they're handed off-chain to a verifier.

Canonical producer: useSignClaimAuthorization in /fhe-airdrop/react.


SupportedChainId

type SupportedChainId = keyof ...;

Defined in: core/chains.ts:9


TokenOpsSdkErrorCode

type TokenOpsSdkErrorCode =
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...
| ...;

Defined in: core/errors.ts:17

Stable, string-literal error codes. Codes are the machine contract — match on error.code in onError handlers and UI surfaces. Messages stay human-readable and may evolve between versions.


DeploymentAddressUnavailableReason

type DeploymentAddressUnavailableReason = ... | ... | ...;

Defined in: core/errors.ts:130


SdkTelemetryTags

type SdkTelemetryTags = Record<..., ...>;

Defined in: core/telemetry.ts:8

Tag values accepted by SdkTelemetry.scope. Mirrors Record<string, unknown> but pinned to the primitives a structured logger can serialise without surprise.

string | number | boolean only — no nested objects, no Date, no arrays. Adapters that need richer tags can widen at the consumer boundary.


ContractRef

type ContractRef = {
address: ...;
chainId: ...;
};

Defined in: core/types.ts:10

Properties

address
address: ...;

Defined in: core/types.ts:11

chainId
chainId: ...;

Defined in: core/types.ts:12

Variables

DEPLOYED_ADDRESSES

const DEPLOYED_ADDRESSES: {
fheVesting: ...;
fheAirdrop: ...;
fheDisperse: ...;
};

Defined in: core/addresses.ts:22

Pre-deployed contract addresses per chain. The SDK calls into these only — there are no factory-deployment helpers.

Prefer the accessors (getFheVestingFactoryAddress, etc.) over reaching into this object directly. They normalize the null / missing-key cases to undefined and keep the trust-boundary policy in one place.

Type Declaration

fheVesting
readonly fheVesting: ...;
fheAirdrop
readonly fheAirdrop: ...;
fheDisperse
readonly fheDisperse: ...;

SUPPORTED_CHAINS

const SUPPORTED_CHAINS: {
1: ...;
11155111: ...;
};

Defined in: core/chains.ts:4

Type Declaration

1
readonly 1: ... = mainnet;
11155111
readonly 11155111: ... = sepolia;

Functions

getDeployedAddress()

function getDeployedAddress<P, C>(
product,
contract,
chainId): ... | ...;

Defined in: core/addresses.ts:57

Generic accessor. Returns undefined when the (product, contract, chainId) tuple has no usable address — whether because the chain is absent from the registry or because the registry explicitly records null (known chain, not deployed).

Type Parameters

Type Parameter
P extends ... | ... | ...
C extends ... | ... | ...

Parameters

ParameterType
productP
contractC
chainIdnumber

Returns

... | ...


getFheVestingFactoryAddress()

function getFheVestingFactoryAddress(chainId): ... | ...;

Defined in: core/addresses.ts:84

Parameters

ParameterType
chainIdnumber

Returns

... | ...


requireFheVestingFactoryAddress()

function requireFheVestingFactoryAddress(chainId): `0x${(...)}`;

Defined in: core/addresses.ts:88

Parameters

ParameterType
chainIdnumber

Returns

`0x${(...)}`


getFheAirdropFactoryAddress()

function getFheAirdropFactoryAddress(chainId): ... | ...;

Defined in: core/addresses.ts:92

Parameters

ParameterType
chainIdnumber

Returns

... | ...


requireFheAirdropFactoryAddress()

function requireFheAirdropFactoryAddress(chainId): `0x${(...)}`;

Defined in: core/addresses.ts:96

Parameters

ParameterType
chainIdnumber

Returns

`0x${(...)}`


getFheDisperseSingletonAddress()

function getFheDisperseSingletonAddress(chainId): ... | ...;

Defined in: core/addresses.ts:100

Parameters

ParameterType
chainIdnumber

Returns

... | ...


requireFheDisperseSingletonAddress()

function requireFheDisperseSingletonAddress(chainId): `0x${(...)}`;

Defined in: core/addresses.ts:104

Parameters

ParameterType
chainIdnumber

Returns

`0x${(...)}`


chainsWithKnownRegistryEntry()

function chainsWithKnownRegistryEntry<P>(product): ...[];

Defined in: core/addresses.ts:114

Chains with a registry entry for product, including ones explicitly marked null (known chain, not yet deployed). Useful when the consumer wants to surface "deployment pending" UI separately from "unsupported chain" UI.

Type Parameters

Type Parameter
P extends ... | ... | ...

Parameters

ParameterType
productP

Returns

...[]


chainsWithDeployment()

function chainsWithDeployment<P>(product): ...[];

Defined in: core/addresses.ts:133

Chains where product is actually usable — every contract under the product has a non-null address on that chain. For single-contract products (the current shape) this equals "the contract is deployed there"; for a future multi-contract product, a chain is included only when all of the product's contracts are deployed (a partial deployment is not "usable"). Use this to gate UI / RPC selection.

Type Parameters

Type Parameter
P extends ... | ... | ...

Parameters

ParameterType
productP

Returns

...[]


asEncryptedHandle()

function asEncryptedHandle(h): `0x${(...)}`;

Defined in: core/brands.ts:107

Mark a raw Hex value as an EncryptedHandle. Caller asserts the value came from a trusted source — either a Zama relayer encrypt result, a contract read of externalEuint*, or the ACL.Allowed event of an FHE.allow(handle, msg.sender) call.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


asExternalInputProof()

function asExternalInputProof(h): `0x${(...)}`;

Defined in: core/brands.ts:110

Mark a raw Hex value as an ExternalInputProof.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


asTxHash()

function asTxHash(h): `0x${(...)}`;

Defined in: core/brands.ts:113

Mark a raw Hex value as a TxHash.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


asVestingId()

function asVestingId(h): `0x${(...)}`;

Defined in: core/brands.ts:116

Mark a raw Hex value as a VestingId.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


asAirdropId()

function asAirdropId(h): `0x${(...)}`;

Defined in: core/brands.ts:119

Mark a raw Hex value as an AirdropId.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


asDisperseId()

function asDisperseId(h): `0x${(...)}`;

Defined in: core/brands.ts:122

Mark a raw Hex value as a DisperseId.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


asRole()

function asRole(h): `0x${(...)}`;

Defined in: core/brands.ts:125

Mark a raw Hex value as a Role.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


asSignature()

function asSignature(h): `0x${(...)}`;

Defined in: core/brands.ts:133

Mark a raw Hex value as a Signature. Caller asserts the bytes are the output of signTypedData / signMessage and NOT a tx hash — the alias exists as a reading-clarity annotation so that call sites distinguish signature bytes from transaction hashes.

Parameters

ParameterType
h`0x${(...)}`

Returns

`0x${(...)}`


isSupportedChainId()

function isSupportedChainId(chainId): chainId is (...) | (...);

Defined in: core/chains.ts:11

Parameters

ParameterType
chainIdnumber

Returns

chainId is (...) | (...)


isTokenOpsSdkError()

function isTokenOpsSdkError(error): error is TokenOpsSdkError;

Defined in: core/errors.ts:105

Brand-based predicate. Prefer over instanceof when bundling boundaries may have caused duplicate SDK copies — Symbol.for is realm-global, so the brand survives.

Parameters

ParameterType
errorunknown

Returns

error is TokenOpsSdkError