requestAirdrop
Requests an airdrop of lamports to a specified public key. This method is only available on devnet and testnet -- it will fail on mainnet-beta. It is the primary way for developers to fund accounts during development and testing. The airdrop amount is limited (typically 1-2 SOL per request on devnet) and may be rate-limited. Returns a transaction signature that can be used with confirmTransaction to verify the airdrop completed.
Parameters
| # | Type | Required | Description |
|---|---|---|---|
| 1 | string | Yes | Base-58 encoded public key of the account to receive SOL |
| 2 | u64 | Yes | Amount of lamports to airdrop |
| 3 | object | No | Configuration object |
Configuration object fields:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level: processed, confirmed, or finalized |
Response
Returns a single value:
| Field | Type | Description |
|---|---|---|
result | string | Transaction signature of the airdrop (base-58) |
Code Examples
cURL
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "requestAirdrop",
"params": [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
1000000000
]
}'TypeScript
const response = await fetch("http://88.216.36.108:7999", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "requestAirdrop",
params: [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
1000000000
]
}),
});
const { result } = await response.json();
console.log("Airdrop signature:", result);Python
import requests
response = requests.post("http://88.216.36.108:7999", json={
"jsonrpc": "2.0",
"id": 1,
"method": "requestAirdrop",
"params": [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
1000000000
]
})
result = response.json()["result"]
print(f"Airdrop signature: {result}")Rust
use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client.post("http://88.216.36.108:7999")
.json(&json!({
"jsonrpc": "2.0",
"id": 1,
"method": "requestAirdrop",
"params": [
"vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg",
1000000000_u64
]
}))
.send().await?
.text().await?;
println!("{}", res);
Ok(())
}Example Response
{
"jsonrpc": "2.0",
"result": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
"id": 1
}