
Near-FusionSwap
Cross-chain atomic swaps between Polygon & NEAR using HTLC contarcts and 1inch Fusion+ protocol
Demo
About
Near-FusionSwap Seamless Cross-Chain Swaps Between NEAR Protocol and Polygon Project Identity Near-FusionSwap represents the fusion of two blockchain ecosystems - NEAR Protocol's developer-friendly infrastructure with Polygon's EVM compatibility. The name emphasizes: "Near": Primary integration with NEAR Protocol blockchain "Fusion": The seamless merging of different blockchain networks "Swap": Core token exchange functionality Using 1inch fusion+ and htlc contarcts we have enabled the cross chain swap between EVM and NEAR ecosystem
How it's made
Architecture Overview Near-FusionSwap is a sophisticated cross-chain DEX that bridges NEAR Protocol and Polygon networks using a novel Hash Time-Locked Contract (HTLC) approach combined with 1inch's Fusion+ protocol. Here's the technical breakdown: Core Technologies & Integration - Rust for Near HTLC contracts - Next.js 14 with App Router for SSR/SSG - Wagmi v2 + RainbowKit for multi-wallet support - Ethers.js v6 for blockchain interactions - TypeScript for type safety across the entire stack Real-time Price Feeds: Built a custom useTokenPrices hook that fetches from 1inch API with caching and error handling Cross-Chain Detection: Implemented intelligent swap type detection that automatically switches UI modes Backend Orchestration (NestJS) - NestJS framework for scalable TypeScript backend - Modular service architecture (PolygonService, NearService, OrderService) - RESTful APIs for cross-chain coordination Service Separation: Each blockchain has its dedicated service layer for clean separation of concerns Order Management: Custom DTO (Data Transfer Objects) for type-safe API communication