requestAirdrop

Learn requestAirdrop use cases, code examples, request parameters, response structure, and tips.

The requestAirdrop RPC method in CoinVera is used to request a small amount of SOL (in lamports) to a specified account on test networks like Devnet or Testnet. It acts as a faucet to provide developers with free SOL for testing and experimentation.

⚠️ Important: This method does not work on Mainnet Beta. It is restricted to test environments with faucet functionality.


✅ Common Use Cases

  • Funding Test Wallets Acquire SOL for paying transaction fees and deploying programs on Devnet/Testnet.

  • Automated Testing Pipelines Ensure test accounts are pre-funded before running integration or e2e tests.

  • Developer Experimentation Quickly receive SOL to experiment with smart contracts or token transfers in a safe sandbox environment.


🧾 Request Parameters

[
  pubkey: string,             // Required – Base-58 public key of the recipient
  lamports: number,           // Required – Amount to airdrop (1 SOL = 1_000_000_000 lamports)
  options?: {
    commitment?: string       // Optional – "processed", "confirmed", or "finalized"
  }
]
  • pubkey (required): The address to receive the airdrop, base-58 encoded.

  • lamports (required): Amount of SOL to request (in lamports). Example: 1 SOL = 1000000000 lamports.

  • commitment (optional): Commitment level to use when confirming the airdrop transaction.


📦 Response Structure

{
  "result": "3oZMg7M...AirdropTxSignature"
}
  • result: A base-58 encoded transaction signature for the airdrop. You can use this with getSignatureStatuses or confirmTransaction to confirm completion.


🧪 Example

Airdrop 1 SOL to a Devnet Account

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "requestAirdrop",
  "params": [
    "4H6B3d4xNoXyRzk9m1eM2PK2shTyzj2UTh8uUreVfEnz",
    1000000000,
    {
      "commitment": "confirmed"
    }
  ]
}

Code Examples

const fetch = require('node-fetch');

async function requestAirdrop(rpcUrl) {
  try {
    const response = await fetch(rpcUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        jsonrpc: '2.0',
        id: 1,
        method: 'requestAirdrop',
        "params": [
            "4UJuvGZ7Ge8H3je63Nsb9ZRNVBAd3CG2ajibnRaVSbw5",
            500000000,
            {
              "commitment": "confirmed"
            }
          ]
      }),
    });

    const data = await response.json();
    
    // Print the exact full response
    console.log('Full RPC Response:');
    console.log(JSON.stringify(data, null, 2));
    
    return data;
  } catch (error) {
    console.error('Error getting health:', error.message);
    return null;
  }
}

// Example usage
const RPC_URL = 'https://devnet-rpc.coinvera.io/?x-api-key=your-coinvera-x-api-key';

requestAirdrop(RPC_URL);

Example Response

{
  "jsonrpc": "2.0",
  "result": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
  "id": 1
}

💡 Developer Tips

  • Testnet Only This method is only supported on Devnet or Testnet. It will fail if used on Mainnet.

  • Rate Limits & Quotas Faucet endpoints often restrict how often or how much you can airdrop. If you're testing frequently, space out your requests.

  • Confirmation Handling The method returns a transaction signature—but confirmation is not guaranteed immediately. Use:

    • getSignatureStatuses

    • confirmTransaction (from @solana/web3.js)

    • getTransaction for full details

  • Useful for Continuous Integration Include airdrop requests in test scripts to automate funding of ephemeral test accounts.


The requestAirdrop method is an essential developer tool when building and testing on Solana's Devnet or Testnet using CoinVera. It provides a frictionless way to acquire SOL for experimentation, testing, and rapid prototyping.

Last updated