Appearance
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.
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
| Type | Code | Description |
|---|---|---|
| PARSE_ERROR | -32700 | Unable to parse JSON input |
| INVALID_REQUEST | -32600 | JSON input does not match JSONRPC spec |
| METHOD_NOT_FOUND | -32601 | Requested method not found |
| INVALID_PARAMS | -32602 | Invalid params provided for method |
| INTERNAL_SERVER_ERROR | -32603 | Unknown error occurred |
AuthError
These are errors related to authentication and authorization.
Error code range -20999 to -20000
| Type | Code | Description |
|---|---|---|
| AUTHENTICATION_ERROR | -20000 | Invalid authentication credentials |
| AUTHORIZATION_ERROR | -20001 | Provided 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
| Type | Code | Description |
|---|---|---|
| HTTP_BODY_SIZE | -11000 | Http body size can't be more than 100MB |
| DATABASE_EXPORT_CONFLICT | -12000 | Database export already in progress |
| DATABASE_IMPORT_CONFLICT | -12001 | Database import already in progress |
| DATABASE_EXPORT_PROGRESS_NOT_FOUND | -12002 | Database backup process not found |
| DATABASE_IMPORT_PROGRESS_NOT_FOUND | -12003 | Database backup process not found |
| DATABASE_IMPORT_NOT_FOUND | -12004 | Database import file not found |
| TR_CANT_UPDATE_TO_PENDING | -12100 | Transfer status can only move from 'pending'->'finished'/'cancelled |
| TR_CANT_UPDATE_TIMESTAMP | -12101 | Cant update transfer.updated_at - allow_timestamps flag is set to off |
| TR_CANT_INSERT_TIMESTAMP | -12102 | Cant insert transfer.created_at - allow_timestamps flag is set to off |
| TR_EMPTY_UPDATE_REQUEST | -12103 | Update request for transfer is empty |
| TR_MISSING_FILTER | -12104 | Transactions can't reversed or updated without valid filter |
| TR_TO_WALLET_WITHDRAWAL | -12105 | To wallet can't be specified when doing a withdrawal |
| TR_FROM_WALLET_DEPOSIT | -12106 | From wallet can't be specified when doing a deposit |
| TR_FROM_TO_CONFLICT | -12107 | from_wallet and to_wallet can not be the same |
| TR_UNABLE_TO_RESOLVE_INPUT | -12108 | Unable to resolve references to foreign keys |
| TRG_MISSING_FILTER | -12200 | Transaction groups can't reversed or updated without valid filter |
| INVALID_FIELD_AGR_COMB | -12300 | Provided aggregation field was not found on Model |
| INVALID_FIELD_FOR_MODEL | -12301 | Provided field was not found on Model |
| NO_METADATA_ON_MODEL | -12302 | Can't use metadata field for grouping as current Model does not have metadata |
| INVALID_MODEL | -12303 | Provided Model name is invalid |
| INVALID_COMPLEX_FILTER | -12304 | The provided complex filter does not pass validation |
| UNCLEAR_AGGREGATOR | -12305 | Invalid aggregator function provided |
| CONTRACT_OWNER_NOT_FOUND | -12306 | Unable to find Wallet specified as Contract token owner |
| DISTRIBUTION_MISSING_TARGETS | -12307 | Unable to resolve all targets (Wallets, Tokens) for distribution request |
| TOKEN_INVALID_WALLET | -12308 | Invalid belongs_to wallet provided |
| BAL_FUTURE_DATETIME | -12309 | Balance datetime can't be in the future |
| INPUT_NEEDS_IDENTIFIER | -12310 | Missing 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 | -12311 | Provided reset confirmation code is invalid |
| INPUT_NEEDS_TOKEN | -12312 | token must be specified on input or in client config |
| CONFLICTING_OPTIONS_FOR_BALANCE | -12313 | return_running_balance and return_running_balance_for can't be specified together |
| CONFLICTING_OPTIONS_FOR_SIGNED_AMOUNT | -12314 | return_signed_amount and return_signed_amount_for_wallet can't be specified together |
| RUNNING_BALANCE_WITHOUT_WALLET | -12315 | return_running_balance option requires Wallet filter to be specified |
| SIGNED_AMOUNT_WITHOUT_WALLET | -12316 | return_signed_amount option requires Wallet filter to be specified |
| REQUIRED_INPUT_MISSING | -12317 | input does not specify required keys |
| EMPTY_UPDATE_REQUEST | -12318 | Need to modify at least one field |
| ALL_INTERVALS_GROUP_BY | -12319 | return_all_intervals requires at least one groupBy |
| TOKEN_MISSING_FOR_BALANCE | -12320 | Need to specify include_balance_for_token to access balance fields |
| TRX_NOT_ALLOWED | -12400 | This method can not run in a transaction |
| TRANSACTION_NOT_FOUND | -12401 | Transaction not found |
| ONLY_SELECT_ALLOWED | -12402 | Only select queries are allowed |
| CNT_DEPOSIT_TOKEN_MISMATCH | -12500 | Unable to find tokens specified in deposits |
| ADMIN_KEY_REQUIRED | -12600 | Admin key can only be created by using an admin key |
| CANT_EXCEED_CURRENT_SCOPES | -12601 | Scopes for new key must be less or equal to scopes on current key |
| CANT_EXCEED_CURRENT_TIMEFRAME | -12602 | ValidUntil 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
| Type | Code | Description |
|---|---|---|
| INVALID_LATEST_HASH | -19000 | Provided latest_control_hash does not match calculation |
| TOKEN_LIMIT_REACHED | -19001 | Unable to issue more tokens as Token.limit has been reached |
| TR_INVALID_BALANCE | -19101 | Transfer would result in invalid balance for a Wallet |
| TR_AMOUNT_NOT_DIVISIBLE | -19102 | Transfer amount is not divisible by specified Token.divisor |
| TR_TOKEN_DISABLED | -19103 | Token status is set to 'disabled' - no new transfers allowed |
| TR_TOKEN_DWONLY | -19104 | Token status is set to 'dw-only' - only deposits or withdrawals allowed |
| TR_TRG_STATUS_MISMATCH | -19105 | Transfers in transfer_group must match transfer_group.transfer_status |
| TR_TRG_CLOSED | -19106 | Cant add Transfer to group. TransferGroup is closed |
| TR_TIMESTAMP_IN_PAST | -19107 | Transfer.created_at must not be in the past |
| TR_TIMESTAMP_MUST_BE_LATEST | -19108 | Transfer.created_at must be the latest |
| TR_INVALID_CANCELLED | -19109 | Cant create cancelled transfer |
| TR_FROM_WALLET_STATUS_CONSTRAINT | -19110 | From wallet.status doesn't allow this type of transfers |
| TR_TO_WALLET_STATUS_CONSTRAINT | -19111 | To wallet.status doesn't allow this type of transfers |
| TR_CANCELLED_CANT_RV | -19112 | Cancelled Transfer can not be reversed |
| TR_DEPOSIT_CANT_RV_WITHOUT_FLAG | -19113 | Deposits 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 | -19114 | Withdrawals 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 | -19115 | The identifier for Transfer object must be unique |
| TR_DIFFERENT_WALLETS | -19116 | To and from wallets have to be different |
| TR_AMOUNT_CONSTRAINT | -19117 | The transfer amount is outside of allowed bounds |
| TRG_SINGLE_PENDING_TR_CANT_RV | -19200 | Transfer is part of TransferGroup and can not be reversed separately |
| TRG_CANCELLED_CANT_RV | -19201 | Cancelled TransferGroup can not be reversed |
| TRG_DEPOSIT_CANT_RV_WITHOUT_FLAG | -19202 | TransferGroup includes Transfer.type = 'deposit', thus for extra validation the reverse_deposit option must be set true |
| TRG_WITHDRAWAL_CANT_RV_WITHOUT_FLAG | -19203 | TransferGroup includes Transfer.type = 'withdrawal', thus for extra validation the reverse_withdrawal option must be set true |
| TRG_UNIQUE_IDENTIFIER | -19204 | The identifier for TransferGroup object must be unique |
| TOKEN_UNIQUE_FOREIGN | -19300 | The foreign for Token object must be unique |
| WALLET_UNIQUE_FOREIGN | -19400 | The foreign for Wallet object must be unique |
| UNIQUE_CONSTRAINT | -19500 | Insert violates unique constraint |
| APIKEY_DELETED_CANT_UPDATE | -19600 | Cant update deleted apikeys |
| APIKEY_NOT_OWNED_CANT_UPDATE | -19601 | Cant update apikeys you dont own |
| APIKEY_LIMIT_REACHED | -19610 | Cant 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
| Type | Code | Description |
|---|---|---|
| CONNECTION_LOST | -10000 | Lost connection to server |
| INPUT_STREAM_INVALID | -10001 | Invalid input stream identifier provided |
| INVALID_RESPONSE_STREAM_CHUNK | -10002 | Received multiple chunks for non-array property |
| INVALID_INPUT_STREAM_CHUNK | -10003 | Invalid chunk sent to input stream |
| INPUT_STREAM_TIMEOUT | -10004 | Input stream failed to finish in allotted time |
| INPUT_STREAM_ERROR | -10005 | Unknown error in input stream |
| INPUT_STREAM_NOT_ALLOWED | -10006 | Stream input not allowed for method |
| INVALID_STREAM_START_METHOD | -10007 | Stream 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
| Type | Code | Description |
|---|---|---|
| METHOD_DISABLED | -15000 | Method is disabled |
| FLAG_PRODUCTION_ON | -15001 | Production flag is "on" - this method is disabled |
| FLAG_PRODUCTION_LOCKED | -15002 | Cant update production flag to false in this server |
| TRANSACTION_TIMEOUT | -15003 | Database transaction timed out |
| CONNECTION_TIMEOUT | -15004 | Unable to get initial response in specified time |
| SENDING_TIMEOUT | -15005 | Unable to get ack from server in specified time |
| REQUEST_TIMEOUT | -15006 | Unable to get a response from server in specified time |
| CONFIG_INVALID | -15100 | Provided 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.