A terminal-style interface for cross-chain swaps powered by NEAR Intents. Built with TanStack Start, this application provides a command-line inspired experience for seamless token swaps across blockchain networks.
Bitcoin Terminal is a modern, terminal-inspired interface for seamless cross-chain swaps. Built with the latest web technologies, it provides a familiar command-line experience for swapping tokens across different blockchain networks. The application integrates with Defuse Protocol for cross-chain swap infrastructure and uses NEAR Intents for transaction resolution.
- Terminal Interface: Interactive command-line style interface for swap operations
- Cross-Chain Swaps: Swap tokens across different blockchain networks powered by NEAR Intents
- Real-time Status: Track swap status with automatic polling
- QR Code Display: Deposit address displayed as QR code for easy scanning
- ASCII QR Codes: Fallback ASCII representation for terminal environments
- Type-Safe: Built with TypeScript for maximum type safety
- PWA Support: Installable as a Progressive Web App
- Node.js 18+
- pnpm 8+
# Install dependencies
pnpm install
# Start development server
pnpm devThe application will be available at http://localhost:3000
pnpm buildpnpm previewThis application uses environment variables for configuration. Create a .env file in the root directory based on the example below:
DEFUSE_JWT_TOKEN- JWT authentication token for Defuse Protocol. Obtain this from the NEAR Intents Partner Portal by signing in and accessing your organization credentials.
DEFUSE_JWT_TOKEN=your_jwt_token_hereTo obtain your DEFUSE_JWT_TOKEN:
- Visit the NEAR Intents Partner Portal
- Sign in with your organization account
- Navigate to your API or credentials section
- Copy your JWT token and add it to the
.envfile
swap- Start a new swap wizardstatus <addr>- Check status of a deposit addressclear- Clear terminal outputhelp- Show available commandscancel- Cancel current swap operation
- Type
swapto start a new swap wizard - Follow the prompts to select:
- Source token and blockchain
- Amount to swap
- Source address
- Destination chain and token
- Destination address
- Confirm the swap
- Send tokens to the displayed deposit address
- Type
sentto start tracking the swap status
- TanStack Start - Full-stack React framework
- TanStack Router - Type-safe routing
- TanStack Query - Data fetching and caching
- Defuse Protocol One-Click SDK - Cross-chain swap infrastructure
- Tailwind CSS - Styling
- Radix UI - Accessible UI components
- Vite - Build tool and dev server
This project uses Biome for linting and formatting:
# Check for issues
pnpm check
# Format code
pnpm format
# Lint code
pnpm lintThis project uses Vitest for testing:
pnpm testsrc/
├── components/
│ ├── terminal/ # Terminal interface components (Terminal, TerminalBody, TerminalHeader, TerminalInput, QRCodeDisplay)
│ └── ui/ # Reusable UI components (Button, Input)
├── constants/ # Application constants
├── hooks/ # Custom React hooks (useStatusPolling, useTerminalWizard)
├── integrations/ # Third-party integrations (TanStack Query provider and devtools)
├── lib/ # Utility functions (errors, errorUtils, qrUtils, tokenUtils, utils)
├── orpc/ # RPC client and router (Defuse Protocol integration)
├── routes/ # TanStack Router routes and configuration
├── styles.css # Global styles
├── types/ # TypeScript type definitions
├── router.tsx # Router configuration
├── polyfill.ts # Polyfills
└── logo.svg # Application logo
public/ # Static assets (favicons, manifests)
├── favicon.ico
├── favicon.svg
├── apple-touch-icon.png
├── web-app-manifest-*.png
└── robots.txt
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue on the GitHub repository.
- Defuse Protocol for cross-chain swap infrastructure
- TanStack for excellent React libraries
- NEAR Protocol ecosystem support