{"id":21820127,"url":"https://github.com/5afe/safe-smart-session-tutorial","last_synced_at":"2025-04-14T02:43:18.267Z","repository":{"id":260450773,"uuid":"879679210","full_name":"5afe/safe-smart-session-tutorial","owner":"5afe","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-12T16:39:26.000Z","size":383,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T16:48:51.619Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/5afe.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":"2024-10-28T11:05:47.000Z","updated_at":"2025-01-02T13:21:16.000Z","dependencies_parsed_at":"2024-11-27T16:35:16.798Z","dependency_job_id":"6ab438e9-9eb9-4021-ad79-185cd1dbcf0e","html_url":"https://github.com/5afe/safe-smart-session-tutorial","commit_stats":null,"previous_names":["5afe/safe-smart-session-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fsafe-smart-session-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fsafe-smart-session-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fsafe-smart-session-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5afe%2Fsafe-smart-session-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5afe","download_url":"https://codeload.github.com/5afe/safe-smart-session-tutorial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248812515,"owners_count":21165443,"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","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-11-27T16:28:45.749Z","updated_at":"2025-04-14T02:43:18.222Z","avatar_url":"https://github.com/5afe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Safe 7579 Tutorial - Smart Sessions\n\nThis project demonstrates the use of smart sessions with **Safe Protocol**, implemented using **Next.js** and **TypeScript**. The app includes components for managing contract actions and session keys, alongside utilities for blockchain interactions.\n\n## Setup\nIn this demo, we’ll showcase the power of a Safe smart account configured for single-signer (1/1) functionality, integrated with a dynamically generated signer enabled by Rhinestone's Smart Sessions validator. This setup empowers the Safe account to operate with session-based keys, allowing predefined actions without requiring the owner’s signature for each transaction.\n\nThis approach leverages session keys with restricted permissions, ensuring security and flexibility for various blockchain interactions, including ERC20 transactions, DEX trades, and interactions with other contracts, all managed seamlessly through the validator module.\n![](images/setup.png)\n\n## Project Structure\n\n- **app/components**: UI components such as `ActionRow`, `ActionTable`, and `SessionKeyForm` for managing contract actions and session data.\n- **lib**: Utility functions for contract interaction (`abi.ts`, `sendUserOp.ts`), session management (`smartSession.ts`, `passkey.ts`), and permissionless actions (`permissionless.ts`).\n- **abi**: Contains ABI data used for interacting with contracts.\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   ```\n2. Install dependencies\n    ```bash\n    pnpm install\n    ```\n3. Create an .env file from .env.example and fill in the required environment variables:\n```bash\n    NEXT_PUBLIC_PIMLICO_API_KEY=\u003cYour Pimlico API Key\u003e\n    NEXT_PUBLIC_PRIVATE_KEY=\u003cYour Private Key\u003e\n```\n4. Run the development server:\n```bash\n    pnpm dev\n```\n\n## Key Features\n\n- **Action Management**: A dynamic table (using `ActionTable.tsx` and `ActionRow.tsx`) for handling multiple contract actions.\n- **Session Key Management**: Secure session key handling using the `SessionKeyForm.tsx`.\n- **Permissionless Functionality**: Includes logic for managing permissionless contract interactions.\n\n## Environment Variables\n\n- `NEXT_PUBLIC_PIMLICO_API_KEY`: API key for interacting with the Pimlico service.\n- `NEXT_PUBLIC_PRIVATE_KEY`: Private key for signing and submitting transactions.\n\n## Contributing\n\nFeel free to fork, submit pull requests, or open issues to improve this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5afe%2Fsafe-smart-session-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5afe%2Fsafe-smart-session-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5afe%2Fsafe-smart-session-tutorial/lists"}