Skip to content

Commit 5deb3d8

Browse files
jungcome7claude
andcommitted
feat(extension): wire smart account routes and entry point
Smart Account UI를 앱에 연결합니다. - index.tsx: /wallet/smart-account, /wallet/smart-account/confirm 라우트 등록 - wallet/index.ts: 페이지 컴포넌트 re-export - account-item.tsx: 계정 드롭다운에 "EVM Smart Account" 메뉴 항목 추가 (eip7702 체인 있을 때만) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cee3d5d commit 5deb3d8

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

apps/extension/src/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ import {
6666
WalletDeletePage,
6767
WalletSelectPage,
6868
WalletShowSensitivePage,
69+
SmartAccountPage,
70+
SmartAccountConfirmPage,
6971
} from "./pages/wallet";
7072
import { SuggestChainPage } from "./pages/suggest-chain";
7173
import { ModalRootProvider } from "./components/modal";
@@ -549,6 +551,14 @@ const RoutesAfterReady: FunctionComponent = observer(() => {
549551
path="/wallet/show-sensitive"
550552
element={<WalletShowSensitivePage />}
551553
/>
554+
<Route
555+
path="/wallet/smart-account"
556+
element={<SmartAccountPage />}
557+
/>
558+
<Route
559+
path="/wallet/smart-account/confirm"
560+
element={<SmartAccountConfirmPage />}
561+
/>
552562
<Route path="/suggest-chain" element={<SuggestChainPage />} />
553563
<Route path="/ibc-transfer" element={<IBCTransferPage />} />
554564
<Route

apps/extension/src/pages/main/components/account-switch-float-modal/account-item.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { useGetIcnsName } from "../../../../hooks/use-get-icns-name";
2424
import { ContextMenuStyles } from "../../../../components/context-menu";
2525
import { AccountNameIcon } from "../account-icon";
2626
import { PortalTooltip } from "../../../../components/tooltip/portal";
27+
import { useEip7702Chains } from "../../../wallet/smart-account/hooks/use-eip7702-chains";
2728

2829
const Styles = {
2930
AccountItem: styled.div<{ isSelected: boolean }>`
@@ -145,6 +146,7 @@ export const AccountItemSwitchModal = observer(
145146

146147
const icnsPrimaryName = useGetIcnsName(bech32Address);
147148
const paragraph = useGetKeyInfoParagraph(keyInfo, true);
149+
const eip7702Chains = useEip7702Chains();
148150
const dropdownItems = (() => {
149151
const defaults = [
150152
{
@@ -186,6 +188,20 @@ export const AccountItemSwitchModal = observer(
186188
}
187189
}
188190

191+
// Smart Account menu — only for software wallets with at least one EIP-7702 chain
192+
if (
193+
(keyInfo.type === "mnemonic" || keyInfo.type === "private-key") &&
194+
eip7702Chains.length > 0
195+
) {
196+
defaults.splice(defaults.length - 1, 0, {
197+
key: "smart-account",
198+
label: intl.formatMessage({
199+
id: "page.wallet.keyring-item.dropdown.smart-account-title",
200+
}),
201+
onSelect: () => navigate(`/wallet/smart-account?id=${keyInfo.id}`),
202+
});
203+
}
204+
189205
return defaults;
190206
})();
191207

apps/extension/src/pages/wallet/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export * from "./select";
22
export * from "./delete";
33
export * from "./change-name";
44
export * from "./show-sensitive";
5+
export { SmartAccountPage, SmartAccountConfirmPage } from "./smart-account";

0 commit comments

Comments
 (0)