airdrop_sol
Request SOL airdrop for testing on devnet or testnet networks to fund wallets for blockchain development and transaction simulations.
Instructions
Request SOL airdrop for testing (devnet/testnet only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| walletName | Yes | Name of the wallet | |
| amount | No | Amount of SOL to airdrop (default: 1) |
Implementation Reference
- src/index.ts:726-748 (handler)The main execution handler for the 'airdrop_sol' tool. It validates the network and wallet, computes lamports, requests airdrop via Solana RPC, and returns the transaction signature.async function handleAirdropSol(args: any) { const { walletName, amount = 1 } = args; if (currentNetwork === "mainnet") { throw new Error("Airdrop is not available on mainnet"); } const wallet = wallets.get(walletName); if (!wallet) { throw new Error(`Wallet '${walletName}' not found`); } ensureConnection(); const lamports = Math.floor(amount * LAMPORTS_PER_SOL); const signature = await connection.requestAirdrop(wallet.keypair.publicKey, lamports); return { success: true, signature, amount: amount, explorerUrl: `https://explorer.solana.com/tx/${signature}?cluster=${currentNetwork}` }; }
- src/index.ts:197-210 (schema)JSON schema defining the input parameters for the airdrop_sol tool: walletName (string, required), amount (number, optional).inputSchema: { type: "object", properties: { walletName: { type: "string", description: "Name of the wallet" }, amount: { type: "number", description: "Amount of SOL to airdrop (default: 1)" } }, required: ["walletName"] }
- src/index.ts:194-210 (registration)Registration of the 'airdrop_sol' tool in the tools array returned by ListToolsRequestSchema handler, including name, description, and input schema.{ name: "airdrop_sol", description: "Request SOL airdrop for testing (devnet/testnet only)", inputSchema: { type: "object", properties: { walletName: { type: "string", description: "Name of the wallet" }, amount: { type: "number", description: "Amount of SOL to airdrop (default: 1)" } }, required: ["walletName"] }
- src/index.ts:1306-1307 (registration)Dispatch case in the central CallToolRequestSchema switch statement that routes 'airdrop_sol' calls to the handleAirdropSol handler.case "airdrop_sol": result = await handleAirdropSol(args);