Gas Saver Simulator is a full stack web app (React and Node.js) that allows users to simulate gas costs for token swaps on the Ethereum blockchain. It utilizes the Enso Network API to fetch real-time swap data.
- Simulate gas costs and token swaps on the Ethereum blockchain.
- Get insights on gas cost (in ETH), price impact, and amount out.
- Simple and intuitive React user interface built with v0.
- Powered by the Enso Network API.
Here’s a quick walkthrough of the app in action:
Ensure you have the following installed:
- Node.js
- npm or yarn
- Clone this repository:
git clone https://github.com/hummusonrails/gas-saver-simulator.git cd gas-saver-simulator npm install
- Rename the
.env.sample
file to.env
and fill in the required environment variables:
ENSO_API_KEY
: Your Enso Network API key. Info on getting your API key can be found in the docs.VITE_API_BASE_URL
: The base URL of your backend server, i.e.https://localhost:3000
.
-
Start the development server:
npm run dev
-
Run the backend server:
node src/app.js
-
Open the application in your browser at http://localhost:5173 (or the URL where you deployed it to).
src/
├── components/
│ ├── ui/ # Reusable UI components (button, card, input, etc.)
│ └── GasSaverSimulator.tsx # Main application component
├── pages/ # Styles and page-level files
├── routes/ # Backend API routes
├── services/ # Enso API service logic
This project integrates with the Enso Network API to simulate token swaps and fetch real-time gas data. The API Swagger reference provides detailed information on the available endpoints.
This project is licensed under the MIT License.