Follow these steps to get this project up and running on your local machine:
-
Clone the repository
Use the following command to clone this repository to your local machine:
git clone [email protected]:zerodevapp/zerodev-examples.git
-
Install dependencies
Navigate to the project directory and install the dependencies:
cd zerodev-examples npm install
-
Setup environment variables
Copy the
.env.example
file to.env
and fill in the values:cp .env.example .env
For
ZERODEV_RPC
, you can get it from the ZeroDev dashboard by creating a project. The examples use Sepolia, so make sure to create a project for Sepolia.The
PRIVATE_KEY
can be any valid Ethereum private key. You should use a random test key; this website can generates random keys for you.If you want to run the examples on another network, make sure to update the
chain
object in the code (some examples use the chain object in ./utils.ts so you'd need to update it there). -
Run the script
Run any of the example scripts using the following command:
npx ts-node path/to/script.ts