Sponsor Coinbase Smart Wallet transactions with paymasters on Polygon Proof of Stake chain.
- 🔗 Connect to the application via Coinbase Smart Wallet.
- 💸 Perform transactions from your newly created wallet.
- 🚫 Pay no gas fees! Thanks to the power of paymasters to cover user's gas fees.
I have written a full tutorial on how to build this application from scratch. Read the tutorial!
To get started locally:
-
Clone this repository.
-
Install dependencies with
pnpm install
. -
Create a thirdweb API key on the thirdweb dashboard.
-
Create a
.env.local
file in the root of the project and add the following:NEXT_PUBLIC_THIRDWEB_CLIENT_ID=your-thirdweb-client-id-goes-here
. -
On the page.tsx file, set what chain you want to use (from the list of supported chains). Note: You need to add a credit card to your thirdweb account if you want to use mainnet chains. To use testnets such as
baseSepolia
, you don't need to add a credit card.// The default is polygon mainnet, which requires a credit card on your thirdweb account. import { polygon } from "thirdweb/chains"; const chainToUse = polygon;
-
For mainnet use, configure paymaster rules on the thirdweb dashboard.
-
Run the application with
pnpm run dev
and visit http://localhost:3000/ in your browser.
Reach out to me on Twitter @jarrodwattsdev or open an issue on this repository for any questions or feedback.