# DeFi Shield Diff Impact Analyzer

> DeFi Shield Diff Impact Analyzer is a paid API for AI agents from defi-shield-hazel.vercel.app, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-16).

Performs line-by-line diff analysis between two code versions to detect breaking changes, export/signature/type modifications, and impact severity.

## Facts

- Endpoint: POST https://defi-shield-hazel.vercel.app/api/dev/diff-impact
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-shield-hazel-vercel-app-44793aa3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cRiHiQ4uKkP4NCmouVNrf

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability defi-shield-hazel-vercel-app-44793aa3 -d '<json body>'
```

Example prompt: Can you run a diff impact analysis on these two versions of my code and tell me if there are any breaking changes, signature changes, or modified exports — here's the before and after content?

## When to prefer this

Use this endpoint when you need structured, programmatic detection of breaking changes between two code versions — especially when tracking export stability, function signature changes, or type modifications. Prefer this over generic diff tools when you need semantic impact classification, not just textual differences.

## Known failure modes

- Empty or identical before/after inputs return no changes detected
- Malformed or non-parseable code may result in parse errors or incomplete diff
- Very large files may exceed payload limits
- Missing required before or after code fields return 400 validation errors
- Non-code text inputs may produce unreliable signature/type tracking

## Output

Returns a structured report with a line-by-line diff, a list of detected breaking changes, modified export names, changed function signatures, type changes, and an overall impact assessment indicating severity and affected surface area.

## Example request

```json
{
 "input": {
  "body": {
   "language": "typescript",
   "new_code": "export function calculateFee(amount: number, taxRate: number = 0.01): number {\n  return amount * taxRate;\n}\n\nexport interface Config {\n  apiKey: string;\n  timeout: number;\n  retryCount?: number;\n}",
   "old_code": "export function calculateFee(amount: number): number {\n  return amount * 0.01;\n}\n\nexport interface Config {\n  apiKey: string;\n  timeout: number;\n}"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "properties": {
      "language": {
       "type": "string",
       "description": "Programming language (default: typescript)"
      },
      "new_code": {
       "type": "string",
       "description": "Modified code"
      },
      "old_code": {
       "type": "string",
       "description": "Original code"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-shield-hazel-vercel-app-44793aa3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-shield-hazel.vercel.app](https://www.zero.xyz/host/defi-shield-hazel.vercel.app/llms.txt)
