airdrop_sol
Request SOL airdrop to a wallet for testing purposes on devnet or testnet networks.
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 handler function that executes the airdrop_sol tool. It requests SOL airdrop from the Solana RPC for the specified wallet on devnet/testnet, converts amount to lamports, 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:195-211 (schema)The input schema definition for the airdrop_sol tool, specifying walletName as required and optional amount.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-1308 (registration)The switch case in the main CallToolRequestSchema handler that registers and dispatches airdrop_sol calls to its handler function.case "airdrop_sol": result = await handleAirdropSol(args); break;