A comprehensive TypeScript project for creating and managing SPL tokens on the Solana blockchain (Devnet). Built as part of the Turbin3 learning program. For the proofs refer to the Notion Link I have shared while I have also shared a docs folder for every proof regarding every contracts result.
- SPL Token initialization and minting
- Token metadata creation using Metaplex
- Associated Token Account (ATA) management
- Token transfers between accounts
- Vault operations (deposit/withdraw SOL & SPL tokens)
- NFT minting and metadata management
Before you begin, ensure you have the following installed:
- Node.js (v22 or higher)
- npm or yarn
- Solana CLI - Installation Guide
- Git
-
Clone the repository:
git clone https://github.com/Abhist17/solana-turbine.git cd solana-turbine -
Install dependencies:
npm install
-
Set up your Solana wallet:
# Generate a new wallet (if you don't have one) solana-keygen new --outfile ~/.config/solana/id.json # Create wallet directory in project mkdir -p ts/cluster1/wallet # Copy your wallet to the project cp ~/.config/solana/id.json ts/cluster1/wallet/turbin3-wallet.json
-
Configure Solana CLI for Devnet:
solana config set --url devnet -
Airdrop test SOL:
solana airdrop 2
solana-turbine/
├── ts/
│ ├── cluster1/
│ │ ├── wallet/
│ │ │ └── turbin3-wallet.json # Your wallet (DO NOT COMMIT!)
│ │ ├── spl_init.ts # Initialize SPL token
│ │ ├── spl_mint.ts # Mint tokens with metadata
│ │ ├── spl_transfer.ts # Transfer tokens
│ │ ├── spl_metadata.ts # Add/update token metadata
│ │ ├── nft_image.ts # Upload NFT image
│ │ ├── nft_metadata.ts # Create NFT metadata
│ │ ├── nft_mint.ts # Mint NFT
│ │ └── vault_*.ts # Vault operations
│ ├── prereq/
│ │ ├── keygen.ts # Generate keypair
│ │ ├── airdrop.ts # Request airdrop
│ │ ├── transfer.ts # Transfer SOL
│ │ └── enroll.ts # Enrollment script
│ └── tools/
│ ├── airdrop_to_wallet.ts
│ ├── base58_to_wallet.ts
│ └── wallet_to_base58.ts
├── package.json
├── tsconfig.json
└── README.md
# Generate a new keypair
npm run keygen
# Request airdrop
npm run airdrop
# Transfer SOL
npm run transfer
# Enroll in program
npm run enroll# Initialize a new SPL token
npm run spl_init
# Mint tokens (creates metadata)
npm run spl_mint
# Transfer tokens
npm run spl_transfer
# Add/update token metadata
npm run spl_metadata# Upload NFT image
npm run nft_image
# Create NFT metadata
npm run nft_metadata
# Mint NFT
npm run nft_mint# Initialize vault
npm run vault_init
# Deposit SOL
npm run vault_deposit
# Withdraw SOL
npm run vault_withdraw
# Deposit SPL tokens
npm run vault_deposit_spl
# Withdraw SPL tokens
npm run vault_withdraw_spl
# Deposit NFT
npm run vault_deposit_nft
# Withdraw NFT
npm run vault_withdraw_nft
# Close vault
npm run vault_close# Airdrop to specific wallet
npm run airdrop_to_wallet
# Convert base58 to wallet format
npm run base58_to_wallet
# Convert wallet to base58
npm run wallet_to_base58- Mint Address:
E2Xj89XKJDcQ8wswgNenJVDbkJ5oG4kUErvhTMvzYVFY - Symbol: MTK
- Name: My Token
- Network: Devnet
You can view the token on Solana Explorer
IMPORTANT SECURITY NOTES:
-
NEVER commit your wallet files to Git
turbin3-wallet.jsoncontains your private key- The
.gitignoreis configured to exclude all wallet files
-
This project uses Devnet
- All tokens are for testing only
- No real monetary value
-
For production use:
- Create a NEW wallet
- Use Mainnet RPC endpoints
- Implement additional security measures
Issue: "Cannot find module 'turbin3-wallet.json'"
# Solution: Create the wallet directory and add your wallet
mkdir -p ts/cluster1/wallet
cp ~/.config/solana/id.json ts/cluster1/wallet/turbin3-wallet.jsonIssue: "Insufficient funds"
# Solution: Airdrop more SOL
solana airdrop 2Issue: "Node module errors"
# Solution: Reinstall dependencies
rm -rf node_modules package-lock.json
npm install- Solana Web3.js - Solana JavaScript API
- @solana/spl-token - SPL Token program interactions
- @metaplex-foundation/umi - Metaplex unified framework
- @metaplex-foundation/mpl-token-metadata - Token metadata standard
- @coral-xyz/anchor - Solana program framework
- TypeScript - Type-safe JavaScript
- tsx - TypeScript execution engine
MIT License
Abhist
- GitHub: @Abhist17
- Project: solana-turbine
- Turbin3 team for the educational program
- Solana Foundation for the blockchain infrastructure
- Metaplex for NFT standards and tools
- Mint Address:
t7xSQLQV7yMmYASZ4TZDjgspAuDkeLdt3MFejQDtDvC - Name: My Token
- Symbol: MTK
- View on Explorer