{
  "openapi": "3.0.3",
  "info": {
    "title": "Robinhood Swap Safety",
    "version": "1.1.0",
    "description": "Partial-coverage risk inspector. No signing. Public ALLOW unavailable: no operator-reviewed deployment profile enabled. A separate exact legacy single-v4 ERC20 profile is implemented, not arbitrary-route validation."
  },
  "servers": [
    {
      "url": "https://couchdicks.org/robinhood/swap-safety"
    }
  ],
  "paths": {
    "/api/v1/check/pool": {
      "post": {
        "summary": "Read-only pool inspection; not trading approval",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "poolId"
                ],
                "properties": {
                  "poolId": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result, not execution permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Evidence"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited; honor Retry-After"
          },
          "503": {
            "description": "Unavailable; fail closed"
          }
        }
      }
    },
    "/api/v1/check/pair": {
      "post": {
        "summary": "Read-only pair inspection; not trading approval",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tokenA",
                  "tokenB"
                ],
                "properties": {
                  "tokenA": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  },
                  "tokenB": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result, not execution permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Evidence"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited; honor Retry-After"
          },
          "503": {
            "description": "Unavailable; fail closed"
          }
        }
      }
    },
    "/api/v1/check/calldata": {
      "post": {
        "summary": "Read-only calldata inspection; not trading approval",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data"
                ],
                "properties": {
                  "data": {
                    "type": "string",
                    "pattern": "^0x(?:[0-9a-fA-F]{2})*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result, not execution permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Evidence"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited; honor Retry-After"
          },
          "503": {
            "description": "Unavailable; fail closed"
          }
        }
      }
    },
    "/api/v1/check/transaction": {
      "post": {
        "summary": "Read-only transaction inspection; not trading approval",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "chainId",
                  "from",
                  "to",
                  "data"
                ],
                "properties": {
                  "chainId": {
                    "type": "integer",
                    "enum": [
                      4663
                    ]
                  },
                  "from": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  },
                  "to": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  },
                  "data": {
                    "type": "string",
                    "pattern": "^0x(?:[0-9a-fA-F]{2})*$"
                  },
                  "value": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result, not execution permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Evidence"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited; honor Retry-After"
          },
          "503": {
            "description": "Unavailable; fail closed"
          }
        },
        "description": "Public requests cannot supply review profiles. Supported exact codec is legacy Universal Router single V4_SWAP 0x10 with actions 0x060c0f, exact-input ERC20-to-ERC20 static hookless pool. Disabled publicly without reviewed profile; other paths fail closed."
      }
    },
    "/api/v1/check/transaction-hash": {
      "post": {
        "summary": "Read-only transaction-hash inspection; not trading approval",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "transactionHash"
                ],
                "properties": {
                  "transactionHash": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inspection result, not execution permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Evidence"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited; honor Retry-After"
          },
          "503": {
            "description": "Unavailable; fail closed"
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "summary": "health",
        "responses": {
          "200": {
            "description": "Read-only service metadata; partial coverage"
          }
        }
      }
    },
    "/api/v1/registry": {
      "get": {
        "summary": "registry",
        "responses": {
          "200": {
            "description": "Read-only service metadata; partial coverage"
          }
        },
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Evidence": {
        "type": "object",
        "required": [
          "schema",
          "issuedAt",
          "expiresAt",
          "result",
          "digest"
        ],
        "properties": {
          "schema": {
            "type": "string",
            "enum": [
              "swap-safety.evidence.v1"
            ]
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "result": {
            "type": "object",
            "required": [
              "decision",
              "code"
            ],
            "properties": {
              "decision": {
                "type": "string",
                "enum": [
                  "DENY",
                  "WARN",
                  "UNPRICEABLE",
                  "ALLOW"
                ],
                "description": "ALLOW unavailable on public deployment. Reserved profile-gated result requires operator-reviewed exact single-hop policy; not general pool safety."
              },
              "code": {
                "type": "string"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time",
                "description": "Optional exact-result expiration; when present enforce this and outer expiresAt, using the earlier time."
              },
              "scope": {
                "type": "string",
                "description": "Evidence scope; historical receipt and pool profiles are not pre-trade approval."
              },
              "transactionHash": {
                "type": "string",
                "description": "For exact profile result: transaction JSON fingerprint, not a broadcast transaction hash. Historical result: submitted on-chain transaction hash; interpret with scope."
              },
              "policyHash": {
                "type": "string",
                "description": "Optional exact-check reviewed profile fingerprint."
              }
            }
          },
          "digest": {
            "type": "string",
            "description": "SHA-256 serialization checksum, not signature"
          }
        }
      }
    }
  }
}
