Interface for reading Stellar blockchain data. Use RPC for modern apps and Horizon for historical queries.
Install
mkdir -p .claude/skills/data-salazarsebas && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18571" && unzip -o skill.zip -d .claude/skills/data-salazarsebas && rm skill.zipInstalls to .claude/skills/data-salazarsebas
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Querying Stellar chain data via Stellar RPC (preferred) and Horizon (legacy). Covers RPC JSON-RPC methods, Horizon REST endpoints, streaming, pagination, historical queries, Hubble/Galexie for deep history, and the RPC/Horizon migration story. Use when reading balances, transactions, operations, ledgers, contract events, or building any indexer/analytics workflow.Key capabilities
- →Query Stellar chain data using Stellar RPC methods
- →Query Horizon endpoints for historical data
- →Stream live events or operations
- →Access historical data beyond RPC's 7-day window using Hubble/Galexie
- →Configure network endpoints for Mainnet, Testnet, Futurenet, and local environments
- →Handle errors and rate limiting for RPC and Horizon requests
How it works
The skill provides access to Stellar chain data through Stellar RPC for real-time state and Horizon for historical queries, guiding the user on which API to use based on their specific data needs. It also covers error handling and rate limiting.
Inputs & outputs
When to use data
- →Query ledger balances
- →Fetch transaction history
- →Stream real-time contract events
- →Simulate transactions before submission
About this skill
Stellar Data: RPC + Horizon
API access for reading chain state. Stellar RPC is the preferred entry point for new projects; Horizon remains for legacy and historical-query workflows. For deeper history beyond RPC's 7-day window, use Hubble/Galexie.
When to use this skill
- Calling Stellar RPC methods (
getLatestLedger,getLedgerEntries,getEvents,simulateTransaction,sendTransaction) - Querying Horizon endpoints (accounts, transactions, operations, effects, ledgers)
- Streaming live events or operations
- Pulling historical data beyond RPC's 7-day window (Hubble, Galexie)
- Choosing between RPC and Horizon for a given workflow
Related skills
- Building transactions to send →
../dapp/SKILL.md - Soroban contract simulation and event emission →
../soroban/SKILL.md - Asset balance and trustline lookups →
../assets/SKILL.md - Standards (SEP-7 deeplinks, SEP-10 auth) →
../standards/SKILL.md
Overview
Stellar provides two API paradigms:
| API | Status | Use Case |
|---|---|---|
| Stellar RPC | Preferred | Soroban, real-time state, new projects |
| Horizon | Legacy-focused | Historical data, legacy applications |
Recommendation: Use Stellar RPC for all new projects. Use Horizon mainly for historical queries and legacy compatibility paths.
Quick Navigation
- RPC methods and usage: Stellar RPC
- Horizon endpoints and streaming: Horizon API (Legacy)
- Migration strategy: Migration: Horizon to RPC
- Data history/indexing options: Historical Data Access
- Environment setup and endpoints: Network Configuration
Stellar RPC
Endpoints
Note: SDF directly provides Futurenet public RPC. For Mainnet RPC, select a provider from the RPC providers directory.
| Network | RPC URL |
|---|---|
| Mainnet | Provider-specific endpoint (see RPC providers directory) |
| Testnet | https://soroban-testnet.stellar.org |
| Futurenet | https://rpc-futurenet.stellar.org |
| Local | http://localhost:8000/soroban/rpc |
Setup
import * as StellarSdk from "@stellar/stellar-sdk";
const rpc = new StellarSdk.rpc.Server("https://soroban-testnet.stellar.org");
Key Methods
Get Account
const account = await rpc.getAccount(publicKey);
// Returns account with sequence number for transaction building
Get Health
const health = await rpc.getHealth();
// { status: "healthy" }
Get Latest Ledger
const ledger = await rpc.getLatestLedger();
// { id: "...", sequence: 123456, protocolVersion: 25 }
Get Ledger Entries
// Read contract storage
const key = StellarSdk.xdr.LedgerKey.contractData(
new StellarSdk.xdr.LedgerKeyContractData({
contract: new StellarSdk.Address(contractId).toScAddress(),
key: StellarSdk.xdr.ScVal.scvSymbol("Counter"),
durability: StellarSdk.xdr.ContractDataDurability.persistent(),
})
);
const entries = await rpc.getLedgerEntries(key);
if (entries.entries.length > 0) {
const value = StellarSdk.scValToNative(
entries.entries[0].val.contractData().val()
);
}
Simulate Transaction
const simulation = await rpc.simulateTransaction(transaction);
if (StellarSdk.rpc.Api.isSimulationError(simulation)) {
console.error("Simulation failed:", simulation.error);
} else if (StellarSdk.rpc.Api.isSimulationSuccess(simulation)) {
console.log("Cost:", simulation.cost);
console.log("Result:", simulation.result);
}
Send Transaction
const response = await rpc.sendTransaction(signedTransaction);
if (response.status === "PENDING") {
// Poll for result
let result = await rpc.getTransaction(response.hash);
while (result.status === "NOT_FOUND") {
await new Promise(r => setTimeout(r, 1000));
result = await rpc.getTransaction(response.hash);
}
if (result.status === "SUCCESS") {
console.log("Success:", result.returnValue);
} else {
console.error("Failed:", result.status);
}
}
Get Transaction
const tx = await rpc.getTransaction(txHash);
// status: "SUCCESS" | "FAILED" | "NOT_FOUND"
// returnValue: ScVal (for contract calls)
// ledger: number
Get Events
const events = await rpc.getEvents({
startLedger: 1000000,
filters: [
{
type: "contract",
contractIds: [contractId],
topics: [
["*", StellarSdk.xdr.ScVal.scvSymbol("transfer").toXDR("base64")],
],
},
],
});
for (const event of events.events) {
console.log("Event:", event.topic, event.value);
}
RPC Limitations
- 7-day history for most methods:
getTransaction,getEvents, etc. only cover recent data getLedgersexception: "Infinite Scroll" feature queries any ledger back to genesis via the data lake- No streaming: Poll for updates (no WebSocket)
- Contract-focused: Limited classic Stellar data
Horizon API (Legacy)
Endpoints
| Network | Horizon URL |
|---|---|
| Mainnet | https://horizon.stellar.org |
| Testnet | https://horizon-testnet.stellar.org |
| Local | http://localhost:8000 |
Setup
import * as StellarSdk from "@stellar/stellar-sdk";
const server = new StellarSdk.Horizon.Server("https://horizon-testnet.stellar.org");
Common Operations
Load Account
const account = await server.loadAccount(publicKey);
// Full account details including balances, signers, data
Get Account Balances
const account = await server.loadAccount(publicKey);
for (const balance of account.balances) {
if (balance.asset_type === "native") {
console.log("XLM:", balance.balance);
} else {
console.log(`${balance.asset_code}:`, balance.balance);
}
}
Get Transactions
// Account transactions
const transactions = await server
.transactions()
.forAccount(publicKey)
.order("desc")
.limit(10)
.call();
// Specific transaction
const tx = await server
.transactions()
.transaction(txHash)
.call();
Get Operations
const operations = await server
.operations()
.forAccount(publicKey)
.order("desc")
.limit(20)
.call();
for (const op of operations.records) {
console.log(op.type, op.created_at);
}
Get Payments
const payments = await server
.payments()
.forAccount(publicKey)
.order("desc")
.call();
for (const payment of payments.records) {
if (payment.type === "payment") {
console.log(
`${payment.from} -> ${payment.to}: ${payment.amount} ${payment.asset_code || "XLM"}`
);
}
}
Get Effects
const effects = await server
.effects()
.forAccount(publicKey)
.limit(50)
.call();
Streaming (Server-Sent Events)
// Stream transactions
const closeHandler = server
.transactions()
.forAccount(publicKey)
.cursor("now")
.stream({
onmessage: (tx) => {
console.log("New transaction:", tx.hash);
},
onerror: (error) => {
console.error("Stream error:", error);
},
});
// Close stream when done
closeHandler();
Submit Transaction
try {
const result = await server.submitTransaction(signedTransaction);
console.log("Success:", result.hash);
} catch (error) {
if (error.response?.data?.extras?.result_codes) {
console.error("Error codes:", error.response.data.extras.result_codes);
}
}
Pagination
// First page
let page = await server.transactions().forAccount(publicKey).limit(10).call();
// Next page
if (page.records.length > 0) {
page = await page.next();
}
// Previous page
page = await page.prev();
Migration: Horizon to RPC
Account Loading
// Horizon (old)
const account = await horizonServer.loadAccount(publicKey);
// RPC (new)
const account = await rpc.getAccount(publicKey);
// Note: RPC returns less data, just what's needed for transactions
Transaction Submission
// Horizon (for classic transactions)
const result = await horizonServer.submitTransaction(tx);
// RPC (for Soroban transactions)
const response = await rpc.sendTransaction(tx);
const result = await pollForResult(response.hash);
Historical Data
// Horizon - full history
const allTxs = await horizonServer
.transactions()
.forAccount(publicKey)
.call();
// RPC - most methods limited to 7 days
// Exception: getLedgers can query back to genesis (Infinite Scroll)
// For full historical data, use:
// 1. Hubble (SDF's BigQuery dataset)
// 2. Galexie (data pipeline)
// 3. Your own indexer
Streaming Replacement
// Horizon - native streaming
server.payments().stream({ onmessage: handlePayment });
// RPC - polling (no native streaming)
async function pollForUpdates() {
const lastLedger = await rpc.getLatestLedger();
// Check for new events/transactions
// Repeat on interval
}
setInterval(pollForUpdates, 5000);
Historical Data Access
For data older than 7 days (not available via most RPC methods; getLedgers can reach genesis via Infinite Scroll):
Hubble (BigQuery)
-- Query Stellar data in BigQuery
SELECT *
FROM `crypto-stellar.crypto_stellar.history_transactions`
WHERE source_account = 'G...'
ORDER BY created_at DESC
LIMIT 100
Galexie
Self-hosted data pipeline for processing Stellar ledger data:
Data Lake
RPC "Infinite Scroll" is powered by the Stellar data lake — a cloud-based object store (SEP-0054 format):
- Public access:
s3://aws-public-blockchain/v1.1/stellar/ledgers/pubnet(AWS Open Data) - Self-host: Use Galexie to export to AWS S3 or Google Clou
Content truncated.
When not to use it
- →When building transactions to send
- →When simulating Soroban contract events
- →When looking up asset balances or trustlines
Limitations
- →Stellar RPC has a 7-day history for most methods
- →Stellar RPC does not support streaming
- →Stellar RPC is contract-focused with limited classic Stellar data
How it compares
This skill differentiates between Stellar RPC and Horizon for data access, providing specific methods and use cases for each, which is more targeted than a general blockchain data query approach.
Compared to similar skills
data side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| data (this skill) | 0 | 1mo | Review | Intermediate |
| mcp-builder | 136 | 3mo | Review | Advanced |
| copilot-sdk | 7 | 3mo | Review | Intermediate |
| mcp-builder-ms-v2 | 0 | 1mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by salazarsebas
View all by salazarsebas →You might also like
mcp-builder
anthropics
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
copilot-sdk
github
Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.
mcp-builder-ms-v2
diegosouzapw
MCP Server Development Guide workflow skill. Use this skill when the user needs building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK) and the operator should preserve the upstream workflow, copied support files, and provenance before me
assets
salazarsebas
Stellar Assets (classic) + trustlines + Stellar Asset Contract (SAC) bridge to Soroban. Covers asset issuance, distribution, authorization flags, clawback, regulated assets, trustline management, and the SAC interop layer that exposes classic assets as Soroban tokens. Use when tokenizing real-world
stripe-integration
wshobson
Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.
llm-application-dev
skillcreatorai
Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration. Use for AI-powered features, chatbots, or LLM-based automation.