Skip to content

feat: enrich transaction history with known transaction data#216

Draft
premiumjibles wants to merge 3 commits intomainfrom
feat/tx-history-enrichment
Draft

feat: enrich transaction history with known transaction data#216
premiumjibles wants to merge 3 commits intomainfrom
feat/tx-history-enrichment

Conversation

@premiumjibles
Copy link
Contributor

@premiumjibles premiumjibles commented Mar 14, 2026

Summary

  • Transaction history enrichment pipeline: Reclassifies generic "Contract interaction" transactions into their actual types (swap, send, limit order, stop-loss, TWAP, deposit, withdraw, approval) using known transaction metadata from tool executions
  • Expanded type system: Adds 6 new transaction types (limitOrder, stopLoss, twap, deposit, withdraw, approval) across the types package, server enrichment, and chat UI
  • Extracted getKnownTransactions() selector: Moves inline knownTransactions builder from ChatProvider.tsx into chatStore.ts, covering all 9 transaction-producing tools (swap, swapUsd, send, limitOrder, stopLoss, twap, vaultDeposit, vaultWithdraw, vaultWithdrawAll) with proper sub-transaction handling (approval/deposit sub-txs)
  • UI updates: New icons (ScrollText for orders, Vault for deposits/withdrawals, ShieldCheck for approvals), label map, and grouped render logic (isSwapLike, isSendLike, isReceiveLike, isContractLike)
  • LLM compliance: Schema and prompt improvements for the transaction history tool

Test plan

  • bun run lint — passes
  • bun run type-check — passes (discriminated union expanded across all consumers)
  • bun test — 828 tests, 0 failures (15 enrichment tests including 8 new ones for new types)
  • Manual: trigger swap → tx history shows "Swap" with swap pair UI
  • Manual: create limit order → tx history shows "Approval" + "Limit Order"
  • Manual: vault deposit → tx history shows "Deposit" with correct icon
  • Manual: vault withdraw → tx history shows "Withdraw" with correct icon

🤖 Generated with Claude Code

Swaps are misclassified as "contract interactions" when Unchained returns
incomplete tokenTransfers data. Fix by sending a lightweight known
transactions map from the client (built from persistedTransactions) and
enriching misclassified contract txs before filtering.

Also parse internalTxs from Unchained to classify swaps where native ETH
is transferred via internal calls rather than top-level tx.value.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
shapeshift-agentic Ready Ready Preview, Comment Mar 15, 2026 11:48pm

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3594998b-9780-4109-88c4-a40b47e59832

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/tx-history-enrichment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Remove .default() from schema fields that caused LLMs to echo unnecessary
parameters. Rewrite types description as positive directive with mapping.
Simplify renderTransactions to number-only type. Cap default context at
25 transactions. Move examples from system prompt into tool description.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 6 new transaction types (limitOrder, stopLoss, twap, deposit, withdraw, approval)
and extract knownTransactions logic from ChatProvider into a chatStore selector that
covers all 9 tool types including approval/deposit sub-transactions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@premiumjibles premiumjibles changed the title feat: enrich transaction history with known swap/send data feat: enrich transaction history with known transaction data Mar 15, 2026
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.

1 participant