aether-agent-sdk 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/README.md +316 -0
- package/package.json +97 -0
package/README.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
# Aether
|
|
2
|
+
|
|
3
|
+
**Autonomous Agent Ecosystem SDK for Solana with x402 Payment Protocol**
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://solana.com)
|
|
8
|
+
[](https://solana.com/x402/what-is-x402)
|
|
9
|
+
|
|
10
|
+
Aether is a complete SDK and framework for building autonomous agent-to-agent systems on Solana. It integrates the x402 Payment Protocol to enable truly autonomous, intelligent agent communication and micropayment settlement.
|
|
11
|
+
|
|
12
|
+
Built for the **x402 Solana Hackathon** - redefining the autonomous agent economy.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## ๐ Vision
|
|
17
|
+
|
|
18
|
+
**Aether** envisions a future where autonomous AI agents orchestrate complex workflows on Solanaโnegotiating contracts, processing micropayments, detecting fraud, and making intelligent decisionsโall without human intervention.
|
|
19
|
+
|
|
20
|
+
Our ecosystem integrates:
|
|
21
|
+
|
|
22
|
+
- **x402 Protocol** - HTTP 402 payment standard for autonomous API payments
|
|
23
|
+
- **Solana** - High-speed, low-cost blockchain for agent transactions
|
|
24
|
+
- **A2A Protocol** - Standardized agent-to-agent communication
|
|
25
|
+
- **USDC on Solana** - Stable, predictable pricing for agent services
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## ๐ฏ What Is Aether?
|
|
30
|
+
|
|
31
|
+
Aether is both a **production-ready SDK** and a **complete framework** that enables:
|
|
32
|
+
|
|
33
|
+
### ๐ Autonomous Workflows
|
|
34
|
+
|
|
35
|
+
- **Agent Negotiation**: Buyers and sellers negotiate terms autonomously
|
|
36
|
+
- **Intelligent Verification**: LLM-powered decision making and fraud detection
|
|
37
|
+
- **Automated Settlement**: x402-based micropayments executed in milliseconds
|
|
38
|
+
- **Zero Human Intervention**: Fully autonomous agent-to-agent transactions
|
|
39
|
+
|
|
40
|
+
### โก Solana-Native Performance
|
|
41
|
+
|
|
42
|
+
- **400ms Finality**: Lightning-fast transaction confirmation
|
|
43
|
+
- **$0.00025 Transaction Costs**: Micropayments at scale
|
|
44
|
+
- **Native USDC**: Stable pricing without volatility
|
|
45
|
+
- **SPL Token Support**: Extensible payment token infrastructure
|
|
46
|
+
|
|
47
|
+
### ๐ค Smart Agents
|
|
48
|
+
|
|
49
|
+
- **AnalyzerAgent**: Queries blockchain data, generates insights, proposes actions
|
|
50
|
+
- **VerifierAgent**: Validates proposals, applies business rules, makes decisions
|
|
51
|
+
- **SettlementAgent**: Executes x402 payments, records settlements on-chain
|
|
52
|
+
- **IntelligentVerifierAgent**: AI-powered validation with GPT-4 reasoning
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## ๐ฆ SDK Installation
|
|
57
|
+
|
|
58
|
+
Aether is available as an npm package for easy integration into your projects.
|
|
59
|
+
|
|
60
|
+
### Install
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install aether-agent-sdk
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Quick Start
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import {
|
|
70
|
+
AnalyzerAgent,
|
|
71
|
+
VerifierAgent,
|
|
72
|
+
SettlementAgent,
|
|
73
|
+
A2AProtocol
|
|
74
|
+
} from 'aether-agent-sdk'
|
|
75
|
+
|
|
76
|
+
const agent = new SettlementAgent()
|
|
77
|
+
await agent.init()
|
|
78
|
+
|
|
79
|
+
const txHash = await agent.executeSolanaTransfer(
|
|
80
|
+
'merchant_wallet_address',
|
|
81
|
+
1.0
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### SDK Documentation
|
|
86
|
+
|
|
87
|
+
- **[API Reference](./docs/API_REFERENCE.md)** - Full API documentation
|
|
88
|
+
- **[Usage Guide](./docs/USAGE_GUIDE.md)** - Integration examples
|
|
89
|
+
- **[x402 Integration](./docs/X402_GUIDE.md)** - x402 payment protocol guide
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## ๐ฌ Demos & Examples
|
|
94
|
+
|
|
95
|
+
Aether includes production-ready demos showcasing real-world use cases with actual Solana transactions.
|
|
96
|
+
|
|
97
|
+
### ๐ณ x402 Payment Demo
|
|
98
|
+
|
|
99
|
+
Demonstrates autonomous agent micropayments using the x402 protocol on Solana.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run demo
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Features:
|
|
106
|
+
- Autonomous payment authorization
|
|
107
|
+
- x402 facilitator integration
|
|
108
|
+
- USDC token transfers on Solana
|
|
109
|
+
- Real-time settlement verification
|
|
110
|
+
|
|
111
|
+
### ๐ค Intelligent Invoice Processing
|
|
112
|
+
|
|
113
|
+
AI-powered invoice verification and automatic payment settlement.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm run demo:invoice-llm
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### ๐ Supply Chain Negotiation
|
|
120
|
+
|
|
121
|
+
Autonomous agents negotiate supply chain terms and settle payments.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npm run demo:negotiation
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## ๐ Getting Started
|
|
130
|
+
|
|
131
|
+
### Prerequisites
|
|
132
|
+
|
|
133
|
+
- Node.js 18+
|
|
134
|
+
- TypeScript 5.9+
|
|
135
|
+
- Solana CLI (optional, for key generation)
|
|
136
|
+
- Devnet SOL and USDC for testing
|
|
137
|
+
|
|
138
|
+
### Setup
|
|
139
|
+
|
|
140
|
+
1. **Clone the repository**
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
git clone https://github.com/4n0nn43x/Aether.git
|
|
144
|
+
cd Aether
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
2. **Install dependencies**
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npm install
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
3. **Configure environment**
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
cp env.example .env
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Edit `.env` with your configuration:
|
|
160
|
+
|
|
161
|
+
```env
|
|
162
|
+
SOLANA_NETWORK=devnet
|
|
163
|
+
SOLANA_RPC_URL=https://api.devnet.solana.com
|
|
164
|
+
AGENT_PRIVATE_KEY=your_base58_private_key
|
|
165
|
+
MERCHANT_WALLET_ADDRESS=merchant_wallet
|
|
166
|
+
USDC_MINT=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
4. **Generate a wallet** (if needed)
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
solana-keygen new --outfile ~/.config/solana/agent-wallet.json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
5. **Get devnet SOL and USDC**
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
solana airdrop 2 your_wallet_address --url devnet
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
For USDC, use the [Solana Faucet](https://faucet.circle.com/) or Solana Devnet tools.
|
|
182
|
+
|
|
183
|
+
6. **Build the project**
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npm run build
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
7. **Run a demo**
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npm run demo
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## ๐๏ธ Architecture
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
201
|
+
โ SDK Entry Point (src/index.ts) โ
|
|
202
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
203
|
+
โ Agents Layer (src/agents/) โ
|
|
204
|
+
โ โโ AnalyzerAgent โ
|
|
205
|
+
โ โโ VerifierAgent โ
|
|
206
|
+
โ โโ SettlementAgent โ
|
|
207
|
+
โ โโ IntelligentVerifierAgent โ
|
|
208
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
209
|
+
โ x402 Facilitator (src/facilitator/) โ
|
|
210
|
+
โ โโ X402FacilitatorServer โ
|
|
211
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
212
|
+
โ Protocols Layer (src/protocols/) โ
|
|
213
|
+
โ โโ A2AProtocol โ
|
|
214
|
+
โ โโ AP2Protocol โ
|
|
215
|
+
โ โโ A2ANegotiation โ
|
|
216
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
217
|
+
โ Solana Integration โ
|
|
218
|
+
โ โโ @solana/web3.js โ
|
|
219
|
+
โ โโ @solana/spl-token โ
|
|
220
|
+
โ โโ @faremeter/* (x402) โ
|
|
221
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## ๐ Key Features
|
|
227
|
+
|
|
228
|
+
### x402 Payment Protocol Integration
|
|
229
|
+
|
|
230
|
+
- HTTP 402 (Payment Required) status code implementation
|
|
231
|
+
- Autonomous payment authorization and verification
|
|
232
|
+
- Sub-second settlement finality on Solana
|
|
233
|
+
- USDC micropayments with stable pricing
|
|
234
|
+
|
|
235
|
+
### Agent-to-Agent Communication
|
|
236
|
+
|
|
237
|
+
- Google A2A Protocol compliance
|
|
238
|
+
- Standardized message formats
|
|
239
|
+
- Async communication patterns
|
|
240
|
+
- Event-driven architecture
|
|
241
|
+
|
|
242
|
+
### AI-Powered Intelligence
|
|
243
|
+
|
|
244
|
+
- LangChain integration for LLM reasoning
|
|
245
|
+
- GPT-4 and Ollama support
|
|
246
|
+
- Intelligent fraud detection
|
|
247
|
+
- Autonomous decision-making
|
|
248
|
+
|
|
249
|
+
### Production-Ready SDK
|
|
250
|
+
|
|
251
|
+
- TypeScript with full type safety
|
|
252
|
+
- Modular exports for tree-shaking
|
|
253
|
+
- Comprehensive error handling
|
|
254
|
+
- Extensive logging and debugging
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## ๐ x402 Hackathon Submission
|
|
259
|
+
|
|
260
|
+
Aether is built for the **x402 Solana Hackathon**, showcasing:
|
|
261
|
+
|
|
262
|
+
โ
**x402 Protocol Integration** - Full implementation of x402 payment standard
|
|
263
|
+
โ
**Solana Devnet Deployment** - Live transactions on Solana devnet
|
|
264
|
+
โ
**Autonomous Agent Economy** - AI agents transacting independently
|
|
265
|
+
โ
**USDC Micropayments** - Sub-dollar payments at scale
|
|
266
|
+
โ
**Open Source** - MIT licensed, fully documented
|
|
267
|
+
|
|
268
|
+
### Hackathon Categories
|
|
269
|
+
|
|
270
|
+
- **Best x402 Infrastructure** - Facilitator implementation for agent payments
|
|
271
|
+
- **Best AI Agent Integration** - LLM-powered autonomous decision-making
|
|
272
|
+
- **Best Developer Tool** - Comprehensive SDK for agent development
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## ๐ Documentation
|
|
277
|
+
|
|
278
|
+
- [API Reference](./docs/API_REFERENCE.md)
|
|
279
|
+
- [Usage Guide](./docs/USAGE_GUIDE.md)
|
|
280
|
+
- [x402 Integration Guide](./docs/X402_GUIDE.md)
|
|
281
|
+
- [Architecture Overview](./docs/ARCHITECTURE.md)
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## ๐ค Contributing
|
|
286
|
+
|
|
287
|
+
Contributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## ๐ License
|
|
292
|
+
|
|
293
|
+
MIT License - see [LICENSE](./LICENSE) for details.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## ๐ Links
|
|
298
|
+
|
|
299
|
+
- **GitHub**: [github.com/4n0nn43x/Aether](https://github.com/4n0nn43x/Aether)
|
|
300
|
+
- **x402 Documentation**: [solana.com/x402](https://solana.com/x402/what-is-x402)
|
|
301
|
+
- **Solana Developers**: [solana.com/developers](https://solana.com/developers)
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## ๐ Acknowledgments
|
|
306
|
+
|
|
307
|
+
Built for the x402 Solana Hackathon with support from:
|
|
308
|
+
- Solana Foundation
|
|
309
|
+
- Coinbase Dev
|
|
310
|
+
- Phantom Wallet
|
|
311
|
+
- Crossmint
|
|
312
|
+
- The entire Solana developer community
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
**Aether** - Redefining the autonomous agent economy on Solana.
|
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aether-agent-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Autonomous Agent Ecosystem SDK for Solana - A2A Protocol, x402 Payment Standard, and Agent-to-Agent Communication",
|
|
5
|
+
"main": "./dist/src/index.js",
|
|
6
|
+
"types": "./dist/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/src/index.js",
|
|
10
|
+
"require": "./dist/src/index.js",
|
|
11
|
+
"types": "./dist/src/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./agents": {
|
|
14
|
+
"import": "./dist/src/agents/index.js",
|
|
15
|
+
"require": "./dist/src/agents/index.js",
|
|
16
|
+
"types": "./dist/src/agents/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./protocols": {
|
|
19
|
+
"import": "./dist/src/protocols/index.js",
|
|
20
|
+
"require": "./dist/src/protocols/index.js",
|
|
21
|
+
"types": "./dist/src/protocols/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./services": {
|
|
24
|
+
"import": "./dist/src/services/index.js",
|
|
25
|
+
"require": "./dist/src/services/index.js",
|
|
26
|
+
"types": "./dist/src/services/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./modes": {
|
|
29
|
+
"import": "./dist/src/modes/index.js",
|
|
30
|
+
"require": "./dist/src/modes/index.js",
|
|
31
|
+
"types": "./dist/src/modes/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./facilitator": {
|
|
34
|
+
"import": "./dist/src/facilitator/index.js",
|
|
35
|
+
"require": "./dist/src/facilitator/index.js",
|
|
36
|
+
"types": "./dist/src/facilitator/index.d.ts"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/src",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE"
|
|
43
|
+
],
|
|
44
|
+
"keywords": [
|
|
45
|
+
"solana",
|
|
46
|
+
"agent",
|
|
47
|
+
"autonomous-agents",
|
|
48
|
+
"a2a-protocol",
|
|
49
|
+
"x402",
|
|
50
|
+
"payment",
|
|
51
|
+
"blockchain",
|
|
52
|
+
"ai",
|
|
53
|
+
"llm",
|
|
54
|
+
"agent-communication",
|
|
55
|
+
"micropayments",
|
|
56
|
+
"usdc",
|
|
57
|
+
"spl-tokens"
|
|
58
|
+
],
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc",
|
|
61
|
+
"start": "node dist/index.js",
|
|
62
|
+
"dev": "ts-node src/index.ts",
|
|
63
|
+
"demo": "ts-node demo/orchestrator.ts",
|
|
64
|
+
"demo:payment": "ts-node demo/solana-x402-payment.ts"
|
|
65
|
+
},
|
|
66
|
+
"repository": {
|
|
67
|
+
"type": "git",
|
|
68
|
+
"url": "git+https://github.com/4n0nn43x/Aether.git"
|
|
69
|
+
},
|
|
70
|
+
"author": "4n0nn43x",
|
|
71
|
+
"license": "MIT",
|
|
72
|
+
"bugs": {
|
|
73
|
+
"url": "https://github.com/4n0nn43x/Aether/issues"
|
|
74
|
+
},
|
|
75
|
+
"homepage": "https://github.com/4n0nn43x/Aether#readme",
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@langchain/core": "^1.0.1",
|
|
78
|
+
"@langchain/ollama": "^1.0.0",
|
|
79
|
+
"@langchain/openai": "^1.0.0",
|
|
80
|
+
"@solana/spl-token": "^0.1.8",
|
|
81
|
+
"@solana/web3.js": "^1.95.5",
|
|
82
|
+
"axios": "^1.12.2",
|
|
83
|
+
"bs58": "^6.0.0",
|
|
84
|
+
"chalk": "^5.6.2",
|
|
85
|
+
"dotenv": "^16.6.1",
|
|
86
|
+
"langchain": "^1.0.1"
|
|
87
|
+
},
|
|
88
|
+
"devDependencies": {
|
|
89
|
+
"@types/axios": "^0.9.36",
|
|
90
|
+
"@types/express": "^5.0.4",
|
|
91
|
+
"@types/node": "^24.9.1",
|
|
92
|
+
"eslint": "^9.38.0",
|
|
93
|
+
"prettier": "^3.6.2",
|
|
94
|
+
"ts-node": "^10.9.2",
|
|
95
|
+
"typescript": "^5.9.3"
|
|
96
|
+
}
|
|
97
|
+
}
|