nansen-cli 1.16.1 → 1.18.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/package.json +2 -1
  3. package/skills/nansen-alerts/SKILL.md +137 -0
  4. package/skills/nansen-alpha-discovery/SKILL.md +43 -0
  5. package/skills/nansen-batch-wallet/SKILL.md +26 -0
  6. package/skills/nansen-cross-chain-flow/SKILL.md +27 -0
  7. package/skills/nansen-dca-watch/SKILL.md +38 -0
  8. package/skills/nansen-defi-exposure/SKILL.md +37 -0
  9. package/skills/nansen-exit-signal/SKILL.md +39 -0
  10. package/skills/nansen-fund-watch/SKILL.md +35 -0
  11. package/skills/nansen-holder-quality/SKILL.md +38 -0
  12. package/skills/nansen-perp-scan/SKILL.md +32 -0
  13. package/skills/nansen-perp-trader/SKILL.md +39 -0
  14. package/skills/nansen-pm-deep-dive/SKILL.md +50 -0
  15. package/skills/nansen-pm-insider-scan/SKILL.md +62 -0
  16. package/skills/nansen-polymarket-trader/SKILL.md +43 -0
  17. package/skills/nansen-portfolio-history/SKILL.md +36 -0
  18. package/skills/nansen-prediction-market/SKILL.md +47 -0
  19. package/skills/nansen-profiler/SKILL.md +98 -0
  20. package/skills/nansen-search/SKILL.md +34 -0
  21. package/skills/nansen-sm-trend/SKILL.md +30 -0
  22. package/skills/nansen-smart-money/SKILL.md +71 -0
  23. package/skills/nansen-token/SKILL.md +90 -0
  24. package/skills/nansen-token-discovery/SKILL.md +54 -0
  25. package/skills/nansen-token-forensics/SKILL.md +40 -0
  26. package/skills/nansen-trade/SKILL.md +100 -0
  27. package/skills/nansen-wallet/SKILL.md +140 -0
  28. package/skills/nansen-wallet-analysis/SKILL.md +45 -0
  29. package/skills/nansen-wallet-attribution/REFERENCE.md +43 -0
  30. package/skills/nansen-wallet-attribution/SKILL.md +46 -0
  31. package/skills/nansen-wallet-migration/SKILL.md +183 -0
  32. package/skills/nansen-web-fetch/SKILL.md +50 -0
  33. package/skills/nansen-web-search/SKILL.md +39 -0
  34. package/src/api.js +144 -73
  35. package/src/cli.js +181 -14
  36. package/src/rpc-urls.js +29 -0
  37. package/src/schema.json +401 -1448
  38. package/src/telemetry.js +237 -0
  39. package/src/trading.js +26 -12
  40. package/src/transfer.js +1 -11
  41. package/src/update-check.js +2 -2
  42. package/src/wallet.js +2 -1
  43. package/src/x402.js +3 -2
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: nansen-trade
3
+ description: Execute DEX swaps on Solana or Base. Use when buying or selling a token, getting a swap quote, or executing a trade.
4
+ metadata:
5
+ openclaw:
6
+ requires:
7
+ env:
8
+ - NANSEN_API_KEY
9
+ - NANSEN_WALLET_PASSWORD
10
+ bins:
11
+ - nansen
12
+ primaryEnv: NANSEN_API_KEY
13
+ install:
14
+ - kind: node
15
+ package: nansen-cli
16
+ bins: [nansen]
17
+ allowed-tools: Bash(nansen:*)
18
+ ---
19
+
20
+ # Trade
21
+
22
+ Two-step flow: quote then execute. **Trades are irreversible once on-chain.**
23
+
24
+ **Prerequisite:** You need a wallet first. Run `nansen wallet create` before trading.
25
+
26
+ ## Quote
27
+
28
+ ```bash
29
+ nansen trade quote \
30
+ --chain solana \
31
+ --from SOL \
32
+ --to USDC \
33
+ --amount 1000000000
34
+ ```
35
+
36
+ Symbols resolve automatically: `SOL`, `ETH`, `USDC`, `USDT`, `WETH`. Raw addresses also work.
37
+
38
+ ## Execute
39
+
40
+ ```bash
41
+ nansen trade execute --quote <quote-id>
42
+ ```
43
+
44
+ ## Agent pattern
45
+
46
+ ```bash
47
+ # Pipe quote ID directly into execute
48
+ quote_id=$(nansen trade quote --chain solana --from SOL --to USDC --amount 1000000000 2>&1 | grep "Quote ID:" | awk '{print $NF}')
49
+ nansen trade execute --quote "$quote_id"
50
+ ```
51
+
52
+ ## Common Token Addresses
53
+
54
+ | Token | Chain | Address |
55
+ |-------|-------|---------|
56
+ | SOL | Solana | `So11111111111111111111111111111111111111112` |
57
+ | USDC | Solana | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` |
58
+ | ETH | Base | `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee` |
59
+ | USDC | Base | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
60
+
61
+ ## Amounts are in base units
62
+
63
+ | Token | Decimals | 1 token = |
64
+ |-------|----------|-----------|
65
+ | SOL | 9 | `1000000000` |
66
+ | ETH | 18 | `1000000000000000000` |
67
+ | USDC | 6 | `1000000` |
68
+
69
+ ## Flags
70
+
71
+ | Flag | Purpose |
72
+ |------|---------|
73
+ | `--chain` | `solana` or `base` |
74
+ | `--from` | Source token (symbol or address) |
75
+ | `--to` | Destination token (symbol or address) |
76
+ | `--amount` | Amount in base units (integer) |
77
+ | `--wallet` | Wallet name (default: default wallet) |
78
+ | `--slippage` | Slippage tolerance as decimal (e.g. 0.03) |
79
+ | `--quote` | Quote ID for execute |
80
+ | `--no-simulate` | Skip pre-broadcast simulation |
81
+
82
+ ## Environment Variables
83
+
84
+ | Var | Purpose |
85
+ |-----|---------|
86
+ | `NANSEN_WALLET_PASSWORD` | **Required for `trade execute`.** Wallet encryption password — persisted in `~/.nansen/.env`. Source before executing: `source ~/.nansen/.env && nansen trade execute ...` |
87
+ | `NANSEN_API_KEY` | API key (also set via `nansen login`) |
88
+
89
+ > **Agents:** Never hold a wallet password only in session memory. If `NANSEN_WALLET_PASSWORD` is not in `~/.nansen/.env`, follow the setup flow in the nansen-wallet skill Password Policy to generate and persist one before proceeding.
90
+
91
+ ## Notes
92
+
93
+ - Quotes expire after ~1 hour. If execute fails, get a fresh quote.
94
+ - A wallet is required even for quotes (the API builds sender-specific transactions).
95
+ - ERC-20 swaps may require an approval step — execute handles this automatically.
96
+
97
+ ## Source
98
+
99
+ - npm: https://www.npmjs.com/package/nansen-cli
100
+ - GitHub: https://github.com/nansen-ai/nansen-cli
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: nansen-wallet
3
+ description: Wallet management — create, list, show, export, send, delete. Use when creating wallets, checking balances, or sending tokens.
4
+ metadata:
5
+ openclaw:
6
+ requires:
7
+ env:
8
+ - NANSEN_API_KEY
9
+ bins:
10
+ - nansen
11
+ primaryEnv: NANSEN_API_KEY
12
+ install:
13
+ - kind: node
14
+ package: nansen-cli
15
+ bins: [nansen]
16
+ allowed-tools: Bash(nansen:*)
17
+ ---
18
+
19
+ # Wallet
20
+
21
+ ## Auth Setup
22
+
23
+ ```bash
24
+ # Save API key (non-interactive)
25
+ nansen login --api-key <key>
26
+ # Or via env var:
27
+ NANSEN_API_KEY=<key> nansen login
28
+
29
+ # Verify
30
+ nansen research profiler labels --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum
31
+ ```
32
+
33
+ ## Wallet Creation (Two-Step Agent Flow)
34
+
35
+ Wallet creation requires a password from the **human user**. The agent must NOT generate or store the password itself.
36
+
37
+ > **Step 1 (Agent → Human):** Ask the user to provide a wallet password (minimum 12 characters).
38
+ >
39
+ > **Step 2 (Agent executes):** Run the create command with the password the user gave you.
40
+
41
+ ```bash
42
+ NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create
43
+ ```
44
+
45
+ After creation, the CLI automatically saves the password:
46
+ - **OS keychain** (macOS Keychain, Linux secret-tool, Windows Credential Manager) — secure, preferred
47
+ - **~/.nansen/wallets/.credentials file** — insecure fallback when no keychain is available (e.g. containers, CI)
48
+
49
+ **All future wallet operations retrieve the password automatically** — no env var or human input needed.
50
+
51
+ If the `.credentials` file fallback is used, the CLI prints a warning on every operation. To migrate to secure storage later, run `nansen wallet secure`.
52
+
53
+ ### Password resolution order (automatic)
54
+
55
+ 1. `NANSEN_WALLET_PASSWORD` env var (if set)
56
+ 2. OS keychain (saved automatically on wallet create)
57
+ 3. `~/.nansen/wallets/.credentials` file (insecure fallback, with warning)
58
+ 4. Structured JSON error with instructions (if none available)
59
+
60
+ ### Critical rules for agents
61
+
62
+ - **NEVER generate a password yourself** — always ask the human user
63
+ - **NEVER store the password** in files, memory, logs, or conversation history
64
+ - **NEVER use `--human` flag** — that enables interactive prompts which agents cannot handle
65
+ - After wallet creation, you do NOT need the password for future operations — the keychain handles it
66
+ - If you get a `PASSWORD_REQUIRED` error, ask the user to provide their password again
67
+
68
+ ## Create
69
+
70
+ ```bash
71
+ # Ask the user for a password first, then:
72
+ NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create
73
+ # Or with a custom name:
74
+ NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create --name trading
75
+ ```
76
+
77
+ ## List & Show
78
+
79
+ ```bash
80
+ nansen wallet list
81
+ nansen wallet show <name>
82
+ nansen wallet default <name>
83
+ ```
84
+
85
+ ## Send
86
+
87
+ ```bash
88
+ # Send native token (SOL, ETH) — password auto-resolved from keychain
89
+ nansen wallet send --to <addr> --amount 1.5 --chain solana
90
+
91
+ # Send entire balance
92
+ nansen wallet send --to <addr> --chain evm --max
93
+
94
+ # Dry run (preview, no broadcast)
95
+ nansen wallet send --to <addr> --amount 1.0 --chain evm --dry-run
96
+ ```
97
+
98
+ ## Export & Delete
99
+
100
+ ```bash
101
+ # Password auto-resolved from keychain
102
+ nansen wallet export <name>
103
+ nansen wallet delete <name>
104
+ ```
105
+
106
+ ## Forget Password
107
+
108
+ ```bash
109
+ # Remove saved password from all stores (keychain + .credentials file)
110
+ nansen wallet forget-password
111
+ ```
112
+
113
+ ## Migrate to Secure Storage
114
+
115
+ ```bash
116
+ nansen wallet secure
117
+ ```
118
+
119
+ For detailed migration steps (from `~/.nansen/.env`, `.credentials`, or env-var-only setups), see the **nansen-wallet-migration** skill.
120
+
121
+ ## Flags
122
+
123
+ | Flag | Purpose |
124
+ |------|---------|
125
+ | `--to` | Recipient address |
126
+ | `--amount` | Amount to send |
127
+ | `--chain` | `evm` or `solana` |
128
+ | `--max` | Send entire balance |
129
+ | `--dry-run` | Preview without broadcasting |
130
+ | `--human` | Enable interactive prompts (human terminal use only — agents must NOT use this) |
131
+ | `--unsafe-no-password` | Skip encryption (keys stored in plaintext — NOT recommended) |
132
+
133
+ ## Environment Variables
134
+
135
+ | Var | Purpose |
136
+ |-----|---------|
137
+ | `NANSEN_WALLET_PASSWORD` | Wallet encryption password — only needed for initial `wallet create`. After that, the OS keychain handles it. |
138
+ | `NANSEN_API_KEY` | API key (also set via `nansen login --api-key <key>`) |
139
+ | `NANSEN_EVM_RPC` | Custom EVM RPC endpoint |
140
+ | `NANSEN_SOLANA_RPC` | Custom Solana RPC endpoint |
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: nansen-wallet-analysis
3
+ description: "Who is this wallet and what have they been doing? Identity labels, balance, PnL summary, recent transactions, perp positions, and counterparties."
4
+ metadata:
5
+ openclaw:
6
+ requires:
7
+ env:
8
+ - NANSEN_API_KEY
9
+ bins:
10
+ - nansen
11
+ primaryEnv: NANSEN_API_KEY
12
+ install:
13
+ - kind: node
14
+ package: nansen-cli
15
+ bins: [nansen]
16
+ allowed-tools: Bash(nansen:*)
17
+ ---
18
+
19
+ # Wallet Analysis
20
+
21
+ **Answers:** "Who is this wallet and what have they been doing?"
22
+
23
+ ```bash
24
+ ADDR=<address> CHAIN=ethereum
25
+
26
+ nansen research profiler labels --address $ADDR --chain $CHAIN
27
+ # → label, category (e.g. "Smart Trader", "Fund", "Public Figure", ENS names)
28
+
29
+ nansen research profiler balance --address $ADDR --chain $CHAIN
30
+ # → token_symbol, token_name, token_amount, price_usd, value_usd per holding
31
+
32
+ nansen research profiler pnl-summary --address $ADDR --chain $CHAIN --days 30
33
+ # → realized_pnl_usd, realized_pnl_percent, win_rate, traded_token_count, traded_times, top5_tokens
34
+
35
+ nansen research profiler transactions --address $ADDR --chain $CHAIN --limit 20
36
+ # → block_timestamp, method, tokens_sent, tokens_received, volume_usd, source_type
37
+
38
+ nansen research profiler perp-positions --address $ADDR
39
+ # → asset_positions, margin_summary_account_value_usd, margin_summary_total_margin_used_usd
40
+
41
+ nansen research profiler counterparties --address $ADDR --chain $CHAIN --days 30
42
+ # → counterparty_address, counterparty_address_label, interaction_count, total_volume_usd, volume_in/out_usd
43
+ ```
44
+
45
+ perp-positions returns Hyperliquid data — returns empty if the wallet has no open perps.
@@ -0,0 +1,43 @@
1
+ # Wallet Attribution — Reference
2
+
3
+ ## Expansion Protocol
4
+
5
+ Run steps 1-2 on the seed address. For every new address found, ask the human:
6
+ **"Found `<addr>` via `<signal>` (`<label>`). Want me to query it?"**
7
+ On confirm, re-run steps 1-2 on it. Reserve step 3 (counterparties) for the seed address only.
8
+
9
+ **Stop expanding when:** address is a known protocol/CEX · confidence is Low · already visited · cluster > 10 wallets.
10
+
11
+ ## Attribution Rules
12
+
13
+ - CEX withdrawal → wallet owner (NOT the CEX)
14
+ - Smart account/DCA bot → end-user who funds it (NOT the protocol)
15
+ - Safe deployer ≠ owner — identical signer sets across Safes = same controller
16
+
17
+ ## Confidence Scoring
18
+
19
+ | Confidence | Signals |
20
+ |------------|---------|
21
+ | **High** | First Funder / shared Safe signers / same CEX deposit address |
22
+ | **Medium** | Coordinated balance movements / related-wallets + label match |
23
+ | **Exclude** | ENS alone, single CEX withdrawal, single deployer |
24
+
25
+ ## Output Format
26
+
27
+ `address` · `owner` · `confidence (H/M/L)` · `signals` · `role`
28
+
29
+ ## L2 Coverage
30
+
31
+ When step 3 returns sparse results on a mainnet EVM address, extend to L2s (4 calls):
32
+
33
+ ```bash
34
+ for CHAIN in base arbitrum optimism polygon; do
35
+ nansen research profiler counterparties --address $ADDR --chain $CHAIN --days 365
36
+ done
37
+ ```
38
+
39
+ ## Cost Warnings
40
+
41
+ - `trace` is credit-heavy; keep `--width 3` or lower
42
+ - L2 counterparty checks above add 4 API calls per address
43
+ - Historical balances reveal past holdings on drained wallets — useful fingerprint
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: nansen-wallet-attribution
3
+ description: "Cluster and attribute related wallets — funding chains, shared signers, CEX deposit patterns. Use when tracing wallet ownership, comparing two wallets, finding wallet relationships, governance voters, or related address clusters."
4
+ metadata:
5
+ openclaw:
6
+ requires:
7
+ env:
8
+ - NANSEN_API_KEY
9
+ bins:
10
+ - nansen
11
+ primaryEnv: NANSEN_API_KEY
12
+ install:
13
+ - kind: node
14
+ package: nansen-cli
15
+ bins: [nansen]
16
+ allowed-tools: Bash(nansen:*)
17
+ ---
18
+
19
+ # Wallet Attribution
20
+
21
+ **Answers:** "Who controls this wallet? Are these wallets related?"
22
+
23
+ Chain: `0x` → `--chain ethereum` (also base, arbitrum, optimism, polygon). Base58 → `--chain solana`.
24
+
25
+ ```bash
26
+ ADDR=<address> CHAIN=<ethereum|solana|base|...> # detect from address format above
27
+ # 1. Identity
28
+ nansen research profiler labels --address $ADDR --chain $CHAIN
29
+ # 2. Related wallets (paginate with --page N)
30
+ nansen research profiler related-wallets --address $ADDR --chain $CHAIN
31
+ # 3. Counterparties (paginate with --page N; widen with --days 365 if empty)
32
+ nansen research profiler counterparties --address $ADDR --chain $CHAIN --days 90
33
+ # 4. Batch profile cluster
34
+ nansen research profiler batch --addresses "addr1,addr2" --chain $CHAIN --include labels,balance,pnl
35
+ # 5. Compare pairs → shared_counterparties, shared_tokens, balances
36
+ nansen research profiler compare --addresses "addr1,addr2" --chain $CHAIN
37
+ # 6. Historical balances (fingerprint drained wallets)
38
+ nansen research profiler historical-balances --address $ADDR --chain $CHAIN --days 90
39
+ # 7. Multi-hop trace (credit-heavy — keep --width ≤3)
40
+ nansen research profiler trace --address $ADDR --chain $CHAIN --depth 2 --width 3
41
+ ```
42
+
43
+ **Expansion:** Run steps 1-2 on seed. For each new address found, ask the human before querying. Reserve step 3 for seed only.
44
+ **Stop when:** known protocol/CEX · Low confidence · already visited · cluster > 10 wallets.
45
+ **Confidence:** High = first funder / shared Safe signers / same CEX deposit. Medium = coordinated movements / related-wallets + label match. Exclude = ENS only, single CEX withdrawal, single deployer.
46
+ Full attribution rules in REFERENCE.md.
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: nansen-wallet-migration
3
+ description: Migrate an existing nansen-cli wallet from insecure password storage (env files, .credentials) to the new secure keychain-backed flow.
4
+ metadata:
5
+ openclaw:
6
+ requires:
7
+ env:
8
+ - NANSEN_API_KEY
9
+ bins:
10
+ - nansen
11
+ primaryEnv: NANSEN_API_KEY
12
+ install:
13
+ - kind: node
14
+ package: nansen-cli
15
+ bins: [nansen]
16
+ allowed-tools: Bash(nansen:*)
17
+ ---
18
+
19
+ # Wallet Migration — Old Flow to Secure Keychain
20
+
21
+ Use this skill when a user already has a nansen-cli wallet set up with the
22
+ **old** password storage method and wants to migrate to the new secure flow.
23
+
24
+ ## When to use
25
+
26
+ - User mentions they stored their password in `~/.nansen/.env`, a `.env` file, or `memory.md`
27
+ - User gets the stderr warning: `⚠ Password loaded from insecure .credentials file`
28
+ - User asks to "secure my wallet" or "migrate to keychain"
29
+ - User created a wallet before the keychain update was released
30
+
31
+ ## Detect current state
32
+
33
+ `wallet show` only displays addresses and does NOT load or check the password.
34
+ To detect the actual password situation, check for stored password sources:
35
+
36
+ ```bash
37
+ # 1. Check if a wallet exists at all
38
+ nansen wallet list 2>&1
39
+
40
+ # 2. Check for insecure password stores
41
+ ls -la ~/.nansen/.env 2>/dev/null && echo "FOUND: ~/.nansen/.env (insecure)"
42
+ ls -la ~/.nansen/wallets/.credentials 2>/dev/null && echo "FOUND: .credentials file (insecure)"
43
+
44
+ # 3. Try an operation that requires the password (without setting env var)
45
+ nansen wallet export default 2>&1
46
+ ```
47
+
48
+ Interpret the `export` output:
49
+ - `⚠ Password loaded from ~/.nansen/wallets/.credentials` on stderr → needs migration (Path B)
50
+ - Export succeeds silently → password is in keychain, no migration needed
51
+ - `PASSWORD_REQUIRED` JSON error → password not persisted anywhere (Path C or D)
52
+
53
+ ## Migration paths
54
+
55
+ ### Path A: Password in `~/.nansen/.env` (old skill pattern)
56
+
57
+ The previous wallet skill told agents to write the password to `~/.nansen/.env`.
58
+
59
+ **Step 1 — Ask the human for their password:**
60
+
61
+ > "Your wallet password is currently stored in ~/.nansen/.env, which is insecure.
62
+ > I can migrate it to your OS keychain. Please confirm the password you used when
63
+ > creating the wallet, or I can read it from ~/.nansen/.env if you authorize it."
64
+
65
+ **Step 2 — Migrate:**
66
+
67
+ The `source` and `nansen wallet secure` MUST run in the same shell so the env
68
+ var is available to the node process:
69
+
70
+ ```bash
71
+ source ~/.nansen/.env 2>/dev/null && nansen wallet secure
72
+ ```
73
+
74
+ **Step 3 — Verify the password actually decrypts the wallet:**
75
+
76
+ ```bash
77
+ # Unset env var to prove keychain works, then export to verify decryption
78
+ unset NANSEN_WALLET_PASSWORD
79
+ nansen wallet export default 2>&1
80
+ ```
81
+
82
+ If export succeeds (shows private keys), the migration worked. If it shows
83
+ `Incorrect password`, the wrong password was migrated — run `nansen wallet
84
+ forget-password` and retry with the correct password.
85
+
86
+ **Step 4 — Clean up the insecure file:**
87
+
88
+ ```bash
89
+ rm -f ~/.nansen/.env
90
+ ```
91
+
92
+ ### Path B: Password in `.credentials` file (auto-saved fallback)
93
+
94
+ This happens when `wallet create` couldn't access the OS keychain (containers, CI).
95
+
96
+ ```bash
97
+ nansen wallet secure
98
+ ```
99
+
100
+ If the keychain is still unavailable (e.g. containerized Linux without D-Bus),
101
+ `nansen wallet secure` will explain the situation and suggest alternatives.
102
+
103
+ After migrating, verify decryption works:
104
+
105
+ ```bash
106
+ nansen wallet export default 2>&1
107
+ ```
108
+
109
+ ### Path C: Password only in `NANSEN_WALLET_PASSWORD` env var
110
+
111
+ ```bash
112
+ # Persist the env var password to keychain
113
+ nansen wallet secure
114
+ ```
115
+
116
+ Then verify without the env var:
117
+
118
+ ```bash
119
+ unset NANSEN_WALLET_PASSWORD
120
+ nansen wallet export default 2>&1
121
+ ```
122
+
123
+ ### Path D: Password lost entirely
124
+
125
+ The password cannot be recovered. The wallet's private keys are encrypted with
126
+ AES-256-GCM and the password is not stored anywhere recoverable.
127
+
128
+ **Tell the human:**
129
+
130
+ > "Your wallet password cannot be recovered. If you have funds in this wallet,
131
+ > they may be inaccessible. You can create a new wallet and transfer any remaining
132
+ > accessible funds."
133
+
134
+ ```bash
135
+ # Create a fresh wallet (human must provide a new password)
136
+ NANSEN_WALLET_PASSWORD="<new_password_from_user>" nansen wallet create --name new-wallet
137
+ ```
138
+
139
+ ## Post-migration verification
140
+
141
+ After any migration, confirm the password was migrated correctly by proving
142
+ the keychain password can actually decrypt the wallet:
143
+
144
+ ```bash
145
+ # Unset env var to prove keychain works
146
+ unset NANSEN_WALLET_PASSWORD
147
+
148
+ # This MUST succeed — it proves the keychain password decrypts the wallet
149
+ nansen wallet export default 2>&1
150
+ ```
151
+
152
+ If export shows `Incorrect password`, the wrong password was saved to the
153
+ keychain. Fix with:
154
+
155
+ ```bash
156
+ nansen wallet forget-password
157
+ NANSEN_WALLET_PASSWORD="<correct_password>" nansen wallet secure
158
+ ```
159
+
160
+ If `stderr` still shows the `.credentials` warning, the keychain migration did
161
+ not succeed — check if the OS keychain service is running (`secret-tool` on Linux,
162
+ `security` on macOS).
163
+
164
+ ## Forget password (all stores)
165
+
166
+ If the user wants to remove their persisted password entirely:
167
+
168
+ ```bash
169
+ nansen wallet forget-password
170
+ ```
171
+
172
+ This clears the password from both OS keychain and `.credentials` file. Future
173
+ wallet operations will require `NANSEN_WALLET_PASSWORD` env var or re-running
174
+ `nansen wallet secure`.
175
+
176
+ ## Critical rules for agents
177
+
178
+ - **NEVER generate a password** — always ask the human
179
+ - **NEVER store the password** in files, memory, logs, or conversation history
180
+ - **NEVER use `--human` flag** — interactive prompts break agents
181
+ - If the human authorizes reading `~/.nansen/.env`, read it in the same command
182
+ (`source ~/.nansen/.env && nansen wallet secure`) — do not echo or log the value
183
+ - **ALWAYS verify after migration** with `nansen wallet export default` — `wallet show` does NOT prove the password works (it never loads the password)
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: nansen-web-fetch
3
+ description: Fetch and analyze content from one or more URLs using AI (Gemini 2.5 Flash). Use when you have specific URLs and need to extract or summarize their content. Pairs well with `nansen web search` results.
4
+ metadata:
5
+ openclaw:
6
+ requires:
7
+ env:
8
+ - NANSEN_API_KEY
9
+ bins:
10
+ - nansen
11
+ primaryEnv: NANSEN_API_KEY
12
+ install:
13
+ - kind: node
14
+ package: nansen-cli
15
+ bins: [nansen]
16
+ allowed-tools: Bash(nansen:*)
17
+ ---
18
+
19
+ # Web Fetch
20
+
21
+ Fetch and analyze content from one or more URLs using Gemini 2.5 Flash with URL context.
22
+
23
+ ```bash
24
+ nansen web fetch https://nansen.ai --question "What products does Nansen offer?"
25
+ nansen web fetch --url https://example.com --url https://other.com --question "Compare these two sites"
26
+ nansen web fetch https://docs.uniswap.org/contracts/v4/overview --question "What changed in v4?"
27
+ ```
28
+
29
+ Positional args and `--url` flags can be combined — all become URLs to fetch.
30
+
31
+ | Flag | Values | Default | Purpose |
32
+ |------|--------|---------|---------|
33
+ | `--url` | URL | — | URL to fetch (repeatable for multiple URLs, up to 20) |
34
+ | `--question` | string | **required** | Question to answer about the URL content |
35
+ | `--pretty` | flag | off | Human-readable JSON |
36
+
37
+ Returns:
38
+ - `analysis` — AI-generated answer to your question
39
+ - `retrieved_urls` — URLs successfully fetched
40
+ - `failed_urls` — URLs that could not be retrieved
41
+
42
+ **Tip:** Combine with `web search` — search first to find relevant URLs, then fetch to get full content.
43
+
44
+ ```bash
45
+ # Find and analyze in two steps
46
+ nansen web search "uniswap v4 launch" --num-results 3 --fields link
47
+ nansen web fetch https://blog.uniswap.org/... --question "What are the key changes?"
48
+ ```
49
+
50
+ **Note:** 30s timeout. Paywalled or bot-blocked pages may appear in `failed_urls`.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: nansen-web-search
3
+ description: Search the web for one or more queries in parallel. Use when you need current information, news, prices, or any web content to complement on-chain Nansen data.
4
+ metadata:
5
+ openclaw:
6
+ requires:
7
+ env:
8
+ - NANSEN_API_KEY
9
+ bins:
10
+ - nansen
11
+ primaryEnv: NANSEN_API_KEY
12
+ install:
13
+ - kind: node
14
+ package: nansen-cli
15
+ bins: [nansen]
16
+ allowed-tools: Bash(nansen:*)
17
+ ---
18
+
19
+ # Web Search
20
+
21
+ Search the web for one or more queries in parallel via the Serper API.
22
+
23
+ ```bash
24
+ nansen web search "bitcoin price"
25
+ nansen web search "solana ecosystem news" --num-results 5
26
+ nansen web search --query "ethereum ETF" --query "bitcoin ETF" --num-results 3
27
+ ```
28
+
29
+ Positional args and `--query` flags can be combined — all become queries.
30
+
31
+ | Flag | Values | Default | Purpose |
32
+ |------|--------|---------|---------|
33
+ | `--query` | string | — | Query string (repeatable for multiple queries) |
34
+ | `--num-results` | 1–20 | 10 | Results per query |
35
+ | `--pretty` | flag | off | Human-readable JSON |
36
+
37
+ Returns `results[]` — one entry per query, each with `organic[]` (title, link, snippet, date) and optional `knowledge_graph`.
38
+
39
+ **Note:** Some domains are excluded from results (paywalled/unfetchable sites like bloomberg.com, twitter.com). Use `nansen web fetch` to retrieve content from specific URLs.