ethereum-optimism / ethereum-optimism/actions
Wallet Refactor: Rename EOAWallet to ExternalWallet
- Dominant language
- TypeScript
- Stars
- 32
- Forks
- 25
- Avg merge
- 10h 20m
- Merged PRs (30d)
- 16
Description
## Summary
Rename the `EOAWallet` base class to `ExternalWallet`. "EOA" is a misnomer — the class doesn't require EOAs; it wraps any viem `Account`. `ExternalWallet` is accurate because the signer IS the wallet (contrasts `SmartWallet`, where the signer is an *owner* of a separate contract account).
**Parent:** #396
**Brainstorm:** #395
**Blocks agent wallet work (#354):** No
## Context
Privy, Turnkey, Dynamic, and Local wallets can all wrap viem `Account` instances that may be EOAs or (in the future) smart accounts handled externally (e.g., injected Coinbase Smart Wallet). The class's actual invariant is "signer.address === wallet.address" and "submit via viem WalletClient" — not "the wallet is an EOA."
## Scope
- Rename class `EOAWallet` → `ExternalWallet`
- Rename directory/file: `wallet/core/wallets/eoa/EOAWallet.ts` → `wallet/core/wallets/ExternalWallet.ts` (final path finalized in per-protocol restructure sub-issue)
- Rename type `EOATransactionReceipt` → `ExternalTransactionReceipt`
- Update all imports and JSDoc across `packages/sdk/`, `packages/demo/backend/`, `packages/demo/frontend/`
- Update all `*Wallet` subclasses' `extends` clause (these subclasses go away in the next sub-issue; update for consistency here)
## Files affected
- `packages/sdk/src/wallet/core/wallets/eoa/EOAWallet.ts`
- `packages/sdk/src/wallet/core/wallets/abstract/types/index.ts` (`EOATransactionReceipt`)
- All `*Wallet` subclasses in `wallet/node/wallets/hosted/*`, `wallet/react/wallets/hosted/*`, `wallet/node/wallets/local/`
- Test files and mocks
- Public exports (`index.node.ts`, `index.react.ts`)
## Deprecation alias
`EOAWallet` is internal-facing. Recommendation: no deprecation alias. Finalize during planning.
## Dependencies
- No hard dependencies
- Best landed after #330 to avoid interleaved rename churn
## Acceptance criteria
- [ ] All `EOAWallet` references renamed to `ExternalWallet`
- [ ] `EOATransactionReceipt` renamed (or justify keeping)
- [ ] `pnpm typecheck && pnpm lint && pnpm test` pass
- [ ] No public API break beyond the rename itself
Contributor guide
Research direction
Start with packages/sdk/src/wallet/core/wallets/eoa/EOAWallet.ts and the abstract types index, then trace imports through hosted and local wallet subclasses, tests, mocks, and index.node.ts/index.react.ts. Rename the listed class and receipt type consistently, update JSDoc and exports, and run pnpm typecheck && pnpm lint && pnpm test to verify completion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100