authenticate-wallet

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Authenticating with the Payments Wallet

支付钱包认证

When the wallet is not signed in (detected via
npx awal status
or when wallet operations fail with authentication errors), use the
npx awal
CLI to authenticate.
If 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.
当钱包未登录时(可通过
npx awal status
检测,或当钱包操作因认证错误失败时),使用
npx awal
CLI进行认证。
如果你能访问邮箱,可自行完成钱包认证;否则你需要向用户索要邮箱地址以及他们收到的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
flowId
.
bash
npx awal@latest auth login <email>
此命令会向指定邮箱发送6位验证码,并输出一个
flowId

Step 2: Verify OTP

步骤2:验证OTP

bash
npx awal@latest auth verify <flowId> <otp>
Use the
flowId
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.
bash
npx awal@latest auth verify <flowId> <otp>
使用步骤1中获取的
flowId
和用户邮箱收到的6位验证码完成认证。如果你能访问用户的邮箱,可直接读取OTP验证码;否则请向用户索要该验证码。

Checking Authentication Status

检查认证状态

bash
npx awal@latest status
Displays wallet server health and authentication status including wallet address.
bash
npx awal@latest status
显示钱包服务器健康状态、认证状态以及钱包地址。

Example Session

示例会话

bash
undefined
bash
undefined

Check 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
undefined
npx awal@latest status
undefined

Available CLI Commands

可用CLI命令

CommandPurpose
npx awal@latest status
Check server health and auth status
npx awal@latest auth login <email>
Send OTP code to email, returns flowId
npx awal@latest auth verify <flowId> <otp>
Complete authentication with OTP code
npx awal@latest balance
Get USDC wallet balance
npx awal@latest address
Get wallet address
npx awal@latest show
Open the wallet companion window
命令用途
npx awal@latest status
检查服务器健康状态与认证状态
npx awal@latest auth login <email>
向邮箱发送OTP验证码,返回flowId
npx awal@latest auth verify <flowId> <otp>
使用OTP验证码完成认证
npx awal@latest balance
获取USDC钱包余额
npx awal@latest address
获取钱包地址
npx awal@latest show
打开钱包配套窗口

JSON Output

JSON输出

All commands support
--json
for machine-readable output:
bash
npx awal@latest status --json
npx awal@latest auth login user@example.com --json
npx awal@latest auth verify <flowId> <otp> --json
所有命令均支持
--json
参数以生成机器可读的输出:
bash
npx awal@latest status --json
npx awal@latest auth login user@example.com --json
npx awal@latest auth verify <flowId> <otp> --json