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
TokenOpsValidationErrorTokenOpsContractErrorDeploymentAddressUnavailableErrorUnsupportedChainErrorMissingAccountErrorMissingClientErrorMissingEncryptorErrorMissingPublicClientErrorMissingWalletClientErrorInvalidArgumentErrorReceiptEventAmbiguousErrorReceiptEventNotFoundErrorContractRevertErrorPausedErrorAccessDeniedErrorInsufficientFeeErrorInsufficientBalanceErrorBatchTooLargeErrorFeatureDisabledErrorTransferFailedErrorFheHandleNotAllowedErrorAlreadyInitializedErrorReentrancyErrorInvalidSignatureErrorWalletRejectedErrorWalletChainMismatchErrorNetworkErrorInsufficientGasFundsErrorUnknownWriteFailureErrorUserRejectedSignatureErrorSigningFailedErrorRelayerUnreachableErrorEncryptionFailedErrorDecryptionFailedErrorUserDecryptNotAllowedErrorVestingNotFoundErrorNotVestingRecipientErrorClaimLockedErrorVestingRevokedErrorVestingNotRevocableErrorVestingExpiredErrorTransferAlreadyPendingErrorNoPendingTransferErrorNotPendingRecipientErrorTransferExpiredErrorAlreadyClaimedErrorClaimNotStartedErrorClaimWindowClosedErrorDisperseSubwalletNotFoundErrorDisperseEncryptedReserveNotGrantedErrorNotRegisteredErrorAlreadyRegisteredError
Constructors
Constructor
new TokenOpsSdkError(message, init?): TokenOpsSdkError;
Defined in: core/errors.ts:93
Parameters
| Parameter | Type |
|---|---|
message | string |
init? | ... | ... |
Returns
Overrides
Error.constructor
Properties
| Property | Modifier | Type | Default value | Overrides | Defined in |
|---|---|---|---|---|---|
name | readonly | string | "TokenOpsSdkError" | Error.name | core/errors.ts:88 |
code | readonly | TokenOpsSdkErrorCode | undefined | - | core/errors.ts:89 |
context | readonly | Record<..., ...> | undefined | - | core/errors.ts:90 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | 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
| Parameter | Type |
|---|---|
chainId | number |
options? | ... | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "UnsupportedChainError" | "UnsupportedChainError" | TokenOpsSdkError.name | - | core/errors.ts:118 |
context | readonly | { chainId: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:119 |
context.chainId | public | ... | 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 passchainIdandpublicClient.chainwas undefined.registry-not-deployed— chain is known to the SDK but the product isn't deployed there yet (nullin 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
| Parameter | Type |
|---|---|
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
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "DeploymentAddressUnavailableError" | "DeploymentAddressUnavailableError" | TokenOpsSdkError.name | - | core/errors.ts:148 |
context | readonly | { reason: ...; product?: ...; contract?: ...; chainId?: ...; clientLabel?: ...; overrideName?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:149 |
context.reason | public | ... | 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
| Parameter | Type |
|---|---|
method | string |
options? | ... | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "MissingPublicClientError" | "MissingPublicClientError" | TokenOpsSdkError.name | - | core/errors.ts:200 |
context | readonly | { method: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:201 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
method | string |
options? | ... | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "MissingWalletClientError" | "MissingWalletClientError" | TokenOpsSdkError.name | - | core/errors.ts:213 |
context | readonly | { method: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:214 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
method | string |
options? | ... | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "MissingAccountError" | "MissingAccountError" | TokenOpsSdkError.name | - | core/errors.ts:226 |
context | readonly | { method: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:227 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
method | string |
options? | ... | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "MissingEncryptorError" | "MissingEncryptorError" | TokenOpsSdkError.name | - | core/errors.ts:239 |
context | readonly | { method: ...; hint?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:240 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
hook | string |
clientKind | string |
options? | ... | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "MissingClientError" | "MissingClientError" | TokenOpsSdkError.name | - | core/errors.ts:259 |
context | readonly | { hook: ...; clientKind: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:260 |
context.hook | public | ... | undefined | - | - | core/errors.ts:260 |
context.clientKind | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; argument: ...; reason: ...; value?: ...; cause?: ...; } |
args.method | ... |
args.argument | ... |
args.reason | ... |
args.value? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "InvalidArgumentError" | "InvalidArgumentError" | TokenOpsSdkError.name | - | core/errors.ts:282 |
context | readonly | { method: ...; argument: ...; reason: ...; value?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:283 |
context.method | public | ... | undefined | - | - | core/errors.ts:284 |
context.argument | public | ... | undefined | - | - | core/errors.ts:285 |
context.reason | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; eventName: ...; contractAddress: ...; txHash: ...; hint?: ...; cause?: ...; } |
args.method | ... |
args.eventName | ... |
args.contractAddress | ... |
args.txHash | ... |
args.hint? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "ReceiptEventNotFoundError" | "ReceiptEventNotFoundError" | TokenOpsSdkError.name | - | core/errors.ts:325 |
context | readonly | { method: ...; eventName: ...; contractAddress: ...; txHash: ...; hint?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:326 |
context.method | public | ... | undefined | - | - | core/errors.ts:327 |
context.eventName | public | ... | undefined | - | - | core/errors.ts:328 |
context.contractAddress | public | ... | undefined | - | - | core/errors.ts:329 |
context.txHash | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; eventName: ...; contractAddress: ...; txHash: ...; count: ...; cause?: ...; } |
args.method | ... |
args.eventName | ... |
args.contractAddress | ... |
args.txHash | ... |
args.count | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "ReceiptEventAmbiguousError" | "ReceiptEventAmbiguousError" | TokenOpsSdkError.name | - | core/errors.ts:373 |
context | readonly | { method: ...; eventName: ...; contractAddress: ...; txHash: ...; count: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:374 |
context.method | public | ... | undefined | - | - | core/errors.ts:375 |
context.eventName | public | ... | undefined | - | - | core/errors.ts:376 |
context.contractAddress | public | ... | undefined | - | - | core/errors.ts:377 |
context.txHash | public | ... | undefined | - | - | core/errors.ts:378 |
context.count | public | ... | 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
| Parameter | Type |
|---|---|
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
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "ContractRevertError" | "ContractRevertError" | TokenOpsSdkError.name | - | core/errors.ts:433 |
context | readonly | { method: ...; contractAddress: ...; revertName?: ...; revertSelector?: ...; revertArgs?: ...; revertReason?: ...; rawRevertData?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:434 |
context.method | public | ... | undefined | - | - | core/errors.ts:435 |
context.contractAddress | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "PausedError" | "PausedError" | TokenOpsSdkError.name | - | core/errors.ts:478 |
context | readonly | { method: ...; contractAddress: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:479 |
context.method | public | ... | undefined | - | - | core/errors.ts:479 |
context.contractAddress | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; account?: ...; role?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.account? | ... |
args.role? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "AccessDeniedError" | "AccessDeniedError" | TokenOpsSdkError.name | - | core/errors.ts:497 |
context | readonly | { method: ...; contractAddress: ...; account?: ...; role?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:498 |
context.method | public | ... | undefined | - | - | core/errors.ts:499 |
context.contractAddress | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; feeKind: ...; required?: ...; provided?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.feeKind | ... |
args.required? | ... |
args.provided? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "InsufficientFeeError" | "InsufficientFeeError" | TokenOpsSdkError.name | - | core/errors.ts:536 |
context | readonly | { method: ...; contractAddress: ...; feeKind: ...; required?: ...; provided?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:537 |
context.method | public | ... | undefined | - | - | core/errors.ts:538 |
context.contractAddress | public | ... | undefined | - | - | core/errors.ts:539 |
context.feeKind | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; balanceKind: ...; requested?: ...; available?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.balanceKind | ... |
args.requested? | ... |
args.available? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "InsufficientBalanceError" | "InsufficientBalanceError" | TokenOpsSdkError.name | - | core/errors.ts:578 |
context | readonly | { method: ...; contractAddress: ...; balanceKind: ...; requested?: ...; available?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:579 |
context.method | public | ... | undefined | - | - | core/errors.ts:580 |
context.contractAddress | public | ... | undefined | - | - | core/errors.ts:581 |
context.balanceKind | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; requested: ...; max: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.requested | ... |
args.max | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "BatchTooLargeError" | "BatchTooLargeError" | - | TokenOpsSdkError.name | - | core/errors.ts:623 |
context | readonly | { method: ...; contractAddress: ...; requested: ...; max: ...; } | undefined | - | TokenOpsSdkError.context | - | core/errors.ts:624 |
context.method | public | ... | undefined | - | - | - | core/errors.ts:625 |
context.contractAddress | public | ... | undefined | - | - | - | core/errors.ts:626 |
context.requested | public | ... | undefined | - | - | - | core/errors.ts:627 |
context.max | public | ... | undefined | bigint — 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; feature: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.feature | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "FeatureDisabledError" | "FeatureDisabledError" | TokenOpsSdkError.name | - | core/errors.ts:661 |
context | readonly | { method: ...; contractAddress: ...; feature: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:662 |
context.method | public | ... | undefined | - | - | core/errors.ts:663 |
context.contractAddress | public | ... | undefined | - | - | core/errors.ts:664 |
context.feature | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; asset: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.asset | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "TransferFailedError" | "TransferFailedError" | TokenOpsSdkError.name | - | core/errors.ts:692 |
context | readonly | { method: ...; contractAddress: ...; asset: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:693 |
context.method | public | ... | undefined | - | - | core/errors.ts:694 |
context.contractAddress | public | ... | undefined | - | - | core/errors.ts:695 |
context.asset | public | ... | 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 callsFHE.isSenderAllowed(handle)on-chain and reverts. The tx made it to the EVM but the contract refused.UserDecryptNotAllowedErrorfires 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; handle?: ...; account?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.handle? | ... |
args.account? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "FheHandleNotAllowedError" | "FheHandleNotAllowedError" | TokenOpsSdkError.name | - | core/errors.ts:737 |
context | readonly | { method: ...; contractAddress: ...; handle?: ...; account?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:738 |
context.method | public | ... | undefined | - | - | core/errors.ts:739 |
context.contractAddress | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "AlreadyInitializedError" | "AlreadyInitializedError" | TokenOpsSdkError.name | - | core/errors.ts:769 |
context | readonly | { method: ...; contractAddress: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:770 |
context.method | public | ... | undefined | - | - | core/errors.ts:770 |
context.contractAddress | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "ReentrancyError" | "ReentrancyError" | TokenOpsSdkError.name | - | core/errors.ts:783 |
context | readonly | { method: ...; contractAddress: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:784 |
context.method | public | ... | undefined | - | - | core/errors.ts:784 |
context.contractAddress | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress: ...; cause?: ...; } |
args.method | ... |
args.contractAddress | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "InvalidSignatureError" | "InvalidSignatureError" | TokenOpsSdkError.name | - | core/errors.ts:801 |
context | readonly | { method: ...; contractAddress: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:802 |
context.method | public | ... | undefined | - | - | core/errors.ts:802 |
context.contractAddress | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "WalletRejectedError" | "WalletRejectedError" | TokenOpsSdkError.name | - | core/errors.ts:833 |
context | readonly | { method: ...; contractAddress?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:834 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "WalletChainMismatchError" | "WalletChainMismatchError" | TokenOpsSdkError.name | - | core/errors.ts:850 |
context | readonly | { method: ...; contractAddress?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:851 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress?: ...; statusCode?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress? | ... |
args.statusCode? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "NetworkError" | "NetworkError" | TokenOpsSdkError.name | - | core/errors.ts:868 |
context | readonly | { method: ...; contractAddress?: ...; statusCode?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:869 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "InsufficientGasFundsError" | "InsufficientGasFundsError" | TokenOpsSdkError.name | - | core/errors.ts:896 |
context | readonly | { method: ...; contractAddress?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:897 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; contractAddress?: ...; cause?: ...; } |
args.method | ... |
args.contractAddress? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "UnknownWriteFailureError" | "UnknownWriteFailureError" | TokenOpsSdkError.name | - | core/errors.ts:914 |
context | readonly | { method: ...; contractAddress?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:915 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; operation: ...; cause?: ...; } |
args.method | ... |
args.operation | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "UserRejectedSignatureError" | "UserRejectedSignatureError" | TokenOpsSdkError.name | - | core/errors.ts:937 |
context | readonly | { method: ...; operation: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:938 |
context.method | public | ... | undefined | - | - | core/errors.ts:938 |
context.operation | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; operation: ...; cause?: ...; } |
args.method | ... |
args.operation | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "SigningFailedError" | "SigningFailedError" | TokenOpsSdkError.name | - | core/errors.ts:954 |
context | readonly | { method: ...; operation: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:955 |
context.method | public | ... | undefined | - | - | core/errors.ts:955 |
context.operation | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; operation: ...; statusCode?: ...; cause?: ...; } |
args.method | ... |
args.operation | ... |
args.statusCode? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "RelayerUnreachableError" | "RelayerUnreachableError" | TokenOpsSdkError.name | - | core/errors.ts:971 |
context | readonly | { method: ...; operation: ...; statusCode?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:972 |
context.method | public | ... | undefined | - | - | core/errors.ts:972 |
context.operation | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; operation: ...; cause?: ...; } |
args.method | ... |
args.operation | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "EncryptionFailedError" | "EncryptionFailedError" | TokenOpsSdkError.name | - | core/errors.ts:990 |
context | readonly | { method: ...; operation: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:991 |
context.method | public | ... | undefined | - | - | core/errors.ts:991 |
context.operation | public | ... | 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
| Parameter | Type |
|---|---|
args | { method: ...; operation: ...; cause?: ...; } |
args.method | ... |
args.operation | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "DecryptionFailedError" | "DecryptionFailedError" | TokenOpsSdkError.name | - | core/errors.ts:1004 |
context | readonly | { method: ...; operation: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:1005 |
context.method | public | ... | undefined | - | - | core/errors.ts:1005 |
context.operation | public | ... | 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 noFHE.allow(handle, sender)ever fired for this caller.FheHandleNotAllowedErrorfires when a contract entrypoint callsFHE.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
| Parameter | Type |
|---|---|
args | { method: ...; handle?: ...; userAddress?: ...; cause?: ...; } |
args.method | ... |
args.handle? | ... |
args.userAddress? | ... |
args.cause? | ... |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "UserDecryptNotAllowedError" | "UserDecryptNotAllowedError" | TokenOpsSdkError.name | - | core/errors.ts:1032 |
context | readonly | { method: ...; handle?: ...; userAddress?: ...; } | undefined | TokenOpsSdkError.context | - | core/errors.ts:1033 |
context.method | public | ... | 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
| Parameter | Type |
|---|---|
message | string |
context | Record<..., ...> |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
context | readonly | Record<..., ...> | undefined | - | TokenOpsSdkError.context | core/errors.ts:90 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "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
| Parameter | Type |
|---|---|
message | string |
context | Record<..., ...> |
Returns
Overrides
Properties
| Property | Modifier | Type | Default value | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | TokenOpsSdkErrorCode | undefined | - | TokenOpsSdkError.code | core/errors.ts:89 |
context | readonly | Record<..., ...> | undefined | - | TokenOpsSdkError.context | core/errors.ts:90 |
[TOKENOPS_SDK_ERROR_BRAND] | readonly | true | true | - | TokenOpsSdkError.[TOKENOPS_SDK_ERROR_BRAND] | core/errors.ts:91 |
name | readonly | "TokenOpsContractError" | "TokenOpsContractError" | TokenOpsSdkError.name | - | core/errors.ts:1076 |
Interfaces
TokenOpsSdkErrorInit
Defined in: core/errors.ts:72
Properties
| Property | Type | Defined in |
|---|---|---|
code | TokenOpsSdkErrorCode | core/errors.ts:73 |
cause? | unknown | core/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
| Property | Type | Description | Defined in |
|---|---|---|---|
ready | boolean | true 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
| Parameter | Type |
|---|---|
name | string |
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
| Parameter | Type |
|---|---|
name | string |
fn | () => ... |
Returns
Promise<...>
error()
error(err, context?): void;
Defined in: core/telemetry.ts:16
Report an error. Implementations must not re-throw.
Parameters
| Parameter | Type |
|---|---|
err | Error |
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
| Parameter | Type |
|---|---|
tags | SdkTelemetryTags |
Returns
ClientPair
Defined in: core/types.ts:5
Properties
| Property | Type | Defined 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
| Parameter | Type |
|---|---|
product | P |
contract | C |
chainId | number |
Returns
... | ...
getFheVestingFactoryAddress()
function getFheVestingFactoryAddress(chainId): ... | ...;
Defined in: core/addresses.ts:84
Parameters
| Parameter | Type |
|---|---|
chainId | number |
Returns
... | ...
requireFheVestingFactoryAddress()
function requireFheVestingFactoryAddress(chainId): `0x${(...)}`;
Defined in: core/addresses.ts:88
Parameters
| Parameter | Type |
|---|---|
chainId | number |
Returns
`0x${(...)}`
getFheAirdropFactoryAddress()
function getFheAirdropFactoryAddress(chainId): ... | ...;
Defined in: core/addresses.ts:92
Parameters
| Parameter | Type |
|---|---|
chainId | number |
Returns
... | ...
requireFheAirdropFactoryAddress()
function requireFheAirdropFactoryAddress(chainId): `0x${(...)}`;
Defined in: core/addresses.ts:96
Parameters
| Parameter | Type |
|---|---|
chainId | number |
Returns
`0x${(...)}`
getFheDisperseSingletonAddress()
function getFheDisperseSingletonAddress(chainId): ... | ...;
Defined in: core/addresses.ts:100
Parameters
| Parameter | Type |
|---|---|
chainId | number |
Returns
... | ...
requireFheDisperseSingletonAddress()
function requireFheDisperseSingletonAddress(chainId): `0x${(...)}`;
Defined in: core/addresses.ts:104
Parameters
| Parameter | Type |
|---|---|
chainId | number |
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
| Parameter | Type |
|---|---|
product | P |
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
| Parameter | Type |
|---|---|
product | P |
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
| Parameter | Type |
|---|---|
h | `0x${(...)}` |
Returns
`0x${(...)}`
asExternalInputProof()
function asExternalInputProof(h): `0x${(...)}`;
Defined in: core/brands.ts:110
Mark a raw Hex value as an ExternalInputProof.
Parameters
| Parameter | Type |
|---|---|
h | `0x${(...)}` |
Returns
`0x${(...)}`
asTxHash()
function asTxHash(h): `0x${(...)}`;
Defined in: core/brands.ts:113
Mark a raw Hex value as a TxHash.
Parameters
| Parameter | Type |
|---|---|
h | `0x${(...)}` |
Returns
`0x${(...)}`
asVestingId()
function asVestingId(h): `0x${(...)}`;
Defined in: core/brands.ts:116
Mark a raw Hex value as a VestingId.
Parameters
| Parameter | Type |
|---|---|
h | `0x${(...)}` |
Returns
`0x${(...)}`
asAirdropId()
function asAirdropId(h): `0x${(...)}`;
Defined in: core/brands.ts:119
Mark a raw Hex value as an AirdropId.
Parameters
| Parameter | Type |
|---|---|
h | `0x${(...)}` |
Returns
`0x${(...)}`
asDisperseId()
function asDisperseId(h): `0x${(...)}`;
Defined in: core/brands.ts:122
Mark a raw Hex value as a DisperseId.
Parameters
| Parameter | Type |
|---|---|
h | `0x${(...)}` |
Returns
`0x${(...)}`
asRole()
function asRole(h): `0x${(...)}`;
Defined in: core/brands.ts:125
Mark a raw Hex value as a Role.
Parameters
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
h | `0x${(...)}` |
Returns
`0x${(...)}`
isSupportedChainId()
function isSupportedChainId(chainId): chainId is (...) | (...);
Defined in: core/chains.ts:11
Parameters
| Parameter | Type |
|---|---|
chainId | number |
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
| Parameter | Type |
|---|---|
error | unknown |
Returns
error is TokenOpsSdkError