Learn requestAirdrop use cases, code examples, request parameters, response structure, and tips.
requestAirdrop
RPC method allows you to request an airdrop of SOL (lamports) to a specified account. This method is exclusively for non-mainnet environments like Devnet and Testnet, where it serves as a faucet to provide developers with free SOL for testing their applications.
Important: This method will not work on Mainnet Beta.
requestAirdrop
to ensure test accounts have sufficient SOL before running test suites.pubkey
(string, required): The public key of the account that will receive the airdropped lamports, provided as a base-58 encoded string.lamports
(u64, required): The amount of lamports to request. (1 SOL = 1,000,000,000 lamports).options
(object, optional): An optional configuration object that can include:
commitment
(string, optional): Specifies the commitment level to wait for when confirming the airdrop transaction (e.g., "finalized"
, "confirmed"
, "processed"
). If omitted, the node’s default commitment for airdrops is used.result
field in the JSON-RPC response is a single string representing the transaction signature of the airdrop, base-58 encoded.
Example Response:
getTransaction
or a Solana explorer to track the status of the airdrop transaction.
requestAirdrop
returns a signature, the transaction still needs to be processed and confirmed by the network. You can use confirmTransaction
(from @solana/web3.js
) or poll getSignatureStatuses
to wait for confirmation.requestAirdrop
to fund your test accounts on Solana’s development networks.