{
  "openapi": "3.1.1",
  "info": {
    "title": "Account Abstraction Explorer API",
    "version": "1.0.0",
    "summary": "Decode ERC-4337 bundles: UserOperations, paymasters, gas per op, deployed smart accounts.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://accountabstractionexplorer.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Decode ERC-4337 bundles: UserOperations, paymasters, gas per op, deployed smart accounts.",
        "description": "Decodes ERC-4337 EntryPoint v0.6/v0.7/v0.8 events in a bundle transaction — every UserOperation with its sender, paymaster sponsorship, success, gas cost and revert reason, plus newly deployed accounts and the bundler's margin. For a smart-account address it shows the code type, EIP-7702 delegation, EntryPoint nonces and deposits and the proxy implementation.\n\nMethodology:\n- EntryPoint events are matched by topic0 computed locally from the signatures UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed), UserOperationRevertReason, PostOpRevertReason and AccountDeployed.\n- Known EntryPoints: v0.6 0x5FF137D4…2789, v0.7 0x00000000…a032 and v0.8 0x4337084D…f108 (deployed at the same address on every chain; checked with eth_getCode). Events from any other emitter are decoded but flagged.\n- Bundler = the transaction sender (tx.from). Bundler margin = sum of actualGasCost charged to the UserOperations minus the transaction fee actually paid; it assumes the handleOps beneficiary is the bundler.\n- Nonce = 192-bit key << 64 | 64-bit sequence (ERC-4337 semi-abstracted nonce). Revert data is decoded as Error(string)/Panic(uint256) or shown as a custom-error selector.\n- Account mode: eth_getCode (0xef0100‖address = EIP-7702 delegation), eth_getBalance, EntryPoint.getNonce(account, 0) and balanceOf(account) (deposit) on each EntryPoint, and the Contract Upgrade Explorer for the proxy implementation.",
        "tags": [
          "web3"
        ],
        "x-mcp-tool": "account_abstraction_explorer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountAbstractionExplorerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Two UserOperations in one bundle (offline)",
                  "value": {
                    "mode": "pasted",
                    "chain": "base",
                    "receipt": "{\"transactionHash\":\"0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1\",\"from\":\"0x5555555555555555555555555555555555555555\",\"status\":\"0x1\",\"gasUsed\":\"0x3d090\",\"effectiveGasPrice\":\"0x1dcd6500\",\"logs\":[{\"address\":\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\",\"topics\":[\"0xd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d\",\"0xb1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1\",\"0x0000000000000000000000001111111111111111111111111111111111111111\"],\"data\":\"0x00000000000000000000000044444444444444444444444444444444444444440000000000000000000000003333333333333333333333333333333333333333\",\"logIndex\":\"0x0\"},{\"address\":\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\",\"topics\":[\"0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f\",\"0xb1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1\",\"0x0000000000000000000000001111111111111111111111111111111111111111\",\"0x0000000000000000000000003333333333333333333333333333333333333333\"],\"data\":\"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000249f0\",\"logIndex\":\"0x1\"},{\"address\":\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\",\"topics\":[\"0x1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201\",\"0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2\",\"0x0000000000000000000000002222222222222222222222222222222222222222\"],\"data\":\"0x00000000000000000000000000000000000000000000000100000000000000070000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006408c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011696e73756666696369656e742066756e6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"logIndex\":\"0x2\"},{\"address\":\"0x0000000071727De22E5E9d8BAf0edAc6f37da032\",\"topics\":[\"0x49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f\",\"0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2\",\"0x0000000000000000000000002222222222222222222222222222222222222222\",\"0x0000000000000000000000000000000000000000000000000000000000000000\"],\"data\":\"0x0000000000000000000000000000000000000000000000010000000000000007000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002d79883d20000000000000000000000000000000000000000000000000000000000000011170\",\"logIndex\":\"0x3\"}]}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountAbstractionExplorerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AccountAbstractionExplorerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "title": "What do you have?",
            "type": "string",
            "enum": [
              "tx",
              "account",
              "pasted"
            ],
            "default": "tx"
          },
          "chain": {
            "title": "Chain",
            "type": "string",
            "enum": [
              "ethereum",
              "base",
              "arbitrum",
              "optimism",
              "polygon",
              "avalanche",
              "bsc"
            ],
            "default": "ethereum"
          },
          "txHash": {
            "title": "Transaction hash",
            "type": "string",
            "maxLength": 66
          },
          "address": {
            "title": "Smart account address",
            "type": "string",
            "maxLength": 42
          },
          "receipt": {
            "title": "Receipt JSON",
            "description": "A transaction receipt ({from, gasUsed, effectiveGasPrice, logs:[…]}) or just the logs array.",
            "type": "string",
            "maxLength": 500000
          }
        },
        "required": []
      },
      "AccountAbstractionExplorerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "mode",
              "chain",
              "transaction",
              "userOps",
              "totals",
              "account",
              "entryPoints"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "tx",
                  "account",
                  "pasted"
                ]
              },
              "chain": {
                "type": "string"
              },
              "transaction": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "hash",
                  "bundler",
                  "status",
                  "gasUsed",
                  "feeWei",
                  "fee"
                ],
                "properties": {
                  "hash": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "bundler": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "gasUsed": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "feeWei": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "fee": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "userOps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "logIndex",
                    "userOpHash",
                    "sender",
                    "paymaster",
                    "sponsored",
                    "nonce",
                    "nonceKey",
                    "nonceSequence",
                    "success",
                    "actualGasCostWei",
                    "actualGasCost",
                    "actualGasUsed",
                    "entryPoint",
                    "entryPointVersion",
                    "revertReason",
                    "postOpRevertReason",
                    "deployed"
                  ],
                  "properties": {
                    "logIndex": {
                      "type": "integer"
                    },
                    "userOpHash": {
                      "type": "string"
                    },
                    "sender": {
                      "type": "string"
                    },
                    "paymaster": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sponsored": {
                      "type": "boolean"
                    },
                    "nonce": {
                      "type": "string"
                    },
                    "nonceKey": {
                      "type": "string"
                    },
                    "nonceSequence": {
                      "type": "string"
                    },
                    "success": {
                      "type": "boolean"
                    },
                    "actualGasCostWei": {
                      "type": "string"
                    },
                    "actualGasCost": {
                      "type": "string"
                    },
                    "actualGasUsed": {
                      "type": "string"
                    },
                    "entryPoint": {
                      "type": "string"
                    },
                    "entryPointVersion": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revertReason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "postOpRevertReason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deployed": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": false,
                      "required": [
                        "factory",
                        "paymaster"
                      ],
                      "properties": {
                        "factory": {
                          "type": "string"
                        },
                        "paymaster": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              "totals": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "ops",
                  "succeeded",
                  "failed",
                  "sponsored",
                  "accountsDeployed",
                  "actualGasCostWei",
                  "bundlerMarginWei",
                  "paymasters"
                ],
                "properties": {
                  "ops": {
                    "type": "integer"
                  },
                  "succeeded": {
                    "type": "integer"
                  },
                  "failed": {
                    "type": "integer"
                  },
                  "sponsored": {
                    "type": "integer"
                  },
                  "accountsDeployed": {
                    "type": "integer"
                  },
                  "actualGasCostWei": {
                    "type": "string"
                  },
                  "bundlerMarginWei": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "paymasters": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "account": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "address",
                  "kind",
                  "codeSize",
                  "eip7702Delegate",
                  "balanceWei",
                  "entryPoints",
                  "implementation",
                  "proxyType"
                ],
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "eoa-or-undeployed",
                      "contract",
                      "eip7702-delegated"
                    ]
                  },
                  "codeSize": {
                    "type": "integer"
                  },
                  "eip7702Delegate": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "balanceWei": {
                    "type": "string"
                  },
                  "entryPoints": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "version",
                        "address",
                        "nonceKey0",
                        "depositWei"
                      ],
                      "properties": {
                        "version": {
                          "type": "string"
                        },
                        "address": {
                          "type": "string"
                        },
                        "nonceKey0": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "depositWei": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  },
                  "implementation": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "proxyType": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "entryPoints": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "version",
                    "address"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}