[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109721":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":21,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":12,"starSnapshotCount":12,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},109721,"wallet-portrait","laodeng2313\u002Fwallet-portrait","laodeng2313","Open-source wallet address portrait tool — CLI + demo that profiles on-chain activity, protocol touches, and risk tags",null,"TypeScript",152,0,51,91,49.1,"MIT License",false,"main",true,[],"2026-11-06 09:19:53","2026-11-11 09:41:29","# wallet-portrait\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-1c2822)](.\u002FLICENSE)\n[![Node.js](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fnode-%3E%3D20-1c2822)](.\u002Fpackage.json)\n[![TypeScript](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTypeScript-strict-1c2822)](.\u002Ftsconfig.json)\n\nA small TypeScript library and CLI that turns an Ethereum address into a readable portrait: native balance, nonce, a sample of activity, contracts it recognizes, and a handful of heuristic tags.\n\nIt is a reading aid for public chain data. **Tags are heuristics. They are not a risk score, not KYC\u002FAML screening, and not financial, legal, or compliance advice.**\n\n## Try it\n\nYou need Node.js 20 or newer. No API key is required.\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Flaodeng2313\u002Fwallet-portrait.git\ncd wallet-portrait\nnpm install\nnpm test\nnpm run cli -- 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\n```\n\nThat address is [vitalik.eth](https:\u002F\u002Fetherscan.io\u002Faddress\u002F0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045). `vitalik.eth` itself also works when the RPC can resolve ENS:\n\n```bash\nnpm run cli -- vitalik.eth\nnpm run cli -- --json 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\n```\n\nAfter `npm run build`, the same command is `node dist\u002Fcli\u002Findex.js \u003Caddress>`.\n\nLocal demo page:\n\n```bash\nnpm run demo\n```\n\nOpen http:\u002F\u002F127.0.0.1:5173 , paste an address, and press Compose. The page calls the public RPC and Blockscout from your browser.\n\n## What you get\n\n`analyzeAddress` returns one JSON-safe `Portrait`:\n\n| Field | Meaning |\n| --- | --- |\n| `address`, `ensName` | Checksummed address, and a name when ENS resolution or Blockscout has one |\n| `chain`, `chainId` | `ethereum` and `1` |\n| `stats` | ETH balance, outgoing nonce, explorer tx count when available, first\u002Flast sampled activity, contract vs EIP-7702 delegation |\n| `protocols` | Counterparties that hit the local label map, with a hit count inside the sample |\n| `tags` | Heuristic ids, a short label, and the reason each one fired |\n| `summary` | A few plain sentences |\n| `sources` | Which RPC and explorer were used |\n| `disclaimer` | The heuristic warning, repeated inside the JSON |\n\nOutgoing transactions are the account nonce (successful sends). The explorer count, when present, includes incoming transfers and is approximate. Dates come from a **recent sample plus the earliest transaction** the explorer returns, not from a full archive. A quiet month can show few labeled protocols even for a famous address.\n\n## Example\n\nCaptured 6 Nov 2026 with the default sample of 50. Balances and counts move.\n\n```text\nWallet portrait · Ethereum mainnet\n\nAddress          0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\nENS              vitalik.eth\nBalance          5.780441 ETH\nOutgoing txs     5,970 (account nonce)\nExplorer txs     78,427 (approx, includes incoming)\nFirst activity   2015-09-28\nLast activity    2026-11-06\nAccount          delegated EOA (EIP-7702 → 0x5A7F…6f6d)\nSample           51 txs, 50 token transfers\nHistory          blockscout\nRPC              https:\u002F\u002Fethereum.publicnode.com\u002F\n\nProtocols\n  ENS              identity   2 hits\n  USDC             token      1 hit\n  USDT             token      1 hit\n\nTags\n  delegated-eoa\n    Bytecode is an EIP-7702 delegation to 0x5A7FC11397E9a8AD41BF10bf13F22B0a63f96f6d. The account is still an EOA.\n  active\n    Last sampled activity is within 90 days.\n  nft-touched\n    The sample includes an ERC-721 or ERC-1155 transfer.\n\nSummary\n  0xd8dA…6045 (vitalik.eth) is a delegated account (EIP-7702) on Ethereum mainnet holding\n  about 5.780441 ETH, with 5,970 outgoing transactions. Sampled activity runs from\n  2015-09-28 to 2026-11-06, and an explorer reports about 78,427 transactions in total.\n  Labeled protocols in the sample include ENS. Labeled tokens include USDC and USDT.\n  Heuristic tags: delegated-eoa, active, nft-touched.\n```\n\nThe same object is what `--json` prints. The extra transaction in “51 txs” is the earliest one, added beside the recent page so the portrait can show a first-seen date.\n\n## CLI\n\n```text\nwallet-portrait \u003Caddress | name.eth> [--json] [--rpc \u003Curl>] [--sample \u003Cn>]\n```\n\n| Flag | Effect |\n| --- | --- |\n| `--json` | Print the portrait as JSON. Default is the text layout above. |\n| `--text` | Force the text layout. |\n| `--rpc \u003Curl>` | Use this JSON-RPC endpoint first. Overrides `RPC_URL`. |\n| `--sample \u003Cn>` | How many recent transactions to request, from 1 to 50. Default 50. |\n| `-h`, `--help` | Usage. |\n\nExit `0` on a portrait, `1` on a bad address or usage, `2` when every RPC fails. If explorers fail but an RPC responds, the command still exits `0` and the portrait says history was unavailable.\n\nAddresses must be `0x` plus 40 hex characters. All-lowercase and all-uppercase are accepted. Mixed case must be valid [EIP-55](https:\u002F\u002Feips.ethereum.org\u002FEIPS\u002Feip-55).\n\n## Library\n\n```ts\nimport { analyzeAddress } from \"wallet-portrait\";\n\nconst portrait = await analyzeAddress(\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\");\nconsole.log(portrait.summary);\nconsole.log(portrait.tags.map((tag) => tag.id));\n```\n\nFrom this repo, before publishing:\n\n```bash\nnpx tsx -e 'import { analyzeAddress } from \".\u002Fsrc\u002Findex.ts\";\nconst portrait = await analyzeAddress(\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\");\nconsole.log(portrait.summary);'\n```\n\n`buildPortrait` is the pure function behind the network calls. Tests use it, and `analyzeAddress(..., { clients })`, so the shaping logic does not need a live chain.\n\n## Environment\n\nCopy `.env.example` if you want the names in front of you. The process reads the variables below; nothing in the tool loads a `.env` file for you.\n\n| Variable | Required | Role |\n| --- | --- | --- |\n| `RPC_URL` | No | Ethereum JSON-RPC URL tried first. When it is unset or down, the client walks a short list of public endpoints (`ethereum.publicnode.com`, `cloudflare-eth.com`, `eth.drpc.org`, `rpc.mevblocker.io`). |\n| `ETHERSCAN_API_KEY` | No | When set, recent history is read from the Etherscan v2 API (`chainid=1`). If that call fails, Blockscout is the fallback. |\n\nUserinfo and common key query parameters are stripped before an RPC URL is stored on the portrait or printed. Do not commit keys. `.env` is gitignored.\n\n## Data sources\n\n1. **JSON-RPC** (viem): balance, nonce, bytecode, and ENS name → address or address → name when the node supports it.\n2. **Blockscout** public API for Ethereum, with no key: one page of recent transactions, one page of token transfers, the tx counter, the address profile (including `ens_domain_name`), and the earliest transaction.\n3. **Etherscan v2**, only if `ETHERSCAN_API_KEY` is set.\n\nEIP-7702 delegation designators (`0xef0100` plus an address) are reported as delegated accounts, not as deployed contracts.\n\nIf both explorers fail, you still get balance, nonce, bytecode, and an explicit note that history was missing. Protocol tags stay empty in that case, because they need counterparties.\n\nThe label map in `src\u002Flabels\u002Fcontracts.ts` is a short curated list (Uniswap, Aave, Compound, Lido, OpenSea, a few bridges and exchanges, WETH and major stablecoins, ENS, Tornado Cash pools, and others). Unknown contracts are omitted. It is not a directory and it will go stale.\n\n## Heuristic tags\n\nEvery tag has a `reason` string on the portrait. Thresholds live in `src\u002Fcore\u002Fconstants.ts`.\n\n| Tag | Rule of thumb |\n| --- | --- |\n| `active` | Last sampled activity is within 90 days. |\n| `dormant` | Last sampled activity is more than 365 days old. |\n| `new-wallet` | The explorer returned an earliest transaction within 45 days, outgoing nonce is at most 5, and the reported total is not already large. Not applied when the earliest transaction is missing. |\n| `empty` | Zero ETH, nonce 0, no sampled transfers, and not a contract. |\n| `contract` | Bytecode is present and it is not an EIP-7702 delegation. |\n| `delegated-eoa` | Bytecode is an EIP-7702 delegation designator. |\n| `defi-user` | The sample touches a labeled DEX, lending, or staking contract. |\n| `nft-touched` | The sample touches a labeled NFT market, or includes an ERC-721 \u002F ERC-1155 transfer. |\n| `exchange-touched` | The sample touches a labeled exchange address. |\n| `bridge-touched` | The sample touches a labeled bridge. |\n| `high-balance` | Native balance is at least 100 ETH. A display threshold, not a judgment. |\n| `high-risk-heuristics` | The sample (or the address itself) hits the local mixer list, **or** the nonce is at least 40 and the anchored first and last activity fall within 7 days. |\n\n`high-risk-heuristics` is a crude pattern name for those two rules. It is not a score, a sanction screening, or a statement about a person.\n\nHolding or transferring USDC does not by itself produce `defi-user`. Stablecoins and WETH show up under protocols with category `token`.\n\n## Layout\n\n```text\nsrc\u002Fcore        address checks, portrait shaping, tags, summary\nsrc\u002Fdata        RPC, Blockscout, optional Etherscan\nsrc\u002Flabels      curated contract map\nsrc\u002Fcli         argument parsing and text layout\ndemo            one Vite page over the same library\ntests           validation, tags, portrait shape, mocked explorers\n```\n\n## Scripts\n\n| Script | What it does |\n| --- | --- |\n| `npm test` | Vitest. No network. |\n| `npm run lint` | `tsc --noEmit` for `src` and `tests`. |\n| `npm run cli -- \u003Caddress>` | Run the CLI with tsx. |\n| `npm start -- \u003Caddress>` | Same as `cli`. |\n| `npm run build` | Emit `dist\u002F` and type declarations. |\n| `npm run demo` | Vite dev server for the page. |\n\n## Privacy\n\nA query sends the address to your RPC provider and to Blockscout, or to Etherscan when a key is set. There is no other telemetry in this repository.\n\n## 简体中文\n\n`wallet-portrait` 是一个开源的以太坊地址画像工具。克隆后跑 CLI（或本地演示页），就能看到余额、nonce、抽样活跃区间、认得出的协议，以及一组启发式标签。\n\n这些标签只是公开数据上的粗规则，方便人读。它们不是风险评分，不是 KYC\u002FAML，也不是投资或合规建议。\n\n```bash\nnpm install\nnpm test\nnpm run cli -- 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\n```\n\n不配置付费 key 也能用。默认走公共 RPC 和 Blockscout。可选环境变量：`RPC_URL`、`ETHERSCAN_API_KEY`。演示页：`npm run demo`，打开 http:\u002F\u002F127.0.0.1:5173 。\n\n## License\n\n[MIT](.\u002FLICENSE)\n","这是一个开源的以太坊钱包地址画像分析工具，通过链上数据生成可读性强的地址行为概览。核心功能包括：查询原生代币余额、账户nonce、近期交易样本、交互过的协议列表，以及基于启发式规则生成的风险与行为标签（如EOA委托、高频交互等）；技术上采用TypeScript开发，支持CLI命令行与本地Web演示页，依赖公共RPC和Blockscout接口，无需API密钥。适用于区块链安全初筛、地址背景快速调研、链上行为教学演示等轻量级分析场景，但不提供合规风控结论或替代专业链上分析服务。",2,"2026-11-24 04:37:17","CREATED_QUERY"]