@wzrd_sol/solana-agent-plugin
v0.1.2
Published
WZRD Liquid Attention Protocol plugin for Solana Agent Kit — deposit, claim, leaderboard, portfolio, velocity signal
Downloads
241
Maintainers
Readme
@wzrd_sol/solana-agent-plugin
WZRD Liquid Attention Protocol plugin for autonomous Solana agents. Provides 5 actions for interacting with WZRD attention markets: browse the leaderboard, classify velocity signals, view portfolio positions, deposit USDC to mint vLOFI, and claim CCM yield via gasless relay.
Works standalone, with Solana Agent Kit, or as a base for ElizaOS action wrappers.
30-Second Test
No Solana Agent Kit dependency is required for the first smoke test. The package is ESM-first, so use type: "module" and import.
mkdir wzrd-agent && cd wzrd-agent
printf '{\"name\":\"wzrd-agent\",\"type\":\"module\",\"private\":true}\n' > package.json
npm install @wzrd_sol/solana-agent-plugin @solana/web3.js
curl -O https://raw.githubusercontent.com/twzrd-sol/wzrd-final/main/agents/solana-agent-kit-plugin/examples/hello-wzrd.mjs
solana-keygen new -o /tmp/agent.json --no-bip39-passphrase
WZRD_KEYPAIR_PATH=/tmp/agent.json node hello-wzrd.mjsWhat you should see:
- top markets
- successful Ed25519 agent auth
- portfolio or signup-bonus path
- claimable CCM state
Install
npm install @wzrd_sol/solana-agent-pluginInstall with Solana Agent Kit only when you are ready to execute through its action system:
npm install @wzrd_sol/solana-agent-plugin solana-agent-kitQuick Start
import { Keypair } from '@solana/web3.js';
import { WzrdClient } from '@wzrd_sol/solana-agent-plugin';
// Any Ed25519 keypair — used for agent auth
const keypair = Keypair.generate();
const client = new WzrdClient(keypair);
// Browse attention markets (no auth required)
const leaderboard = await client.getLeaderboard();
console.log(leaderboard.markets.map(m => `${m.channel_id}: ${m.velocity_ema}`));
// Authenticated endpoints (auto-handles challenge/verify flow)
const portfolio = await client.getPortfolio();
const claims = await client.getClaims();
const result = await client.claimRelay(); // gasless CCM claimSolana Agent Kit
The package works standalone or as a Solana Agent Kit plugin.
import { SolanaAgentKit } from 'solana-agent-kit';
import { WZRD_PLUGIN } from '@wzrd_sol/solana-agent-plugin';
const agent = new SolanaAgentKit(/* wallet + rpc + model config */);
agent.use(WZRD_PLUGIN);Actions
The plugin exports 5 actions that follow the Solana Agent Kit action interface:
| Action | Auth | Description |
|--------|------|-------------|
| LEADERBOARD_ACTION | No | Fetch ranked attention markets |
| VELOCITY_ACTION | No | Classify signal strength (BREAKOUT / MOMENTUM / EMERGING / STABLE / COOLING / WEAK) |
| PORTFOLIO_ACTION | Yes | View portfolio positions |
| DEPOSIT_ACTION | Yes | Deposit USDC into a market, receive vLOFI |
| CLAIM_ACTION | Yes | Claim CCM via server-paid gasless relay |
import { WZRD_ACTIONS, WZRD_PLUGIN } from '@wzrd_sol/solana-agent-plugin';
// Register all actions with Solana Agent Kit
// WZRD_PLUGIN.actions contains all 5 actionsAPI
new WzrdClient(keypair: Keypair, apiUrl?: string)
Creates a client instance. The keypair is used for Ed25519 agent authentication. Default API URL is https://api.twzrd.xyz.
Methods
getLeaderboard(limit?: number, platform?: string)-- no authgetPortfolio()-- authenticatedgetClaims()-- authenticatedclaimRelay()-- authenticated, gaslessgetHealth()-- no auth
Auth is handled automatically: the client requests a challenge nonce, signs it with the keypair, and caches the bearer token (24h TTL, auto-refreshes).
For an end-to-end smoke test, use examples/hello-wzrd.mjs. It works with just:
@wzrd_sol/solana-agent-plugin@solana/web3.jsWZRD_KEYPAIR_PATH=/path/to/keypair.json
License
MIT
