Skip to content

Errors

WAPI errors follow the JSON-RPC standard and extend the WAPIError class. All errors share a common structure:

typescript
class WAPIError extends Error {
  public readonly type: ERROR_TYPES;   // String identifier (e.g., "TR_INVALID_BALANCE")
  public code: number;                 // Numeric error code (e.g., -19101)
  public data: unknown;                // Additional context, usually includes .description
  public message: string;              // Human-readable error message
}

TIP

In wapi-client, error.message is automatically set to error.data.description for better log readability.

Quick Reference by Error Code

Use Ctrl+F / Cmd+F to search for a specific error code.

CodeTypeCategory
-32700Parse errorJSONRPCError
-32603Internal server errorJSONRPCError
-32602Invalid paramsJSONRPCError
-32601Method not foundJSONRPCError
-32600Invalid requestJSONRPCError
-20001AUTHORIZATION_ERRORAuthError
-20000Authentication errorAuthError
-19610APIKEY_LIMIT_REACHEDConstraintError
-19601APIKEY_NOT_OWNED_CANT_UPDATEConstraintError
-19600APIKEY_DELETED_CANT_UPDATEConstraintError
-19500UNIQUE_CONSTRAINTConstraintError
-19400WALLET_UNIQUE_FOREIGNConstraintError
-19300TOKEN_UNIQUE_FOREIGNConstraintError
-19204TRG_UNIQUE_IDENTIFIERConstraintError
-19203TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAGConstraintError
-19202TRG_DEPOSIT_CANT_RV_WITHOUT_FLAGConstraintError
-19201TRG_CANCELLED_CANT_RVConstraintError
-19200TRG_SINGLE_PENDING_TR_CANT_RVConstraintError
-19117TR_AMOUNT_CONSTRAINTConstraintError
-19116TR_DIFFERENT_WALLETSConstraintError
-19115TR_UNIQUE_IDENTIFIERConstraintError
-19114TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAGConstraintError
-19113TR_DEPOSIT_CANT_RV_WITHOUT_FLAGConstraintError
-19112TR_CANCELLED_CANT_RVConstraintError
-19111TR_TO_WALLET_STATUS_CONSTRAINTConstraintError
-19110TR_FROM_WALLET_STATUS_CONSTRAINTConstraintError
-19109TR_INVALID_CANCELLEDConstraintError
-19108TR_TIMESTAMP_MUST_BE_LATESTConstraintError
-19107TR_TIMESTAMP_IN_PASTConstraintError
-19106TR_TRG_CLOSEDConstraintError
-19105TR_TRG_STATUS_MISMATCHConstraintError
-19104TR_TOKEN_DWONLYConstraintError
-19103TR_TOKEN_DISABLEDConstraintError
-19102TR_AMOUNT_NOT_DIVISIBLEConstraintError
-19101TR_INVALID_BALANCEConstraintError
-19001TOKEN_LIMIT_REACHEDConstraintError
-19000INVALID_LATEST_HASHConstraintError
-15100CONFIG_INVALIDConfigError
-15006REQUEST_TIMEOUTConfigError
-15005SENDING_TIMEOUTConfigError
-15004CONNECTION_TIMEOUTConfigError
-15003TRANSACTION_TIMEOUTConfigError
-15002FLAG_PRODUCTION_LOCKEDConfigError
-15001FLAG_PRODUCTION_ONConfigError
-15000METHOD_DISABLEDConfigError
-12602CANT_EXCEED_CURRENT_TIMEFRAMEInputError
-12601CANT_EXCEED_CURRENT_SCOPESInputError
-12600ADMIN_KEY_REQUIREDInputError
-12500CNT_DEPOSIT_TOKEN_MISMATCHInputError
-12402ONLY_SELECT_ALLOWEDInputError
-12401TRANSACTION_NOT_FOUNDInputError
-12400TRX_NOT_ALLOWEDInputError
-12320TOKEN_MISSING_FOR_BALANCEInputError
-12319ALL_INTERVALS_GROUP_BYInputError
-12318EMPTY_UPDATE_REQUESTInputError
-12317REQUIRED_INPUT_MISSINGInputError
-12316SIGNED_AMOUNT_WITHOUT_WALLETInputError
-12315RUNNING_BALANCE_WITHOUT_WALLETInputError
-12314CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNTInputError
-12313CONFLICTING_OPTIONS_FOR_BALANCEInputError
-12312INPUT_NEEDS_TOKENInputError
-12311RESET_INVALID_CONFIRMATIONInputError
-12310INPUT_NEEDS_IDENTIFIERInputError
-12309BAL_FUTURE_DATETIMEInputError
-12308TOKEN_INVALID_WALLETInputError
-12307DISTRIBUTION_MISSING_TARGETSInputError
-12306CONTRACT_OWNER_NOT_FOUNDInputError
-12305UNCLEAR_AGGREGATORInputError
-12304INVALID_COMPLEX_FILTERInputError
-12303INVALID_MODELInputError
-12302NO_METADATA_ON_MODELInputError
-12301INVALID_FIELD_FOR_MODELInputError
-12300INVALID_FIELD_AGR_COMBInputError
-12200TRG_MISSING_FILTERInputError
-12108TR_UNABLE_TO_RESOLVE_INPUTInputError
-12107TR_FROM_TO_CONFLICTInputError
-12106TR_FROM_WALLET_DEPOSITInputError
-12105TR_TO_WALLET_WITHDRAWALInputError
-12104TR_MISSING_FILTERInputError
-12103TR_EMPTY_UPDATE_REQUESTInputError
-12102TR_CANT_INSERT_TIMESTAMPInputError
-12101TR_CANT_UPDATE_TIMESTAMPInputError
-12100TR_CANT_UPDATE_TO_PENDINGInputError
-12004DATABASE_IMPORT_NOT_FOUNDInputError
-12003DATABASE_IMPORT_PROGRESS_NOT_FOUNDInputError
-12002DATABASE_EXPORT_PROGRESS_NOT_FOUNDInputError
-12001DATABASE_IMPORT_CONFLICTInputError
-12000DATABASE_EXPORT_CONFLICTInputError
-11000HTTP_BODY_SIZEInputError
-10007INVALID_STREAM_START_METHODStreamError
-10006INPUT_STREAM_NOT_ALLOWEDStreamError
-10005INPUT_STREAM_ERRORStreamError
-10004INPUT_STREAM_TIMEOUTStreamError
-10003INVALID_INPUT_STREAM_CHUNKStreamError
-10002INVALID_RESPONSE_STREAM_CHUNKStreamError
-10001INPUT_STREAM_INVALIDStreamError
-10000CONNECTION_LOSTStreamError

JSONRPCError

These are errors defined by the JSONRPC spec and related to the base handling of messages. Some of these have been overridden by other Error classes for convenience

Error code range -32700 to -32600

TypeCodeDescription
PARSE_ERROR-32700Unable to parse JSON input
INVALID_REQUEST-32600JSON input does not match JSONRPC spec
METHOD_NOT_FOUND-32601Requested method not found
INVALID_PARAMS-32602Invalid params provided for method
INTERNAL_SERVER_ERROR-32603Unknown error occurred

AuthError

These are errors related to authentication and authorization.

Error code range -20999 to -20000

TypeCodeDescription
AUTHENTICATION_ERROR-20000Invalid authentication credentials
AUTHORIZATION_ERROR-20001Provided credentials lack access rights

AuthenticationError

This is a subclass of AuthError just for convenience - it indicates problems with the provided credentials.

AuthorizationError

This is a subclass of AuthError just for convenience - it indicates a lack of privileges related to the request.

InputError

These are errors related to incorrect input for methods.

Error code range -14999 to -11000

TypeCodeDescription
HTTP_BODY_SIZE-11000Http body size can't be more than 100MB
DATABASE_EXPORT_CONFLICT-12000Database export already in progress
DATABASE_IMPORT_CONFLICT-12001Database import already in progress
DATABASE_EXPORT_PROGRESS_NOT_FOUND-12002Database backup process not found
DATABASE_IMPORT_PROGRESS_NOT_FOUND-12003Database backup process not found
DATABASE_IMPORT_NOT_FOUND-12004Database import file not found
TR_CANT_UPDATE_TO_PENDING-12100Transfer status can only move from 'pending'->'finished'/'cancelled
TR_CANT_UPDATE_TIMESTAMP-12101Cant update transfer.updated_at - allow_timestamps flag is set to off
TR_CANT_INSERT_TIMESTAMP-12102Cant insert transfer.created_at - allow_timestamps flag is set to off
TR_EMPTY_UPDATE_REQUEST-12103Update request for transfer is empty
TR_MISSING_FILTER-12104Transactions can't reversed or updated without valid filter
TR_TO_WALLET_WITHDRAWAL-12105To wallet can't be specified when doing a withdrawal
TR_FROM_WALLET_DEPOSIT-12106From wallet can't be specified when doing a deposit
TR_FROM_TO_CONFLICT-12107from_wallet and to_wallet can not be the same
TR_UNABLE_TO_RESOLVE_INPUT-12108Unable to resolve references to foreign keys
TRG_MISSING_FILTER-12200Transaction groups can't reversed or updated without valid filter
INVALID_FIELD_AGR_COMB-12300Provided aggregation field was not found on Model
INVALID_FIELD_FOR_MODEL-12301Provided field was not found on Model
NO_METADATA_ON_MODEL-12302Can't use metadata field for grouping as current Model does not have metadata
INVALID_MODEL-12303Provided Model name is invalid
INVALID_COMPLEX_FILTER-12304The provided complex filter does not pass validation
UNCLEAR_AGGREGATOR-12305Invalid aggregator function provided
CONTRACT_OWNER_NOT_FOUND-12306Unable to find Wallet specified as Contract token owner
DISTRIBUTION_MISSING_TARGETS-12307Unable to resolve all targets (Wallets, Tokens) for distribution request
TOKEN_INVALID_WALLET-12308Invalid belongs_to wallet provided
BAL_FUTURE_DATETIME-12309Balance datetime can't be in the future
INPUT_NEEDS_IDENTIFIER-12310Missing identifier - automatically calculated identifiers conflict on identical input for 30s To make an identical transfer during that window you need to provide a unique identifier
RESET_INVALID_CONFIRMATION-12311Provided reset confirmation code is invalid
INPUT_NEEDS_TOKEN-12312token must be specified on input or in client config
CONFLICTING_OPTIONS_FOR_BALANCE-12313return_running_balance and return_running_balance_for can't be specified together
CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT-12314return_signed_amount and return_signed_amount_for_wallet can't be specified together
RUNNING_BALANCE_WITHOUT_WALLET-12315return_running_balance option requires Wallet filter to be specified
SIGNED_AMOUNT_WITHOUT_WALLET-12316return_signed_amount option requires Wallet filter to be specified
REQUIRED_INPUT_MISSING-12317input does not specify required keys
EMPTY_UPDATE_REQUEST-12318Need to modify at least one field
ALL_INTERVALS_GROUP_BY-12319return_all_intervals requires at least one groupBy
TOKEN_MISSING_FOR_BALANCE-12320Need to specify include_balance_for_token to access balance fields
TRX_NOT_ALLOWED-12400This method can not run in a transaction
TRANSACTION_NOT_FOUND-12401Transaction not found
ONLY_SELECT_ALLOWED-12402Only select queries are allowed
CNT_DEPOSIT_TOKEN_MISMATCH-12500Unable to find tokens specified in deposits
ADMIN_KEY_REQUIRED-12600Admin key can only be created by using an admin key
CANT_EXCEED_CURRENT_SCOPES-12601Scopes for new key must be less or equal to scopes on current key
CANT_EXCEED_CURRENT_TIMEFRAME-12602ValidUntil for new key is limited by validUntil of current key

ValidationError

A subclass of InputError that is raised when user input does not match the JSON Schema of the method. Will provide validation errors in .data property.

ConstraintError

These are errors from method execution conflicting with one or more constraints of the system - such as negative balance or chronological order etc.

Error code range -19999 to -19000

TypeCodeDescription
INVALID_LATEST_HASH-19000Provided latest_control_hash does not match calculation
TOKEN_LIMIT_REACHED-19001Unable to issue more tokens as Token.limit has been reached
TR_INVALID_BALANCE-19101Transfer would result in invalid balance for a Wallet
TR_AMOUNT_NOT_DIVISIBLE-19102Transfer amount is not divisible by specified Token.divisor
TR_TOKEN_DISABLED-19103Token status is set to 'disabled' - no new transfers allowed
TR_TOKEN_DWONLY-19104Token status is set to 'dw-only' - only deposits or withdrawals allowed
TR_TRG_STATUS_MISMATCH-19105Transfers in transfer_group must match transfer_group.transfer_status
TR_TRG_CLOSED-19106Cant add Transfer to group. TransferGroup is closed
TR_TIMESTAMP_IN_PAST-19107Transfer.created_at must not be in the past
TR_TIMESTAMP_MUST_BE_LATEST-19108Transfer.created_at must be the latest
TR_INVALID_CANCELLED-19109Cant create cancelled transfer
TR_FROM_WALLET_STATUS_CONSTRAINT-19110From wallet.status doesn't allow this type of transfers
TR_TO_WALLET_STATUS_CONSTRAINT-19111To wallet.status doesn't allow this type of transfers
TR_CANCELLED_CANT_RV-19112Cancelled Transfer can not be reversed
TR_DEPOSIT_CANT_RV_WITHOUT_FLAG-19113Deposits are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'deposit' requires reverse_deposit option to be true.
TR_WITHDRAWAL_CANT_RV_WITHOUT_FLAG-19114Withdrawals are expected connection points with outside systems, thus extra validation is required. Reversing a Transfer.type = 'withdrawal' requires reverse_withdrawal option to be true.
TR_UNIQUE_IDENTIFIER-19115The identifier for Transfer object must be unique
TR_DIFFERENT_WALLETS-19116To and from wallets have to be different
TR_AMOUNT_CONSTRAINT-19117The transfer amount is outside of allowed bounds
TRG_SINGLE_PENDING_TR_CANT_RV-19200Transfer is part of TransferGroup and can not be reversed separately
TRG_CANCELLED_CANT_RV-19201Cancelled TransferGroup can not be reversed
TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG-19202TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true
TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG-19203TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true
TRG_UNIQUE_IDENTIFIER-19204The identifier for TransferGroup object must be unique
TOKEN_UNIQUE_FOREIGN-19300The foreign for Token object must be unique
WALLET_UNIQUE_FOREIGN-19400The foreign for Wallet object must be unique
UNIQUE_CONSTRAINT-19500Insert violates unique constraint
APIKEY_DELETED_CANT_UPDATE-19600Cant update deleted apikeys
APIKEY_NOT_OWNED_CANT_UPDATE-19601Cant update apikeys you dont own
APIKEY_LIMIT_REACHED-19610Cant create any more api keys, limit reached

StreamError

These are errors related to streaming input/output and the chunks not being in expected states.

Error code range -10999 to -10000

TypeCodeDescription
CONNECTION_LOST-10000Lost connection to server
INPUT_STREAM_INVALID-10001Invalid input stream identifier provided
INVALID_RESPONSE_STREAM_CHUNK-10002Received multiple chunks for non-array property
INVALID_INPUT_STREAM_CHUNK-10003Invalid chunk sent to input stream
INPUT_STREAM_TIMEOUT-10004Input stream failed to finish in allotted time
INPUT_STREAM_ERROR-10005Unknown error in input stream
INPUT_STREAM_NOT_ALLOWED-10006Stream input not allowed for method
INVALID_STREAM_START_METHOD-10007Stream start message invalid, method missing

ConfigError

These are errors that originate from the WAPI instance configuration conflicting with the users request.

Error code range -16000 to -15000

TypeCodeDescription
METHOD_DISABLED-15000Method is disabled
FLAG_PRODUCTION_ON-15001Production flag is "on" - this method is disabled
FLAG_PRODUCTION_LOCKED-15002Cant update production flag to false in this server
TRANSACTION_TIMEOUT-15003Database transaction timed out
CONNECTION_TIMEOUT-15004Unable to get initial response in specified time
SENDING_TIMEOUT-15005Unable to get ack from server in specified time
REQUEST_TIMEOUT-15006Unable to get a response from server in specified time
CONFIG_INVALID-15100Provided configuration is invalid

UnknownError

This is a special error which is thrown when the cause of the error is unexpected.

InternalError

This is a special error when something blows up in the processing of a request. Akin to HTTP 500.