diff --git a/next.config.js b/next.config.js index c071158..d977010 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,7 @@ // next.config.js module.exports = { - reactStrictMode: true + reactStrictMode: true, + images: { + unoptimized: true, + } }; diff --git a/pages/explorer.tsx b/pages/explorer.tsx index 050b83f..c2ba47e 100644 --- a/pages/explorer.tsx +++ b/pages/explorer.tsx @@ -5,19 +5,12 @@ import { INFRA_ADDRESS, BundlerMode, BundlerProvider, - BundlerUserOperationData, PackedUserOperation, wrap, } from "@consenlabs/imaccount-sdk"; -import { UserOpReceipt } from "../types/receipt"; +import { DataType, UserOpReceipt } from "../types"; import Header from "./header"; -enum DataType { - Address = "/address/", - Transaction = "/tx/", - Block = "/block/", -} - const Explorer = () => { const [userOpHash, setUserOpHash] = useState( "0x95193f1f7d7cac1caa3385a33ce7a63dc3b66d3ba91059addfcaaf1091834fcc" @@ -26,7 +19,7 @@ const Explorer = () => { process.env.NEXT_PUBLIC_RPC_URL ?? "https://.g.alchemy.com/v2/" ); - const [chainName, setChainName] = useState() + const [chainName, setChainName] = useState(); const [userOpReceipt, setUserOpReceipt] = useState( null ); diff --git a/pages/imaccount-info.tsx b/pages/imaccount-info.tsx index d920d4e..51a4e8c 100644 --- a/pages/imaccount-info.tsx +++ b/pages/imaccount-info.tsx @@ -6,6 +6,7 @@ import { InfoType, } from "@consenlabs/imaccount-sdk"; import { Address } from "viem"; +import { DataType } from "../types"; import Header from "./header"; enum AddressType { @@ -13,6 +14,15 @@ enum AddressType { Account = "Account", } +type FullInfoType = { + BasicInfo: InfoType, + DeploymentInfo: { + EntryFactory: Address, + AccountFactory: Address, + Version: string + } +} + const AccountInfo = () => { const [address, setAddress] = useState
( "0xea67ba18ab79c208369f7f40cf21a27c41f605f2" @@ -22,11 +32,27 @@ const AccountInfo = () => { process.env.NEXT_PUBLIC_RPC_URL ?? "https://.g.alchemy.com/v2/" ); + const [chainName, setChainName] = useState(); const [fetching, setFetching] = useState(false); const [info, setInfo] = useState(); const isFetchDisabled = !address || !type || !ALCHEMY_RPC_URL; + const getExplorerLink = (address: string, type: DataType): string => { + if (!ALCHEMY_RPC_URL) return "https://"; + + const provider = getPublicClient(ALCHEMY_RPC_URL); + if (!chainName || chainName === "") { + setChainName(provider.chain?.name); + } + const explorerLink = provider.chain?.blockExplorers?.default.url; + + if (!explorerLink) return "https://"; + + const dataLink = explorerLink + type + address; + return dataLink; + }; + const getWalletInfo = async () => { if (!address || !type || !ALCHEMY_RPC_URL) { alert("Please fill in all required fields."); @@ -56,10 +82,11 @@ const AccountInfo = () => { return (
-

imToken AA Wallet Infomation

+

imToken AA Wallet Watcher

It is an experimental feature. Please use it cautiously.

+

Infomation

Contract Type

diff --git a/pages/index.tsx b/pages/index.tsx index 155cf2e..bf55af1 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -3,13 +3,21 @@ import Link from "next/link"; import Header from "./header"; import Footer from "./footer"; +import Image from "next/image"; const Home = () => { return (
- GIF + Usagi
diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png new file mode 100644 index 0000000..12b1d99 Binary files /dev/null and b/public/android-chrome-192x192.png differ diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png new file mode 100644 index 0000000..3a8a6c4 Binary files /dev/null and b/public/android-chrome-512x512.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..ebdad42 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 0000000..11a6f00 Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100644 index 0000000..99d0101 Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico index 4a7045a..93abebd 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..46cb5f9 --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "AA Debugger", + "short_name": "AA Debugger", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} \ No newline at end of file diff --git a/styles.css b/styles.css index 38191b4..71510b4 100644 --- a/styles.css +++ b/styles.css @@ -185,4 +185,34 @@ footer { border: 1px solid #3e3e3e; border-radius: 4px; overflow-x: auto; +} + +select { + width: 100%; + padding: 10px; + margin-top: 5px; + margin-bottom: 20px; + border: 1px solid #3e3e3e; + border-radius: 4px; + background-color: #2e2e2e; + color: #dcdcdc; + font-family: 'Ubuntu Mono', monospace; + appearance: none; + /* Removes default arrow */ + cursor: pointer; + transition: border-color 0.3s ease, background-color 0.3s ease; +} + +select:hover { + border-color: #4ec9b0; +} + +select:focus { + outline: none; + border-color: #4ec9b0; +} + +select option { + background-color: #2e2e2e; + color: #dcdcdc; } \ No newline at end of file diff --git a/types/receipt.ts b/types/index.ts similarity index 89% rename from types/receipt.ts rename to types/index.ts index 4b85fef..4c1b116 100644 --- a/types/receipt.ts +++ b/types/index.ts @@ -1,5 +1,11 @@ import { Address } from "viem"; +export enum DataType { + Address = "/address/", + Transaction = "/tx/", + Block = "/block/", +} + export type Log = { address: Address; topics: string[];