> For the complete documentation index, see [llms.txt](https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/core-concepts/transactions.md).

# Transactions

Every on-chain action — send, receive, airdrop — produces a `transaction` row.

## Fields

```ts
type Transaction = {
  id: string;             // internal UUID
  signature: string|null; // Solana signature once confirmed
  kind: "usdc" | "sol";
  direction: "send" | "receive";
  amount: number;         // whole units
  counterparty: string|null;
  status: "pending" | "confirmed" | "failed";
  memo: string|null;
  created_at: string;     // ISO 8601
  wallet_id: string;
};
```

## Statuses

| Status      | Meaning                                                          |
| ----------- | ---------------------------------------------------------------- |
| `pending`   | Broadcast, awaiting confirmation (rare; we wait for `confirmed`) |
| `confirmed` | Finalized on Solana (commitment: `confirmed`)                    |
| `failed`    | RPC accepted but the cluster rejected — full reason in audit log |

## Receive detection

Inbound USDC is detected by a background indexer that polls each wallet's signatures. Expect a 5–15 second lag between an on-chain transfer to your agent and a `receive` row appearing.

## Memo handling

Memos use the Solana **Memo Program** and are visible on-chain. Keep them under 200 chars. They're great for invoice IDs and vendor references — don't put PII in them.

## Querying

```ts
const all = await bs.transactions.list();          // last 100
```

Filtering and pagination are on the roadmap. For heavy reporting, mirror via webhook (`tx.sent`) into your own warehouse.

## Reconciliation

For every `confirmed` tx the on-chain signature is the source of truth. The ledger row is informational and can be re-derived from Solana history if needed.


---

# 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://black-sheep-finance.gitbook.io/black-sheep-finance-docs/core-concepts/transactions.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.
