bcnmy / userop-debugger-backend

MIT License
7 stars 2 forks source link

Adding error decoder services #19

Closed tomarsachin2271 closed 10 months ago

tomarsachin2271 commented 10 months ago

PR Description

This PR introduces several enhancements to the debugger API:

Enhanced Response Format

With these updates, the API response now includes a section for decoded errors. An example of how these decoded errors appear in the response is provided below:


{
    "jsonrpc": "2.0",
    "id": 2,
    "result": {
        "originalError": {
            "code": -325432,
            "message": "AA21: User didn't pay prefund"
        },
        "decodedErrors": [
            {
                "message": "Smart Account is supposed to pay for this userOp but it does not have enough native balance to pay for the gas. Max 0.082724540135468525 Matic is required to pay for the gas.",
                "errorSource": "SMART_ACCOUNT"
            }
        ],
        // ... other fields ...
    }
}