This project demonstrates a seamless integration with the Solana blockchain using Reown's AppKit. It provides a modern web interface for connecting to Solana wallets (like Phantom) and handling transactions for both SOL and USDT tokens.
- Solana wallet integration (Phantom)
- SOL token transactions
- USDT token transactions
Before you begin, ensure you have the following installed:
- Clone the repository:
git clone <repository-url>
cd <project-directory>- Install dependencies:
npm install- Build the application:
task gen- Start the development server:
task serve-
Open your browser and navigate to the local server address (typically shown in the console output).
-
Connect your Solana wallet when prompted.
After loading the application, you can use the following commands in your browser's console:
// Open the wallet connection modal
window.wallet.connect();
// Check if wallet is connected
window.wallet.isConnected();// Send SOL to an address
// Parameters: toAddress (string), token type ("SOL"), amount (number)
window.wallet.sendTransaction("RECIPIENT_ADDRESS", "SOL", 0.1);
// Send USDT to an address
// Parameters: toAddress (string), token type ("USDT"), amount (number)
window.wallet.sendTransaction("RECIPIENT_ADDRESS", "USDT", 10);Note:
- Always verify the recipient address before sending
The project uses Webpack for bundling and Task for build automation. The main configuration files are:
webpack.config.js- Webpack configurationTaskfile.yaml- Task runner configuration
To modify the build process, you can edit these configuration files according to your needs.