gate-exchange-subaccount
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGate Exchange Sub-Account Skill
Gate Exchange子账户管理Skill
Provide sub-account management capabilities on Gate, including querying sub-account status, listing all sub-accounts, creating new sub-accounts, and locking/unlocking sub-accounts.
提供Gate上的子账户管理功能,包括查询子账户状态、列出所有子账户、创建新子账户以及锁定/解锁子账户。
Prerequisites
前提条件
- MCP Dependency: Requires gate-mcp to be installed.
- Authentication: All sub-account operations require API key authentication with main-account privileges.
- Permission: The current user must be a main account holder to manage sub-accounts.
- MCP依赖:需要安装gate-mcp。
- 身份验证:所有子账户操作均需要拥有主账户权限的API密钥进行身份验证。
- 权限:当前用户必须是主账户持有者才能管理子账户。
Available MCP Tools
可用的MCP工具
| Tool | Auth | Description |
|---|---|---|
| Yes | Get details of a specific sub-account by user ID |
| Yes | List all sub-accounts under the main account |
| Yes | Create a new normal sub-account |
| Yes | Lock a sub-account to disable login and trading |
| Yes | Unlock a previously locked sub-account |
| 工具 | 需身份验证 | 描述 |
|---|---|---|
| 是 | 通过用户ID获取特定子账户的详细信息 |
| 是 | 列出主账户下的所有子账户 |
| 是 | 创建一个新的普通子账户 |
| 是 | 锁定子账户以禁用登录和交易功能 |
| 是 | 解锁之前被锁定的子账户 |
Workflow
工作流程
Step 1: Identify User Intent
步骤1:识别用户意图
Parse the user's message to determine which sub-account operation they need.
Key data to extract:
- : One of
intent,query_status,list_all,create,lockunlock - : Sub-account UID (required for
user_id,query_status,lock)unlock - : Desired username (for
login_name, may need to ask user)create
Intent detection rules:
| Signal Keywords | Intent |
|---|---|
| "status of sub-account", "sub-account UID {id}", "check sub-account" | |
| "all sub-accounts", "list sub-accounts", "my sub-accounts", "which sub-accounts" | |
| "create sub-account", "new sub-account", "add sub-account" | |
| "lock sub-account", "disable sub-account", "freeze sub-account" | |
| "unlock sub-account", "enable sub-account", "unfreeze sub-account" | |
解析用户消息,确定他们需要的子账户操作类型。
需要提取的关键数据:
- :
intent(查询状态)、query_status(列出全部)、list_all(创建)、create(锁定)、lock(解锁)中的一种unlock - :子账户UID(
user_id、query_status、lock操作必填)unlock - :所需的用户名(
login_name操作需要,可能需要询问用户)create
意图检测规则:
| 关键词信号 | 意图 |
|---|---|
| "status of sub-account"、"sub-account UID {id}"、"check sub-account" | |
| "all sub-accounts"、"list sub-accounts"、"my sub-accounts"、"which sub-accounts" | |
| "create sub-account"、"new sub-account"、"add sub-account" | |
| "lock sub-account"、"disable sub-account"、"freeze sub-account" | |
| "unlock sub-account"、"enable sub-account"、"unfreeze sub-account" | |
Step 2: Execute by Intent
步骤2:按意图执行操作
Case A: Query Sub-Account Status (query_status
)
query_status场景A:查询子账户状态(query_status
)
query_statusCall with:
cex_sa_get_sa- : The sub-account UID provided by the user
user_id
Key data to extract:
- : Sub-account username
login_name - : Sub-account remark/note
remark - : Account state (normal / locked)
state - : Account type (normal / pool)
type - : Account creation timestamp
create_time
Present the sub-account details in a structured format.
调用,传入:
cex_sa_get_sa- :用户提供的子账户UID
user_id
需要提取的关键数据:
- :子账户用户名
login_name - :子账户备注
remark - :账户状态(正常/锁定)
state - :账户类型(普通/池化)
type - :账户创建时间戳
create_time
以结构化格式展示子账户详细信息。
Case B: List All Sub-Accounts (list_all
)
list_all场景B:列出所有子账户(list_all
)
list_allCall with:
cex_sa_list_sas- : "0" (normal sub-accounts only)
type
Key data to extract:
- For each sub-account: ,
user_id,login_name,remark,statecreate_time
Present results as a table with username, UID, remark (if any), and current status.
调用,传入:
cex_sa_list_sas- :"0"(仅普通子账户)
type
需要提取的关键数据:
- 每个子账户的:、
user_id、login_name、remark、statecreate_time
以表格形式展示结果,包含用户名、UID、备注(如有)和当前状态。
Case C: Create Sub-Account (create
)
create场景C:创建子账户(create
)
createPre-check: Call with : "0" to get the current list of normal sub-accounts. Check if the user can still create more sub-accounts based on the returned count.
cex_sa_list_sastypeIf creation is available:
- Ask the user to provide a login name for the new sub-account
- Optionally collect: email, remark
- Confirm all details with the user before proceeding
- Call with:
cex_sa_create_sa- : User-provided login name (required)
login_name - : User-provided email (optional)
email - : User-provided remark (optional)
remark
- Present the newly created sub-account details
Key data to extract:
- : Newly created sub-account UID
user_id - : Confirmed username
login_name - : Should be "normal"
state
Important: Only normal sub-accounts can be created through this skill.
预检查:调用并传入:"0"获取当前普通子账户列表,根据返回的数量检查用户是否还能创建更多子账户。
cex_sa_list_sastype如果可以创建:
- 请用户提供新子账户的登录名
- 可选收集:邮箱、备注
- 执行前与用户确认所有信息
- 调用,传入:
cex_sa_create_sa- :用户提供的登录名(必填)
login_name - :用户提供的邮箱(可选)
email - :用户提供的备注(可选)
remark
- 展示新创建的子账户详细信息
需要提取的关键数据:
- :新创建的子账户UID
user_id - :确认后的用户名
login_name - :应为“normal”(正常)
state
重要提示:通过该Skill仅能创建普通子账户。
Case D: Lock Sub-Account (lock
)
lock场景D:锁定子账户(lock
)
lock- Validate that is provided; if not, ask the user
user_id - Call with
cex_sa_get_sato verify the sub-account exists and belongs to the main accountuser_id - If the sub-account is already locked, inform the user and stop
- Confirm with the user: "Are you sure you want to lock sub-account {user_id} ({login_name})? This will disable login and trading for this sub-account."
- On confirmation, call with:
cex_sa_lock_sa- : The sub-account UID
user_id
- Report the result
Key data to extract:
- Lock operation success/failure status
- 验证是否提供了;如果没有,询问用户
user_id - 调用传入
cex_sa_get_sa,验证子账户存在且属于当前主账户user_id - 如果子账户已被锁定,告知用户并停止操作
- 与用户确认:“您确定要锁定子账户{user_id}({login_name})吗?这将禁用该子账户的登录和交易功能。”
- 用户确认后,调用,传入:
cex_sa_lock_sa- :子账户UID
user_id
- 反馈操作结果
需要提取的关键数据:
- 锁定操作的成功/失败状态
Case E: Unlock Sub-Account (unlock
)
unlock场景E:解锁子账户(unlock
)
unlock- Validate that is provided; if not, ask the user
user_id - Call with
cex_sa_get_sato verify the sub-account exists and is currently lockeduser_id - If the sub-account is already unlocked/normal, inform the user and stop
- Confirm with the user: "Are you sure you want to unlock sub-account {user_id} ({login_name})?"
- On confirmation, call with:
cex_sa_unlock_sa- : The sub-account UID
user_id
- Report the result
Key data to extract:
- Unlock operation success/failure status
- 验证是否提供了;如果没有,询问用户
user_id - 调用传入
cex_sa_get_sa,验证子账户存在且当前处于锁定状态user_id - 如果子账户已解锁/状态正常,告知用户并停止操作
- 与用户确认:“您确定要解锁子账户{user_id}({login_name})吗?”
- 用户确认后,调用,传入:
cex_sa_unlock_sa- :子账户UID
user_id
- 反馈操作结果
需要提取的关键数据:
- 解锁操作的成功/失败状态
Step 3: Format and Respond
步骤3:格式化并响应
Present results using the Report Template below. Always include relevant context and next-step suggestions.
使用下方的报告模板展示结果,始终包含相关上下文和下一步建议。
Judgment Logic Summary
判断逻辑汇总
| Condition | Action |
|---|---|
| User asks for a specific sub-account status with UID | Route to Case A: |
| User asks to see all sub-accounts | Route to Case B: |
| User wants to create a new sub-account | Route to Case C: |
| User wants to lock a sub-account with UID | Route to Case D: |
| User wants to unlock a sub-account with UID | Route to Case E: |
| UID not provided for operations requiring it | Ask user for the sub-account UID |
| Login name not provided for creation | Ask user for a login name |
| Sub-account already in target state (lock/unlock) | Inform user, no action needed |
| API returns authentication error | Prompt user to log in |
| API returns permission error | Inform user that main account privileges are required |
| Sub-account does not exist or does not belong to user | Inform user the UID is invalid |
| 条件 | 操作 |
|---|---|
| 用户提供UID并询问特定子账户状态 | 路由到场景A: |
| 用户要求查看所有子账户 | 路由到场景B: |
| 用户想要创建新子账户 | 路由到场景C: |
| 用户提供UID并想要锁定子账户 | 路由到场景D: |
| 用户提供UID并想要解锁子账户 | 路由到场景E: |
| 需UID的操作未提供UID | 询问用户获取子账户UID |
| 创建操作未提供登录名 | 询问用户提供登录名 |
| 子账户已处于目标状态(锁定/解锁) | 告知用户,无需执行操作 |
| API返回身份验证错误 | 提示用户登录 |
| API返回权限错误 | 告知用户需要主账户权限 |
| 子账户不存在或不属于当前用户 | 告知用户UID无效 |
Report Template
报告模板
Query Status Response
查询状态响应
Sub-Account Details
---
Username: {login_name}
UID: {user_id}
Status: {state}
Type: {type}
Remark: {remark or "N/A"}
Created: {create_time}子账户详细信息
---
用户名: {login_name}
UID: {user_id}
状态: {state}
类型: {type}
备注: {remark 或 "无"}
创建时间: {create_time}List All Sub-Accounts Response
列出所有子账户响应
Your Sub-Accounts
---
| # | Username | UID | Status | Remark |
|---|----------|-----|--------|--------|
| 1 | {login_name} | {user_id} | {state} | {remark or "-"} |
| 2 | ... | ... | ... | ... |
Total: {count} sub-account(s)您的子账户列表
---
| 序号 | 用户名 | UID | 状态 | 备注 |
|---|----------|-----|--------|--------|
| 1 | {login_name} | {user_id} | {state} | {remark 或 "-"} |
| 2 | ... | ... | ... | ... |
总计: {count} 个子账户Create Sub-Account Response
创建子账户响应
Sub-Account Created Successfully
---
Username: {login_name}
UID: {user_id}
Status: Normal
Remark: {remark or "N/A"}
Note: Only normal sub-accounts can be created through this interface.子账户创建成功
---
用户名: {login_name}
UID: {user_id}
状态: 正常
备注: {remark 或 "无"}
注意:通过该接口仅能创建普通子账户。Lock/Unlock Response
锁定/解锁响应
Sub-Account {Action} Successfully
---
Username: {login_name}
UID: {user_id}
Previous Status: {previous_state}
Current Status: {new_state}子账户{Action}成功
---
用户名: {login_name}
UID: {user_id}
之前状态: {previous_state}
当前状态: {new_state}Domain Knowledge
领域知识
- A main account on Gate can create multiple sub-accounts for asset isolation, strategy separation, or team management.
- Sub-accounts share the main account's KYC verification but have independent trading and wallet capabilities.
- Locking a sub-account disables both login and trading; the assets remain safe but inaccessible until unlocked.
- There are two types of sub-accounts: normal (type=0) and pool (type=1). This skill only supports creating normal sub-accounts.
- Sub-account creation requires a unique login name. Email and remark are optional.
- Gate上的主账户可以创建多个子账户,用于资产隔离、策略分离或团队管理。
- 子账户共享主账户的KYC验证,但拥有独立的交易和钱包功能。
- 锁定子账户会禁用登录和交易功能;资产会保持安全,但在解锁前无法访问。
- 子账户分为两种类型:普通(type=0)和池化(type=1)。该Skill仅支持创建普通子账户。
- 创建子账户需要唯一的登录名,邮箱和备注为可选信息。
Safety Rules
安全规则
- Write operations (,
cex_sa_create_sa,cex_sa_lock_sa): Always require explicit user confirmation before execution. Never auto-execute.cex_sa_unlock_sa - UID validation: Before lock/unlock, always verify the sub-account exists and belongs to the current main account.
- State check: Before lock/unlock, check current state to avoid redundant operations.
- No sensitive data exposure: Never expose API keys, internal endpoint URLs, or raw error traces.
- Normal sub-accounts only: Creation is restricted to normal sub-accounts (type=0). Do not attempt to create pool sub-accounts.
- 写入操作(、
cex_sa_create_sa、cex_sa_lock_sa):执行前必须获得用户明确确认,绝不能自动执行。cex_sa_unlock_sa - UID验证:锁定/解锁操作前,必须验证子账户存在且属于当前主账户。
- 状态检查:锁定/解锁操作前,检查当前状态以避免重复操作。
- 敏感数据不暴露:绝不能暴露API密钥、内部端点URL或原始错误跟踪信息。
- 仅普通子账户:创建操作仅限于普通子账户(type=0),请勿尝试创建池化子账户。
Error Handling
错误处理
| Condition | Response |
|---|---|
| Auth endpoint returns "not login" | "Please log in to your Gate account first." |
| User is not a main account | "Sub-account management requires main account privileges. Please switch to your main account." |
| Sub-account UID not found | "Sub-account with UID {user_id} was not found. Please verify the UID and try again." |
| Sub-account does not belong to user | "This sub-account does not belong to your main account." |
| Sub-account already locked | "Sub-account {user_id} is already locked. No action needed." |
| Sub-account already unlocked | "Sub-account {user_id} is already in normal (unlocked) state. No action needed." |
| Create sub-account fails (limit reached) | "You have reached the maximum number of sub-accounts. Please contact support if you need more." |
| Create sub-account fails (duplicate name) | "The login name '{login_name}' is already taken. Please choose a different name." |
| Unknown error | "An error occurred while processing your request. Please try again later." |
| 条件 | 响应 |
|---|---|
| 身份验证端点返回"not login" | "请先登录您的Gate账户。" |
| 用户不是主账户 | "子账户管理需要主账户权限,请切换到您的主账户。" |
| 子账户UID未找到 | "未找到UID为{user_id}的子账户,请验证UID后重试。" |
| 子账户不属于当前用户 | "该子账户不属于您的主账户。" |
| 子账户已被锁定 | "子账户{user_id}已处于锁定状态,无需执行操作。" |
| 子账户已解锁 | "子账户{user_id}已处于正常(解锁)状态,无需执行操作。" |
| 创建子账户失败(达到数量上限) | "您已达到子账户创建上限,如需更多请联系客服。" |
| 创建子账户失败(用户名重复) | "登录名'{login_name}'已被占用,请选择其他名称。" |
| 未知错误 | "处理您的请求时发生错误,请稍后重试。" |
Prompt Examples & Scenarios
提示示例与场景
See scenarios.md for full prompt examples and expected behaviors.
完整的提示示例和预期行为请查看scenarios.md。",