eigen-skills 1.0.0 → 1.1.1
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 +19 -18
- package/SKILL.md +328 -0
- package/package.json +9 -4
- package/scripts/postinstall.js +39 -0
- package/skills/eigen-avs/scripts/avs-api.js +2 -16
- package/skills/eigen-delegation/scripts/delegation-api.js +1 -59
- package/skills/eigen-restaking/scripts/eigen-api.js +16 -6
- package/skills/eigen-rewards/scripts/rewards-api.js +2 -37
package/README.md
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<p align="center">
|
|
7
|
-
<a href="#installation">Installation</a> •
|
|
8
|
-
<a href="#skills-overview">Skills</a> •
|
|
9
|
-
<a href="#architecture">Architecture</a> •
|
|
10
|
-
<a href="#usage">Usage</a> •
|
|
11
|
-
<a href="#api-reference">API Reference</a>
|
|
12
|
-
</p>
|
|
13
|
-
</p>
|
|
1
|
+
# eigen-skills
|
|
2
|
+
|
|
3
|
+
**EigenLayer Agent Skills — Plug-and-play AI agent capabilities for the entire EigenLayer stack**
|
|
4
|
+
|
|
5
|
+
[Installation](#installation) | [Skills](#skills-overview) | [Architecture](#architecture) | [Usage](#usage) | [API Reference](#api-reference)
|
|
14
6
|
|
|
15
7
|
---
|
|
16
8
|
|
|
@@ -126,20 +118,29 @@ npx skills add zeeshan8281/eigen-skills
|
|
|
126
118
|
|
|
127
119
|
## Installation
|
|
128
120
|
|
|
129
|
-
### For
|
|
121
|
+
### For Claude Code (one command)
|
|
130
122
|
|
|
131
123
|
```bash
|
|
132
|
-
|
|
124
|
+
npm install eigen-skills
|
|
133
125
|
```
|
|
134
126
|
|
|
135
|
-
|
|
127
|
+
That's it. The postinstall script automatically copies the `SKILL.md` into `.claude/skills/eigen/` — Claude Code discovers it instantly. Just set your API key:
|
|
136
128
|
|
|
137
|
-
|
|
129
|
+
```bash
|
|
130
|
+
export EIGEN_API_KEY="your-key-here"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Then open Claude Code and ask anything about EigenLayer.
|
|
134
|
+
|
|
135
|
+
### Alternative: curl (no npm)
|
|
138
136
|
|
|
139
137
|
```bash
|
|
140
|
-
|
|
138
|
+
mkdir -p .claude/skills/eigen
|
|
139
|
+
curl -o .claude/skills/eigen/SKILL.md https://raw.githubusercontent.com/zeeshan8281/eigen-agent-skills/main/SKILL.md
|
|
141
140
|
```
|
|
142
141
|
|
|
142
|
+
### For Programmatic Use (JavaScript)
|
|
143
|
+
|
|
143
144
|
```javascript
|
|
144
145
|
const { EigenAPI, AVSAPI, RewardsAPI, DelegationAPI, EigenCompute, EigenDA } = require('eigen-skills');
|
|
145
146
|
```
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eigen-skills
|
|
3
|
+
description: "Query live EigenLayer data — restaking, operators, AVS, rewards, delegation, stakers, TVL, deposits, withdrawals, EigenCompute TEE, and EigenDA blob storage via EigenExplorer API"
|
|
4
|
+
version: 1.0.1
|
|
5
|
+
metadata:
|
|
6
|
+
emoji: "🔄"
|
|
7
|
+
tags: ["eigenlayer", "restaking", "avs", "operators", "rewards", "delegation", "eigencompute", "eigenda"]
|
|
8
|
+
user-invocable: true
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# EigenLayer Skills for Claude Code
|
|
12
|
+
|
|
13
|
+
One-command integration: drop this file into your project and Claude Code can query live EigenLayer data.
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
curl -o SKILL.md https://raw.githubusercontent.com/zeeshan8281/eigen-agent-skills/main/SKILL.md
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Get a free API key at https://developer.eigenexplorer.com and set it:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export EIGEN_API_KEY="your-key-here"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Data Source
|
|
28
|
+
|
|
29
|
+
**EigenExplorer API** — `https://api.eigenexplorer.com`
|
|
30
|
+
- Auth: `x-api-token` header
|
|
31
|
+
- Testnet: `https://api-holesky.eigenexplorer.com`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 1. Ecosystem Metrics
|
|
36
|
+
|
|
37
|
+
Use when the user asks about EigenLayer stats, total TVL, total stakers, total operators, or an ecosystem overview.
|
|
38
|
+
|
|
39
|
+
### Get ecosystem metrics
|
|
40
|
+
```bash
|
|
41
|
+
curl -s "https://api.eigenexplorer.com/metrics" -H "x-api-token: $EIGEN_API_KEY"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Get historical TVL
|
|
45
|
+
```bash
|
|
46
|
+
curl -s "https://api.eigenexplorer.com/metrics/historical/tvl" -H "x-api-token: $EIGEN_API_KEY"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 2. Operators
|
|
52
|
+
|
|
53
|
+
Use when the user asks about EigenLayer operators, top operators, operator details, or operator search.
|
|
54
|
+
|
|
55
|
+
### List operators (sorted by staker count)
|
|
56
|
+
```bash
|
|
57
|
+
curl -s "https://api.eigenexplorer.com/operators?withTvl=true&sortByTotalStakers=desc&take=10" -H "x-api-token: $EIGEN_API_KEY"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### List operators by TVL
|
|
61
|
+
```bash
|
|
62
|
+
curl -s "https://api.eigenexplorer.com/operators?withTvl=true&sortByTvl=desc&take=10" -H "x-api-token: $EIGEN_API_KEY"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### List operators by APY
|
|
66
|
+
```bash
|
|
67
|
+
curl -s "https://api.eigenexplorer.com/operators?withTvl=true&sortByApy=desc&take=10" -H "x-api-token: $EIGEN_API_KEY"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Search operators by name
|
|
71
|
+
```bash
|
|
72
|
+
curl -s "https://api.eigenexplorer.com/operators?searchByText=NAME&withTvl=true" -H "x-api-token: $EIGEN_API_KEY"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Get a specific operator
|
|
76
|
+
```bash
|
|
77
|
+
curl -s "https://api.eigenexplorer.com/operators/0xOPERATOR_ADDRESS?withTvl=true" -H "x-api-token: $EIGEN_API_KEY"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Get stakers delegating to an operator
|
|
81
|
+
```bash
|
|
82
|
+
curl -s "https://api.eigenexplorer.com/operators/0xOPERATOR_ADDRESS/stakers?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Get all operator addresses (lightweight)
|
|
86
|
+
```bash
|
|
87
|
+
curl -s "https://api.eigenexplorer.com/operators/addresses" -H "x-api-token: $EIGEN_API_KEY"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 3. Stakers
|
|
93
|
+
|
|
94
|
+
Use when the user asks about a specific staker's position, deposits, withdrawals, or delegation.
|
|
95
|
+
|
|
96
|
+
### Get staker info
|
|
97
|
+
```bash
|
|
98
|
+
curl -s "https://api.eigenexplorer.com/stakers/0xSTAKER_ADDRESS" -H "x-api-token: $EIGEN_API_KEY"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Get staker deposits
|
|
102
|
+
```bash
|
|
103
|
+
curl -s "https://api.eigenexplorer.com/stakers/0xSTAKER_ADDRESS/deposits?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Get staker withdrawals
|
|
107
|
+
```bash
|
|
108
|
+
curl -s "https://api.eigenexplorer.com/stakers/0xSTAKER_ADDRESS/withdrawals?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Get staker rewards
|
|
112
|
+
```bash
|
|
113
|
+
curl -s "https://api.eigenexplorer.com/stakers/0xSTAKER_ADDRESS/rewards" -H "x-api-token: $EIGEN_API_KEY"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 4. AVS (Actively Validated Services)
|
|
119
|
+
|
|
120
|
+
Use when the user asks about AVS, which services exist, operators/stakers per AVS, or comparing AVS.
|
|
121
|
+
|
|
122
|
+
### List all AVS (sorted by TVL)
|
|
123
|
+
```bash
|
|
124
|
+
curl -s "https://api.eigenexplorer.com/avs?withTvl=true&sortByTvl=desc&take=10" -H "x-api-token: $EIGEN_API_KEY"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### List AVS by APY
|
|
128
|
+
```bash
|
|
129
|
+
curl -s "https://api.eigenexplorer.com/avs?withTvl=true&sortByApy=desc&take=10" -H "x-api-token: $EIGEN_API_KEY"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Search AVS by name
|
|
133
|
+
```bash
|
|
134
|
+
curl -s "https://api.eigenexplorer.com/avs?searchByText=NAME&withTvl=true" -H "x-api-token: $EIGEN_API_KEY"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Get a specific AVS
|
|
138
|
+
```bash
|
|
139
|
+
curl -s "https://api.eigenexplorer.com/avs/0xAVS_ADDRESS?withTvl=true" -H "x-api-token: $EIGEN_API_KEY"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Get operators registered to an AVS
|
|
143
|
+
```bash
|
|
144
|
+
curl -s "https://api.eigenexplorer.com/avs/0xAVS_ADDRESS/operators?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Get stakers for an AVS
|
|
148
|
+
```bash
|
|
149
|
+
curl -s "https://api.eigenexplorer.com/avs/0xAVS_ADDRESS/stakers?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Get rewards distributed by an AVS
|
|
153
|
+
```bash
|
|
154
|
+
curl -s "https://api.eigenexplorer.com/avs/0xAVS_ADDRESS/rewards" -H "x-api-token: $EIGEN_API_KEY"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Get registration events for an AVS
|
|
158
|
+
```bash
|
|
159
|
+
curl -s "https://api.eigenexplorer.com/avs/0xAVS_ADDRESS/events/registration?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Get operator-sets for an AVS
|
|
163
|
+
```bash
|
|
164
|
+
curl -s "https://api.eigenexplorer.com/avs/0xAVS_ADDRESS/operator-sets?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## 5. Rewards & Yield
|
|
170
|
+
|
|
171
|
+
Use when the user asks about rewards, APY, yield, best operators/AVS by returns, or how much a staker is earning.
|
|
172
|
+
|
|
173
|
+
### Top operators by APY
|
|
174
|
+
```bash
|
|
175
|
+
curl -s "https://api.eigenexplorer.com/operators?withTvl=true&sortByApy=desc&take=10" -H "x-api-token: $EIGEN_API_KEY"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Top AVS by APY
|
|
179
|
+
```bash
|
|
180
|
+
curl -s "https://api.eigenexplorer.com/avs?withTvl=true&sortByApy=desc&take=10" -H "x-api-token: $EIGEN_API_KEY"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Get rewards for a specific operator
|
|
184
|
+
```bash
|
|
185
|
+
curl -s "https://api.eigenexplorer.com/operators/0xOPERATOR_ADDRESS/rewards" -H "x-api-token: $EIGEN_API_KEY"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## 6. Deposits & Withdrawals (Global)
|
|
191
|
+
|
|
192
|
+
Use when the user asks about recent deposits/withdrawals across the whole protocol.
|
|
193
|
+
|
|
194
|
+
### Get recent deposits
|
|
195
|
+
```bash
|
|
196
|
+
curl -s "https://api.eigenexplorer.com/deposits?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Get recent withdrawals
|
|
200
|
+
```bash
|
|
201
|
+
curl -s "https://api.eigenexplorer.com/withdrawals?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 7. Delegation & Events
|
|
207
|
+
|
|
208
|
+
Use when the user asks about delegation events, who is delegating to whom, or operator registration events.
|
|
209
|
+
|
|
210
|
+
### Get delegation events
|
|
211
|
+
```bash
|
|
212
|
+
curl -s "https://api.eigenexplorer.com/events/delegation?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Get operator registration events
|
|
216
|
+
```bash
|
|
217
|
+
curl -s "https://api.eigenexplorer.com/events/registration-status?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Get all operator-sets
|
|
221
|
+
```bash
|
|
222
|
+
curl -s "https://api.eigenexplorer.com/operator-sets?take=20" -H "x-api-token: $EIGEN_API_KEY"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 8. EigenCompute (TEE)
|
|
228
|
+
|
|
229
|
+
Use when the user asks about deploying to EigenCompute, TEE, EigenCloud, attestation, or app management.
|
|
230
|
+
|
|
231
|
+
**Requires:** `npm install -g @layr-labs/ecloud-cli`
|
|
232
|
+
|
|
233
|
+
### Authentication
|
|
234
|
+
```bash
|
|
235
|
+
ecloud auth login
|
|
236
|
+
ecloud auth whoami
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Deploy an app
|
|
240
|
+
```bash
|
|
241
|
+
ecloud compute app create --name my-app --language typescript
|
|
242
|
+
ecloud compute app deploy
|
|
243
|
+
```
|
|
244
|
+
Always use **"Build and deploy from Dockerfile"** — deploy from registry is unreliable.
|
|
245
|
+
|
|
246
|
+
### Manage apps
|
|
247
|
+
```bash
|
|
248
|
+
ecloud compute app list
|
|
249
|
+
ecloud compute app info <APP_ID>
|
|
250
|
+
ecloud compute app logs <APP_ID>
|
|
251
|
+
ecloud compute app start <APP_ID>
|
|
252
|
+
ecloud compute app stop <APP_ID>
|
|
253
|
+
ecloud compute app terminate <APP_ID>
|
|
254
|
+
ecloud compute app upgrade <APP_ID>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Set sealed secrets
|
|
258
|
+
```bash
|
|
259
|
+
ecloud compute app env set MY_SECRET="value" API_KEY="key"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### TEE attestation
|
|
263
|
+
Inside the TEE, the KMS signing key is at `/usr/local/bin/kms-signing-public-key.pem`. Verify at `https://verify-sepolia.eigencloud.xyz`.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 9. EigenDA (Data Availability)
|
|
268
|
+
|
|
269
|
+
Use when the user asks about storing/retrieving data on EigenDA, blob storage, or data availability.
|
|
270
|
+
|
|
271
|
+
**Requires:** EigenDA Proxy running locally:
|
|
272
|
+
```bash
|
|
273
|
+
docker run -d --name eigenda-proxy -p 3100:3100 \
|
|
274
|
+
ghcr.io/layr-labs/eigenda-proxy:latest \
|
|
275
|
+
--eigenda.disperser-rpc=disperser-sepolia.eigenda.xyz:443 \
|
|
276
|
+
--eigenda.service-manager-addr=0xD4A7E1Bd8015057293f0D0A557088c286942e84b \
|
|
277
|
+
--eigenda.eth-rpc=YOUR_SEPOLIA_RPC_URL \
|
|
278
|
+
--eigenda.status-query-timeout=45s \
|
|
279
|
+
--eigenda.signer-private-key-hex=YOUR_PRIVATE_KEY \
|
|
280
|
+
--memstore.enabled=false --eigenda.disable-tls=false
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Store a blob
|
|
284
|
+
```bash
|
|
285
|
+
curl -s -X POST "http://127.0.0.1:3100/put?commitment_mode=standard" \
|
|
286
|
+
-H "Content-Type: application/json" \
|
|
287
|
+
-d '{"key": "value"}'
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Retrieve a blob
|
|
291
|
+
```bash
|
|
292
|
+
curl -s "http://127.0.0.1:3100/get/COMMITMENT_HASH?commitment_mode=standard"
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Health check
|
|
296
|
+
```bash
|
|
297
|
+
curl -s "http://127.0.0.1:3100/health"
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### View blob on explorer
|
|
301
|
+
```
|
|
302
|
+
https://blobs-sepolia.eigenda.xyz/blobs/COMMITMENT_HASH
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Query Parameters Reference
|
|
308
|
+
|
|
309
|
+
| Parameter | Used On | Values | Description |
|
|
310
|
+
|-----------|---------|--------|-------------|
|
|
311
|
+
| `withTvl` | operators, avs | `true`/`false` | Include TVL calculations |
|
|
312
|
+
| `sortByTvl` | operators, avs | `asc`/`desc` | Sort by TVL |
|
|
313
|
+
| `sortByApy` | operators, avs | `asc`/`desc` | Sort by APY |
|
|
314
|
+
| `sortByTotalStakers` | operators, avs | `asc`/`desc` | Sort by staker count |
|
|
315
|
+
| `sortByTotalAvs` | operators | `asc`/`desc` | Sort by AVS count |
|
|
316
|
+
| `searchByText` | operators, avs | string | Case-insensitive name search |
|
|
317
|
+
| `skip` | all list endpoints | number | Pagination offset (default: 0) |
|
|
318
|
+
| `take` | all list endpoints | number | Results per page (default: 12) |
|
|
319
|
+
|
|
320
|
+
## Response Formatting
|
|
321
|
+
|
|
322
|
+
When presenting results to users:
|
|
323
|
+
- **Bold names** and abbreviate addresses (`0x1234...abcd`)
|
|
324
|
+
- TVL in human-readable form ("$1.2B" not "1200000000")
|
|
325
|
+
- APY as percentages ("4.2% APY")
|
|
326
|
+
- Show staker counts and operator counts
|
|
327
|
+
- Use bullet points, not tables
|
|
328
|
+
- Flag high APY + low TVL as potentially risky
|
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eigen-skills",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Agent Skills for EigenLayer — restaking, AVS, operators, rewards, delegation data powered by EigenExplorer API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"agents": {
|
|
7
7
|
"skills": "skills/"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
+
"postinstall": "node scripts/postinstall.js",
|
|
10
11
|
"test": "node scripts/test-all.js",
|
|
11
|
-
"demo": "node scripts/demo.js"
|
|
12
|
+
"demo": "node scripts/demo.js",
|
|
13
|
+
"ui": "node server.js"
|
|
12
14
|
},
|
|
13
15
|
"keywords": [
|
|
14
16
|
"eigenlayer",
|
|
@@ -24,6 +26,9 @@
|
|
|
24
26
|
"author": "zeeshan8281",
|
|
25
27
|
"license": "MIT",
|
|
26
28
|
"dependencies": {
|
|
27
|
-
"axios": "^1.7.0"
|
|
29
|
+
"axios": "^1.7.0",
|
|
30
|
+
"dotenv": "^17.3.1",
|
|
31
|
+
"express": "^5.2.1",
|
|
32
|
+
"socket.io": "^4.8.3"
|
|
28
33
|
}
|
|
29
|
-
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
// Resolve symlinks to get the real path, then find the package root
|
|
7
|
+
const scriptDir = fs.realpathSync(__dirname);
|
|
8
|
+
const packageDir = path.resolve(scriptDir, '..');
|
|
9
|
+
const src = path.join(packageDir, 'SKILL.md');
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(src)) {
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Walk up from the original __dirname (may be symlinked) to find project root
|
|
16
|
+
// npm sets INIT_CWD to where `npm install` was run
|
|
17
|
+
const projectRoot = process.env.INIT_CWD || path.resolve(packageDir, '..', '..');
|
|
18
|
+
|
|
19
|
+
// Don't run if we're installing our own deps
|
|
20
|
+
if (path.resolve(projectRoot) === path.resolve(packageDir)) {
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (!fs.existsSync(path.join(projectRoot, 'package.json'))) {
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const destDir = path.join(projectRoot, '.claude', 'skills', 'eigen');
|
|
29
|
+
const dest = path.join(destDir, 'SKILL.md');
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
33
|
+
fs.copyFileSync(src, dest);
|
|
34
|
+
console.log('\n⚡ eigen-skills: SKILL.md installed to .claude/skills/eigen/');
|
|
35
|
+
console.log(' Claude Code can now query live EigenLayer data.');
|
|
36
|
+
console.log(' Set your API key: export EIGEN_API_KEY="your-key"\n');
|
|
37
|
+
} catch (err) {
|
|
38
|
+
// Silent fail — don't break the user's install
|
|
39
|
+
}
|
|
@@ -102,26 +102,12 @@ class AVSAPI {
|
|
|
102
102
|
// ─── AVS Registration Events ──────────────────────────
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
* Get registration events for a specific AVS.
|
|
105
|
+
* Get registration/deregistration events for a specific AVS.
|
|
106
106
|
* @param {string} avsAddress
|
|
107
107
|
* @param {object} opts
|
|
108
108
|
*/
|
|
109
109
|
async getAVSRegistrationEvents(avsAddress, opts = {}) {
|
|
110
|
-
const { data } = await this.client.get(`/avs/${avsAddress}/events/registration`, {
|
|
111
|
-
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
112
|
-
});
|
|
113
|
-
return data;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// ─── Operator-Sets per AVS ────────────────────────────
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Get operator sets for a specific AVS.
|
|
120
|
-
* @param {string} avsAddress
|
|
121
|
-
* @param {object} opts
|
|
122
|
-
*/
|
|
123
|
-
async getAVSOperatorSets(avsAddress, opts = {}) {
|
|
124
|
-
const { data } = await this.client.get(`/avs/${avsAddress}/operator-sets`, {
|
|
110
|
+
const { data } = await this.client.get(`/avs/${avsAddress}/events/registration-status`, {
|
|
125
111
|
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
126
112
|
});
|
|
127
113
|
return data;
|
|
@@ -39,7 +39,7 @@ class DelegationAPI {
|
|
|
39
39
|
};
|
|
40
40
|
if (opts.type) params.type = opts.type;
|
|
41
41
|
|
|
42
|
-
const { data } = await this.client.get('/events', { params });
|
|
42
|
+
const { data } = await this.client.get('/events/delegation', { params });
|
|
43
43
|
return data;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -64,64 +64,6 @@ class DelegationAPI {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
/**
|
|
68
|
-
* Get all stakers delegating to a specific operator.
|
|
69
|
-
* @param {string} operatorAddress
|
|
70
|
-
* @param {object} opts
|
|
71
|
-
*/
|
|
72
|
-
async getOperatorStakers(operatorAddress, opts = {}) {
|
|
73
|
-
const { data } = await this.client.get(`/operators/${operatorAddress}/stakers`, {
|
|
74
|
-
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
75
|
-
});
|
|
76
|
-
return data;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// ─── Staker Delegation ────────────────────────────────
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Get which operator a staker has delegated to and their position details.
|
|
83
|
-
* @param {string} stakerAddress
|
|
84
|
-
*/
|
|
85
|
-
async getStakerDelegation(stakerAddress) {
|
|
86
|
-
const { data } = await this.client.get(`/stakers/${stakerAddress}`);
|
|
87
|
-
return data;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Get a staker's withdrawal history (partial/full undelegations).
|
|
92
|
-
* @param {string} stakerAddress
|
|
93
|
-
* @param {object} opts
|
|
94
|
-
*/
|
|
95
|
-
async getStakerWithdrawals(stakerAddress, opts = {}) {
|
|
96
|
-
const { data } = await this.client.get(`/stakers/${stakerAddress}/withdrawals`, {
|
|
97
|
-
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
98
|
-
});
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// ─── Operator-Sets ────────────────────────────────────
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Get all operator-sets (the new slashing-era grouping model).
|
|
106
|
-
* @param {object} opts
|
|
107
|
-
*/
|
|
108
|
-
async getOperatorSets(opts = {}) {
|
|
109
|
-
const { data } = await this.client.get('/operator-sets', {
|
|
110
|
-
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
111
|
-
});
|
|
112
|
-
return data;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Get a specific operator-set by AVS address + operatorSetId.
|
|
117
|
-
* @param {string} avsAddress
|
|
118
|
-
* @param {string} operatorSetId
|
|
119
|
-
*/
|
|
120
|
-
async getOperatorSet(avsAddress, operatorSetId) {
|
|
121
|
-
const { data } = await this.client.get(`/operator-sets/${avsAddress}/${operatorSetId}`);
|
|
122
|
-
return data;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
67
|
// ─── Top Delegated Operators ──────────────────────────
|
|
126
68
|
|
|
127
69
|
/**
|
|
@@ -144,12 +144,11 @@ class EigenAPI {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* Get historical metrics.
|
|
147
|
+
* Get historical TVL metrics.
|
|
148
148
|
* @param {object} opts
|
|
149
|
-
* @param {string} [opts.frequency] - 'daily', 'weekly', etc.
|
|
150
149
|
*/
|
|
151
150
|
async getHistoricalMetrics(opts = {}) {
|
|
152
|
-
const { data } = await this.client.get('/metrics/historical', {
|
|
151
|
+
const { data } = await this.client.get('/metrics/historical/tvl', {
|
|
153
152
|
params: opts,
|
|
154
153
|
});
|
|
155
154
|
return data;
|
|
@@ -158,11 +157,22 @@ class EigenAPI {
|
|
|
158
157
|
// ─── Events ───────────────────────────────────────────
|
|
159
158
|
|
|
160
159
|
/**
|
|
161
|
-
* Get
|
|
160
|
+
* Get delegation events (shares increased/decreased, staker delegated/undelegated).
|
|
162
161
|
* @param {object} opts
|
|
163
162
|
*/
|
|
164
|
-
async
|
|
165
|
-
const { data } = await this.client.get('/events', {
|
|
163
|
+
async getDelegationEvents(opts = {}) {
|
|
164
|
+
const { data } = await this.client.get('/events/delegation', {
|
|
165
|
+
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
166
|
+
});
|
|
167
|
+
return data;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Get operator registration/deregistration events.
|
|
172
|
+
* @param {object} opts
|
|
173
|
+
*/
|
|
174
|
+
async getRegistrationEvents(opts = {}) {
|
|
175
|
+
const { data } = await this.client.get('/events/registration-status', {
|
|
166
176
|
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
167
177
|
});
|
|
168
178
|
return data;
|
|
@@ -23,46 +23,11 @@ class RewardsAPI {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// ───
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Get all rewards data.
|
|
30
|
-
* @param {object} opts
|
|
31
|
-
*/
|
|
32
|
-
async getRewards(opts = {}) {
|
|
33
|
-
const { data } = await this.client.get('/rewards', {
|
|
34
|
-
params: { skip: opts.skip || 0, take: opts.take || 12 },
|
|
35
|
-
});
|
|
36
|
-
return data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// ─── Operator Rewards ─────────────────────────────────
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Get rewards info for a specific operator.
|
|
43
|
-
* Returns the reward strategies and tokens the operator receives.
|
|
44
|
-
* @param {string} operatorAddress
|
|
45
|
-
*/
|
|
46
|
-
async getOperatorRewards(operatorAddress) {
|
|
47
|
-
const { data } = await this.client.get(`/operators/${operatorAddress}/rewards`);
|
|
48
|
-
return data;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// ─── Staker Rewards ───────────────────────────────────
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Get staker rewards by address.
|
|
55
|
-
* @param {string} stakerAddress
|
|
56
|
-
*/
|
|
57
|
-
async getStakerRewards(stakerAddress) {
|
|
58
|
-
const { data } = await this.client.get(`/stakers/${stakerAddress}/rewards`);
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ─── AVS Rewards ──────────────────────────────────────
|
|
26
|
+
// ─── AVS Rewards (only verified working rewards endpoint) ─────
|
|
63
27
|
|
|
64
28
|
/**
|
|
65
29
|
* Get rewards distributed by a specific AVS.
|
|
30
|
+
* Returns reward submission hashes, durations, tokens, and amounts.
|
|
66
31
|
* @param {string} avsAddress
|
|
67
32
|
*/
|
|
68
33
|
async getAVSRewards(avsAddress) {
|