> For the complete documentation index, see [llms.txt](https://kaze-ai.gitbook.io/kaze-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kaze-ai.gitbook.io/kaze-ai/token-operations/request-faucet-funds.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
