{"id":19303820,"url":"https://github.com/web3w/web3-wallets","last_synced_at":"2025-10-04T18:44:58.994Z","repository":{"id":38835517,"uuid":"446666621","full_name":"web3w/web3-wallets","owner":"web3w","description":"An agent that links MetaMask,CoinBase Wallet and WalletConnect","archived":false,"fork":false,"pushed_at":"2023-11-05T17:12:48.000Z","size":6508,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T11:41:36.486Z","etag":null,"topics":["blockchain","ethereum","wallet"],"latest_commit_sha":null,"homepage":"https://web3w.github.io/web3-wallets","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web3w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-11T03:38:19.000Z","updated_at":"2022-08-11T01:48:36.000Z","dependencies_parsed_at":"2024-11-09T23:27:56.178Z","dependency_job_id":"a2b92068-f423-418c-9505-d41d298997e3","html_url":"https://github.com/web3w/web3-wallets","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/web3w/web3-wallets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fweb3-wallets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fweb3-wallets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fweb3-wallets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fweb3-wallets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3w","download_url":"https://codeload.github.com/web3w/web3-wallets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fweb3-wallets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358488,"owners_count":25973946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","ethereum","wallet"],"created_at":"2024-11-09T23:27:40.370Z","updated_at":"2025-10-04T18:44:58.919Z","avatar_url":"https://github.com/web3w.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# web3-wallets\n\nAdapt to web3 wallet, unified interface.\n\nExample: https://web3w.github.io/web3-wallets\n\n```\n                                    wallets          blockchains\n\n\n                               ╭───[MetaMask]────────[EVM-blockchains]\n                               │\n                               ├───[WalletConnect]───[EVM-blockchains]\n[your dapp]───[web3-wallets]───|\n                               ├───[Coinbase]─────────[EVM-blockchains]\n                               │\n                               ├───[Coin98]─────[EVM-blockchains]\n                               |\n                               ╰───[Other]----[Other] #Todo\n\n```\n\n## Used `WalletNames`\n\n### An adapted wallet\n\n'metamask','wallet_connect','coinbase','imtoken','math_wallet','token_pocket','bitkeep','onekey'\n\n#### Web3Js\n\n```ts\nconst wallet = new Web3Wallets({name: 'metamask'})\nconst web3 = new Web3(wallet)\nconst sign = await web3.eth.personal.sign(\"hello web3\", wallet.address)\n```\n\n#### Ethers\n\n```ts\nconst wallet = new Web3Wallets({name: 'metamask'})\nconst provider = new ethers.providers.Web3Provider(wallet)\nconst signer = provider.getSigner()\nconst sign = await signer.signMessage(\"hello web3\")\n```\n\n#### Connect\n\n```ts\nconst accounts = await wallet.connect() // same enable()\nconst res = await wallet.request({\"method\": \"eth_blockNumber\", \"params\": []})\n```\n\n## Detect Wallets\n\n```ts\nconst wallets = detectWallets()\nconst walletList = Object.values(wallets)\n```\n\n## Get Provider\n\n```ts\nexport interface WalletInfo {\n    chainId: number\n    address: string\n    privateKeys?: string[]\n    rpcUrl?: RpcInfo\n    port?: number\n    cacheExpiration?: number\n    bridge?: string\n    offsetGasLimitRatio?: number\n    isSetGasPrice?: boolean\n}\n\nconst {address, chainId, rpcUrl, walletSigner, walletProvider} = getProvider(walletInfo)\n\n```\n\n## Signature\n\n### signMessage\n\n### signTypeData\n\n```ts\n\nconst DOMAIN_DEFAULT = {\n    name: 'ZeroEx',\n    chainId: 1,\n    verifyingContract: '0x0000000000000000000000000000000000000000',\n    version: '1.0.0',\n};\nconst zeroHash = getEIP712DomainHash(DOMAIN_DEFAULT)\nconst zero = \"0xc92fa40dbe33b59738624b1b4ec40b30ff52e4da223f68018a7e0667ffc0e798\"\nconsole.assert(zeroHash == zero)\n\nfunction getEIP712StructHash(typedData\n\n.\nprimaryType, EIP_712_ORDER_TYPE, typedData.message\n)\n\nfunction getEIP712Hash(typeData: EIP712TypedData): string\n\n```\n\n### ecSignMessage\n\n### ecSignHash\n\n### hexUtils\n\n## Chain Info\n\n```ts\n//\nfunction getChainInfo(chinaId: number): ChainConfig\n\n//\nasync function getChainRpcUrl(chinaId: number, best?: true): Promise\u003cstring\u003e\n\n```\n\n### RPC\n\n```ts\n    const response = await fetchJson(url, {timeout: 10000, proxyUrl: 'http://127.0.0.1:7890'})\nif (response.ok) {\n    console.log(await response.json())\n} else {\n    console.log(response)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fweb3-wallets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3w%2Fweb3-wallets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fweb3-wallets/lists"}