# Use TipLink

The `Use TipLink` tool, part of AgentiPy, allows users to create TipLinks. TipLink is a service on Solana that enables sending SOL or SPL tokens via a shareable link, making it easy to tip users or onboard new users to crypto without needing their wallet address beforehand. This tool uses an Agentipy proxy service to create these TipLinks.

## Functionality

This tool is implemented in the `TiplinkManager` class. It interacts with an Agentipy proxy service (`agent.base_proxy_url`) to create TipLinks. The agent's private key is encrypted and sent to this proxy, and an OpenAI API key (`agent.openai_api_key`) also seems to be part of the payload.

### Key Methods:

* `create_tiplink(agent: SolanaAgentKit, amount: float, spl_mint_address: Optional[str] = None) -> Optional[Dict[str, Any]]`:
  * Creates a new TipLink funded by the agent's wallet.
  * Parameters:
    * `agent`: The `SolanaAgentKit` instance.
    * `amount`: The amount of SOL or SPL tokens to fund the TipLink with.
    * `spl_mint_address` (Optional): If creating a TipLink for an SPL token, this is its mint address (string). If `None`, SOL is used.
  * Sends a request to the Agentipy proxy endpoint (`/tiplink/create-tiplink`).
  * The response from the proxy is expected to contain the TipLink URL and transaction details for funding it.
  * Returns a dictionary with the TipLink URL, transaction details, or an error.

##

**Important Considerations:**

* **Proxy Service:** This tool relies on an Agentipy proxy service. The functionality is dependent on this proxy's correct implementation of TipLink creation.
* **On-Chain Fund Transfer:** Creating a TipLink is an on-chain action that transfers SOL or SPL tokens from your (the agent's) wallet to a new TipLink account/address. This requires SOL for gas fees and sufficient balance of the asset being tipped.
* **TipLink Security:** Once a TipLink is created and funded, the link itself is the key to accessing the funds. Share these links securely.
* **API Keys:** An `openai_api_key` is passed to the proxy; its role in TipLink creation should be understood from the proxy's documentation. The agent's Solana private key is also encrypted and sent.

## Source Code

You can find the source code for this tool on GitHub: <https://github.com/niceberginc/agentipy/blob/main/agentipy/tools/use_tiplink.py>


---

# 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://docs.agentipy.fun/tools/use-tiplink.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.
