moonpay-auth
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMoonPay auth and setup
MoonPay 身份验证与配置
Install
安装
bash
npm i -g @moonpay/cliThis installs the (and ) binary globally.
mpmoonpaybash
npm i -g @moonpay/cli这会全局安装 (以及 )二进制文件。
mpmoonpayVerify installation
验证安装
bash
mp --version
mp --helpbash
mp --version
mp --helpAuth commands
身份验证命令
bash
undefinedbash
undefinedLog in (sends OTP to email)
登录(向邮箱发送一次性验证码OTP)
mp login --email user@example.com
mp login --email user@example.com
Verify OTP code
验证OTP验证码
mp verify --email user@example.com --code 123456
mp verify --email user@example.com --code 123456
Check current user
查看当前登录用户
mp user retrieve
mp user retrieve
Log out
登出
mp logout
undefinedmp logout
undefinedLocal wallet management
本地钱包管理
The CLI manages local wallets stored encrypted in . Private keys are encrypted with AES-256-GCM using a random key stored in your OS keychain. No password required — keys never leave the machine.
~/.config/moonpay/wallets.jsonbash
undefined该CLI管理加密存储在 中的本地钱包。私钥使用存储在操作系统钥匙串中的随机密钥,通过AES-256-GCM算法加密。无需密码,密钥永远不会离开本机。
~/.config/moonpay/wallets.jsonbash
undefinedCreate a new HD wallet (Solana, Ethereum, Bitcoin, Tron)
创建新的HD钱包(支持Solana、Ethereum、Bitcoin、Tron)
mp wallet create --name "my-wallet"
mp wallet create --name "my-wallet"
Import from a mnemonic (all chains)
从助记词导入(支持所有链)
mp wallet import --name "restored" --mnemonic "word1 word2 ..."
mp wallet import --name "restored" --mnemonic "word1 word2 ..."
Import from a private key (single chain)
从私钥导入(仅支持单链)
mp wallet import --name "imported" --key <hex-key> --chain ethereum
mp wallet import --name "imported" --key <hex-key> --chain ethereum
List all local wallets
列出所有本地钱包
mp wallet list
mp wallet list
Get wallet details (by name or address)
获取钱包详情(可按名称或地址查询)
mp wallet retrieve --wallet "my-wallet"
mp wallet retrieve --wallet "my-wallet"
Export mnemonic/key (interactive only — agents cannot run this)
导出助记词/私钥(仅支持交互式操作,Agent无法运行该命令)
mp wallet export --wallet "my-wallet"
mp wallet export --wallet "my-wallet"
Delete a wallet (irreversible)
删除钱包(操作不可撤销)
mp wallet delete --wallet "my-wallet" --confirm
undefinedmp wallet delete --wallet "my-wallet" --confirm
undefinedWorkflow
工作流
- Run to check if authenticated.
mp user retrieve - If it fails, run , then
mp login --email <email>.mp verify --email <email> --code <code> - Run to see local wallets.
mp wallet list - If no wallets, create one: .
mp wallet create --name "default"
- 执行 检查是否已完成身份验证。
mp user retrieve - 如果执行失败,运行 ,然后运行
mp login --email <邮箱地址>。mp verify --email <邮箱地址> --code <验证码> - 运行 查看本地钱包列表。
mp wallet list - 如果没有钱包,可创建一个:。
mp wallet create --name "default"
Autonomous login
自主登录
Agents can log in without human intervention if they have access to the user's email. For example, with the CLI (Google Workspace):
gogbash
undefinedAgent如果能够访问用户的邮箱,即可无需人工干预完成登录。例如使用 CLI(Google Workspace工具):
gogbash
undefined1. Send OTP
1. 发送OTP验证码
mp login --email user@example.com
mp login --email user@example.com
2. Read the OTP code from email
2. 从邮箱中读取OTP验证码
gog gmail search "Your MoonPay verification code" --max-results 1
gog gmail search "Your MoonPay verification code" --max-results 1
3. Verify with the code
3. 使用验证码完成验证
mp verify --email user@example.com --code <code>
This enables fully autonomous agent setup — no human in the loop.mp verify --email user@example.com --code <code>
这可实现完全自主的Agent配置,无需人工参与流程。Config locations
配置文件位置
- Wallets: (encrypted, AES-256-GCM)
~/.config/moonpay/wallets.json - Encryption key: OS keychain (/
moonpay-cli)encryption-key - Credentials: (encrypted, AES-256-GCM)
~/.config/moonpay/credentials.json - Config: (base URL, client ID)
~/.config/moonpay/config.json
- 钱包文件: (AES-256-GCM加密)
~/.config/moonpay/wallets.json - 加密密钥: 操作系统钥匙串(/
moonpay-cli)encryption-key - 凭证信息: (AES-256-GCM加密)
~/.config/moonpay/credentials.json - 配置文件: (存储基础URL、客户端ID)
~/.config/moonpay/config.json
Security
安全说明
- Wallet secrets are always encrypted on disk
- Encryption key is stored in macOS Keychain / Linux libsecret
- No password to remember — the OS handles authentication
- requires an interactive terminal (TTY) — agents and scripts cannot extract secrets
wallet export - 24-word BIP39 mnemonics (256-bit entropy)
- 钱包密钥始终在磁盘上加密存储
- 加密密钥存储在macOS Keychain / Linux libsecret中
- 无需记忆密码,由操作系统处理身份验证
- 命令需要交互式终端(TTY),Agent和脚本无法导出密钥
wallet export - 采用24词BIP39助记词(256位熵)
Related skills
相关技能
- moonpay-swap-tokens — Swap or bridge tokens using local wallets.
- moonpay-check-wallet — Check wallet balances.
- moonpay-swap-tokens — 使用本地钱包兑换或跨链转移代币
- moonpay-check-wallet — 查看钱包余额