{
  "openapi": "3.0.0",
  "info": {
    "title": "Identity Resolver",
    "version": "1.0.0",
    "description": "Resolve Web3 identities across ENS, Farcaster, and Lens Protocol"
  },
  "servers": [{ "url": "https://id.ivan-tempo.xyz" }],
  "paths": {
    "/api/resolve": {
      "get": {
        "operationId": "resolve",
        "summary": "Resolve handle to address",
        "description": "Resolve ENS (.eth), Farcaster (username), or Lens (.lens) handle to an Ethereum address.",
        "parameters": [
          {
            "name": "handle",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Handle to resolve (e.g. vitalik.eth, dwr, stani.lens)"
          }
        ],
        "x-payment-info": {
          "authMode": "paid",
          "protocols": ["mpp"],
          "price": "0.01",
          "currency": "USDC.e",
          "currencyAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "network": "tempo",
          "chainId": 4217,
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "feePayer": true,
          "gasAbstracted": true
        },
        "x-mpp": {
          "price": 10000,
          "token": "USDC.e",
          "tokenAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "network": "tempo",
          "feePayer": true
        },
        "responses": {
          "200": { "description": "Resolved identity with handle, type, address" },
          "402": { "description": "Payment required." }
        }
      }
    },
    "/api/resolve/batch": {
      "get": {
        "operationId": "resolveBatch",
        "summary": "Batch resolve handles to addresses",
        "description": "Resolve up to 20 handles in a single call. Price is $0.01 per handle.",
        "parameters": [
          {
            "name": "handles",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Comma-separated handles (max 20), e.g. vitalik.eth,dwr,stani.lens"
          }
        ],
        "x-payment-info": {
          "authMode": "paid",
          "protocols": ["mpp"],
          "price": "0.01",
          "currency": "USDC.e",
          "currencyAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "network": "tempo",
          "chainId": 4217,
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "feePayer": true,
          "gasAbstracted": true
        },
        "x-mpp": {
          "price": 10000,
          "token": "USDC.e",
          "tokenAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "network": "tempo",
          "feePayer": true
        },
        "responses": {
          "200": { "description": "Array of resolved results with per-handle type and address" },
          "402": { "description": "Payment required." }
        }
      }
    },
    "/api/reverse": {
      "get": {
        "operationId": "reverse",
        "summary": "Reverse lookup address to handles",
        "description": "Given an Ethereum address, return all associated handles across ENS, Farcaster, and Lens.",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Ethereum address (0x...)"
          }
        ],
        "x-payment-info": {
          "authMode": "paid",
          "protocols": ["mpp"],
          "price": "0.01",
          "currency": "USDC.e",
          "currencyAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "network": "tempo",
          "chainId": 4217,
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "feePayer": true,
          "gasAbstracted": true
        },
        "x-mpp": {
          "price": 10000,
          "token": "USDC.e",
          "tokenAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "network": "tempo",
          "feePayer": true
        },
        "responses": {
          "200": { "description": "Object with ens, farcaster, and lens handles" },
          "402": { "description": "Payment required." }
        }
      }
    },
    "/api/profile": {
      "get": {
        "operationId": "profile",
        "summary": "Get full identity profile",
        "description": "Fetch complete profile including bio, avatar, follower counts, and social links.",
        "parameters": [
          {
            "name": "handle",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Handle to fetch profile for"
          }
        ],
        "x-payment-info": {
          "authMode": "paid",
          "protocols": ["mpp"],
          "price": "0.02",
          "currency": "USDC.e",
          "currencyAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "network": "tempo",
          "chainId": 4217,
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "feePayer": true,
          "gasAbstracted": true
        },
        "x-mpp": {
          "price": 20000,
          "token": "USDC.e",
          "tokenAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "network": "tempo",
          "feePayer": true
        },
        "responses": {
          "200": { "description": "Full profile object" },
          "402": { "description": "Payment required." },
          "404": { "description": "Profile not found." }
        }
      }
    },
    "/api/check": {
      "get": {
        "operationId": "check",
        "summary": "Check handle availability",
        "description": "Check if an ENS, Farcaster, or Lens handle is available for registration.",
        "parameters": [
          {
            "name": "handle",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Handle to check availability for"
          }
        ],
        "x-payment-info": {
          "authMode": "paid",
          "protocols": ["mpp"],
          "price": "0.01",
          "currency": "USDC.e",
          "currencyAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "network": "tempo",
          "chainId": 4217,
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "feePayer": true,
          "gasAbstracted": true
        },
        "x-mpp": {
          "price": 10000,
          "token": "USDC.e",
          "tokenAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "network": "tempo",
          "feePayer": true
        },
        "responses": {
          "200": { "description": "Object with handle, type, and available boolean" },
          "402": { "description": "Payment required." }
        }
      }
    },
    "/api/related": {
      "get": {
        "operationId": "related",
        "summary": "Find related addresses",
        "description": "Discover addresses linked to the same identity via shared handles (e.g. Farcaster verifications).",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Ethereum address (0x...)"
          }
        ],
        "x-payment-info": {
          "authMode": "paid",
          "protocols": ["mpp"],
          "price": "0.02",
          "currency": "USDC.e",
          "currencyAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "network": "tempo",
          "chainId": 4217,
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "feePayer": true,
          "gasAbstracted": true
        },
        "x-mpp": {
          "price": 20000,
          "token": "USDC.e",
          "tokenAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "network": "tempo",
          "feePayer": true
        },
        "responses": {
          "200": { "description": "Object with handles and array of related addresses" },
          "402": { "description": "Payment required." }
        }
      }
    },
    "/api/links": {
      "get": {
        "operationId": "links",
        "summary": "Get social links from profile",
        "description": "Extract social links and website from an ENS, Farcaster, or Lens profile.",
        "parameters": [
          {
            "name": "handle",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Handle to fetch links for"
          }
        ],
        "x-payment-info": {
          "authMode": "paid",
          "protocols": ["mpp"],
          "price": "0.01",
          "currency": "USDC.e",
          "currencyAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "network": "tempo",
          "chainId": 4217,
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "feePayer": true,
          "gasAbstracted": true
        },
        "x-mpp": {
          "price": 10000,
          "token": "USDC.e",
          "tokenAddress": "0x20C000000000000000000000b9537d11c60E8b50",
          "recipient": "0x0d509f743bc6fc907d5f63d8b0dae1fca8d80897",
          "network": "tempo",
          "feePayer": true
        },
        "responses": {
          "200": { "description": "Object with handle, type, and links map" },
          "402": { "description": "Payment required." }
        }
      }
    }
  }
}
