Api reference
Add Error ABI
Add custom error ABIs to the system.
Add custom error ABIs to the system.
Endpoint
POST /addErrorDescription
Adds custom error ABIs to the system for use in error decoding.
Request Body
{
"errorABI": {
"type": "error",
"name": "ECDSAInvalidSignatureS",
"inputs": [
{
"name": "s",
"type": "bytes32",
"internalType": "bytes32"
}
]
}
}Response
{
"status": 200,
"errorDef": "error ECDSAInvalidSignatureS(bytes32 indexed s)"
}Response Fields
status(integer): HTTP status code (200 for success)errorDef(string): The canonical error definition string
Example Request
curl -X POST https://api.msa.omnes.tech/addError \
-H "Content-Type: application/json" \
-d '{
"errorABI": {
"type": "error",
"name": "ECDSAInvalidSignatureS",
"inputs": [
{
"name": "s",
"type": "bytes32",
"internalType": "bytes32"
}
]
}
}'const response = await fetch('https://api.msa.omnes.tech/addError', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
errorABI: {
type: 'error',
name: 'ECDSAInvalidSignatureS',
inputs: [
{
name: 's',
type: 'bytes32',
internalType: 'bytes32',
},
],
},
}),
});
const result = await response.json();
console.log('Error registered:', result.errorDef);import requests
url = "https://api.msa.omnes.tech/addError"
payload = {
"errorABI": {
"type": "error",
"name": "ECDSAInvalidSignatureS",
"inputs": [
{
"name": "s",
"type": "bytes32",
"internalType": "bytes32"
}
]
}
}
response = requests.post(url, json=payload)
result = response.json()
print(f"Error registered: {result['errorDef']}")Use Cases
- Custom errors: Register errors from custom smart contracts
- Error decoding: Enable proper decoding of custom contract errors
- Debugging: Better error messages for debugging failed transactions
- Integration: Support integration with any EVM-compatible contract
Best Practices
- Register before use: Add error ABIs before transactions that might use them
- Use correct format: Ensure ABI format matches Solidity error definition
- Handle duplicates: Check if error already exists before adding
- Validate ABI: Ensure error ABI is valid before registration
Related Endpoints
- Get Receipt - Get receipts with decoded error messages
- Add Event ABI - Register event ABIs
💡 Tip: Register custom error ABIs to get better error messages when transactions fail. This helps with debugging and provides clearer error information.