@clawdvault/sdk 0.4.0 → 0.4.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 CHANGED
@@ -127,59 +127,6 @@ client.setSigner(newSigner);
127
127
  const address = client.getWalletAddress(); // returns string | null
128
128
  ```
129
129
 
130
- ## USD Price Fields
131
-
132
- The SDK provides native USD pricing on tokens, trades, and stats:
133
-
134
- ### Token Fields
135
-
136
- ```typescript
137
- const { token } = await client.getToken('MINT_ADDRESS');
138
-
139
- // USD Fields
140
- console.log(token.price_usd); // Current price in USD
141
- console.log(token.market_cap_usd); // Market cap in USD
142
-
143
- // SOL Fields (still available)
144
- console.log(token.price_sol); // Price in SOL
145
- console.log(token.market_cap_sol); // Market cap in SOL
146
- ```
147
-
148
- ### Trade Fields
149
-
150
- ```typescript
151
- const { trades } = await client.getTrades({ mint: 'MINT_ADDRESS' });
152
-
153
- for (const trade of trades) {
154
- console.log(trade.price_usd); // Price in USD at time of trade
155
- console.log(trade.sol_price_usd); // SOL/USD price at time of trade
156
- console.log(trade.price_sol); // Price in SOL at time of trade
157
- }
158
- ```
159
-
160
- ### Candles with Currency
161
-
162
- ```typescript
163
- // Get candles in USD
164
- const { candles } = await client.getCandles({
165
- mint: 'MINT_ADDRESS',
166
- interval: '5m',
167
- currency: 'usd' // 'usd' or 'sol'
168
- });
169
-
170
- // candles[0].open, high, low, close are in USD when currency='usd'
171
- ```
172
-
173
- ### Stats Fields
174
-
175
- ```typescript
176
- const stats = await client.getStats('MINT_ADDRESS');
177
-
178
- console.log(stats.onChain?.priceUsd); // Price in USD
179
- console.log(stats.onChain?.marketCapUsd); // Market cap in USD
180
- console.log(stats.onChain?.solPriceUsd); // SOL/USD rate
181
- ```
182
-
183
130
  ## Browser Usage with Phantom Wallet
184
131
 
185
132
  ```typescript
@@ -258,27 +205,21 @@ const jupSell = await client.sellJupiter('MINT', 1000000, 50);
258
205
  ### Price & Market Data
259
206
 
260
207
  ```typescript
261
- // Trade history (includes USD prices)
208
+ // Trade history
262
209
  const { trades } = await client.getTrades({
263
210
  mint: 'MINT_ADDRESS',
264
211
  limit: 50
265
212
  });
266
- // trades[0].price_usd - Price in USD at trade time
267
- // trades[0].sol_price_usd - SOL price at trade time
268
213
 
269
- // OHLCV candles (SOL or USD)
214
+ // OHLCV candles
270
215
  const { candles } = await client.getCandles({
271
216
  mint: 'MINT_ADDRESS',
272
- interval: '1m', // '1m' | '5m' | '15m' | '1h' | '4h' | '1d'
273
- limit: 100,
274
- currency: 'usd' // 'usd' or 'sol' (default: 'sol')
217
+ interval: '1m', // '1m' | '5m' | '15m' | '1h' | '4h' | '1d'
218
+ limit: 100
275
219
  });
276
220
 
277
- // On-chain stats (includes USD market cap)
221
+ // On-chain stats
278
222
  const stats = await client.getStats('MINT_ADDRESS');
279
- // stats.onChain.priceUsd - Price in USD
280
- // stats.onChain.marketCapUsd - Market cap in USD
281
- // stats.onChain.solPriceUsd - SOL/USD price
282
223
 
283
224
  // Top holders
284
225
  const { holders } = await client.getHolders('MINT_ADDRESS');
@@ -336,6 +277,52 @@ client.setSessionToken(token);
336
277
  const { valid } = await client.validateSession();
337
278
  ```
338
279
 
280
+ ### Agent Operations
281
+
282
+ ```typescript
283
+ // Register a new AI agent
284
+ const result = await client.registerAgent({
285
+ wallet: 'WALLET_ADDRESS',
286
+ name: 'My Agent', // optional
287
+ });
288
+ console.log('API Key:', result.apiKey); // save this!
289
+ console.log('Claim Code:', result.claimCode);
290
+ console.log('Tweet:', result.tweetTemplate);
291
+
292
+ // Verify agent via Twitter
293
+ const claim = await client.claimAgent({
294
+ apiKey: 'YOUR_API_KEY',
295
+ tweetUrl: 'https://twitter.com/user/status/123',
296
+ });
297
+ console.log('Verified:', claim.twitterHandle);
298
+
299
+ // Upload agent avatar (requires API key auth)
300
+ const { url } = await client.uploadAvatar(
301
+ imageBuffer, // File | Buffer | Uint8Array
302
+ 'WALLET_ADDR', // agent wallet
303
+ 'API_KEY', // agent API key
304
+ 'avatar.png' // filename (for MIME detection)
305
+ );
306
+
307
+ // List agents (leaderboard)
308
+ const { agents } = await client.listAgents({
309
+ sortBy: 'volume', // 'volume' | 'tokens' | 'fees'
310
+ limit: 25,
311
+ page: 1,
312
+ });
313
+
314
+ // List users (leaderboard)
315
+ const { users } = await client.listUsers({
316
+ sortBy: 'volume',
317
+ limit: 25,
318
+ });
319
+
320
+ // Get site-wide stats
321
+ const stats = await client.getSiteStats();
322
+ console.log('Total tokens:', stats.totalTokens);
323
+ console.log('Total volume:', stats.totalVolume);
324
+ ```
325
+
339
326
  ### File Upload
340
327
 
341
328
  ```typescript
@@ -388,6 +375,28 @@ try {
388
375
  }
389
376
  ```
390
377
 
378
+ ### Agent Operations
379
+
380
+ ```typescript
381
+ // Register an AI agent
382
+ const result = await client.registerAgent({ wallet, name? });
383
+
384
+ // Verify agent via Twitter
385
+ const claim = await client.claimAgent({ apiKey, tweetUrl });
386
+
387
+ // List agents leaderboard
388
+ const { agents } = await client.listAgents({ sortBy?, limit?, page? });
389
+
390
+ // List users leaderboard
391
+ const { users } = await client.listUsers({ sortBy?, limit?, page? });
392
+
393
+ // Get site stats (total tokens, volume, etc.)
394
+ const stats = await client.getSiteStats();
395
+
396
+ // Upload agent avatar (requires API key)
397
+ const { url } = await client.uploadAvatar(file, wallet, apiKey, filename?);
398
+ ```
399
+
391
400
  ## TypeScript Types
392
401
 
393
402
  All types are exported for use in your application:
@@ -399,6 +408,12 @@ import type {
399
408
  QuoteResponse,
400
409
  TokenListParams,
401
410
  ExecuteTradeResponse,
411
+ AgentRegisterRequest,
412
+ AgentClaimRequest,
413
+ AgentRegisterResponse,
414
+ AgentClaimResponse,
415
+ AgentsListResponse,
416
+ AgentEntry,
402
417
  // ... many more
403
418
  } from '@clawdvault/sdk';
404
419
  ```