@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 CHANGED
@@ -1,171 +1,153 @@
1
- # @wzrd_sol/sdk
1
+ # WZRD — AI Model Velocity Oracle
2
2
 
3
- TypeScript SDK for the Liquid Attention Protocol on Solana.
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
- npm install @wzrd_sol/sdk @solana/web3.js
8
+ pip install wzrd-client
11
9
  ```
12
10
 
13
- ## Example Scripts
14
-
15
- From the repo root:
11
+ ```python
12
+ import wzrd
16
13
 
17
- ```bash
18
- npm run build --workspace=sdk
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
- Runnable examples:
18
+ No API key. No auth. Returns in <100ms (cached).
23
19
 
24
- - `npm run example:deposit --workspace=sdk`
25
- - `npm run example:claim --workspace=sdk`
20
+ ## Earn CCM
26
21
 
27
- Both examples expect:
22
+ Agents that contribute model selection data earn CCM tokens. The loop is: **authenticate, pick, infer, report, claim.**
28
23
 
29
- - `SOLANA_RPC_URL`
30
- - `WZRD_KEYPAIR_PATH`
24
+ ```python
25
+ import wzrd
31
26
 
32
- The deposit example also expects:
27
+ wzrd.run_loop(
28
+ keypair="~/.config/solana/id.json",
29
+ tasks=["code", "chat", "reasoning"],
30
+ cycle_seconds=60,
31
+ )
32
+ ```
33
33
 
34
- - `WZRD_MARKET_ID`
35
- - `WZRD_DEPOSIT_USDC`
34
+ Claims are gasless — no SOL required. Server-witnessed inference ensures real usage.
36
35
 
37
- ## Quick Reference
36
+ **[Full getting-started guide](https://twzrd.xyz/start)**
38
37
 
39
- ### PDA Derivation
38
+ ## MCP
40
39
 
41
- ```typescript
42
- import {
43
- getProtocolStatePDA,
44
- getMarketVaultPDA,
45
- getUserPositionPDA,
46
- getGlobalRootConfigPDA,
47
- getClaimStatePDA,
48
- PROGRAM_ID,
49
- } from '@wzrd_sol/sdk';
50
-
51
- const protocolState = getProtocolStatePDA();
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
- ### Deposit USDC Receive vLOFI
53
+ Hero tool: `pick_model` one call, best model for your task.
57
54
 
58
- ```typescript
59
- import { Connection, Keypair, VersionedTransaction, TransactionMessage } from '@solana/web3.js';
60
- import { createDepositMarketIx } from '@wzrd_sol/sdk';
55
+ ## TypeScript SDK
61
56
 
62
- const connection = new Connection('https://api.mainnet-beta.solana.com');
63
- const wallet = Keypair.fromSecretKey(/* your key */);
57
+ Full instruction builders for the on-chain protocol: deposit, settle, claim, LP.
64
58
 
65
- // Build instructions for a 1 USDC deposit into market 6
66
- const ixs = await createDepositMarketIx(connection, wallet.publicKey, 6, 1_000_000n);
59
+ ```bash
60
+ npm install @wzrd_sol/sdk
61
+ ```
67
62
 
68
- const { blockhash } = await connection.getLatestBlockhash();
69
- const message = new TransactionMessage({
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 tx = new VersionedTransaction(message);
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
- ### Claim CCM via Merkle Proof
82
-
83
- ```typescript
84
- import { createClaimGlobalIx } from '@wzrd_sol/sdk';
69
+ ### Framework Plugins
85
70
 
86
- // Fetch proof from the server API
87
- const res = await fetch(`https://api.twzrd.xyz/v1/claims/${wallet.publicKey.toBase58()}`);
88
- const { root_seq, cumulative_total, proof } = await res.json();
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
- const ixs = await createClaimGlobalIx(
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
- // Build, sign, send as above
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
- ### Settle a Matured Position
89
+ ## Public API
102
90
 
103
- ```typescript
104
- import { createSettleMarketIx } from '@wzrd_sol/sdk';
91
+ Base URL: `https://api.twzrd.xyz`
105
92
 
106
- const ixs = await createSettleMarketIx(connection, wallet.publicKey, 6);
107
- // Build, sign, send as above
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
- `settle_market` returns USDC from reserve and burns vLOFI. It does not mint CCM; CCM is claimed via merkle proof (`claim_global` / `claim_global_v2`).
101
+ Full spec: [openapi.json](https://api.twzrd.xyz/openapi.json)
111
102
 
112
- ### Read On-Chain State
103
+ ## Links
113
104
 
114
- ```typescript
115
- import { fetchMarketVault, fetchOnChainPosition, fetchTokenBalance } from '@wzrd_sol/sdk';
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
- const vault = await fetchMarketVault(connection, 6);
118
- console.log('Total deposited:', vault?.totalDeposited);
115
+ ## Key Identifiers
119
116
 
120
- const pos = await fetchOnChainPosition(connection, wallet.publicKey, 6);
121
- console.log('My deposit:', pos?.depositedAmount, 'Multiplier:', pos?.attentionMultiplierBps);
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
- ## Exports
123
+ ## Architecture
125
124
 
126
- ### Constants
127
-
128
- | Export | Description |
129
- |--------|-------------|
130
- | `PROGRAM_ID` | Mainnet program ID (`GnGz...`) |
131
- | `DEVNET_PROGRAM_ID` | Devnet program ID (`GmGX...`) |
132
- | `TOKEN_PROGRAM_ID` | SPL Token program |
133
- | `TOKEN_2022_PROGRAM_ID` | Token-2022 program (CCM uses this) |
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
- ### PDA Derivation
138
+ ## Build
136
139
 
137
- | Function | Seeds |
138
- |----------|-------|
139
- | `getProtocolStatePDA()` | `["protocol_state"]` |
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
- ### Instruction Builders
144
+ # Frontend
145
+ cd app && npm install && npm run dev
146
146
 
147
- | Function | On-chain instruction |
148
- |----------|---------------------|
149
- | `createDepositMarketIx(conn, user, marketId, amount)` | `deposit_market` |
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
- ### Account Parsers
151
+ ## License
155
152
 
156
- | Function | Account type |
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.
@@ -41,7 +41,7 @@ function log(msg) {
41
41
  function fmtCcm(raw) {
42
42
  if (!raw)
43
43
  return '0 CCM';
44
- const human = Math.floor(raw / 1e9).toLocaleString();
44
+ const human = Math.floor(raw / 1e6).toLocaleString();
45
45
  return `${human} CCM`;
46
46
  }
47
47
  function sleep(ms) {
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.1.2";
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.1.2';
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.2.0",
4
- "description": "TypeScript SDK for the WZRD Liquid Attention Protocol deposit, settle, claim on Solana",
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-final",
41
- "directory": "sdk"
40
+ "url": "https://github.com/twzrd-sol/wzrd-velocity"
42
41
  },
43
42
  "homepage": "https://twzrd.xyz",
44
43
  "publishConfig": {