{"id":21247139,"url":"https://github.com/alchemyplatform/sponsoring-userops","last_synced_at":"2025-03-15T05:14:02.864Z","repository":{"id":194170359,"uuid":"690254647","full_name":"alchemyplatform/sponsoring-userops","owner":"alchemyplatform","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-06T18:33:48.000Z","size":60,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-21T20:26:13.583Z","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/alchemyplatform.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}},"created_at":"2023-09-11T20:54:50.000Z","updated_at":"2024-10-29T19:08:21.000Z","dependencies_parsed_at":"2023-09-12T05:38:04.168Z","dependency_job_id":null,"html_url":"https://github.com/alchemyplatform/sponsoring-userops","commit_stats":null,"previous_names":["alchemyplatform/sponsoring-userops"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fsponsoring-userops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fsponsoring-userops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fsponsoring-userops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fsponsoring-userops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alchemyplatform","download_url":"https://codeload.github.com/alchemyplatform/sponsoring-userops/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685583,"owners_count":20330982,"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-21T02:16:17.610Z","updated_at":"2025-03-15T05:14:02.822Z","avatar_url":"https://github.com/alchemyplatform.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sponsoring user operations using AA-SDK and Gas Manager\n\nThis repository serves as the codebase for Alchemy's tutorial on sponsoring userops [tutorial](https://docs.alchemy.com/docs/how-to-sponsor-userops-using-aa-sdk-and-gas-manager). This tutorial walks you through the process of using Alchemy AA-SDK and Gas Manager to execute sponsored userops (such as sending ETH).\n\n## Prerequisites\n\nYou will need the latest recommended [Node](https://nodejs.org/en) version v18.16.1 to use this repository.\n\nTo check which version you have, run the following in your preferred terminal:\n\n```\nnode -v\n```\n\nIf v18.16.1 appears, you are ready to use the repository! If it does not, the best way to install and change your node versions is through [Node Version Manager](https://github.com/nvm-sh/nvm#intro)\n\nClick the above link to install nvm if you do not already have it. Then run the following command.\n\n```\nnvm install 18.16.1\nnode -v\n```\n\nIn your terminal, you should now see\n\n```\nNow using node v18.16.1 (npm v9.5.1)\nv18.16.1\n```\n\n## Setup and running the scripts\n\nClone the repository and install the dependencies:\n\n```\ngit clone https://github.com/alchemyplatform/sponsoring-userops.git\ncd sponsoring-userops\nnpm install\n```\n\nThen create your `.env` file based on `.env.example`.\n\nOnce you have created and populated your `.env`, run the following command:\n\n```\nnpm run index\n```\n\nThe command executes a sponsored user operation to send ETH from your SCA to the specified wallet adddress in [index.ts](https://github.com/alchemyplatform/sponsoring-userops/blob/main/src/index.ts#L7).\n\n## Explaining the Scripts\n\nLet's briefly review the files within the [src](https://github.com/alchemyplatform/sponsoring-userops/tree/main/src) folder.\n\n#### `createSmartAccountClient.ts`\n\n- Creates a signer for your smart contract account ( existing or new account ) coupled with Alchemy's Gas Manager that can be used to send sponsored user operations ( i.e. their gas is paid by Alchemy's Gas Manager ).\n\n#### `index.ts`\n\n- Sends a sponsored user operation that sends ETH from your SCA to the specified wallet adddress in [index.ts](https://github.com/alchemyplatform/sponsoring-userops/blob/main/src/index.ts#L7).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fsponsoring-userops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchemyplatform%2Fsponsoring-userops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fsponsoring-userops/lists"}