@wzrd_sol/eliza-plugin 0.1.0 → 0.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 +61 -0
- package/dist/actions/claim.js +15 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @wzrd_sol/eliza-plugin
|
|
2
|
+
|
|
3
|
+
ElizaOS plugin for the WZRD Liquid Attention Protocol on Solana. Gives ElizaOS agents the ability to discover AI model velocity, manage attention market positions, deposit USDC, and claim CCM yield.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @wzrd_sol/eliza-plugin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
Set these in your ElizaOS runtime settings or environment:
|
|
14
|
+
|
|
15
|
+
| Variable | Required | Default | Description |
|
|
16
|
+
|----------|----------|---------|-------------|
|
|
17
|
+
| `SOLANA_PRIVATE_KEY` | Yes (for tx) | — | Base58 keypair for signing deposits/claims |
|
|
18
|
+
| `WZRD_API_URL` | No | `https://api.twzrd.xyz` | WZRD backend endpoint |
|
|
19
|
+
| `SOLANA_RPC_URL` | No | Helius mainnet | Solana RPC for on-chain reads |
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { wzrdPlugin } from "@wzrd_sol/eliza-plugin";
|
|
25
|
+
|
|
26
|
+
// Register with your ElizaOS agent
|
|
27
|
+
const agent = new AgentRuntime({
|
|
28
|
+
plugins: [wzrdPlugin],
|
|
29
|
+
// ... other config
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Actions
|
|
34
|
+
|
|
35
|
+
| Action | Auth | Description |
|
|
36
|
+
|--------|------|-------------|
|
|
37
|
+
| `WZRD_LEADERBOARD` | No | Fetch top markets ranked by velocity EMA |
|
|
38
|
+
| `WZRD_VELOCITY` | No | Classify attention signal strength for a market |
|
|
39
|
+
| `WZRD_PORTFOLIO` | Yes | View positions and accrued yield |
|
|
40
|
+
| `WZRD_DEPOSIT` | Yes | Deposit USDC into an attention market, receive vLOFI |
|
|
41
|
+
| `WZRD_CLAIM` | Yes | Claim accrued CCM via gasless relay or self-signed tx |
|
|
42
|
+
|
|
43
|
+
### Example prompts
|
|
44
|
+
|
|
45
|
+
- "Show me the top WZRD markets"
|
|
46
|
+
- "What's the velocity signal for market 6?"
|
|
47
|
+
- "Check my WZRD portfolio"
|
|
48
|
+
- "Deposit 1 USDC into market 3"
|
|
49
|
+
- "Claim my CCM rewards"
|
|
50
|
+
|
|
51
|
+
## Links
|
|
52
|
+
|
|
53
|
+
- [WZRD Protocol](https://twzrd.xyz)
|
|
54
|
+
- [SDK](https://www.npmjs.com/package/@wzrd_sol/sdk)
|
|
55
|
+
- [OpenAPI](https://twzrd.xyz/openapi.json)
|
|
56
|
+
- [MCP Server](https://app.twzrd.xyz/api/mcp)
|
|
57
|
+
- [Agent Discovery](https://twzrd.xyz/llms.txt)
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT
|
package/dist/actions/claim.js
CHANGED
|
@@ -10,7 +10,21 @@ export const claimAction = {
|
|
|
10
10
|
validate: async () => true,
|
|
11
11
|
handler: async (runtime, _msg, _state, _opt, callback) => {
|
|
12
12
|
const client = getWzrdClient(runtime);
|
|
13
|
-
|
|
13
|
+
let claims;
|
|
14
|
+
try {
|
|
15
|
+
claims = await client.getClaims();
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
19
|
+
if (msg.includes('404')) {
|
|
20
|
+
const text = 'No claims found. Deposit into a market first to start accruing CCM.';
|
|
21
|
+
await callback?.({ text });
|
|
22
|
+
return { success: true, text };
|
|
23
|
+
}
|
|
24
|
+
const text = `Failed to fetch claims: ${msg}`;
|
|
25
|
+
await callback?.({ text });
|
|
26
|
+
return { success: false, error: text };
|
|
27
|
+
}
|
|
14
28
|
const claimable = claims.cumulative_total - claims.claimed_total;
|
|
15
29
|
if (claimable <= 0) {
|
|
16
30
|
const text = `No CCM to claim. Cumulative: ${claims.cumulative_total}, claimed: ${claims.claimed_total}.`;
|
package/package.json
CHANGED