A modern web application for creating and managing Solana tokens using Metaplex, Next.js, TailwindCSS, and Zustand.
- β Create Fungible Tokens β Generate custom Solana tokens with unique metadata.
- β Decentralized Storage β Upload token images securely.
- β Customizable Tokenomics β Set supply, decimals, and other properties.
- β Seamless Wallet Integration β Connect using Solana Wallet Adapter.
- β Modern UI/UX β Built with Next.js & TailwindCSS, with dark/light mode support.
- β State Management β Uses Zustand for efficient global state management.
- β Metaplex Umi Integration β Leverages Metaplex's Umi framework for streamlined blockchain operations.
|-------------|---------| | Next.js | React framework for server-side rendering & static generation | | TailwindCSS | Rapid UI styling with utility-first CSS | | Solana Wallet Adapter | Wallet authentication & connection handling | | Metaplex Umi | Lightweight SDK for interacting with the Solana blockchain | | Zustand | Global state management | | TypeScript | Static typing for reliability and scalability |
git clone https://github.com/an-ordinary-dev/SolanaTokenCreatorr.git
cd SolanaTokenCreatorrnpm install
# or
yarn installCreate a .env.local file in the root directory with the following:
# Solana RPC URL (Default: Devnet)
NEXT_PUBLIC_RPC_URL=https://api.devnet.solana.com
# Wallet Address for Minting Fees
NEXT_PUBLIC_FEE_ADDRESS=your_wallet_address_here
# Fee Amount (in SOL)
NEXT_PUBLIC_FEE_AMOUNT=0.005npm run dev
# or
yarn devNow, open http://localhost:3000 in your browser.
| Variable | Description |
|---|---|
NEXT_PUBLIC_RPC_URL |
Solana RPC URL for blockchain interactions (Devnet/Mainnet) |
NEXT_PUBLIC_FEE_ADDRESS |
Wallet address where minting fees are sent |
NEXT_PUBLIC_FEE_AMOUNT |
Minting fee in SOL (default: 0.005 SOL) |
- Replace
NEXT_PUBLIC_FEE_ADDRESSwith your actual Solana wallet address. - If deploying on Mainnet, update
NEXT_PUBLIC_RPC_URLaccordingly. - Ensure your wallet has enough SOL for transaction fees.
You can modify the RPC URL via:
.env.local(Recommended)constants.ts- Hardcoded in
umiStore(Not recommended)
Example (in src/store/useUmiStore.ts at line 21):
const useUmiStore = create<UmiState>()((set) => ({
// Add your own RPC here
umi: createUmi('https://api.devnet.solana.com').use(
signerIdentity(
createNoopSigner(publicKey('11111111111111111111111111111111'))
)
),
signer: undefined,
updateSigner: (signer) => {
console.log('updateSigner')
set(() => ({ signer: createSignerFromWalletAdapter(signer) }))
},
}))Zustand is used for state management, allowing us to store and manage the Umi instance globally.
Advantages:
- Access state anywhere in
.tsor.tsxfiles. - Automatic signer updates when wallet adapter changes.
- Lightweight & efficient compared to Redux.
const umi = useUmiStore().umi
const signer = useUmiStore().signer
umi.use(signerIdentity(signer))const umi = useUmiStore.getState().umi
const signer = useUmiStore.getState().signer
umi.use(signerIdentity(signer))The /lib/umi folder contains helper functions for managing blockchain interactions.
This function:
- Sends transactions with the latest wallet adapter state.
- Confirms transactions with a specified commitment level.
- Handles priority fees.
Example:
// import useUmiStore from '@/store/useUmiStore'
// import { setComputeUnitPrice } from '@metaplex-foundation/mpl-toolbox'
// import { TransactionBuilder, signerIdentity } from '@metaplex-foundation/umi'
// import { base58 } from '@metaplex-foundation/umi/serializers'
// const sendAndConfirmWalletAdapter = async (tx: TransactionBuilder) => {
// const umi = useUmiStore.getState().umi
// const signer = useUmiStore.getState().signer
// umi.use(signerIdentity(signer!))
// const blockhash = await umi.rpc.getLatestBlockhash()
// const transactions = tx.add(setComputeUnitPrice(umi, { microLamports: BigInt(100000) }))
// const signedTx = await transactions.buildAndSign(umi)
// const signature = await umi.rpc.sendTransaction(signedTx)
// const confirmation = await umi.rpc.confirmTransaction(signature, { strategy: { type: 'blockhash', ...blockhash } })
// return { signature: base58.deserialize(signature), confirmation }
// }
// export default sendAndConfirmWalletAdapterThis project is optimized for deployment on Vercel.
- Push your code to GitHub.
- Connect your repository to Vercel.
- Add environment variables on Vercel.
- Click Deploy.
If deploying on your own server:
npm run build
npm startThis project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you have any questions or need help, please open an issue on GitHub.