Skip to content

chore: delete dead code (legacy interface, diagnostics, unused config)#28

Open
dawsbot wants to merge 1 commit into
mainfrom
chore/delete-dead-code
Open

chore: delete dead code (legacy interface, diagnostics, unused config)#28
dawsbot wants to merge 1 commit into
mainfrom
chore/delete-dead-code

Conversation

@dawsbot

@dawsbot dawsbot commented Jul 6, 2026

Copy link
Copy Markdown
Owner

What

Removes three unrelated pieces of dead code:

  1. pages/api/chain-info/[chainId]/[evmAddress].ts — deletes the ~1720-line legacy Covalent APIResponse interface that was explicitly kept "for reference but no longer used." The live handler (~64 lines) is untouched. File shrinks from 1788 → 64 lines.
  2. components/contract/SendTokens.tsx — removes the [drain] DIAGNOSTIC console.log/console.error statements. Their only consumers were the useChainId and useCapabilities hooks, which are now removed too (along with their imports) since nothing else references them.
  3. config.ts — deletes the vestigial NETWORK_ID = 31337 / NETWORK_NAME = 'localhost' config. grep across the codebase confirms nothing imports NETWORK_ID, NETWORK_NAME, or the module itself.

Why

Dead code is misleading to read and maintain — the legacy interface in particular is a huge distraction in a file whose live logic is tiny, and the diagnostic logs were leftover debugging noise shipping to users' consoles.

Verification

  • tsc --noEmit clean
  • eslint . clean
  • next build succeeds

Note: opened alongside fix/native-token-batching (#27), which rewrites sendBatchedTokens in this same file (it also removes the same diagnostic logs as part of its refactor). Both branch off main, so expect a small merge conflict in sendBatchedTokens depending on merge order — the two changes are compatible in intent.

The repo's Moralis test suite requires a MORALIS_API_KEY and was not run in this environment; these changes don't touch any tested module.

🤖 Generated with Claude Code

Three unrelated bits of dead code removed together:

- pages/api/chain-info/[chainId]/[evmAddress].ts: drop the ~1720-line
  legacy Covalent `APIResponse` interface that was kept "for reference"
  but is no longer referenced anywhere. The live handler is untouched.
- components/contract/SendTokens.tsx: remove the `[drain]` DIAGNOSTIC
  console.log/console.error statements, plus the now-unused `useChainId`
  and `useCapabilities` hooks (and their imports) that only fed them.
- config.ts: delete the vestigial NETWORK_ID = 31337 / localhost config;
  grep confirms nothing imports it.

Build, typecheck, and lint all pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
drain Ready Ready Preview, Comment Jul 6, 2026 7:08pm

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