Registering Errors on Smart Contract Calls
Since we cannot determine if a gas estimation fails on the integrator's side—particularly when called from the integrator's smart contract—we provide an endpoint to register errors that occur during on-chain calls. This information is highly valuable to us for maintaining service quality, allowing us to analyze and review failed trades (e.g., tokens involved, DEX used, and other relevant details).
Endpoint: POST /api/register-error
This endpoint allows clients to register errors that occur during smart contract calls when conducting a trade. The provided information can include various transaction-related details, though all fields are optional.
Request
Method:
POST
Content-Type:
application/json
Request Body Parameters
input_data
string
(Optional) The raw input data of the transaction.
value
string
(Optional) The value of the transaction in wei (smallest unit of the native token).
sender
string
(Optional) The address of the sender initiating the transaction (0x...
).
to_address
string
(Optional) The address to which the transaction is sent (0x...
).
api_key
string
(Optional) The API key for authentication and tracking.
chain_id
number
(Optional) The ID of the blockchain network where the transaction was conducted.
block_number
number
(Optional) The block number where the transaction was attempted.
transaction_hash
string
(Optional) The hash of the transaction (0x...
).
Response
Successful Response
HTTP Status:
200 OK
Response Body:
Error Response
HTTP Status:
400 Bad Request
Response Body (example):
Example Request
Request Body
Response
Notes
Optional Fields: All fields in the request are optional; the backend should handle missing fields gracefully.
Error Logging: This endpoint is used to collect transaction details when an error occurs, providing valuable insights for debugging and analytics.
Authentication: If the
api-key
is required for security, ensure it is validated against your system.Chain-Specific Handling: The
chainId
should correspond to the appropriate blockchain network (e.g., Ethereum Mainnet =1
).
This documentation entry provides clear guidelines for developers to use the POST /api/register-error
endpoint effectively.
Last updated