# Direct Stake API

### 📌 Introduction

For developers who prefer not to use React or wish to integrate minting functionality in a custom manner, The Vault offers a direct API endpoint at [https://direct.vaultapi.dev](https://direct.vaultapi.dev/). This API enables you to mint Liquid Staking Tokens (LSTs) by constructing transactions tailored to your application's requirements.

🔗 **GitHub Repository**: [The Vault LST Creator Widget](https://github.com/SolanaVault/lst-minter-widget)

### 🔗 API Endpoint

* **URL:** <https://direct.vaultapi.dev>

### ⚡ Required Query Parameters

To successfully create a transaction, the following parameters must be included in the request:

| Parameter         | Type   | Description                                        |
| ----------------- | ------ | -------------------------------------------------- |
| `mint`            | String | The mint address of the LST to be minted.          |
| `wallet_address`  | String | The wallet address initiating the minting process. |
| `amount`          | Number | The amount of tokens to be minted.                 |
| `current_balance` | Number | The current balance of the user's wallet.          |

### ⚙️ Optional Parameter

* **`target`** (String): Required only when minting vSOL, specifying the target address.

### 📊 API Response

Upon sending a valid request, the API returns a base64-encoded transaction (`transaction`). The user's wallet must sign this transaction and then broadcast it to the Solana network to complete the minting process.

### 🚀 Integration Steps

#### 1️⃣ Construct the API Request

Gather the required parameters (`mint`, `wallet_address`, `amount`, `current_balance`). If minting vSOL, also include the `target` parameter.

#### 2️⃣ Send the Request

Make a GET request to:

```bash
https://direct.vaultapi.dev
```

with the collected parameters.

#### 3️⃣ Handle the Response

Receive a base64-encoded transaction (`transaction`) from the API.

#### 4️⃣ Sign the Transaction

Prompt the user's wallet to sign the received transaction.

#### 5️⃣ Broadcast the Transaction

Submit the signed transaction to the Solana network for processing.

### 💡 Example API Call

You can test the API with the following example:

```bash
curl "https://direct.vaultapi.dev/stake?\
address=<Minter's wallet address>&\
mint=vSoLxydx6akxyMD9XEcPvGYNGq6Nn66oqVb3UkGkei7&\
amount=100000&\
balance=1000000"
```

If you run this, you will receive a transaction (`transaction`) that you can inspect and simulate by pasting it into the [Solana Transaction Inspector](https://explorer.solana.com/tx/inspector).

### 📞 Need Help?

For any issues or questions, join our [Discord](https://discord.gg/aQC53CGgQY) community.

Get started today and integrate LST minting seamlessly into your application!


---

# 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.thevault.finance/power-users/direct-stake-api.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.
