{
 "openapi": "3.1.0",
 "info": {
  "title": "Chain Check API (ScriptSmith)",
  "version": "2.0.0",
  "description": "Pay-per-call crypto safety data for agents and developers: token approvals, phishing URLs, EVM and Solana token risk, contract scans, wallet reports, ENS labels and gas. Pay in USDC on Base with x402: no account, no API key.",
  "contact": {
   "email": "scriptsmith@mail.grokbot.com",
   "url": "https://scriptsmith-dashboard.pages.dev/x402/"
  },
  "x-guidance": "Every endpoint is GET with query params. Call it once without payment to get the 402 terms (PAYMENT-REQUIRED header, v2; JSON body, v1). Invalid input returns 400 before any payment. Results are heuristic data, not financial advice."
 },
 "servers": [
  {
   "url": "https://scriptsmith-dashboard.pages.dev"
  }
 ],
 "paths": {
  "/x402/v1/token-approvals": {
   "get": {
    "operationId": "tokenApprovals",
    "summary": "Token approval audit",
    "description": "Active ERC-20 and NFT approvals for a wallet on 7 EVM chains (full Etherscan event history on Ethereum, Arbitrum and Polygon), each re-checked on-chain, with unlimited-allowance and malicious-spender flags and revoke instructions. Price: 0.02 USDC on Base via x402.",
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "eth",
        "base",
        "arbitrum",
        "optimism",
        "polygon",
        "bsc",
        "avalanche"
       ]
      },
      "description": "EVM chain: eth, base, arbitrum, optimism, polygon, bsc, avalanche",
      "example": "eth"
     },
     {
      "name": "address",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Wallet address (0x...)",
      "example": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
     }
    ],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "20000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "active_approvals": 3,
         "unlimited": 2,
         "high_risk": 0,
         "approvals": [
          {
           "symbol": "USDC",
           "spender": "0x...",
           "allowance": "unlimited",
           "risk_level": "medium"
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  },
  "/x402/v1/phishing-check": {
   "get": {
    "operationId": "phishingCheck",
    "summary": "Phishing URL check",
    "description": "Check a URL or domain against 460k+ known crypto phishing domains (MetaMask eth-phishing-detect + ScamSniffer), GoPlus phishing data and lookalike/typosquat heuristics. Price: 0.005 USDC on Base via x402.",
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "URL or domain to check",
      "example": "metamsk.io"
     }
    ],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "5000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "host": "metamsk.io",
         "verdict": "danger",
         "listed": [
          {
           "domain": "metamsk.io",
           "sources": [
            "MetaMask"
           ]
          }
         ],
         "signals": [
          {
           "level": "warn",
           "text": "Looks very similar to metamask.io"
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  },
  "/x402/v1/token-risk": {
   "get": {
    "operationId": "tokenRisk",
    "summary": "EVM token risk score",
    "description": "Token risk score 0-100 (honeypot, buy/sell tax, mint, hidden owner, blacklist, pause, unverified source, LP lock, top holders) for ERC-20s on 7 EVM chains. Price: 0.02 USDC on Base via x402.",
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "eth",
        "base",
        "arbitrum",
        "optimism",
        "polygon",
        "bsc",
        "avalanche"
       ]
      },
      "description": "EVM chain: eth, base, arbitrum, optimism, polygon, bsc, avalanche",
      "example": "base"
     },
     {
      "name": "address",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Token contract (0x...)",
      "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
     }
    ],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "20000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "symbol": "USDC",
         "risk_score_0_100": 15,
         "verdict": "low",
         "flags": [
          "Owner can mint"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  },
  "/x402/v1/solana-token": {
   "get": {
    "operationId": "solanaToken",
    "summary": "Solana token safety check",
    "description": "Solana token safety check: mint and freeze authority, Token-2022 extensions (transfer hooks, permanent delegate, fees), supply and top-holder concentration, with a 0-100 risk score. Price: 0.02 USDC on Base via x402.",
    "parameters": [
     {
      "name": "mint",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "SPL or Token-2022 mint address",
      "example": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"
     }
    ],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "20000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "symbol": "Bonk",
         "mint_authority": null,
         "freeze_authority": null,
         "extensions": [],
         "risk_score_0_100": 0,
         "verdict": "low"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  },
  "/x402/v1/contract-scan": {
   "get": {
    "operationId": "contractScan",
    "summary": "Contract capability scan",
    "description": "Smart-contract quick risk scan from bytecode: proxy and admin detection, owner, mint, blacklist, pause, fee-change and trading-toggle capabilities, with plain-English flags. Price: 0.02 USDC on Base via x402.",
    "parameters": [
     {
      "name": "chain",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "eth",
        "base",
        "arbitrum",
        "optimism",
        "polygon",
        "bsc",
        "avalanche"
       ]
      },
      "description": "EVM chain: eth, base, arbitrum, optimism, polygon, bsc, avalanche",
      "example": "base"
     },
     {
      "name": "address",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Contract address (0x...)",
      "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
     }
    ],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "20000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "is_contract": true,
         "proxy": {
          "implementation": "0x..."
         },
         "capabilities": {
          "mint": true
         },
         "flags": [
          "Upgradeable proxy"
         ],
         "centralisation_score_0_100": 58
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  },
  "/x402/v1/wallet-report": {
   "get": {
    "operationId": "walletReport",
    "summary": "Multi-chain wallet report",
    "description": "Native, USDC and USDT balances, transaction counts, contract and EIP-7702 delegation detection for one address on Ethereum, Base, Arbitrum, Optimism, Polygon, BNB Chain and Avalanche. Price: 0.01 USDC on Base via x402.",
    "parameters": [
     {
      "name": "address",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Wallet address (0x...)",
      "example": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
     }
    ],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "10000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "active_chains": [
          "eth",
          "base"
         ],
         "total_stablecoins_usd": "410.09",
         "chains": {
          "base": {
           "ETH": "3.13",
           "USDC": "79.53",
           "tx_count": 12
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  },
  "/x402/v1/address-label": {
   "get": {
    "operationId": "addressLabel",
    "summary": "Address and ENS label",
    "description": "Resolve ENS name <-> address, check whether it is a contract, and flag known-malicious addresses (phishing, scam, sanctions, mixer, hacker) before you send funds. Price: 0.01 USDC on Base via x402.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "0x address or ENS name",
      "example": "vitalik.eth"
     }
    ],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "10000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "address": "0xd8dA...",
         "ens_name": "vitalik.eth",
         "malicious_flags": [],
         "verdict": "no known flags"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  },
  "/x402/v1/gas": {
   "get": {
    "operationId": "gas",
    "summary": "Multi-chain gas snapshot",
    "description": "Live gas on 7 EVM chains with base fee and the USD cost of a transfer, ERC-20 transfer, approve, NFT mint and swap, plus the cheapest chain for a swap. Price: 0.005 USDC on Base via x402.",
    "parameters": [],
    "x-payment-info": {
     "protocol": "x402",
     "price": {
      "amount": "5000",
      "currency": "USDC",
      "decimals": 6
     },
     "network": "eip155:8453",
     "payTo": "0xee31Abd15C22c89309311D8aaE128cBd6186D06C"
    },
    "responses": {
     "200": {
      "description": "Result (JSON)",
      "content": {
       "application/json": {
        "example": {
         "chains": {
          "base": {
           "gas_gwei": 0.006,
           "cost_usd": {
            "swap": 0.004
           }
          }
         },
         "cheapest_for_swap": "base"
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (not charged)"
     },
     "402": {
      "description": "Payment required (x402)"
     }
    }
   }
  }
 }
}