# Request Faucet Funds

**Code Breakdown**

**1. Request SOL Airdrop**

Send an airdrop request to the Solana faucet for a specified wallet:

Copy

```
response = await agent.connection.request_airdrop(  
    agent.wallet_address, 5 * LAMPORTS_PER_SOL  
)  
```

* **Amount:** 5 SOL (adjustable).
* **Network:** Devnet/Testnet only.

**2. Confirm Transaction**

Once the faucet provides SOL, confirm the transaction to ensure successful completion:

Copy

```
latest_blockhash = await agent.connection.get_latest_blockhash()  
await agent.connection.confirm_transaction(  
    tx_signature,  
    commitment=Confirmed,  
    last_valid_block_height=latest_blockhash.value.last_valid_block_height  
)  
```

**3. Error Handling**

Capture and handle potential errors during the airdrop process:

Copy

```
except KeyError:  
    raise Exception("Airdrop response did not contain a transaction signature.")  
except RPCException as e:  
    raise Exception(f"Faucet request failed: {str(e)}")  
except Exception as e:  
    raise Exception(f"An error occurred: {str(e)}")  
```

***

**Key Features**

1. **Development-Only**
   * Designed specifically for Solana’s devnet/testnet environments.
2. **Quick SOL Access**
   * Instantly funds wallets with 5 SOL for development and testing purposes.
3. **Error Resilience**
   * Handles missing transaction signatures, RPC issues, and unexpected errors gracefully.
4. **Transaction Confirmation**
   * Ensures that funds are credited by confirming the transaction after the request.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kaze-ai.gitbook.io/kaze-ai/token-operations/request-faucet-funds.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
