@wzrd_sol/sdk 0.2.0 → 0.3.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 +106 -124
- package/dist/agent-loop.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,171 +1,153 @@
|
|
|
1
|
-
#
|
|
1
|
+
# WZRD — AI Model Velocity Oracle
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Builds `deposit_market`, `settle_market`, and `claim_global` transaction instructions that wallets sign directly — no server signing needed.
|
|
3
|
+
Real-time adoption tracking for 100+ open-source AI models across HuggingFace, GitHub, OpenRouter, and ArtificialAnalysis. Free to read. Agents earn CCM on Solana.
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
|
|
8
|
+
pip install wzrd-client
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
From the repo root:
|
|
11
|
+
```python
|
|
12
|
+
import wzrd
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
npm run typecheck:examples --workspace=sdk
|
|
14
|
+
model = wzrd.pick("code") # Best model for coding right now
|
|
15
|
+
details = wzrd.pick_details("reasoning") # With score, trend, confidence
|
|
20
16
|
```
|
|
21
17
|
|
|
22
|
-
|
|
18
|
+
No API key. No auth. Returns in <100ms (cached).
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
- `npm run example:claim --workspace=sdk`
|
|
20
|
+
## Earn CCM
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
Agents that contribute model selection data earn CCM tokens. The loop is: **authenticate, pick, infer, report, claim.**
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
```python
|
|
25
|
+
import wzrd
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
wzrd.run_loop(
|
|
28
|
+
keypair="~/.config/solana/id.json",
|
|
29
|
+
tasks=["code", "chat", "reasoning"],
|
|
30
|
+
cycle_seconds=60,
|
|
31
|
+
)
|
|
32
|
+
```
|
|
33
33
|
|
|
34
|
-
-
|
|
35
|
-
- `WZRD_DEPOSIT_USDC`
|
|
34
|
+
Claims are gasless — no SOL required. Server-witnessed inference ensures real usage.
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
**[Full getting-started guide](https://twzrd.xyz/start)**
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
## MCP
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const marketVault = getMarketVaultPDA(protocolState, 6); // market ID 6
|
|
53
|
-
const position = getUserPositionPDA(marketVault, walletPubkey);
|
|
40
|
+
26 tools. Zero config. Connect from Claude Desktop, Cursor, or any MCP client.
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"wzrd": {
|
|
46
|
+
"transport": "streamable-http",
|
|
47
|
+
"url": "https://app.twzrd.xyz/api/mcp"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
54
51
|
```
|
|
55
52
|
|
|
56
|
-
|
|
53
|
+
Hero tool: `pick_model` — one call, best model for your task.
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
import { Connection, Keypair, VersionedTransaction, TransactionMessage } from '@solana/web3.js';
|
|
60
|
-
import { createDepositMarketIx } from '@wzrd_sol/sdk';
|
|
55
|
+
## TypeScript SDK
|
|
61
56
|
|
|
62
|
-
|
|
63
|
-
const wallet = Keypair.fromSecretKey(/* your key */);
|
|
57
|
+
Full instruction builders for the on-chain protocol: deposit, settle, claim, LP.
|
|
64
58
|
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
```bash
|
|
60
|
+
npm install @wzrd_sol/sdk
|
|
61
|
+
```
|
|
67
62
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
payerKey: wallet.publicKey,
|
|
71
|
-
recentBlockhash: blockhash,
|
|
72
|
-
instructions: ixs,
|
|
73
|
-
}).compileToV0Message();
|
|
63
|
+
```typescript
|
|
64
|
+
import { createDepositMarketIx } from '@wzrd_sol/sdk';
|
|
74
65
|
|
|
75
|
-
const
|
|
76
|
-
tx.sign([wallet]);
|
|
77
|
-
const sig = await connection.sendTransaction(tx);
|
|
78
|
-
console.log('Deposit tx:', sig);
|
|
66
|
+
const ixs = await createDepositMarketIx(connection, wallet, marketId, 1_000_000n);
|
|
79
67
|
```
|
|
80
68
|
|
|
81
|
-
###
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
import { createClaimGlobalIx } from '@wzrd_sol/sdk';
|
|
69
|
+
### Framework Plugins
|
|
85
70
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
| Framework | Package | Install |
|
|
72
|
+
|-----------|---------|---------|
|
|
73
|
+
| ElizaOS | `@wzrd_sol/eliza-plugin` | `npm i @wzrd_sol/eliza-plugin` |
|
|
74
|
+
| Solana Agent Kit | `@wzrd_sol/solana-agent-plugin` | `npm i @wzrd_sol/solana-agent-plugin` |
|
|
75
|
+
| GOAT | `@wzrd_sol/goat-plugin` | `npm i @wzrd_sol/goat-plugin` |
|
|
89
76
|
|
|
90
|
-
|
|
91
|
-
connection,
|
|
92
|
-
wallet.publicKey,
|
|
93
|
-
root_seq,
|
|
94
|
-
BigInt(cumulative_total),
|
|
95
|
-
proof, // hex-encoded [u8; 32] nodes
|
|
96
|
-
);
|
|
77
|
+
## Python API
|
|
97
78
|
|
|
98
|
-
|
|
99
|
-
|
|
79
|
+
| Function | What it does |
|
|
80
|
+
|----------|-------------|
|
|
81
|
+
| `wzrd.pick(task)` | Best model name for a task |
|
|
82
|
+
| `wzrd.pick_details(task)` | Structured result with score, trend, confidence |
|
|
83
|
+
| `wzrd.shortlist(task, limit=5)` | Top N ranked models |
|
|
84
|
+
| `wzrd.compare(a, b)` | Head-to-head comparison |
|
|
85
|
+
| `wzrd.pick_onchain(task)` | Trustless — reads Switchboard feeds directly |
|
|
86
|
+
| `wzrd.run_loop(keypair=...)` | Full earn loop: auth, pick, report, claim |
|
|
87
|
+
| `WZRDRouter(client)` | Drop-in wrapper for OpenAI/Anthropic clients |
|
|
100
88
|
|
|
101
|
-
|
|
89
|
+
## Public API
|
|
102
90
|
|
|
103
|
-
|
|
104
|
-
import { createSettleMarketIx } from '@wzrd_sol/sdk';
|
|
91
|
+
Base URL: `https://api.twzrd.xyz`
|
|
105
92
|
|
|
106
|
-
|
|
107
|
-
|
|
93
|
+
```
|
|
94
|
+
GET /v1/signals/momentum — model velocity signals
|
|
95
|
+
GET /v1/leaderboard — ranked attention markets
|
|
96
|
+
GET /v1/markets/:id — single market detail
|
|
97
|
+
GET /v1/feeds — Switchboard oracle feeds
|
|
98
|
+
GET /health — service health
|
|
108
99
|
```
|
|
109
100
|
|
|
110
|
-
|
|
101
|
+
Full spec: [openapi.json](https://api.twzrd.xyz/openapi.json)
|
|
111
102
|
|
|
112
|
-
|
|
103
|
+
## Links
|
|
113
104
|
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
| | |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Get Started | [twzrd.xyz/start](https://twzrd.xyz/start) |
|
|
108
|
+
| Live Feed | [twzrd.xyz/feed](https://twzrd.xyz/feed) |
|
|
109
|
+
| MCP Guide | [twzrd.xyz/mcp-guide.md](https://twzrd.xyz/mcp-guide.md) |
|
|
110
|
+
| Machine Manifest | [twzrd.xyz/llms.txt](https://twzrd.xyz/llms.txt) |
|
|
111
|
+
| API | [api.twzrd.xyz/v1/leaderboard](https://api.twzrd.xyz/v1/leaderboard) |
|
|
112
|
+
| PyPI | [wzrd-client](https://pypi.org/project/wzrd-client/) |
|
|
113
|
+
| npm | [@wzrd_sol/sdk](https://www.npmjs.com/package/@wzrd_sol/sdk) |
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
console.log('Total deposited:', vault?.totalDeposited);
|
|
115
|
+
## Key Identifiers
|
|
119
116
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
| Item | Address |
|
|
118
|
+
|------|---------|
|
|
119
|
+
| Program | `GnGzNdsQMxMpJfMeqnkGPsvHm8kwaDidiKjNU2dCVZop` |
|
|
120
|
+
| CCM Mint | `Dxk8mAb3C7AM8JN6tAJfVuSja5yidhZM5sEKW3SRX2BM` (Token-2022, 50 BPS transfer fee) |
|
|
121
|
+
| vLOFI Mint | `E9Kt33axpCy3ve2PCY9BSrbPhcR9wdDsWQECAahzw2dS` |
|
|
123
122
|
|
|
124
|
-
##
|
|
123
|
+
## Architecture
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
125
|
+
```
|
|
126
|
+
wzrd-final/
|
|
127
|
+
├── programs/attention-oracle/ # On-chain program (Solana)
|
|
128
|
+
├── server/ # Backend API + background jobs (Axum/Rust)
|
|
129
|
+
├── app/ # Frontend (React/Vite)
|
|
130
|
+
├── sdk/ # TypeScript SDK — 35 instruction builders
|
|
131
|
+
├── integrations/wzrd-client/ # Python client (PyPI: wzrd-client)
|
|
132
|
+
├── agents/ # 13 agent implementations across 6 frameworks
|
|
133
|
+
├── crates/ # Rust crates (stream ingestor, merkle, types)
|
|
134
|
+
├── ops/ # Deployment scripts
|
|
135
|
+
└── migrations/ # SQL migrations
|
|
136
|
+
```
|
|
134
137
|
|
|
135
|
-
|
|
138
|
+
## Build
|
|
136
139
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
| `getMarketVaultPDA(protocolState, marketId)` | `["market_vault", protocolState, marketId]` |
|
|
141
|
-
| `getUserPositionPDA(marketVault, user)` | `["market_position", marketVault, user]` |
|
|
142
|
-
| `getGlobalRootConfigPDA(ccmMint)` | `["global_root", ccmMint]` |
|
|
143
|
-
| `getClaimStatePDA(ccmMint, claimer)` | `["claim_global", ccmMint, claimer]` |
|
|
140
|
+
```bash
|
|
141
|
+
# Server
|
|
142
|
+
cargo build -p wzrd-server
|
|
144
143
|
|
|
145
|
-
|
|
144
|
+
# Frontend
|
|
145
|
+
cd app && npm install && npm run dev
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
| `createSettleMarketIx(conn, user, marketId)` | `settle_market` |
|
|
151
|
-
| `createClaimGlobalIx(conn, claimer, rootSeq, total, proof)` | `claim_global` |
|
|
152
|
-
| `createInitializeMarketVaultIx(admin, marketId, ...)` | `initialize_market_vault` |
|
|
147
|
+
# On-chain program
|
|
148
|
+
anchor build
|
|
149
|
+
```
|
|
153
150
|
|
|
154
|
-
|
|
151
|
+
## License
|
|
155
152
|
|
|
156
|
-
|
|
157
|
-
|----------|-------------|
|
|
158
|
-
| `parseMarketVault(data)` | `MarketVault` |
|
|
159
|
-
| `parseProtocolState(data)` | `ProtocolState` |
|
|
160
|
-
| `parseUserMarketPosition(data)` | `UserMarketPosition` |
|
|
161
|
-
| `fetchMarketVault(conn, marketId)` | Fetch + parse |
|
|
162
|
-
| `fetchOnChainPosition(conn, user, marketId)` | Fetch + parse |
|
|
163
|
-
| `fetchTokenBalance(conn, ata)` | Raw token balance |
|
|
164
|
-
|
|
165
|
-
## Key Addresses
|
|
166
|
-
|
|
167
|
-
| Asset | Mint | Token Program |
|
|
168
|
-
|-------|------|---------------|
|
|
169
|
-
| USDC | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` | SPL Token |
|
|
170
|
-
| vLOFI | `E9Kt33axpCy3ve2PCY9BSrbPhcR9wdDsWQECAahzw2dS` | SPL Token |
|
|
171
|
-
| CCM | `Dxk8mAb3C7AM8JN6tAJfVuSja5yidhZM5sEKW3SRX2BM` | Token-2022 |
|
|
153
|
+
All rights reserved. Source available for transparency and agent integration.
|
package/dist/agent-loop.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* PDA derivation, instruction builders, and account parsers for
|
|
5
5
|
* deposit_market, settle_market, and claim_global.
|
|
6
6
|
*/
|
|
7
|
-
export declare const VERSION = "0.
|
|
7
|
+
export declare const VERSION = "0.2.0";
|
|
8
8
|
export { PROGRAM_ID, DEVNET_PROGRAM_ID, MAINNET_PROGRAM_ID, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID, PROTOCOL_STATE_SEED, MARKET_VAULT_SEED, MARKET_POSITION_SEED, GLOBAL_ROOT_SEED, CLAIM_STATE_GLOBAL_SEED, CHANNEL_CONFIG_V2_SEED, STREAM_ROOT_SEED, CLAIM_STATE_STREAM_SEED, } from './constants.js';
|
|
9
9
|
export { getProtocolStatePDA, getMarketVaultPDA, getUserPositionPDA, getGlobalRootConfigPDA, getClaimStatePDA, getChannelConfigV2PDA, getStreamRootConfigPDA, getClaimStateStreamPDA, getAta, } from './pda.js';
|
|
10
10
|
export type { LifecyclePhase, LifecyclePhaseInput, MarketVaultData, MarketVaultFull, ProtocolStateData, OnChainPosition, } from './accounts.js';
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* PDA derivation, instruction builders, and account parsers for
|
|
5
5
|
* deposit_market, settle_market, and claim_global.
|
|
6
6
|
*/
|
|
7
|
-
export const VERSION = '0.
|
|
7
|
+
export const VERSION = '0.2.0';
|
|
8
8
|
// ── Constants ──────────────────────────────────────────
|
|
9
9
|
export { PROGRAM_ID, DEVNET_PROGRAM_ID, MAINNET_PROGRAM_ID, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID, PROTOCOL_STATE_SEED, MARKET_VAULT_SEED, MARKET_POSITION_SEED, GLOBAL_ROOT_SEED, CLAIM_STATE_GLOBAL_SEED, CHANNEL_CONFIG_V2_SEED, STREAM_ROOT_SEED, CLAIM_STATE_STREAM_SEED, } from './constants.js';
|
|
10
10
|
// ── PDA Derivation ─────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzrd_sol/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Earn CCM from any Node.js agent in 6 lines. Model velocity oracle + earn loop on Solana.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/twzrd-sol/wzrd-
|
|
41
|
-
"directory": "sdk"
|
|
40
|
+
"url": "https://github.com/twzrd-sol/wzrd-velocity"
|
|
42
41
|
},
|
|
43
42
|
"homepage": "https://twzrd.xyz",
|
|
44
43
|
"publishConfig": {
|