nansen-cli 1.19.0 → 1.21.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/src/schema.json CHANGED
@@ -6,6 +6,7 @@
6
6
  "portfolio": {
7
7
  "subcommands": {
8
8
  "defi": {
9
+ "endpoint": "/api/v1/portfolio/defi-holdings",
9
10
  "description": "DeFi holdings across protocols",
10
11
  "options": {
11
12
  "wallet": {
@@ -19,6 +20,7 @@
19
20
  "smart-money": {
20
21
  "subcommands": {
21
22
  "netflow": {
23
+ "endpoint": "/api/v1/smart-money/netflow",
22
24
  "description": "Net capital flows (inflows vs outflows)",
23
25
  "options": {
24
26
  "chain": {
@@ -27,6 +29,7 @@
27
29
  }
28
30
  },
29
31
  "dex-trades": {
32
+ "endpoint": "/api/v1/smart-money/dex-trades",
30
33
  "description": "Real-time DEX trading activity",
31
34
  "options": {
32
35
  "chain": {
@@ -35,12 +38,15 @@
35
38
  }
36
39
  },
37
40
  "perp-trades": {
41
+ "endpoint": "/api/v1/smart-money/perp-trades",
38
42
  "description": "Perpetual trading on Hyperliquid"
39
43
  },
40
44
  "dcas": {
45
+ "endpoint": "/api/v1/smart-money/dcas",
41
46
  "description": "DCA strategies on Jupiter"
42
47
  },
43
48
  "holdings": {
49
+ "endpoint": "/api/v1/smart-money/holdings",
44
50
  "description": "Aggregated token balances",
45
51
  "options": {
46
52
  "chain": {
@@ -49,6 +55,7 @@
49
55
  }
50
56
  },
51
57
  "historical-holdings": {
58
+ "endpoint": "/api/v1/smart-money/historical-holdings",
52
59
  "description": "Historical holdings over time",
53
60
  "options": {
54
61
  "chain": {
@@ -65,6 +72,7 @@
65
72
  "profiler": {
66
73
  "subcommands": {
67
74
  "transactions": {
75
+ "endpoint": "/api/v1/profiler/address/transactions",
68
76
  "description": "Transaction history",
69
77
  "options": {
70
78
  "address": {
@@ -79,6 +87,7 @@
79
87
  }
80
88
  },
81
89
  "pnl-summary": {
90
+ "endpoint": "/api/v1/profiler/address/pnl-summary",
82
91
  "description": "Summarized PnL metrics",
83
92
  "options": {
84
93
  "address": {
@@ -93,6 +102,7 @@
93
102
  }
94
103
  },
95
104
  "balance": {
105
+ "endpoint": "/api/v1/profiler/address/current-balance",
96
106
  "description": "Current token holdings",
97
107
  "options": {
98
108
  "address": {
@@ -104,6 +114,7 @@
104
114
  }
105
115
  },
106
116
  "counterparties": {
117
+ "endpoint": "/api/v1/profiler/address/counterparties",
107
118
  "description": "Top counterparties by volume",
108
119
  "options": {
109
120
  "address": {
@@ -118,6 +129,7 @@
118
129
  }
119
130
  },
120
131
  "historical-balances": {
132
+ "endpoint": "/api/v1/profiler/address/historical-balances",
121
133
  "description": "Historical balances over time",
122
134
  "options": {
123
135
  "address": {
@@ -132,6 +144,7 @@
132
144
  }
133
145
  },
134
146
  "related-wallets": {
147
+ "endpoint": "/api/v1/profiler/address/related-wallets",
135
148
  "description": "Find wallets related to an address",
136
149
  "options": {
137
150
  "address": {
@@ -143,6 +156,7 @@
143
156
  }
144
157
  },
145
158
  "pnl": {
159
+ "endpoint": "/api/v1/profiler/address/pnl",
146
160
  "description": "PnL and trade performance",
147
161
  "options": {
148
162
  "address": {
@@ -157,6 +171,7 @@
157
171
  }
158
172
  },
159
173
  "labels": {
174
+ "endpoint": "/api/v1/profiler/address/labels",
160
175
  "description": "Behavioral and entity labels",
161
176
  "options": {
162
177
  "address": {
@@ -168,6 +183,7 @@
168
183
  }
169
184
  },
170
185
  "perp-positions": {
186
+ "endpoint": "/api/v1/profiler/perp-positions",
171
187
  "description": "Current perpetual positions",
172
188
  "options": {
173
189
  "address": {
@@ -176,6 +192,7 @@
176
192
  }
177
193
  },
178
194
  "perp-trades": {
195
+ "endpoint": "/api/v1/profiler/perp-trades",
179
196
  "description": "Perpetual trading history",
180
197
  "options": {
181
198
  "address": {
@@ -187,6 +204,7 @@
187
204
  }
188
205
  },
189
206
  "search": {
207
+ "endpoint": "/api/v1/search/entity-name",
190
208
  "description": "Search for entities by name",
191
209
  "options": {
192
210
  "query": {
@@ -251,6 +269,7 @@
251
269
  "token": {
252
270
  "subcommands": {
253
271
  "flows": {
272
+ "endpoint": "/api/v1/tgm/flows",
254
273
  "description": "Token flow metrics",
255
274
  "options": {
256
275
  "chain": {
@@ -265,6 +284,7 @@
265
284
  }
266
285
  },
267
286
  "who-bought-sold": {
287
+ "endpoint": "/api/v1/tgm/who-bought-sold",
268
288
  "description": "Recent buyers and sellers",
269
289
  "options": {
270
290
  "chain": {
@@ -279,6 +299,7 @@
279
299
  }
280
300
  },
281
301
  "dex-trades": {
302
+ "endpoint": "/api/v1/tgm/dex-trades",
282
303
  "description": "DEX trading activity",
283
304
  "options": {
284
305
  "chain": {
@@ -293,6 +314,7 @@
293
314
  }
294
315
  },
295
316
  "transfers": {
317
+ "endpoint": "/api/v1/tgm/transfers",
296
318
  "description": "Token transfer history",
297
319
  "options": {
298
320
  "chain": {
@@ -307,6 +329,7 @@
307
329
  }
308
330
  },
309
331
  "holders": {
332
+ "endpoint": "/api/v1/tgm/holders",
310
333
  "description": "Token holder analysis",
311
334
  "options": {
312
335
  "chain": {
@@ -318,6 +341,7 @@
318
341
  }
319
342
  },
320
343
  "pnl": {
344
+ "endpoint": "/api/v1/tgm/pnl-leaderboard",
321
345
  "description": "PnL leaderboard",
322
346
  "options": {
323
347
  "chain": {
@@ -332,6 +356,7 @@
332
356
  }
333
357
  },
334
358
  "perp-pnl-leaderboard": {
359
+ "endpoint": "/api/v1/tgm/perp-pnl-leaderboard",
335
360
  "description": "Perp PnL leaderboard by token",
336
361
  "options": {
337
362
  "symbol": {
@@ -343,6 +368,7 @@
343
368
  }
344
369
  },
345
370
  "perp-positions": {
371
+ "endpoint": "/api/v1/tgm/perp-positions",
346
372
  "description": "Open perp positions by token symbol",
347
373
  "options": {
348
374
  "symbol": {
@@ -351,6 +377,7 @@
351
377
  }
352
378
  },
353
379
  "perp-trades": {
380
+ "endpoint": "/api/v1/tgm/perp-trades",
354
381
  "description": "Perp trades by token symbol",
355
382
  "options": {
356
383
  "symbol": {
@@ -362,6 +389,7 @@
362
389
  }
363
390
  },
364
391
  "flow-intelligence": {
392
+ "endpoint": "/api/v1/tgm/flow-intelligence",
365
393
  "description": "Detailed flow intelligence by label",
366
394
  "options": {
367
395
  "chain": {
@@ -376,6 +404,7 @@
376
404
  }
377
405
  },
378
406
  "info": {
407
+ "endpoint": "/api/v1/tgm/token-information",
379
408
  "description": "Get detailed information for a specific token",
380
409
  "options": {
381
410
  "chain": {
@@ -390,6 +419,7 @@
390
419
  }
391
420
  },
392
421
  "indicators": {
422
+ "endpoint": "/api/v1/tgm/indicators",
393
423
  "description": "Risk and reward indicators for a token (Nansen Score)",
394
424
  "options": {
395
425
  "chain": {
@@ -401,6 +431,7 @@
401
431
  }
402
432
  },
403
433
  "ohlcv": {
434
+ "endpoint": "/api/v1/tgm/token-ohlcv",
404
435
  "description": "OHLCV candle data for a token",
405
436
  "options": {
406
437
  "chain": {
@@ -415,6 +446,7 @@
415
446
  }
416
447
  },
417
448
  "jup-dca": {
449
+ "endpoint": "/api/v1/tgm/jup-dca",
418
450
  "description": "Jupiter DCA orders for token",
419
451
  "options": {
420
452
  "token": {
@@ -423,6 +455,7 @@
423
455
  }
424
456
  },
425
457
  "screener": {
458
+ "endpoint": "/api/v1/token-screener",
426
459
  "description": "Discover and filter tokens",
427
460
  "options": {
428
461
  "timeframe": {
@@ -437,6 +470,7 @@
437
470
  "description": "Token God Mode - deep analytics for any token"
438
471
  },
439
472
  "search": {
473
+ "endpoint": "/api/v1/search/general",
440
474
  "description": "Search for tokens and entities across Nansen",
441
475
  "options": {
442
476
  "query": {
@@ -453,6 +487,7 @@
453
487
  "perp": {
454
488
  "subcommands": {
455
489
  "screener": {
490
+ "endpoint": "/api/v1/perp-screener",
456
491
  "description": "Screen perpetual futures contracts",
457
492
  "options": {
458
493
  "days": {
@@ -461,6 +496,7 @@
461
496
  }
462
497
  },
463
498
  "leaderboard": {
499
+ "endpoint": "/api/v1/perp-leaderboard",
464
500
  "description": "Perpetual futures PnL leaderboard",
465
501
  "options": {
466
502
  "days": {
@@ -474,6 +510,7 @@
474
510
  "prediction-market": {
475
511
  "subcommands": {
476
512
  "ohlcv": {
513
+ "endpoint": "/api/v1/prediction-market/ohlcv",
477
514
  "description": "Get Prediction Market OHLCV Candles",
478
515
  "options": {
479
516
  "market-id": {
@@ -482,6 +519,7 @@
482
519
  }
483
520
  },
484
521
  "orderbook": {
522
+ "endpoint": "/api/v1/prediction-market/orderbook",
485
523
  "description": "Get Prediction Market Orderbook",
486
524
  "options": {
487
525
  "market-id": {
@@ -490,6 +528,7 @@
490
528
  }
491
529
  },
492
530
  "top-holders": {
531
+ "endpoint": "/api/v1/prediction-market/top-holders",
493
532
  "description": "Get Prediction Market Top Holders",
494
533
  "options": {
495
534
  "market-id": {
@@ -498,6 +537,7 @@
498
537
  }
499
538
  },
500
539
  "trades-by-market": {
540
+ "endpoint": "/api/v1/prediction-market/trades-by-market",
501
541
  "description": "Get Prediction Market Trades by Market",
502
542
  "options": {
503
543
  "market-id": {
@@ -506,6 +546,7 @@
506
546
  }
507
547
  },
508
548
  "market-screener": {
549
+ "endpoint": "/api/v1/prediction-market/market-screener",
509
550
  "description": "Get Prediction Market Screener",
510
551
  "options": {
511
552
  "query": {
@@ -514,6 +555,7 @@
514
555
  }
515
556
  },
516
557
  "event-screener": {
558
+ "endpoint": "/api/v1/prediction-market/event-screener",
517
559
  "description": "Get Prediction Market Event Screener",
518
560
  "options": {
519
561
  "query": {
@@ -522,6 +564,7 @@
522
564
  }
523
565
  },
524
566
  "pnl-by-market": {
567
+ "endpoint": "/api/v1/prediction-market/pnl-by-market",
525
568
  "description": "Get Prediction Market PnL by Market",
526
569
  "options": {
527
570
  "market-id": {
@@ -530,6 +573,7 @@
530
573
  }
531
574
  },
532
575
  "pnl-by-address": {
576
+ "endpoint": "/api/v1/prediction-market/pnl-by-address",
533
577
  "description": "Get Prediction Market PnL by Address",
534
578
  "options": {
535
579
  "address": {
@@ -538,6 +582,7 @@
538
582
  }
539
583
  },
540
584
  "position-detail": {
585
+ "endpoint": "/api/v1/prediction-market/position-detail",
541
586
  "description": "Get Prediction Market Position Detail",
542
587
  "options": {
543
588
  "market-id": {
@@ -546,6 +591,7 @@
546
591
  }
547
592
  },
548
593
  "trades-by-address": {
594
+ "endpoint": "/api/v1/prediction-market/trades-by-address",
549
595
  "description": "Get Prediction Market Trades by Address",
550
596
  "options": {
551
597
  "address": {
@@ -554,6 +600,7 @@
554
600
  }
555
601
  },
556
602
  "categories": {
603
+ "endpoint": "/api/v1/prediction-market/categories",
557
604
  "description": "Get Prediction Market Categories"
558
605
  }
559
606
  },
@@ -826,6 +873,35 @@
826
873
  ]
827
874
  }
828
875
  }
876
+ },
877
+ "agent": {
878
+ "description": "Nansen AI research agent \u2014 ask questions about wallets, tokens, and on-chain activity",
879
+ "options": {
880
+ "expert": {
881
+ "type": "boolean",
882
+ "description": "Use expert mode (deeper analysis, slower). Default: fast mode."
883
+ },
884
+ "conversation-id": {
885
+ "type": "string",
886
+ "format": "uuid",
887
+ "description": "Continue a previous conversation by passing its UUID v4 ID"
888
+ },
889
+ "json": {
890
+ "type": "boolean",
891
+ "description": "Output raw JSON (conversation_id, mode, text, tool_calls) instead of formatted text"
892
+ }
893
+ },
894
+ "examples": [
895
+ "nansen agent \"What are the top smart money inflows on Ethereum today?\"",
896
+ "nansen agent \"Analyze wallet 0xd8dA...6045\" --expert",
897
+ "nansen agent \"Tell me more\" --conversation-id <id>"
898
+ ],
899
+ "returns": [
900
+ "conversation_id",
901
+ "mode",
902
+ "text",
903
+ "tool_calls"
904
+ ]
829
905
  }
830
906
  },
831
907
  "globalOptions": {
package/src/wallet.js CHANGED
@@ -596,8 +596,15 @@ export function buildWalletCommands(deps = {}) {
596
596
  // All other subcommands fall through to unified handlers below
597
597
  }
598
598
 
599
+ const isPrivy = options.provider === 'privy' || process.env.NANSEN_WALLET_PROVIDER === 'privy';
600
+
599
601
  const handlers = {
600
602
  'create': async () => {
603
+ // Privy wallets are handled above — if we reach here with provider=privy,
604
+ // the privy path already failed and called exit(). Guard against environments
605
+ // where exit() does not terminate (agent frameworks, test harnesses).
606
+ if (isPrivy) return;
607
+
601
608
  const name = options.name || args[1] || 'default';
602
609
 
603
610
  let password;