Skip to content

Feat: AI analysis foundation#218

Merged
MatiasOS merged 24 commits intoopenscan-explorer:release/v1.2.1-afrom
MatiasOS:feat/ai-analysis-foundation
Feb 13, 2026
Merged

Feat: AI analysis foundation#218
MatiasOS merged 24 commits intoopenscan-explorer:release/v1.2.1-afrom
MatiasOS:feat/ai-analysis-foundation

Conversation

@MatiasOS
Copy link
Member

@MatiasOS MatiasOS commented Feb 10, 2026

Description

Adds the AI analysis foundation across EVM pages, including a reusable analysis panel, provider-agnostic AI service, prompt templates, caching, and settings-managed API keys, plus enriched transaction context via ERC-7730 pre-analysis and contract/ABI summarization.

Related Issue

Closes #170

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • Added AIAnalysisPanel with analyze/expand/refresh behavior, error handling, and cached-result support.
  • Implemented AI provider config, prompt templates, service wrapper (OpenAI-compatible + Anthropic), and localStorage caching with context hashing.
  • Added ERC-7730 transaction pre-analysis and richer AI context (token info, decoded calldata/logs, L2 fields).
  • Integrated AI analysis panel into block, transaction, account, contract, ERC20/721/1155 displays and introduced AI styling/layout.
  • Added settings UI for AI API keys (primary + expandable list), cache clearing integration, and new en/es i18n strings.
  • Added @erc7730/sdk dependency and updated TypeScript target to es2022.

Screenshots (if applicable)

Example images:
image

image image

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

  • AI provider resolution uses the first configured key in priority order (Groq → OpenAI → Anthropic → Together AI).
  • AI analysis results are cached in localStorage with context-hash invalidation; cache can be cleared from Settings.

@github-actions
Copy link

github-actions bot commented Feb 10, 2026

🚀 Preview: https://pr-218--openscan.netlify.app
📝 Commit: f0c4132a1f55e4adbd6d8ce031b00fd41e50df71

@MatiasOS MatiasOS force-pushed the feat/ai-analysis-foundation branch from c9d86b8 to 6c25795 Compare February 10, 2026 19:39
- Add aiAnalysis.sectionTitle to English and Spanish address translations
- Wrap AccountDisplay, ERC20Display, ERC721Display, ERC1155Display
  in page-with-analysis 2-column grid layout
- Add AIAnalysis panel to each display with appropriate analysis type
  (account for EOA, contract for token displays)
- Build context objects with address data, token metadata, and
  verification status per display type
- Add onTransactionsChange callback to TransactionHistory to expose
  loaded transactions to AccountDisplay for richer AI context
- Include recent transaction summaries (first 10 txs) in EOA context
- Thread app language through AIAnalysis -> useAIAnalysis -> AIService
  -> AIPromptTemplates
- Add language instruction to all prompt templates so AI responds in
  the user's selected language (e.g., Spanish when app is set to es)
- Default to English with no extra instruction for en locale
Use @erc7730/sdk ClearSigner to decode transaction calldata into
human-readable format (intent, formatted fields, security warnings)
before sending context to the LLM.
Conditionally inject system prompt hint when erc7730Intent is present
in the context, instructing the LLM to use decoded fields and highlight
security warnings.
- Add 2-column layout with AI analysis panel on the right
- Build rich context from tx data, decoded input, event logs, L2 fields,
  and ERC-7730 pre-analysis for LLM consumption
- Add i18n keys for transaction AI analysis section (en + es)
@MatiasOS MatiasOS requested a review from AugustoL February 12, 2026 15:27
@MatiasOS MatiasOS marked this pull request as ready for review February 12, 2026 15:27
@MatiasOS MatiasOS changed the title Feat/ai analysis foundation Feat: AI analysis foundation Feb 12, 2026
@MatiasOS MatiasOS merged commit 5022139 into openscan-explorer:release/v1.2.1-a Feb 13, 2026
2 checks passed
@MatiasOS MatiasOS deleted the feat/ai-analysis-foundation branch February 13, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants