π Live Demo Β· πΈ Screenshots Β· βοΈ Deployed Contract
OrbitSwap is a production-ready decentralized token swap application built on the Stellar network. Users can securely connect multiple Stellar wallets, browse supported assets, inspect Stellar DEX market information, interact with deployed Soroban smart contracts, execute token swaps, monitor transaction progress, and receive live blockchain updates through a responsive modern interface.
- π Multi-Wallet Support β Connect with Freighter, xBull, Albedo, Rabet, and LOBSTR via StellarWalletsKit
- π± Token Swap Interface β Production-quality DEX experience with real-time quotes
- π Market Information β Live price feeds from Stellar DEX order books
- βοΈ Soroban Smart Contract β Deployed contract for swap operations with read/write support
- π‘ Real-Time Events β Live contract event streaming and blockchain synchronization
- π Transaction Tracking β Full lifecycle tracking: preparing β pending β confirmed
- π Notifications β Toast notifications for all wallet and transaction events
- π± Responsive Design β Optimized for desktop, tablet, and mobile
- βΏ Accessibility β Semantic HTML, keyboard navigation, ARIA labels, focus states
- π§ͺ Comprehensive Tests β 29 passing tests covering hooks, components, and services
| Layer | Technologies |
|---|---|
| Frontend | React 18, TypeScript, Vite, Tailwind CSS |
| Blockchain | Stellar SDK, Soroban SDK |
| Wallets | StellarWalletsKit (Freighter, xBull, Albedo, Rabet, LOBSTR) |
| Smart Contract | Soroban (Rust), deployed on Stellar Testnet |
| State | Zustand |
| Routing | React Router v6 |
| Testing | Vitest, React Testing Library |
| Linting | ESLint, Prettier |
| Build | Vite |
orbitswap/
βββ contracts/
β βββ orbitswap/
β βββ Cargo.toml # Soroban contract manifest
β βββ src/
β βββ lib.rs # Smart contract implementation
β βββ test.rs # Contract unit tests
βββ public/
β βββ favicon.svg
β βββ wallets/ # Wallet icon SVGs
βββ src/
β βββ components/
β β βββ layout/ # Navbar, Footer, Layout
β β βββ swap/ # SwapCard, AssetSelector
β β βββ ui/ # Button, Skeleton, StatusBadge, Toast
β β βββ wallet/ # WalletSelector, WalletPanel
β βββ constants/ # App configuration
β βββ contracts/ # Contract references
β βββ hooks/ # Custom React hooks
β βββ pages/ # HomePage, HistoryPage
β βββ providers/ # WalletProvider, ContractProvider
β βββ services/ # wallet.service, stellar.service, contract.service
β βββ store/ # Zustand state management
β βββ styles/ # Global CSS with Tailwind
β βββ test/ # Test setup and test files
β βββ types/ # TypeScript type definitions
βββ .env.example # Environment variables template
βββ index.html
βββ package.json
βββ tailwind.config.js
βββ tsconfig.json
βββ vite.config.ts
- Node.js >= 18
- npm >= 9
- A Stellar wallet browser extension (Freighter, xBull, Albedo, or Rabet)
# Clone the repository
git clone https://github.com/your-username/orbitswap.git
cd orbitswap
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env| Variable | Description | Default |
|---|---|---|
VITE_STELLAR_NETWORK |
Stellar network (TESTNET or PUBLIC) |
TESTNET |
VITE_HORIZON_URL |
Horizon API endpoint | https://horizon-testnet.stellar.org |
VITE_SOROBAN_RPC_URL |
Soroban RPC endpoint | https://soroban-testnet.stellar.org |
VITE_CONTRACT_ID |
Deployed Soroban contract ID | CDMFGNFKQOJ3IRFN7GYL2B6242TWQX3JXLUHUZB3CLK2HNUT7VLYMNVN |
VITE_APP_NAME |
Application name | OrbitSwap |
VITE_APP_URL |
Application URL | http://localhost:3000 |
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm run preview# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverageπ https://orbitswap-eta.vercel.app
Deployed on Vercel.
Wallet selector modal showing all 5 supported Stellar wallets: Freighter, xBull, Albedo, Rabet, and LOBSTR
OrbitSwap supports 5 Stellar wallets through StellarWalletsKit:
| Wallet | Installation |
|---|---|
| Freighter | freighter.app |
| xBull | xbull.app |
| Albedo | albedo.link |
| Rabet | rabet.io |
| LOBSTR | lobstr.co |
- Click the "Connect Wallet" button in the navigation bar
- Select your preferred wallet from the list
- Approve the connection request in your wallet extension
- Your wallet address and balance will appear in the Wallet Panel
- Multi-wallet switching β Switch between wallets without refreshing
- Auto-reconnect β Persists wallet connection across page reloads
- Address display β Shows short address with copy-to-clipboard
- Balance tracking β Real-time balance updates every 15 seconds
- Network badge β Displays current Stellar network
The OrbitSwap Soroban smart contract manages:
- Asset registry β Maintains a list of supported swap assets
- Swap estimation β Calculates estimated output and fees
- Swap execution β Validates and executes token swaps with slippage protection
- Admin controls β Pause/unpause functionality for emergency stops
- Events β Emits
SwapExecutedevents for real-time tracking
contracts/orbitswap/
βββ Cargo.toml
βββ src/
βββ lib.rs # Contract + client implementation
βββ test.rs # Contract tests (init, swap, pause)
- Network: Stellar Testnet
- Contract ID:
CDMFGNFKQOJ3IRFN7GYL2B6242TWQX3JXLUHUZB3CLK2HNUT7VLYMNVN - Soroban RPC: https://soroban-testnet.stellar.org
- Deployer:
GDQY77NYQ2A4RYCQ4PKD2BFC532ECYEKPFHPS24POUHG7L4KLDB74567
- Transaction Hash (init):
8f582b3bd3a59c4ed777e7f74f3c6b01ee859129d7658bd3999cfc9928a4ef73 - Stellar Expert: View on Explorer
- Network: Testnet
- Function Called:
init(admin: orbitswap-deployer)
This is a Soroban contract invocation (init function), fully verifiable on Stellar Explorer.
# Install Rust and Soroban CLI
cargo install --locked soroban-cli
# Build the contract
cd contracts/orbitswap
cargo build --target wasm32-unknown-unknown --release
# Deploy to testnet (requires funded Stellar account)
soroban contract deploy \
--wasm target/wasm32-unknown-unknown/release/orbitswap.wasm \
--source <YOUR_SECRET_KEY> \
--network testnetThe frontend interacts with the contract via ContractService:
Read Operations:
get_assets()β Fetch supported assetsget_swap_estimate()β Get swap quote from contractget_balance()β Check contract balance for an asset
Write Operations:
swap()β Execute a token swap with slippage protectionadd_asset()β Admin: add a new supported assetpause()/unpause()β Admin: emergency pause controls
Contract events are streamed via polling (every 5 seconds) using the Soroban RPC getEvents endpoint. Events are stored in the Zustand store and displayed in the Notifications panel.
Every transaction goes through a defined lifecycle:
Preparing β Awaiting Wallet Approval β Signing β Submitting β Pending β Confirmed
β Failed
β Rejected
β Timeout
Status badges are displayed with color-coded indicators:
- π‘ Pending states β amber/yellow pulsing dot
- π’ Confirmed β green dot
- π΄ Failed/Rejected β red dot
- βͺ Timeout β gray dot
- Connect Wallet β Select and connect a Stellar wallet
- Select Assets β Choose input and output tokens from the asset selector
- Enter Amount β Input the swap amount (or click MAX)
- Review Quote β View exchange rate, network fee, and estimated output
- Confirm Swap β Review the preview modal and confirm
- Track Transaction β Monitor status with in-app tracking and Explorer links
The application explicitly handles these error scenarios:
| Error | Display | Recovery |
|---|---|---|
| Wallet not installed | Installation guide + link | Install wallet, retry |
| Wallet rejected request | User cancelled message | Dismiss, retry |
| Insufficient balance | Current vs required balance | Add funds, retry |
| Unsupported network | Network mismatch warning | Switch network |
| Timeout | Transaction timeout notice | Retry transaction |
| Contract failure | Friendly error message | Dismiss, retry |
All transactions include direct links to Stellar Expert for on-chain verification.
MIT Β© 2026 OrbitSwap
Built for the Rise In Stellar Builder Challenge β Level 2 (Yellow Belt).
Built with:
- Stellar β Decentralized blockchain network
- Soroban β Smart contract platform
- StellarWalletsKit β Multi-wallet integration
