nansen-cli 1.27.1 → 1.29.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/privy.js CHANGED
@@ -125,6 +125,15 @@ export class PrivyClient {
125
125
  });
126
126
  }
127
127
 
128
+ async signSolanaMessage(walletId, messageBuffer) {
129
+ const messageBase64 = Buffer.from(messageBuffer).toString('base64');
130
+ return this._request("POST", `/wallets/${walletId}/rpc`, {
131
+ method: "signMessage",
132
+ chain_type: "solana",
133
+ params: { message: messageBase64, encoding: "base64" },
134
+ });
135
+ }
136
+
128
137
  }
129
138
 
130
139
  // ============= Helpers =============
package/src/schema.json CHANGED
@@ -500,6 +500,19 @@
500
500
  "default": true
501
501
  }
502
502
  }
503
+ },
504
+ "top-tokens": {
505
+ "endpoint": "/api/v1/nansen-score/top-tokens",
506
+ "description": "Top tokens ranked by Nansen Score (public endpoint, any authenticated API key)",
507
+ "options": {
508
+ "market-cap": {
509
+ "description": "Filter by market cap group",
510
+ "enum": ["lowcap", "midcap", "largecap"]
511
+ },
512
+ "limit": {
513
+ "default": 25
514
+ }
515
+ }
503
516
  }
504
517
  },
505
518
  "description": "Token God Mode - deep analytics for any token"
@@ -839,7 +852,7 @@
839
852
  },
840
853
  "to-chain": {
841
854
  "type": "string",
842
- "description": "Destination blockchain for cross-chain swap (solana or base). Omit for same-chain. At least one side must be USDC or a native token (ETH, SOL). Non-native to non-native is not supported — swap to USDC first, then bridge. Minimum ~$5 per cross-chain trade (Li.Fi bridge)."
855
+ "description": "Destination blockchain for cross-chain swap (solana or base). Omit for same-chain. At least one side must be USDC or a native token (ETH, SOL). Non-native to non-native is not supported — swap to USDC first, then bridge. Bridge providers (Li.Fi or Relay) are selected automatically based on best price. Sub-dollar swaps are supported via Relay."
843
856
  },
844
857
  "from": {
845
858
  "type": "string",
@@ -867,6 +880,10 @@
867
880
  "to-wallet": {
868
881
  "type": "string",
869
882
  "description": "Destination wallet address for cross-chain swaps. Auto-derived from wallet if omitted."
883
+ },
884
+ "aggregator": {
885
+ "type": "string",
886
+ "description": "Force a specific aggregator: lifi, relay, jupiter, or okx. Filters the returned quote list client-side; errors if no quote from that aggregator was returned."
870
887
  }
871
888
  },
872
889
  "prerequisites": [
@@ -884,11 +901,15 @@
884
901
  "wallet": {
885
902
  "type": "string",
886
903
  "description": "Wallet name, or \"walletconnect\"/\"wc\" for WalletConnect (EVM only)"
904
+ },
905
+ "gasless": {
906
+ "type": "boolean",
907
+ "description": "Relay-only: have Relay's solver pay gas + broadcast (user signs only). Requires the selected quote's aggregator to be \"relay\". Not supported via WalletConnect."
887
908
  }
888
909
  }
889
910
  },
890
911
  "bridge-status": {
891
- "description": "Check cross-chain bridge transaction status",
912
+ "description": "Check cross-chain bridge transaction status. Aggregator (Li.Fi or Relay) is auto-detected from a local tx record saved at execute time (kept 30 days); pass --aggregator to override when polling from a different machine.",
892
913
  "options": {
893
914
  "tx-hash": {
894
915
  "type": "string",
@@ -904,6 +925,142 @@
904
925
  "type": "string",
905
926
  "required": true,
906
927
  "description": "Destination chain (solana or base)"
928
+ },
929
+ "aggregator": {
930
+ "type": "string",
931
+ "description": "lifi or relay. Overrides auto-detection — use when polling from a different machine or after the 30-day local record TTL has expired."
932
+ }
933
+ }
934
+ },
935
+ "limit-order": {
936
+ "description": "Limit order management (Solana only)",
937
+ "subcommands": {
938
+ "create": {
939
+ "description": "Place a new limit order",
940
+ "options": {
941
+ "from": {
942
+ "type": "string",
943
+ "required": true,
944
+ "description": "Token to sell (address or symbol)"
945
+ },
946
+ "to": {
947
+ "type": "string",
948
+ "required": true,
949
+ "description": "Token to buy (address or symbol)"
950
+ },
951
+ "amount": {
952
+ "type": "string",
953
+ "required": true,
954
+ "description": "Amount in base units (e.g. lamports)"
955
+ },
956
+ "trigger-price": {
957
+ "type": "number",
958
+ "required": true,
959
+ "description": "Trigger price in USD"
960
+ },
961
+ "trigger-condition": {
962
+ "type": "string",
963
+ "required": true,
964
+ "description": "Trigger when price is 'above' or 'below' target"
965
+ },
966
+ "trigger-mint": {
967
+ "type": "string",
968
+ "required": true,
969
+ "description": "Token whose price triggers the order (e.g. SOL)"
970
+ },
971
+ "slippage-bps": {
972
+ "type": "number",
973
+ "description": "Slippage tolerance in basis points (e.g. 50 = 0.5%)"
974
+ },
975
+ "expires": {
976
+ "type": "string",
977
+ "default": "30d",
978
+ "description": "Expiry duration (e.g. 24h, 7d, 30d) or epoch ms"
979
+ },
980
+ "wallet": {
981
+ "type": "string",
982
+ "description": "Wallet name (or \"walletconnect\"/\"wc\")"
983
+ }
984
+ },
985
+ "chains": ["solana"],
986
+ "prerequisites": [
987
+ "A Solana wallet must be configured. Run: nansen wallet create"
988
+ ]
989
+ },
990
+ "list": {
991
+ "description": "List your limit orders",
992
+ "options": {
993
+ "state": {
994
+ "type": "string",
995
+ "description": "Filter by state (active, past)"
996
+ },
997
+ "mint": {
998
+ "type": "string",
999
+ "description": "Filter by token mint address"
1000
+ },
1001
+ "limit": {
1002
+ "type": "number",
1003
+ "default": 20,
1004
+ "description": "Max results per page"
1005
+ },
1006
+ "offset": {
1007
+ "type": "number",
1008
+ "default": 0,
1009
+ "description": "Pagination offset"
1010
+ },
1011
+ "sort": {
1012
+ "type": "string",
1013
+ "description": "Sort field"
1014
+ },
1015
+ "dir": {
1016
+ "type": "string",
1017
+ "default": "desc",
1018
+ "description": "Sort direction (asc or desc)"
1019
+ },
1020
+ "wallet": {
1021
+ "type": "string",
1022
+ "description": "Wallet name (or \"walletconnect\"/\"wc\")"
1023
+ }
1024
+ },
1025
+ "chains": ["solana"]
1026
+ },
1027
+ "cancel": {
1028
+ "description": "Cancel an open limit order",
1029
+ "options": {
1030
+ "order": {
1031
+ "type": "string",
1032
+ "required": true,
1033
+ "description": "Order ID to cancel"
1034
+ },
1035
+ "wallet": {
1036
+ "type": "string",
1037
+ "description": "Wallet name (or \"walletconnect\"/\"wc\")"
1038
+ }
1039
+ },
1040
+ "chains": ["solana"]
1041
+ },
1042
+ "update": {
1043
+ "description": "Update trigger price or slippage on an existing order",
1044
+ "options": {
1045
+ "order": {
1046
+ "type": "string",
1047
+ "required": true,
1048
+ "description": "Order ID to update"
1049
+ },
1050
+ "trigger-price": {
1051
+ "type": "number",
1052
+ "description": "New trigger price in USD"
1053
+ },
1054
+ "slippage-bps": {
1055
+ "type": "number",
1056
+ "description": "New slippage in basis points (0-10000)"
1057
+ },
1058
+ "wallet": {
1059
+ "type": "string",
1060
+ "description": "Wallet name (or \"walletconnect\"/\"wc\")"
1061
+ }
1062
+ },
1063
+ "chains": ["solana"]
907
1064
  }
908
1065
  }
909
1066
  }
package/src/telemetry.js CHANGED
@@ -158,9 +158,13 @@ function buildContext() {
158
158
 
159
159
  /**
160
160
  * Convert a command string like "smart-money netflow" to a path like "/smart-money/netflow".
161
+ * Agent ("agent …") always maps to "/agent" so prompts are not exploded into path segments.
161
162
  */
162
163
  function commandToPath(command) {
163
- return '/' + command.replace(/\s+/g, '/');
164
+ if (typeof command === 'string' && /^agent(?:\s+|$)/.test(command.trimStart())) {
165
+ return '/agent';
166
+ }
167
+ return '/' + String(command).replace(/\s+/g, '/');
164
168
  }
165
169
 
166
170
  /**