An open API service indexing awesome lists of open source software.

https://github.com/harshgupta20/sol-airdrop

Solana devnet airdrop dApp that lets users connect their wallet and request free test SOL with a single click. Ideal for developers testing Solana programs.
https://github.com/harshgupta20/sol-airdrop

airdrop blockchain dapp devnet solana solanaairdrop solanaexplorer

Last synced: 5 months ago
JSON representation

Solana devnet airdrop dApp that lets users connect their wallet and request free test SOL with a single click. Ideal for developers testing Solana programs.

Awesome Lists containing this project

README

          

# ๐Ÿš€ Solana Airdrop DApp

This is a simple Solana-based airdrop dApp built using React + Vite, and integrated with the `@solana/wallet-adapter` to request test SOL tokens on the **Devnet**.

---

## ๐Ÿง  Features

- Connect Phantom or any Solana-compatible wallet
- Automatically fetch wallet address
- Airdrop SOL tokens (Devnet)
- Clean UI using Tailwind CSS
- Shows success/error status after airdrop

---

## ๐Ÿ–ฅ๏ธ Demo

![airdrop-demo](https://your-image-url-or-gif-here.com)

---

## ๐Ÿ“ฆ Tech Stack

- React + Vite
- Tailwind CSS
- @solana/web3.js
- @solana/wallet-adapter

---

## ๐Ÿš€ Getting Started

### 1. Clone the repo

```bash
git clone https://github.com/yourusername/solana-airdrop.git
cd solana-airdrop
```

### 2. Install dependencies

```bash
npm install
```

### 3. Run the development server

```bash
npm run dev
```

---

## ๐Ÿ”ง Configuration

Make sure you have the following packages installed:

```bash
npm install @solana/web3.js @solana/wallet-adapter-react @solana/wallet-adapter-react-ui @solana/wallet-adapter-wallets
```

Also install Tailwind CSS:

```bash
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
```

Then configure your `tailwind.config.js` like this:

```js
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
};
```

And include this in `src/index.css`:

```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```

---

## ๐Ÿ” Wallet Setup

Wrap your app with WalletProvider in `main.jsx` and configure supported wallets and network (Devnet):

```jsx
import {
WalletAdapterNetwork,
ConnectionProvider,
WalletProvider
} from '@solana/wallet-adapter-react';
import { WalletModalProvider } from '@solana/wallet-adapter-react-ui';
import {
PhantomWalletAdapter
} from '@solana/wallet-adapter-wallets';

const network = WalletAdapterNetwork.Devnet;

const wallets = [new PhantomWalletAdapter()];





```

---

## ๐Ÿ“ Folder Structure

```
.
โ”œโ”€โ”€ src
โ”‚ โ”œโ”€โ”€ Airdrop.jsx # The main airdrop component
โ”‚ โ”œโ”€โ”€ main.jsx # Entry point, WalletProvider configured here
โ”‚ โ”œโ”€โ”€ App.jsx # Renders Airdrop
โ”‚ โ””โ”€โ”€ index.css # Tailwind base styles
```

---

## ๐Ÿงช Test it

- Use: https://explorer.solana.com/?cluster=devnet to verify transactions

---

## ๐Ÿ™ Credits

Built with โค๏ธ by [Harsh Gupta](https://www.linkedin.com/in/harshgupta2001)

---

## ๐Ÿ“œ License

This project is licensed under the MIT License.