🚀Multi-Chain Payment Gateway

A comprehensive multi-chain payment gateway supporting Ethereum, BSC, Arbitrum, Polygon, and Harmony with advanced dashboards, administrative controls, and easy-to-integrate client-side widgets.

✨ Features

Multi-Chain Support

  • Ethereum Mainnet: Native ETH, WBTC, WETH, USDT, DAI, USDC

  • Binance Smart Chain: Native BNB, BTCB, USDT, DAI, USDC

  • Arbitrum One: Native ETH, WBTC, WETH, USDT, DAI, USDC

  • Polygon: Native MATIC, WBTC, WETH, USDT, DAI, USDC

  • Harmony One: Native ONE, ETH, BTC, USDT, DAI, USDC

Comprehensive Dashboards

  • Main Dashboard: Real-time overview of all chains, payments, and system health

  • Administrative Dashboard: Complete configuration management for chains, widgets, and security

  • Widget Management: Create, configure, and manage client-side payment widgets

  • Multi-Chain Monitoring: Live status of all blockchain networks with latency and block data

Client-Side Widgets

  • Easy Integration: Single script tag deployment

  • Customizable Themes: Light and dark mode support

  • Multi-Chain Selection: Users can choose their preferred blockchain

  • Payment Calculation: Real-time amount calculation with discount support

  • Event-Driven: Custom events for seamless integration with existing applications

Advanced Features

  • Discount System: Configurable discount codes and percentages

  • Transaction Verification: Automatic blockchain verification of payments

  • Security: Rate limiting, CORS protection, and secure headers

  • RESTful API: Clean and well-documented endpoints

  • Real-time Updates: Auto-refreshing dashboards with live data

🛠️ Installation

  1. Clone the repository

  2. Install dependencies

  3. Set up environment variables

  4. Start the server

🔧 Configuration

Environment Variables

Supported Blockchains

Blockchain
Native Token
Chain ID
Block Explorer

Ethereum

ETH

1

BSC

BNB

56

Arbitrum

ETH

42161

cd frontend pnpm install pnpm dev

Backend:

pnpm install pnpm dev

When developing locally run the backend at :3000 and the frontend Vite dev server (default :5173) or use pnpm run frontend:dev from project root which proxies /api to the backend.

| Harmony | ONE | 1666600000 | Harmony Explorer |

📊 Dashboards

Main Dashboard

Access the comprehensive dashboard at http://localhost:3000/dashboard.html

Features:

  • System Overview: Real-time health, uptime, and environment status

  • Multi-Chain Status: Connected chains, latency, and network health

  • Payment Statistics: Transaction volume, success rates, and analytics

  • Widget Analytics: Integration health and usage metrics

  • Blockchain Networks: Live status of all supported chains

Administrative Dashboard

Access admin controls at http://localhost:3000/admin-dashboard.html

Features:

  • Chain Management: Enable/disable chains, configure settings

  • System Configuration: Payment settings, security controls

  • Widget Management: Create, configure, and delete widgets

  • Security Settings: Rate limiting, CORS configuration

🔌 API Endpoints

Base URL

Dashboard Endpoints

Get Dashboard Data

Get Multi-Chain Statistics

Get System Health

Admin Endpoints

Get Configuration

Update Configuration

Chain Management

Widget Endpoints

Generate Widget

Request Body:

List Widgets

Serve Widget Script

🔗 Widget Integration

Quick Integration

Add this script tag to your website:

Custom Container

Specify a custom container for the widget:

Event Handling

Listen for payment events:

Widget Configuration

Widgets support various configuration options:

  • Type: payment, calculator

  • Theme: light, dark

  • Chains: Array of supported chains

  • Customization: Colors, branding, styling

🧪 Testing

Run the test suite:

Test specific modules:

🔐 Security Features

  • Multi-Chain Security: Secure transaction verification across all chains

  • Rate Limiting: Protects against abuse and DDoS attacks

  • CORS Protection: Configurable origin whitelist

  • Security Headers: Comprehensive security header configuration

  • Input Validation: Strict validation of all requests

  • Environment Isolation: Separate configurations for development and production

🚀 Deployment

Production Setup

  1. Set environment to production

  2. Configure production RPC endpoints

    • Set up reliable RPC endpoints for all chains

    • Configure proper rate limits and security settings

    • Set secure JWT secrets and encryption keys

  3. Use process manager

Docker Deployment

🤝 Integration Examples

E-commerce Integration

Subscription Service Integration

📈 Monitoring and Analytics

The gateway provides comprehensive monitoring:

  • Real-time Chain Status: Monitor all blockchain networks

  • Payment Analytics: Track transaction volume and success rates

  • Widget Performance: Monitor widget usage across domains

  • System Health: CPU, memory, and network monitoring

  • Custom Metrics: Configurable business metrics

🆘 Support and Documentation

  • API Documentation: Available at /api/docs (when enabled)

  • Widget Documentation: See /widget-demo.html for examples

  • Configuration Guide: Detailed in this README

  • Troubleshooting: Check logs and health endpoints

📝 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Commit your changes

  4. Push to the branch

  5. Create a Pull Request


Built with ❤️ for the multi-chain future

Last updated

Was this helpful?