{"id":18542709,"url":"https://github.com/coinbase/paymaster-bundler-examples","last_synced_at":"2025-04-06T04:08:14.740Z","repository":{"id":224838155,"uuid":"763676477","full_name":"coinbase/paymaster-bundler-examples","owner":"coinbase","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-21T00:47:20.000Z","size":212,"stargazers_count":64,"open_issues_count":14,"forks_count":44,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T03:03:02.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coinbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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-02-26T18:12:26.000Z","updated_at":"2025-03-23T02:53:10.000Z","dependencies_parsed_at":"2024-03-18T15:09:18.194Z","dependency_job_id":"cf4ba54a-ece7-499c-a787-91b9f4e63f1d","html_url":"https://github.com/coinbase/paymaster-bundler-examples","commit_stats":null,"previous_names":["coinbase/paymaster-bundler-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fpaymaster-bundler-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fpaymaster-bundler-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fpaymaster-bundler-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase%2Fpaymaster-bundler-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coinbase","download_url":"https://codeload.github.com/coinbase/paymaster-bundler-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430869,"owners_count":20937874,"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-06T20:09:46.533Z","updated_at":"2025-04-06T04:08:14.667Z","avatar_url":"https://github.com/coinbase.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Coinbase Developer Platform Paymaster \u0026 Bundler Examples](https://github.com/coinbase/paymaster-bundler-examples)\n\n✨ Looking for frontend examples? Be sure to check out our **[Wagmi](https://github.com/coinbase/paymaster-bundler-examples/tree/master/examples/wagmi)** example for inspiration and guidance! ✨\n\nThis repo has code examples on how to sponsor a mint for a [Knight Warriors](https://sepolia.basescan.org/token/0x66519fcaee1ed65bc9e0acc25ccd900668d3ed49) NFT on Base Sepolia using Coinbase Developer Platform's Paymaster \u0026 Bundler. If you'd like to see a live demo app sponsoring NFT mints in action, check out ours [here](https://paymaster-demo-app.vercel.app/).\n\nWe currently have examples for the following SDKs, but contributions are always welcome! See [Contributing](https://github.com/coinbase/paymaster-bundler-examples/blob/master/CONTRIBUTING.md) for more details.\n\n### Supported SDKs\n\n- [Alchemy (aa-core)](https://github.com/coinbase/paymaster-bundler-examples/tree/master/examples/alchemy)\n- [Pimlico (permissionless.js)](https://github.com/coinbase/paymaster-bundler-examples/tree/master/examples/pimlico)\n- [ZeroDev (@zerodev/sdk)](https://github.com/coinbase/paymaster-bundler-examples/tree/master/examples/zerodev)\n- [Wagmi (wevm/wagmi)](https://github.com/coinbase/paymaster-bundler-examples/tree/master/examples/wagmi)\n- [Viem](https://github.com/coinbase/paymaster-bundler-examples/tree/master/examples/viem)\n\n### Supported Account Types\n\n- [SimpleAccount](https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/samples/SimpleAccount.sol) (default)\n- [Safe](https://safe.global/)\n- [Kernel](https://github.com/zerodevapp/kernel)\n- [Coinbase Smart Account](https://github.com/coinbase/smart-wallet)\n\n### Compatibility\n\n| SDK               | Simple | Safe | Kernel | Coinbase |\n| ----------------- | ------ | ---- | ------ | -------- |\n| aa-core           | ✅     | ❌   | ❌     | ❌       |\n| permissionless.js | ✅     | ✅   | ✅     | ✅       |\n| @zerodev/sdk      | ❌     | ❌   | ✅     | ❌       |\n| wevm/wagmi        | ❌     | ✅   | ❌     | ✅       |\n| viem              | ✅     | ✅   | ✅     | ✅       |\n\n## Getting Started\n\nPrerequisites: you'll need to have [node](https://nodejs.org/en) and [yarn](https://yarnpkg.com/) installed.\n\n### 1. Clone this repo locally\n\n```\ngit clone https://github.com/coinbase/paymaster-bundler-examples.git\n```\n\n### 2. Set up environment variables\n\n- ### Copy the env example\n\n```\ncp .env.example .env\n```\n\n- ### Install dotenv\n\n```\nyarn\n```\n\n- This will setup dotenv to load the env file for private values\n\n- ### Get your Node RPC URL\n\n  - Navigate to https://www.coinbase.com/developer-platform/products/base-node\n  - Sign up for a Coinbase Developer Platform account, if you don't have one already.\n  - Under the **Build Onchain** section in the Portal, select **Node**\n  - In the dropdown on the top right of **Configuration**, select **Base Testnet (Sepolia)**\n  - Copy your RPC endpoint, and paste it into `.env` as the `RPC_URL` variable.\n    - The RPC URL should look like `https://api.developer.coinbase.com/rpc/v1/base-sepolia/\u003capi_key\u003e`\n\n- ### Add a signer\n\n  You'll need to add a private key to initialize and sign for your [ERC-4337](https://www.erc4337.io/) smart contract account\n\n  - Since the NFT mint is free and gas will be sponsored by our Paymaster, you can use a new account without any funds\n  - You can create a new private key with [Foundry](https://book.getfoundry.sh/reference/cast/cast-wallet-new)\n    - To install Foundry, run `curl -L https://foundry.paradigm.xyz | bash`\n    - To generate a new key pair, run `cast wallet new`\n  - Copy your private key, and paste it into `.env` as the `PRIVATE_KEY` variable\n\n- ### Optional: configure the smart account for Pimlico\n\n  - If you're using Pimlico, you can use a different smart account type by changing the `account_type` variable in `.env`\n    - Valid values: `simple`, `safe`, `kernel`\n    - [pimlico/src/account.js](https://github.com/coinbase/paymaster-bundler-examples/blob/master/examples/pimlico/src/account.js) is a code example on how to configure a different smart account for SDKs that support this feature\n\n### 3. Navigate to the directory of the SDK you want to run the example with.\n\nExample for Alchemy\n\n```\ncd examples/alchemy\n```\n\n### 4. Install the dependencies with yarn\n\n```\nyarn\n```\n\n### 5. Run the example\n\n```\nyarn dev\n```\n\n### 6. See your sponsored transaction live!\n\nYou should receive an Etherscan link with your sponsored transaction in the terminal output. [Example](https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885)\n\n```\nMinting to 0xF19CEA17462220437000F459f721e3e393bd1fc9\nWaiting for transaction...\n ⛽ Successfully sponsored gas for mintTo transaction with Coinbase Developer Platform!\n 🔍 View on Etherscan: https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885\n✨  Done in 5.66s.\n```\n\n### 7. Play around with our demo app\n\nIf you'd like to see an example of an app sponsoring NFT mints in action, check out our demo app [here](https://paymaster-demo-app.vercel.app/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fpaymaster-bundler-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinbase%2Fpaymaster-bundler-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase%2Fpaymaster-bundler-examples/lists"}