Skip to content

ionicprotocol/ionic-api

Repository files navigation

🌊 Ionic API

A robust and secure REST API for interacting with Ionic Protocol across multiple chains. Built with TypeScript, Express, and Viem.

🌟 Features

  • 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

🚀 Quick Start

  1. Clone & Install

    git clone <repository-url>
    cd ionic-api
    npm install
  2. Environment Setup

    cp .env.example .env
    # Add your credentials:
    # SUPABASE_API_URL=your_supabase_url
    # SUPABASE_API_KEY=your_supabase_key
  3. Start Development Server

    npm run dev

📚 API Documentation

Swagger UI

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

Available Endpoints

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.

🛠️ Tech Stack

  • 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

🔐 Security

This API implements several security measures:

  • Request validation
  • Secure HTTP headers
  • Environment variable protection
  • Error handling

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

⚡ Performance

  • Optimized for high throughput
  • Efficient error handling
  • Fast response times
  • Minimal dependencies

🔗 Related Links


Built with ❤️ for the DeFi community

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published