> For the complete documentation index, see [llms.txt](https://velora-1.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://velora-1.gitbook.io/docs/reference/accounts.md). Agents can also search and read this documentation through its [MCP server](https://velora-1.gitbook.io/docs/~gitbook/mcp).

# Accounts & State

## StreamConfig

The single persistent account per stream. PDA seeds: `["stream", creator, recipient, stream_id (u64 le)]`.

| Field                   | Type              | Description                                           |
| ----------------------- | ----------------- | ----------------------------------------------------- |
| `stream_id`             | `u64`             | Caller-chosen id, part of the PDA seed                |
| `creator`               | `Pubkey`          | Funded the stream; refund target on cancel            |
| `recipient`             | `Pubkey`          | Receives vested tokens                                |
| `mint`                  | `Pubkey`          | SPL mint of the streamed token                        |
| `vault`                 | `Pubkey`          | The vault token account PDA                           |
| `schedule_type`         | `ScheduleType`    | `Linear` / `Cliff` / `CliffLinear` / `Milestone`      |
| `total_amount`          | `u64`             | Total locked at creation                              |
| `amount_claimed`        | `u64`             | Cumulative withdrawn so far                           |
| `start_timestamp`       | `i64`             | Unix seconds; linear start                            |
| `end_timestamp`         | `i64`             | Unix seconds; linear end                              |
| `cliff_timestamp`       | `i64`             | Cliff point (Cliff / CliffLinear)                     |
| `cliff_amount`          | `u64`             | Lump sum at cliff (CliffLinear)                       |
| `authority_type`        | `AuthorityType`   | `None` / `SingleKey` / `MultiSig` (milestone release) |
| `release_authority`     | `Pubkey`          | Extra release key for `SingleKey`                     |
| `milestone_released`    | `bool`            | Set by `release_milestone`                            |
| `milestone_description` | `[u8; 128]`       | Free-form label                                       |
| `status`                | `StreamStatus`    | `Active` / `Cancelled` / `Completed`                  |
| `is_cancellable`        | `bool`            | Master cancel switch                                  |
| `cancel_authority`      | `CancelAuthority` | `CreatorOnly` / `Either` / `Neither`                  |
| `created_at`            | `i64`             | Creation timestamp                                    |
| `bump`                  | `u8`              | StreamConfig PDA bump                                 |
| `vault_bump`            | `u8`              | Vault PDA bump                                        |
| `reserved`              | `[u8; 30]`        | Padding for Phase 3 fields                            |

Account size is `8 + StreamConfig::INIT_SPACE` (discriminator + Anchor-derived `InitSpace`).

## vault

An SPL token account, PDA seeds `["vault", stream_config]`, with its **authority set to itself**. Only the program — signing with the vault seeds — can transfer tokens out. Created with `init` during `create_stream`.

## Enums

### ScheduleType

`Linear` · `Cliff` · `CliffLinear` · `Milestone` — see [Schedule Types](https://velora-1.gitbook.io/docs/reference/schedule-types.md).

### AuthorityType

Who may call `release_milestone`: `None` (creator only) · `SingleKey` (creator or `release_authority`) · `MultiSig` (creator only, simplified).

### StreamStatus

`Active` · `Cancelled` · `Completed`. Set to `Completed` automatically when `amount_claimed == total_amount`.

### CancelAuthority

`CreatorOnly` · `Either` · `Neither`. Gated additionally by `is_cancellable`.

## TypeScript enum encoding

Anchor encodes these enums as single-key objects:

```ts
const linear       = { linear: {} };
const cliff        = { cliff: {} };
const cliffLinear  = { cliffLinear: {} };
const milestone    = { milestone: {} };

const authorityNone = { none: {} };
const singleKey     = { singleKey: {} };
const multiSig      = { multiSig: {} };

const creatorOnly = { creatorOnly: {} };
const either      = { either: {} };
const neither     = { neither: {} };
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://velora-1.gitbook.io/docs/reference/accounts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
