# Data

> Querying Stellar chain data via Stellar SDK (preferred), Stellar RPC, and Horizon (legacy). Covers SDK methods, JSON-RPC, REST endpoints, streaming, pagination, agentic kit integration.

- **Type:** Skill
- **Install:** `agentstack add skill-rylsherdamz-rgb-stellar-forge-data`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [rylsherdamz-rgb](https://agentstack.voostack.com/s/rylsherdamz-rgb)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [rylsherdamz-rgb](https://github.com/rylsherdamz-rgb)
- **Source:** https://github.com/rylsherdamz-rgb/stellar-forge/tree/master/skills/data
- **Website:** https://www.npmjs.com/package/create-stellar-agentic

## Install

```sh
agentstack add skill-rylsherdamz-rgb-stellar-forge-data
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Data — Stellar Chain Queries

All blockchain queries use `useStellarData()` (frontend) or Stellar SDK / RPC directly (backend). Never raw curl or manual RPC calls.

## Source Files (published with this skill)

| File | Contents |
|------|----------|
| `templates/src/index.ts` | Express server — balance endpoint, contract query endpoint, CORS |
| `templates/src/services/stellar.ts` | RPC client — `getBalances`, `queryContract`, `getContractData`, `getEvents`, `getTransaction` |

## Agentic Kit (Frontend)

Import from `@/hooks/use-stellar-data`:

```ts
const { getBalances, queryContract, getContractData, getEvents, getTransaction, loading, error } = useStellarData();
```

| Method | Returns | Description |
|--------|---------|-------------|
| `getBalances(address)` | `{asset, balance}[]` | All trustline balances + native XLM |
| `queryContract(contractId, method, args[])` | `ScVal \| null` | Read-only contract query (simulation) |
| `getContractData(contractId, key)` | `ScVal \| null` | Raw contract storage entry |
| `getEvents(contractId, limit?)` | `Event[]` | Contract events (newest first) |
| `getTransaction(hash)` | `TxResponse \| null` | Check tx status + return value |

## Backend / API

Use the Stellar SDK directly:

```ts
import { rpc } from "@/lib/stellar-config";
const account = await rpc.getAccount(address);
const sim = await rpc.simulateTransaction(tx);
const sent = await rpc.sendTransaction(signedTx);
const events = await rpc.getEvents({ contractIds: [contractId] });
```

## Raw RPC (if needed)

- `rpc.getLedgerEntries(keys)` — raw ledger data
- `rpc.getNetwork()` — network info
- `rpc.getLatestLedger()` — current ledger seq
- Horizon: `GET /accounts/{id}`, `GET /claimable_balances`, `GET /payments`

## Strict Rules
1. Frontend: always use `useStellarData()` — never raw RPC or curl
2. Read-only contract state: use `useContract().read()` (simulation, no tx)
3. State-changing contract calls: use `useContract().write()` (sign + submit)
4. Backend: use `rpc.*` methods directly for server-side queries

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [rylsherdamz-rgb](https://github.com/rylsherdamz-rgb)
- **Source:** [rylsherdamz-rgb/stellar-forge](https://github.com/rylsherdamz-rgb/stellar-forge)
- **License:** MIT
- **Homepage:** https://www.npmjs.com/package/create-stellar-agentic

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-rylsherdamz-rgb-stellar-forge-data
- Seller: https://agentstack.voostack.com/s/rylsherdamz-rgb
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
