{"id":17809753,"url":"https://github.com/zeroxbrock/protect-button","last_synced_at":"2025-08-13T13:30:42.899Z","repository":{"id":137201663,"uuid":"612004687","full_name":"zeroXbrock/protect-button","owner":"zeroXbrock","description":"React button that connects Metamask to Flashbots Protect when clicked","archived":false,"fork":false,"pushed_at":"2023-10-17T22:30:11.000Z","size":1840,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T13:39:45.886Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/protect-button","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/zeroXbrock.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":"2023-03-10T01:49:30.000Z","updated_at":"2023-09-29T11:36:18.000Z","dependencies_parsed_at":"2023-05-30T08:00:11.873Z","dependency_job_id":"6d76c000-5ecb-4b4c-83f7-326e5c128b4a","html_url":"https://github.com/zeroXbrock/protect-button","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/zeroXbrock/protect-button","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2Fprotect-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2Fprotect-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2Fprotect-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2Fprotect-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroXbrock","download_url":"https://codeload.github.com/zeroXbrock/protect-button/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2Fprotect-button/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270250902,"owners_count":24552738,"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-08-13T02:00:09.904Z","response_time":66,"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":[],"created_at":"2024-10-27T15:21:38.832Z","updated_at":"2025-08-13T13:30:42.508Z","avatar_url":"https://github.com/zeroXbrock.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Connect to Protect\n\nReact component: a button that connects Metamask to Flashbots Protect when clicked.\n\n## Dependencies\n\n* [react ^18](https://reactjs.org/)\n\n### OPTIONAL\n\n* [metamask-react](https://www.npmjs.com/package/metamask-react) - The component accepts a callback `addChain` given by `useMetaMask` from metamask-react to handle the low-level connection to Metamask.\n\n## Run demo\n\nBuild from source:\n\n```sh\ncd protect\nyarn install \u0026\u0026 yarn build\ncd ..\n```\n\nRun demo:\n\n```sh\ncd web-demo\nnpm install \u0026\u0026 npm start\ncd ..\n```\n\n## Using in your library\n\nInstall from npm:\n\n```sh\nyarn add protect-button\n# or\nnpm i protect-button\n```\n\nAlternatively, if you built from source:\n\n```sh\nyarn add ../protect-button\n# or\nnpm i ../protect-button\n```\n\n```tsx\n\u003cProtectButton addChain={addChain} chainId={1}\u003eConnect to Protect (Mainnet)\u003c/ProtectButton\u003e\n```\n\n`addChain` is optional; if omitted, component will use `window.ethereum`\n\n```tsx\n\u003cProtectButton chainId={5}\u003eConnect to Protect (Goerli)\u003c/ProtectButton\u003e\n```\n\n### Full example\n\nIn a React file (tsx or jsx):\n\n```tsx\nimport React from 'react'\nimport './App.css'\n// using metamask-react is optional but recommended\nimport { useMetaMask } from 'metamask-react'\nimport ProtectButton from \"protect-button\"\n\nfunction App() {\n  const { status, connect, addChain } = useMetaMask()\n  return (\n    \u003cdiv className=\"App\"\u003e\n      \u003cheader className=\"App-header\"\u003e\n        {status === 'notConnected' \u0026\u0026 (\n          \u003cbutton onClick={connect}\u003eConnect to MetaMask\u003c/button\u003e\n        )}\n        {status !== 'connected' \u0026\u0026 status !== \"notConnected\" \u0026\u0026 (\n          \u003cspan\u003eConnecting to MetaMask...\u003c/span\u003e\n        )}\n        {status === 'connected' \u0026\u0026 (\u003c\u003e\n          \u003cProtectButton addChain={addChain} chainId={1}\u003eConnect to Protect (Mainnet)\u003c/ProtectButton\u003e\n          {/* addChain is optional; if ommited, will use `window.ethereum` */}\n          \u003cProtectButton chainId={5}\u003eConnect to Protect (Goerli)\u003c/ProtectButton\u003e\n        \u003c/\u003e)}\n      \u003c/header\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroxbrock%2Fprotect-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroxbrock%2Fprotect-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroxbrock%2Fprotect-button/lists"}