CoinSwitch is a decentralized token swapping application built on the Solana blockchain. It allows users to seamlessly exchange tokens, view balances, and manage slippage settings—all within an intuitive and user-friendly interface.
- Token Swapping: Swap tokens on the Solana network using the Jupiter Aggregator API.
- Wallet Integration: Connect your wallet via Solana Wallet Adapter for secure transactions.
- Token Balances: View real-time token balances.
- Slippage Settings: Configure slippage tolerance to prevent unexpected outcomes during swaps.
- Live Exchange Rates: See the real-time exchange rate for your selected tokens.
- Responsive Design: Fully responsive and optimized for mobile and desktop users.
- Frontend: React.js, Next.js
- Blockchain: Solana
- Libraries:
@solana/web3.js: Interact with the Solana blockchain.@solana/wallet-adapter-react: Wallet integration for Solana.axios: Fetch data from APIs.react-toastify: Toast notifications for user feedback.lucide-react: Icons for a modern UI.
- Node.js and npm installed.
- A wallet that supports Solana, e.g., Phantom.
-
Clone the Repository
git clone https://github.com/Ayush272002/CoinSwitch.git cd CoinSwitch -
Install Dependencies
npm install
-
Run the Development Server
npm run dev
-
Access the App Open your browser and navigate to
http://localhost:3000.
-
Update the Solana cluster endpoint in the
Connectionobject (https://api.devnet.solana.com) if required. For example, to switch to the mainnet:const connection = new Connection( 'https://api.mainnet-beta.solana.com', 'confirmed' );
-
The swap uses Jupiter Aggregator's API for quotes. Ensure you have network access to the API endpoints.
- Connect your wallet using the "Connect Wallet" button.
- Select tokens for swapping from the dropdown lists.
- Enter the amount of tokens to sell.
- (Optional) Adjust slippage tolerance by clicking the gear icon.
- Click Swap to complete the transaction.
- Build the project for production:
npm run build
- Start the production server:
npm start
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature name" - Push to the branch:
git push origin feature-name
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Jupiter Aggregator for providing the swap API.
- Solana for the blockchain infrastructure.
- Phantom for wallet integration support.
For questions, issues, or feature requests, please contact Ayush272002.