Step into the Paymaster Bundler experience.
Just a quick heads up: this experience is a work in progress, keep an eye out for updates as we work on making it even better!
VAULT
Items
Mystery boxes
Athena Mystery Box
Guide
Paymaster & Bundler Experience
Welcome to the Paymaster & Bundler experience! This guide will help you get started with Coinbase Cloud's Paymaster.
If you haven't done so already, check the Build Onchain Apps homepage to get the repo running locally. You'll also need to complete the setup steps below to render the application locally.
1. Sign up for Coinbase Cloud and create your Base project
This example uses Coinbase Cloud's Paymaster and Bundler to sponsor transactions.
Get started with .25 ETH in free credits:- Navigate to the Base Node homepage
- Sign up for a Coinbase Cloud account, if you don't have one already
- Create a
Base
project underStart a New Project
- Choose
Sepolia
as the network - Under Paymaster & Bundler, click
Activate
- This step may take up to 30 seconds to propagate changes
(Optional) Set a custom gas policy for your project under Manage
- Copy your RPC URL, and set it as
NEXT_PUBLIC_RPC_URL
andNEXT_PUBLIC_PAYMASTER_URL
in the .env file.
2. Set up your embedded wallet & signer
This example uses Privy embedded wallets for authentication and as a signer for the smart contract account.
However, you can use any other embedded wallet or signer.- Navigate to https://www.privy.io/
- Create an app, copy your app ID, and set it as
NEXT_PUBLIC_PRIVY_ID
in the .env file. - You can customize the logo and name of your application in the dashboard.
- To change the signer for the smart contract account, modify these lines in
PaymasterBundlerDemo.tsx
javascript
...
3. Send your own sponsored transactions!
- Get started by modifying
./_contracts
and replacing it with the contract ABI of your choice. - In
constants.ts
, modify thecontract_address
environment variable. - In the
handleOpenBox
callback inGameplay.tsx
, you'll want to replace theencodeFunctionData
parameters with the ABI, function name, and arguments of the contract you're calling. - To integrate with other SDKs like Alchemy or Pimlico, refer to the Coinbase Cloud example repo.
javascript
...