stellarskills 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/skills/stellar-expert.md +36 -0
- package/README.md +150 -0
- package/SKILL.md +143 -0
- package/accounts/SKILL.md +275 -0
- package/anchors/SKILL.md +116 -0
- package/assets/SKILL.md +290 -0
- package/bin/cli.js +496 -0
- package/dex/SKILL.md +170 -0
- package/fees/SKILL.md +149 -0
- package/frontend/SKILL.md +169 -0
- package/horizon/SKILL.md +411 -0
- package/local-node/SKILL.md +125 -0
- package/openzeppelin/SKILL.md +76 -0
- package/operations/SKILL.md +260 -0
- package/package.json +35 -0
- package/rpc/SKILL.md +222 -0
- package/security/SKILL.md +184 -0
- package/seps/SKILL.md +384 -0
- package/soroban/SKILL.md +343 -0
- package/storage/SKILL.md +141 -0
- package/testing/SKILL.md +218 -0
- package/tools/SKILL.md +112 -0
- package/why/SKILL.md +73 -0
- package/x402/SKILL.md +99 -0
package/tools/SKILL.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stellarskills-tools
|
|
3
|
+
description: The essential tools, SDKs, wallets, and explorers for building on Stellar.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# STELLARSKILLS — Tools & SDKs
|
|
7
|
+
|
|
8
|
+
> The essential tools, SDKs, wallets, and explorers for building on Stellar.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## SDKs (Software Development Kits)
|
|
13
|
+
|
|
14
|
+
SDF officially maintains or heavily supports these SDKs for interacting with Horizon and Soroban RPC.
|
|
15
|
+
|
|
16
|
+
| Language | Package | Purpose |
|
|
17
|
+
|----------|---------|---------|
|
|
18
|
+
| **JavaScript / TS** | `@stellar/stellar-sdk` | Everything. Wallets, backend, frontend. |
|
|
19
|
+
| **Rust** | `soroban-sdk` | Writing Soroban smart contracts. |
|
|
20
|
+
| **Python** | `stellar-sdk` | Backend automation, data science. |
|
|
21
|
+
| **Go** | `github.com/stellar/go` | High-performance backend services. |
|
|
22
|
+
| **Java** | `java-stellar-sdk` | Enterprise backends, Android. |
|
|
23
|
+
| **Flutter / Dart** | `stellar_flutter_sdk` | Mobile app development. |
|
|
24
|
+
| **iOS / Swift** | `stellar-ios-mac-sdk` | iOS app development. |
|
|
25
|
+
|
|
26
|
+
### JS SDK Pro Tip
|
|
27
|
+
The JS SDK is split conceptually but bundled together:
|
|
28
|
+
- `Keypair`, `TransactionBuilder`, `Operation` (Core XDR building)
|
|
29
|
+
- `Horizon.Server` (Classic protocol REST API)
|
|
30
|
+
- `SorobanRpc.Server` (Smart contract JSON-RPC)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Developer Tools
|
|
35
|
+
|
|
36
|
+
### 1. Stellar CLI
|
|
37
|
+
The Swiss Army knife for Soroban and Stellar development. Written in Rust.
|
|
38
|
+
```bash
|
|
39
|
+
cargo install --locked stellar-cli --features opt
|
|
40
|
+
|
|
41
|
+
# Manage identities
|
|
42
|
+
stellar keys generate alice
|
|
43
|
+
|
|
44
|
+
# Fund on testnet
|
|
45
|
+
stellar keys fund alice
|
|
46
|
+
|
|
47
|
+
# Build and optimize contracts
|
|
48
|
+
stellar contract build
|
|
49
|
+
stellar contract optimize --wasm target/.../my_contract.wasm
|
|
50
|
+
|
|
51
|
+
# Deploy and invoke contracts
|
|
52
|
+
stellar contract deploy --wasm ... --source alice --network testnet
|
|
53
|
+
stellar contract invoke --id C... --source alice --network testnet -- func_name --arg value
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2. Stellar Lab
|
|
57
|
+
A GUI for exploring the network, building transactions manually, and signing them. Excellent for debugging XDR.
|
|
58
|
+
**URL**: `https://lab.stellar.org`
|
|
59
|
+
|
|
60
|
+
### 3. Friendbot
|
|
61
|
+
The testnet faucet. Funds an account with 10,000 testnet XLM.
|
|
62
|
+
```bash
|
|
63
|
+
curl "https://friendbot.stellar.org?addr=G..."
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Explorers
|
|
69
|
+
|
|
70
|
+
To view ledgers, accounts, transactions, and assets on-chain.
|
|
71
|
+
|
|
72
|
+
| Explorer | URL | Best For |
|
|
73
|
+
|----------|-----|----------|
|
|
74
|
+
| **Stellar Expert** | `https://stellar.expert` | The gold standard. Asset stats, AMM pools, contract invocations, SEP discovery. |
|
|
75
|
+
| **Steexp** | `https://steexp.com` | Simple, fast ledger exploration. |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Wallets (for Developers)
|
|
80
|
+
|
|
81
|
+
To test your dApp, you need a wallet that supports Soroban and WalletConnect.
|
|
82
|
+
|
|
83
|
+
| Wallet | Platform | Notes |
|
|
84
|
+
|--------|----------|-------|
|
|
85
|
+
| **Freighter** | Browser Extension | The MetaMask of Stellar. Built by SDF. Essential for testing web dApps. Supports testnet, futurenet, mainnet. |
|
|
86
|
+
| **Lobstr** | Mobile / Web | The most popular consumer wallet. Supports classic assets, DEX, and WalletConnect. |
|
|
87
|
+
| **Vibrant** | Mobile | USDC-centric consumer wallet. Good for testing SEP-24 fiat rails. |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## RPC & Horizon Providers
|
|
92
|
+
|
|
93
|
+
You shouldn't use the SDF public endpoints (`horizon.stellar.org`) for heavy production traffic. Use a commercial provider:
|
|
94
|
+
|
|
95
|
+
- **Validation Cloud** (RPC, Horizon)
|
|
96
|
+
- **Blockdaemon** (RPC, Horizon)
|
|
97
|
+
- **Tatum** (Horizon)
|
|
98
|
+
- **QuickNode** (Horizon, RPC coming soon)
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Open Source Reference Projects
|
|
103
|
+
|
|
104
|
+
When you don't know how to implement something, look here:
|
|
105
|
+
|
|
106
|
+
- **Polaris** (`stellar/django-polaris`): Reference implementation for Anchors (SEPs).
|
|
107
|
+
- **Soroban Example dApp** (`stellar/soroban-example-dapp`): End-to-end React + Soroban contract example.
|
|
108
|
+
- **Freighter API** (`stellar/freighter`): How the browser extension works.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
*raw.githubusercontent.com/ggoldani/stellarskills/main/tools — MIT License*
|
package/why/SKILL.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stellarskills-why
|
|
3
|
+
description: A sober, honest assessment of what Stellar is for, its tradeoffs, and why you would choose it over EVM or Solana.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# STELLARSKILLS — Why Stellar?
|
|
7
|
+
|
|
8
|
+
> A sober, honest assessment of what Stellar is for, its tradeoffs, and why you would choose it over EVM or Solana.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Stellar's Thesis
|
|
13
|
+
|
|
14
|
+
Stellar was built in 2014 with a specific, narrow thesis: **Provide the infrastructure for global payments and asset issuance.**
|
|
15
|
+
|
|
16
|
+
It is not trying to be a world computer. It is not trying to host the next big decentralized social network. It is trying to be the rails that money moves on.
|
|
17
|
+
|
|
18
|
+
### The Sweet Spot
|
|
19
|
+
You should build on Stellar if your application involves:
|
|
20
|
+
- Cross-border remittances.
|
|
21
|
+
- B2B payments.
|
|
22
|
+
- Fiat stablecoins (USDC, EURC, etc.) and tokenized RWAs (Real World Assets).
|
|
23
|
+
- Regulated asset issuance (where the issuer needs freeze/clawback capabilities).
|
|
24
|
+
- Treasury management and payroll.
|
|
25
|
+
- On/off-ramps to the traditional banking system.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Technical Tradeoffs
|
|
30
|
+
|
|
31
|
+
### 1. Throughput & Finality
|
|
32
|
+
- **Stellar**: ~1000 tx/sec (classic), 3-5 second block times. **Instant finality.** Because it uses SCP (Stellar Consensus Protocol, a federated Byzantine agreement algorithm) rather than Proof of Work or Proof of Stake, there are no forks. Once a transaction is in a ledger, it cannot be rolled back.
|
|
33
|
+
- **EVM/L2s**: Variable finality (often minutes or days for absolute settlement on L1).
|
|
34
|
+
|
|
35
|
+
### 2. The Mempool
|
|
36
|
+
- **Stellar**: There is no public mempool. Transactions are submitted directly to Horizon/RPC, broadcast to validators, and included in the next 5-second ledger. This eliminates MEV (Miner Extractable Value) like front-running and sandwich attacks.
|
|
37
|
+
- **Ethereum/Solana**: Public mempool creates a dark forest of MEV bots.
|
|
38
|
+
|
|
39
|
+
### 3. State Management (Accounts vs Wallets)
|
|
40
|
+
- **Stellar**: An account must explicitly be funded (minimum balance of 1 XLM) and must explicitly opt-in to receive an asset (Trustlines). This prevents spam tokens from being airdropped into your wallet without permission.
|
|
41
|
+
- **EVM**: Anyone can send any ERC-20 to any address.
|
|
42
|
+
|
|
43
|
+
### 4. Smart Contracts (Soroban)
|
|
44
|
+
- **Stellar**: Rust-based, WASM execution, explicit resource metering, explicitly isolated storage. Designed for safety and predictable pricing.
|
|
45
|
+
- **EVM**: Solidity, global mutable state, implicit auth. Designed for maximum composability but prone to reentrancy and state bloat.
|
|
46
|
+
|
|
47
|
+
### 5. The Built-in DEX
|
|
48
|
+
- **Stellar**: Limit order books and AMMs are native to the protocol. You don't interact with a smart contract to trade; you just submit an Operation.
|
|
49
|
+
- **EVM**: All trading happens via third-party smart contracts (Uniswap, 1inch).
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## The Interoperability Standard (SEPs)
|
|
54
|
+
|
|
55
|
+
The biggest reason fintechs choose Stellar is the **SEP (Stellar Ecosystem Proposal)** framework.
|
|
56
|
+
|
|
57
|
+
If you build a wallet on Ethereum, integrating a fiat on-ramp means signing a bespoke business deal with MoonPay or Ramp, reading their custom API docs, and implementing their specific flow.
|
|
58
|
+
|
|
59
|
+
On Stellar, fiat on/off-ramps (Anchors) all follow the exact same API standards (SEP-24, SEP-6, SEP-31). A wallet developer writes the integration code *once*, and instantly supports cashing in/out across dozens of countries (USDC in the US, ARST in Argentina, BRL in Brazil, NGN in Nigeria) without changing a line of code.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## When NOT to use Stellar
|
|
64
|
+
|
|
65
|
+
Do not use Stellar if:
|
|
66
|
+
1. You want to build a high-frequency trading on-chain game.
|
|
67
|
+
2. You need to store large amounts of arbitrary data on-chain.
|
|
68
|
+
3. You rely on deep, complex smart contract composability (e.g., flash loans nested through 5 different DeFi protocols).
|
|
69
|
+
4. Your primary go-to-market strategy relies on "degen" memecoin speculation.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
*raw.githubusercontent.com/ggoldani/stellarskills/main/why — MIT License*
|
package/x402/SKILL.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: stellarskills-x402
|
|
3
|
+
description: Pay-per-API calls for AI Agents on Stellar. Monetize endpoints natively without subscriptions or credit cards using HTTP 402.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# STELLARSKILLS — x402 Protocol (Agent Economy)
|
|
7
|
+
|
|
8
|
+
> Pay-per-API calls for AI Agents on Stellar. Monetize endpoints natively without subscriptions or credit cards using HTTP 402.
|
|
9
|
+
|
|
10
|
+
> ⚠️ **CUTTING EDGE TECH:** The x402 protocol on Stellar is extremely new. The SDKs and middleware patterns shown here may change rapidly. Always verify against the latest Coinbase/Stellar x402 documentation and contribute updates via PR!
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. What is x402?
|
|
15
|
+
|
|
16
|
+
x402 revives the reserved `402 Payment Required` HTTP status code. It allows servers to monetize endpoints per-request and allows clients (especially autonomous AI Agents) to pay for that request natively using digital assets (like USDC) on the Stellar Network.
|
|
17
|
+
|
|
18
|
+
Instead of a human signing up for a subscription tier and providing a credit card, an AI Agent can dynamically pay 1/100th of a cent via a Stellar micropayment every time it hits your API.
|
|
19
|
+
|
|
20
|
+
### The Flow
|
|
21
|
+
1. **Client** requests a protected resource.
|
|
22
|
+
2. **Server** responds with HTTP `402` and payment requirements.
|
|
23
|
+
3. **Client** signs a Stellar payment transaction using their keypair (with Soroban auth).
|
|
24
|
+
4. **Client** retries the request with the signed payment in the `X-PAYMENT` header.
|
|
25
|
+
5. **Server** verifies the payment via a facilitator, settles on Stellar, and returns the resource.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Server Integration (Selling Access)
|
|
30
|
+
|
|
31
|
+
To protect an API endpoint, use the x402 payment middleware. The middleware intercepts the request and handles the 402 rejection and the subsequent payment verification automatically.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install stellar-x402 express
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
import express from 'express';
|
|
39
|
+
import { paymentMiddleware } from 'stellar-x402/server';
|
|
40
|
+
|
|
41
|
+
const app = express();
|
|
42
|
+
|
|
43
|
+
// Protect a specific route
|
|
44
|
+
app.use(
|
|
45
|
+
'/api/premium-data',
|
|
46
|
+
paymentMiddleware({
|
|
47
|
+
// Configuration dictates price and the Stellar address receiving the payment
|
|
48
|
+
token: 'USDC',
|
|
49
|
+
amount: '0.05',
|
|
50
|
+
recipient: process.env.STELLAR_MERCHANT_PUBLIC_KEY
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
app.get('/api/premium-data', (req, res) => {
|
|
55
|
+
// This block only executes if the client successfully paid
|
|
56
|
+
res.json({ secret: "AI agents rule the world" });
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
app.listen(3000);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 3. Client Integration (Agent Paying for Access)
|
|
65
|
+
|
|
66
|
+
If you are writing an AI Agent that needs to consume a paid x402 endpoint, do not handle the `402` retry logic manually. Use the client wrapper.
|
|
67
|
+
|
|
68
|
+
The client wrapper automatically intercepts `402 Payment Required` responses, parses the cost, uses the Agent's private key to sign a transaction, and transparently retries the request with the `X-PAYMENT` header attached.
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
import { wrapFetchWithPayment } from 'stellar-x402/client-http';
|
|
72
|
+
import { Keypair } from '@stellar/stellar-sdk';
|
|
73
|
+
|
|
74
|
+
// The agent's wallet
|
|
75
|
+
const keypair = Keypair.fromSecret(process.env.STELLAR_SECRET_KEY);
|
|
76
|
+
|
|
77
|
+
// Wrap the native fetch API
|
|
78
|
+
const fetchWithPayment = wrapFetchWithPayment(fetch, keypair);
|
|
79
|
+
|
|
80
|
+
async function getPremiumData() {
|
|
81
|
+
try {
|
|
82
|
+
// 1. Initial request (fails with 402)
|
|
83
|
+
// 2. Wrapper automatically signs payment
|
|
84
|
+
// 3. Wrapper automatically retries request with X-PAYMENT header
|
|
85
|
+
// 4. Returns the final 200 OK response
|
|
86
|
+
const response = await fetchWithPayment('https://api.example.com/premium-data');
|
|
87
|
+
|
|
88
|
+
const data = await response.json();
|
|
89
|
+
console.log(data); // { secret: "AI agents rule the world" }
|
|
90
|
+
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error("Payment or network failed:", error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
*raw.githubusercontent.com/ggoldani/stellarskills/main/x402 — MIT License*
|