Prerequisites
Getting an endpoint on Base Sepolia
How to Get a Paymaster & Bundler endpoint on Base testnet (Sepolia) from CDP
- Create a new CDP account or sign in to your existing account.
- Navigate to Paymaster.
- The address of the NFT contract we are calling is
0x66519FCAee1Ed65bc9e0aCc25cCD900668D3eD49
, add that to the contract allowlist and save the policy. - Switch to Base testnet (Sepolia) in the top right of the configuration.
- Copy your endpoint to use later.
Expand for images and click to enlarge
Expand for images and click to enlarge

Sending a transaction
How to call the mint function of a Base Sepolia NFT contract (or contract of choice)1. Initialize your project
In your terminal, create a directory calledpaymaster-tutorial
and initialize a project using npm.
2. Download dependencies
- Install
viem
.
3. Create smart account using a private key
The example below uses Coinbase smart wallet, but any smart account will work. a. Create a new private key with Foundry. b. Install Foundry:curl -L https://foundry.paradigm.xyz | bash
c. Generate a new key pair: cast wallet new
.
d. Update your config.js
file with the private key and create the account.
4. Add your smart contract’s ABI
Create a file calledexample-app-abi.js
to store our NFT contract’s abi and address. You will have to update this to your smart contract’s ABI.
5. Create the Bundler and Paymaster clients, submit transaction
Create a new file calledindex.js