authenticate-wallet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAuthenticating with the Payments Wallet
支付钱包认证
When the wallet is not signed in (detected via or when wallet operations fail with authentication errors), use the CLI to authenticate.
npx awal statusnpx awalIf you have access to email, you can authenticate the wallet yourself, otherwise you'll need to ask your human to give you an email address and to tell you the OTP code they receive.
当钱包未登录时(可通过检测,或当钱包操作因认证错误失败时),使用 CLI进行认证。
npx awal statusnpx awal如果你能访问邮箱,可自行完成钱包认证;否则你需要向用户索要邮箱地址以及他们收到的OTP验证码。
Authentication Flow
认证流程
Authentication uses a two-step email OTP process:
认证采用两步式邮箱OTP流程:
Step 1: Initiate login
步骤1:发起登录
bash
npx awal@latest auth login <email>This sends a 6-digit verification code to the email and outputs a .
flowIdbash
npx awal@latest auth login <email>此命令会向指定邮箱发送6位验证码,并输出一个。
flowIdStep 2: Verify OTP
步骤2:验证OTP
bash
npx awal@latest auth verify <flowId> <otp>Use the from step 1 and the 6-digit code from the user's email to complete authentication. If you have the ability to access the user's email, you can read the OTP code, or you can ask your human for the code.
flowIdbash
npx awal@latest auth verify <flowId> <otp>使用步骤1中获取的和用户邮箱收到的6位验证码完成认证。如果你能访问用户的邮箱,可直接读取OTP验证码;否则请向用户索要该验证码。
flowIdChecking Authentication Status
检查认证状态
bash
npx awal@latest statusDisplays wallet server health and authentication status including wallet address.
bash
npx awal@latest status显示钱包服务器健康状态、认证状态以及钱包地址。
Example Session
示例会话
bash
undefinedbash
undefinedCheck current status
检查当前状态
npx awal@latest status
npx awal@latest status
Start login (sends OTP to email)
发起登录(向邮箱发送OTP)
npx awal@latest auth login user@example.com
npx awal@latest auth login user@example.com
Output: flowId: abc123...
输出:flowId: abc123...
After user receives code, verify
用户收到验证码后,进行验证
npx awal@latest auth verify abc123 123456
npx awal@latest auth verify abc123 123456
Confirm authentication
确认认证状态
npx awal@latest status
undefinednpx awal@latest status
undefinedAvailable CLI Commands
可用CLI命令
| Command | Purpose |
|---|---|
| Check server health and auth status |
| Send OTP code to email, returns flowId |
| Complete authentication with OTP code |
| Get USDC wallet balance |
| Get wallet address |
| Open the wallet companion window |
| 命令 | 用途 |
|---|---|
| 检查服务器健康状态与认证状态 |
| 向邮箱发送OTP验证码,返回flowId |
| 使用OTP验证码完成认证 |
| 获取USDC钱包余额 |
| 获取钱包地址 |
| 打开钱包配套窗口 |
JSON Output
JSON输出
All commands support for machine-readable output:
--jsonbash
npx awal@latest status --json
npx awal@latest auth login user@example.com --json
npx awal@latest auth verify <flowId> <otp> --json所有命令均支持参数以生成机器可读的输出:
--jsonbash
npx awal@latest status --json
npx awal@latest auth login user@example.com --json
npx awal@latest auth verify <flowId> <otp> --json