{"id":50009140,"url":"https://github.com/gift-stack/bungee-ui","last_synced_at":"2026-05-19T21:04:40.059Z","repository":{"id":289162562,"uuid":"970319574","full_name":"Gift-Stack/bungee-ui","owner":"Gift-Stack","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-03T06:42:39.000Z","size":178,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-03T07:37:13.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://bungee-ui.vercel.app","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/Gift-Stack.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,"zenodo":null}},"created_at":"2025-04-21T20:39:46.000Z","updated_at":"2025-05-03T06:42:43.000Z","dependencies_parsed_at":"2025-04-22T04:36:39.875Z","dependency_job_id":null,"html_url":"https://github.com/Gift-Stack/bungee-ui","commit_stats":null,"previous_names":["gift-stack/bungee-ui"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Gift-Stack/bungee-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gift-Stack%2Fbungee-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gift-Stack%2Fbungee-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gift-Stack%2Fbungee-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gift-Stack%2Fbungee-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gift-Stack","download_url":"https://codeload.github.com/Gift-Stack/bungee-ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gift-Stack%2Fbungee-ui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33233119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T15:49:41.270Z","status":"ssl_error","status_checked_at":"2026-05-19T15:49:22.917Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-05-19T21:04:32.923Z","updated_at":"2026-05-19T21:04:40.043Z","avatar_url":"https://github.com/Gift-Stack.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bungee Single-Chain Swap with EIP-5792 Smart Wallet Support\n\nA minimal web application demonstrating token swaps (USDC to ETH) on Arbitrum using Socket APIs, with special support for Safe wallets and EIP-5792 batching capabilities.\n\n## Features\n\n- 🔄 Single-chain swaps from USDC to ETH on Arbitrum\n- 👛 Support for both EOA and Safe smart wallets\n- 🔐 EIP-5792 compliant transaction batching\n- 💰 Real-time price quotes and gas estimates\n- 📊 Transaction status tracking with signature collection progress\n- 🎨 Clean, minimal UI focused on functionality\n\n## Prerequisites\n\nBefore you begin, ensure you have:\n\n- Node.js 18.x or later\n- Yarn package manager\n- A wallet with some Arbitrum ETH for gas fees\n- A Safe wallet (optional, for testing smart wallet features)\n\n## Environment Variables\n\nCreate a `.env.local` file in the root directory with:\n\n```env\nNEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_project_id\nNEXT_PUBLIC_SOCKET_API_KEY=your_socket_api_key\n```\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone git@github.com:Gift-Stack/bungee-ui.git\ncd bungee-ui\n```\n\n2. Install dependencies:\n\n```bash\nyarn install\n```\n\n3. Start the development server:\n\n```bash\nyarn dev\n```\n\n4. Open [http://localhost:3000](http://localhost:3000) in your browser\n\n## Testing\n\n### Test Scenarios\n\n1. **EOA Wallet Flow**\n\n   - Connect an EOA wallet\n   - Enter USDC amount\n   - Approve USDC spending (if first time)\n   - Complete swap\n\n2. **Safe Wallet Flow**\n   - Connect a Safe wallet\n   - Enter USDC amount\n   - Approve and swap in a single transaction\n   - Monitor signature collection progress\n\n### Test Accounts\n\nFor testing, you'll need:\n\n- USDC on Arbitrum: `0xaf88d065e77c8cC2239327C5EDb3A432268e5831`\n- Some ETH on Arbitrum for gas fees\n\n## Key Implementation Decisions\n\n### 1. Wallet Integration\n\n- Used RainbowKit for wallet connection due to its built-in Safe wallet support\n- Implemented `useCapabilities` hook to detect Safe wallet features\n- Configured for Arbitrum network only to keep the UI focused\n\n### 2. Transaction Batching (EIP-5792)\n\n- Implemented automatic detection of Safe wallets using `useCapabilities`\n- For Safe wallets: Batch approval and swap transactions using `sendCallsAsync`\n- For EOA wallets: Handle approval and swap sequentially\n- Used atomic transactions for Safe wallets to ensure both operations succeed or fail together\n\n### 3. State Management\n\n- Used React Query for data fetching and caching\n- Implemented custom hooks for swap-related operations:\n  - `useQuote`: Fetches and manages price quotes\n  - `usePrepareSwap`: Prepares transaction data\n  - `useSwap`: Handles the swap execution\n  - `useApprove`: Manages token approvals\n\n### 4. Error Handling\n\n- Implemented comprehensive error handling for:\n  - Network issues\n  - User rejections\n  - Insufficient funds\n  - Failed transactions\n- Added retry mechanism for failed network requests\n\n### 5. UI/UX Decisions\n\n- Minimal interface focused on core functionality\n- Real-time price updates with debouncing\n- Clear transaction status indicators\n- Signature collection progress for Safe wallets\n\n## Project Structure\n\n```\nsrc/\n├── actions/ # API interactions and external calls\n├── components/ # React components\n├── hooks/ # Custom React hooks\n├── lib/ # Utility functions and constants\n├── providers/ # Context providers and configurations\n└── app/ # Next.js app router files\n```\n\n## Technical Considerations\n\n### Security\n\n- No hardcoded API keys or sensitive data\n- Environment variable validation at startup\n- Proper error handling for all user interactions\n\n### Performance\n\n- Debounced input for price quotes\n- Efficient state management with React Query\n- Minimal external dependencies\n- Optimized class handling during hydration to remove extension-added classes\n\n### Extension Class Handling\n\n- Implemented automatic cleanup of extension-added classes during hydration\n- Uses efficient `for...of` loop for class removal\n- Prevents potential conflicts with browser extensions that add classes to the document\n- Ensures clean DOM state for consistent styling\n\n### Compatibility\n\n- Tested with MetaMask and Safe wallets\n- Support for both mobile and desktop browsers\n- Graceful fallbacks for unsupported features\n\n## Known Limitations\n\n- Only supports USDC to ETH swaps on Arbitrum\n- Requires manual approval for first-time token usage with EOA wallets\n- Safe wallet operations require multiple signatures based on wallet configuration\n\n## Video Walkthrough\nhttps://www.loom.com/share/abb28b271c3a4b258f4f14fde50bb15e?sid=e6345d25-e44b-4588-aa50-e1bcb38468da\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgift-stack%2Fbungee-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgift-stack%2Fbungee-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgift-stack%2Fbungee-ui/lists"}