A robust and secure REST API for interacting with Ionic Protocol across multiple chains. Built with TypeScript, Express, and Viem.
-
Multi-Chain Support: Seamlessly interact with Ionic Protocol on:
- ⚡ Mode Network
- 🔵 Base
- 🔴 Optimism
- 🟣 Bob
- 🟡 Fraxtal
- 🟢 Lisk
- 🔷 Ink
- 🟨 SuperSeed
- 🟦 WorldChain
- 🟩 Swell
- 🟪 Soneium
- 🔘 OzeanTest
- 🔶 CampTest
-
Core Operations:
- 💰 Supply assets
- 🏦 Withdraw funds
- 💸 Borrow assets
- 💳 Repay loans
-
Security First:
- 🔒 Helmet security headers
- ✅ Input validation
- 🛡️ CORS protection
- 🔐 Environment variable protection
-
Clone & Install
git clone <repository-url> cd ionic-api npm install
-
Environment Setup
cp .env.example .env # Add your credentials: # SUPABASE_API_URL=your_supabase_url # SUPABASE_API_KEY=your_supabase_key
-
Start Development Server
npm run dev
Access our interactive API documentation at /api-docs
to:
- Explore all available endpoints
- Test API calls directly from your browser
- View request/response schemas
- Download OpenAPI specification
Supply Assets
POST /beta/v0/ionic/supply/:chain
Supply assets to an Ionic pool.
Withdraw Assets
POST /beta/v0/ionic/withdraw/:chain
Withdraw your supplied assets.
Borrow Assets
POST /beta/v0/ionic/borrow/:chain
Borrow assets from a pool.
Repay Loan
POST /beta/v0/ionic/repay/:chain
Repay your borrowed assets.
Get Pool Address
GET /beta/v0/ionic/market-address/:chain/:asset
Retrieve the Market address for a specific asset.
- TypeScript - Type safety and better developer experience
- Express - Fast, unopinionated web framework
- Viem - Modern Ethereum library
- Supabase - Backend infrastructure
- Helmet - Security middleware
- CORS - Cross-origin resource sharing
This API implements several security measures:
- Request validation
- Secure HTTP headers
- Environment variable protection
- Error handling
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Optimized for high throughput
- Efficient error handling
- Fast response times
- Minimal dependencies
Built with ❤️ for the DeFi community