nansen-wallet-manager

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Wallet

钱包

Auth Setup

身份验证设置

bash
undefined
bash
undefined

Save API key (non-interactive)

保存API密钥(非交互式)

nansen login --api-key <key>
nansen login --api-key <key>

Or via env var:

或通过环境变量:

NANSEN_API_KEY=<key> nansen login
NANSEN_API_KEY=<key> nansen login

Verify

验证

nansen research profiler labels --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum
undefined
nansen research profiler labels --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain ethereum
undefined

Wallet Creation (Two-Step Agent Flow)

钱包创建(两步Agent流程)

Wallet creation requires a password from the human user. The agent must NOT generate or store the password itself.
Step 1 (Agent → Human): Ask the user to provide a wallet password (minimum 12 characters).
Step 2 (Agent executes): Run the create command with the password the user gave you.
bash
NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create
After creation, the CLI automatically saves the password:
  • OS keychain (macOS Keychain, Linux secret-tool, Windows Credential Manager) — secure, preferred
  • ~/.nansen/wallets/.credentials file — insecure fallback when no keychain is available (e.g. containers, CI)
All future wallet operations retrieve the password automatically — no env var or human input needed.
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
.
创建钱包需要人类用户提供密码。Agent绝对不能自行生成或存储密码。
步骤1(Agent → 人类): 请求用户提供钱包密码(至少12个字符)。
步骤2(Agent执行): 使用用户提供的密码运行创建命令。
bash
NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create
创建完成后,CLI会自动保存密码:
  • 系统密钥链(macOS Keychain、Linux secret-tool、Windows Credential Manager)——安全,为首选方式
  • ~/.nansen/wallets/.credentials文件——当没有密钥链可用时的不安全回退方案(例如容器、CI环境)
后续所有钱包操作都会自动获取密码——无需环境变量或人工输入。
如果使用
.credentials
文件回退方案,CLI会在每次操作时打印警告。之后若要迁移到安全存储,运行
nansen wallet secure
即可。

Password resolution order (automatic)

密码自动解析顺序

  1. NANSEN_WALLET_PASSWORD
    env var (if set)
  2. OS keychain (saved automatically on wallet create)
  3. ~/.nansen/wallets/.credentials
    file (insecure fallback, with warning)
  4. Structured JSON error with instructions (if none available)
  1. NANSEN_WALLET_PASSWORD
    环境变量(若已设置)
  2. 系统密钥链(创建钱包时自动保存)
  3. ~/.nansen/wallets/.credentials
    文件(不安全回退,带警告)
  4. 包含操作指引的结构化JSON错误(若以上都不可用)

Critical rules for agents

Agent必须遵守的关键规则

  • NEVER generate a password yourself — always ask the human user
  • NEVER store the password in files, memory, logs, or conversation history
  • NEVER use
    --human
    flag
    — that enables interactive prompts which agents cannot handle
  • After wallet creation, you do NOT need the password for future operations — the keychain handles it
  • If you get a
    PASSWORD_REQUIRED
    error, ask the user to provide their password again
  • 绝对不要自行生成密码——务必向人类用户索要
  • 绝对不要在文件、内存、日志或对话历史中存储密码
  • 绝对不要使用
    --human
    标志
    ——该标志启用交互式提示,Agent无法处理
  • 钱包创建完成后,后续操作无需密码——密钥链会自动处理
  • 若收到
    PASSWORD_REQUIRED
    错误,请再次请求用户提供密码

Create

创建

bash
undefined
bash
undefined

Ask the user for a password first, then:

先向用户索要密码,然后执行:

NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create
NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create

Or with a custom name:

或使用自定义名称:

NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create --name trading
undefined
NANSEN_WALLET_PASSWORD="<password_from_user>" nansen wallet create --name trading
undefined

List & Show

列出与查看

bash
nansen wallet list
nansen wallet show <name>
nansen wallet default <name>
bash
nansen wallet list
nansen wallet show <name>
nansen wallet default <name>

Send

转账

bash
undefined
bash
undefined

Send native token (SOL, ETH) — password auto-resolved from keychain

转账原生代币(SOL、ETH)——密码从密钥链自动解析

nansen wallet send --to <addr> --amount 1.5 --chain solana
nansen wallet send --to <addr> --amount 1.5 --chain solana

Send entire balance

转账全部余额

nansen wallet send --to <addr> --chain evm --max
nansen wallet send --to <addr> --chain evm --max

Dry run (preview, no broadcast)

试运行(预览,不广播交易)

nansen wallet send --to <addr> --amount 1.0 --chain evm --dry-run
undefined
nansen wallet send --to <addr> --amount 1.0 --chain evm --dry-run
undefined

Export & Delete

导出与删除

bash
undefined
bash
undefined

Password auto-resolved from keychain

密码从密钥链自动解析

nansen wallet export <name> nansen wallet delete <name>
undefined
nansen wallet export <name> nansen wallet delete <name>
undefined

Forget Password

忘记密码

bash
undefined
bash
undefined

Remove saved password from all stores (keychain + .credentials file)

从所有存储中移除已保存的密码(密钥链 + .credentials文件)

nansen wallet forget-password
undefined
nansen wallet forget-password
undefined

Migrate to Secure Storage

迁移到安全存储

bash
nansen wallet secure
For detailed migration steps (from
~/.nansen/.env
,
.credentials
, or env-var-only setups), see the nansen-wallet-migration skill.
bash
nansen wallet secure
如需详细的迁移步骤(从
~/.nansen/.env
.credentials
或仅使用环境变量的设置迁移),请查看nansen-wallet-migration技能。

Flags

标志

FlagPurpose
--to
Recipient address
--amount
Amount to send
--chain
evm
or
solana
--max
Send entire balance
--dry-run
Preview without broadcasting
--human
Enable interactive prompts (human terminal use only — agents must NOT use this)
--unsafe-no-password
Skip encryption (keys stored in plaintext — NOT recommended)
标志用途
--to
接收方地址
--amount
转账金额
--chain
evm
solana
--max
转账全部余额
--dry-run
预览交易,不广播
--human
启用交互式提示(仅适用于人类终端使用——Agent绝对不能使用)
--unsafe-no-password
跳过加密(密钥以明文存储——不推荐)

Environment Variables

环境变量

VarPurpose
NANSEN_WALLET_PASSWORD
Wallet encryption password — only needed for initial
wallet create
. After that, the OS keychain handles it.
NANSEN_API_KEY
API key (also set via
nansen login --api-key <key>
)
NANSEN_EVM_RPC
Custom EVM RPC endpoint
NANSEN_SOLANA_RPC
Custom Solana RPC endpoint
变量用途
NANSEN_WALLET_PASSWORD
钱包加密密码——仅在初始
wallet create
时需要。之后由系统密钥链处理。
NANSEN_API_KEY
API密钥(也可通过
nansen login --api-key <key>
设置)
NANSEN_EVM_RPC
自定义EVM RPC端点
NANSEN_SOLANA_RPC
自定义Solana RPC端点