This project aims to leverage the ERC4337 Ethereum Protocol to implement Account Abstraction with a simple Account management system. The project provides the following features:
- Create Account: Provides the option to create a new account, with an additional capability to create an account from a signing key.
- Find Account by ID: Enables users to search for an account using a unique account ID.
- Get Smart Wallet Address: Retrieves the address of a smart wallet associated with an account.
- Transfer ETH: Enables users to transfer Ethereum (ETH) from one account to some Ethereum address.
- Transfer ERC20 token: Allows users to transfer ERC20 tokens from one account to some Ethereum address.
To get started with the project, follow these steps:
- Clone the repository:
git clone https://github.com/thunderjr/erc-4337-account-factory-nestjs
- Navigate to the project directory:
cd erc-4337-account-factory-nestjs
- Install the dependencies:
yarn install
-
Configure the Ethereum network settings:
- Rename the
.env.example
file to.env
in the project root directory. - Set your network provider RPC URL in the
RPC_URL
variable. - The
PAYMASTER_URL
is only required if you're sendingwithPaymaster
on the request's body.
- Rename the
-
Start the application:
yarn start
Once the application is running, you can interact with the API endpoints to perform various operations. Below are the available API endpoints:
POST /account
: Create a new account.GET /account/:id
: Get account details by ID.GET /accounts/:id/address
: Get the smart wallet address associated with an account.POST /transaction/transfer
: Transfer ETH from one account to some Ethereum address.POST /transaction/erc20-transfer
: Transfer ERC20 tokens from one account to some Ethereum address.