Skip to main content
The Chainworks API uses consistent error responses across all endpoints.

Error Response Format

When a request fails, you receive an error response:
The partialResult field may contain useful information even when the request fails, such as partial token data or pool information.

Both transports share this envelope

The success and error envelope is identical on Socket.IO and HTTP. A successful response always has success: true and a result field; responses may also include optional rateLimit and serverTimings objects. Over Socket.IO, the response arrives on the event you emitted. Over HTTP, the same JSON is returned in the response body, and the HTTP status code reflects the outcome: Even on a 400 or 500, the body still follows the error envelope above, so you can read error.code and error.message the same way on both transports.

Common Error Codes

Connection Errors

Request Errors

Trading Errors

Transaction Errors


Handling Errors

TypeScript

Python


Retry Strategy

For transient errors, implement exponential backoff:

Debugging Tips

  1. Check the console - Log full responses to see error details
  2. Use the playground - Test requests interactively at /playground
  3. Validate addresses - Ensure addresses are correct for the target chain
  4. Check token contract - Some tokens have transfer restrictions
  5. Monitor connection - Ensure WebSocket connection is stable

Getting Help

If you encounter persistent errors:
  1. Note the error code and message
  2. Capture the full request parameters
  3. Contact us at info@chainworks.co