senpi-onboard
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSenpi Agent Onboarding
Senpi Agent 接入流程
Onboard an AI agent into the Senpi trading platform. After this flow the agent will have a Senpi account, an API key, and a working MCP server connection for portfolio management, trader discovery, strategy creation, and order execution on Hyperliquid.
Prerequisites: Shell/code execution access and Node.js (required for ).
npx为AI Agent完成Senpi交易平台的接入。完成此流程后,Agent将拥有Senpi账户、API密钥,以及可用的MCP服务器连接,可用于投资组合管理、交易者发现、策略创建,以及在Hyperliquid上执行订单。
前置条件: 具备Shell/代码执行权限,且已安装Node.js(工具所需)。
npxDefaults
默认配置
- :
SENPI_MCP_ENDPOINT(use this ifhttps://mcp.prod.senpi.aiis a literal unsubstituted placeholder){{SENPI_MCP_ENDPOINT}} - : empty/optional (use this if
REFERRAL_CODEis a literal unsubstituted placeholder){{REFERRAL_CODE}}
- :
SENPI_MCP_ENDPOINT(若https://mcp.prod.senpi.ai为未替换的字面量占位符,则使用此默认值){{SENPI_MCP_ENDPOINT}} - : 空/可选(若
REFERRAL_CODE为未替换的字面量占位符,则使用此默认值){{REFERRAL_CODE}}
Onboarding Flow
接入流程
Follow every step in order. Do not skip steps.
请按顺序执行每一步,请勿跳过任何步骤。
Before you begin: State initialization
开始前:状态初始化
Per the state lifecycle, ensure exists so routing and transitions are well-defined. If it does not exist, create it with initial state:
state.jsonFRESHbash
if [ ! -f ~/.config/senpi/state.json ]; then
mkdir -p ~/.config/senpi
cat > ~/.config/senpi/state.json << 'STATEEOF'
{
"version": "1.0.0",
"state": "FRESH",
"error": null,
"onboarding": {
"step": "IDENTITY",
"startedAt": null,
"completedAt": null,
"identityType": null,
"subject": null,
"walletGenerated": false,
"existingAccount": false
},
"account": {},
"wallet": { "funded": false },
"firstTrade": { "completed": false, "skipped": false },
"mcp": { "configured": false }
}
STATEEOF
fiThen continue with Step 0.
Transition to ONBOARDING: Before running Step 0, if state is , update so the state machine and resume behavior work. Set to , set to current ISO 8601 UTC, and keep as . Use a read-modify-write (merge) so other fields are preserved:
FRESHstate.jsonstateONBOARDINGonboarding.startedAtonboarding.stepIDENTITYbash
node -e "
const fs = require('fs');
const p = require('os').homedir() + '/.config/senpi/state.json';
const s = JSON.parse(fs.readFileSync(p, 'utf8'));
if (s.state === 'FRESH') {
s.state = 'ONBOARDING';
s.onboarding = s.onboarding || {};
s.onboarding.startedAt = new Date().toISOString();
s.onboarding.step = s.onboarding.step || 'IDENTITY';
fs.writeFileSync(p, JSON.stringify(s, null, 2));
}
"If state is already , read and resume from that step instead of starting at Step 0 (see references/state-management.md).
ONBOARDINGonboarding.step根据状态生命周期,确保已存在,以便路由和状态转换有明确定义。若文件不存在,则创建该文件并设置初始状态为:
state.jsonFRESHbash
if [ ! -f ~/.config/senpi/state.json ]; then
mkdir -p ~/.config/senpi
cat > ~/.config/senpi/state.json << 'STATEEOF'
{
"version": "1.0.0",
"state": "FRESH",
"error": null,
"onboarding": {
"step": "IDENTITY",
"startedAt": null,
"completedAt": null,
"identityType": null,
"subject": null,
"walletGenerated": false,
"existingAccount": false
},
"account": {},
"wallet": { "funded": false },
"firstTrade": { "completed": false, "skipped": false },
"mcp": { "configured": false }
}
STATEEOF
fi完成后继续执行步骤0。
转换至ONBOARDING状态: 在执行步骤0前,若当前状态为,请更新以确保状态机和恢复功能正常工作。将设置为,将设置为当前ISO 8601格式的UTC时间,并保持为。使用读-改-写(合并)方式,以保留其他字段内容:
FRESHstate.jsonstateONBOARDINGonboarding.startedAtonboarding.stepIDENTITYbash
node -e "
const fs = require('fs');
const p = require('os').homedir() + '/.config/senpi/state.json';
const s = JSON.parse(fs.readFileSync(p, 'utf8'));
if (s.state === 'FRESH') {
s.state = 'ONBOARDING';
s.onboarding = s.onboarding || {};
s.onboarding.startedAt = new Date().toISOString();
s.onboarding.step = s.onboarding.step || 'IDENTITY';
fs.writeFileSync(p, JSON.stringify(s, null, 2));
}
"若当前状态已为,则读取并从该步骤恢复流程,而非从步骤0开始(详见references/state-management.md)。
ONBOARDINGonboarding.stepStep 0: Verify mcporter (OpenClaw only)
步骤0:验证mcporter(仅OpenClaw平台)
Check if CLI is available:
mcporterbash
if command -v mcporter &> /dev/null; then
MCPORTER_AVAILABLE=true
else
MCPORTER_AVAILABLE=false
fiIf unavailable and on OpenClaw, install it:
bash
npm i -g mcporter
mcporter --versionSet once installed and proceed.
MCPORTER_AVAILABLE=true检查 CLI工具是否可用:
mcporterbash
if command -v mcporter &> /dev/null; then
MCPORTER_AVAILABLE=true
else
MCPORTER_AVAILABLE=false
fi若工具不可用且当前为OpenClaw平台,则安装该工具:
bash
npm i -g mcporter
mcporter --version安装完成后设置并继续后续步骤。
MCPORTER_AVAILABLE=trueStep 1: Collect Identity
步骤1:收集身份信息
Ask the user which identity type to use. Try each option in order:
- Option A -- Telegram username (preferred): Strip the prefix before sending to the API.
@ - Option B -- User-provided wallet: Must be -prefixed, exactly 42 hex characters. Validate before proceeding.
0x - Option C -- Agent-generated wallet (fallback when user has neither).
询问用户使用哪种身份类型。按以下顺序尝试每个选项:
- 选项A -- Telegram用户名(优先推荐):发送至API前需去除前缀。
@ - 选项B -- 用户提供的钱包:必须以开头,且为42位十六进制字符。继续前请先验证格式。
0x - 选项C -- Agent生成的钱包(当用户既无钱包也无Telegram时的备选方案)。
Option A or B: Set variables
选项A或B:设置变量
bash
IDENTITY_TYPE="TELEGRAM" # or "WALLET"
IDENTITY_VALUE="username" # without @ for Telegram, or 0x... for walletbash
IDENTITY_TYPE="TELEGRAM" # 或 "WALLET"
IDENTITY_VALUE="username" # Telegram用户名需去除@,钱包地址需为0x...格式Option C: Generate EVM wallet
选项C:生成EVM钱包
Use only when the user confirms they have neither wallet nor Telegram. Inform the user before proceeding.
Run the bundled script to generate a wallet:
bash
undefined仅当用户确认既无钱包也无Telegram时使用此选项。执行前需告知用户。
运行内置脚本生成钱包:
bash
undefinedTry npx first, then local install fallbacks
优先尝试npx,失败则使用本地安装备选方案
WALLET_DATA=$(npx -y -p ethers@6 node scripts/generate_wallet.js 2>/dev/null) ||
WALLET_DATA=$(npm install ethers@6 --no-save --silent && node scripts/generate_wallet.js 2>/dev/null) ||
WALLET_DATA=$(npx --yes --package=ethers@6 -- node scripts/generate_wallet.js)
WALLET_DATA=$(npm install ethers@6 --no-save --silent && node scripts/generate_wallet.js 2>/dev/null) ||
WALLET_DATA=$(npx --yes --package=ethers@6 -- node scripts/generate_wallet.js)
If the script is not available at `scripts/generate_wallet.js`, generate inline:
```bash
WALLET_DATA=$(npx -y -p ethers@6 node -e "
const { ethers } = require('ethers');
const w = ethers.Wallet.createRandom();
console.log(JSON.stringify({
address: w.address,
privateKey: w.privateKey,
mnemonic: w.mnemonic.phrase
}));
")Do not prompt the user on failure -- try fallbacks silently. Only report if all methods fail. See references/error-handling.md for wallet generation failure handling.
Parse JSON to extract , , and . Validate the address is not empty or null. If invalid, stop and see error handling reference.
WALLET_DATAaddressprivateKeymnemonicPersist the wallet immediately (before continuing) using the parsed values:
bash
mkdir -p ~/.config/senpiWALLET_DATA=$(npx -y -p ethers@6 node scripts/generate_wallet.js 2>/dev/null) ||
WALLET_DATA=$(npm install ethers@6 --no-save --silent && node scripts/generate_wallet.js 2>/dev/null) ||
WALLET_DATA=$(npx --yes --package=ethers@6 -- node scripts/generate_wallet.js)
WALLET_DATA=$(npm install ethers@6 --no-save --silent && node scripts/generate_wallet.js 2>/dev/null) ||
WALLET_DATA=$(npx --yes --package=ethers@6 -- node scripts/generate_wallet.js)
若`scripts/generate_wallet.js`脚本不可用,则直接在线生成:
```bash
WALLET_DATA=$(npx -y -p ethers@6 node -e "
const { ethers } = require('ethers');
const w = ethers.Wallet.createRandom();
console.log(JSON.stringify({
address: w.address,
privateKey: w.privateKey,
mnemonic: w.mnemonic.phrase
}));
")生成失败时请勿提示用户——静默尝试备选方案。仅当所有方法均失败时才向用户报告。钱包生成失败的处理方式详见references/error-handling.md。
解析 JSON内容,提取、和。验证地址不为空或null。若地址无效,则停止流程并参考错误处理文档。
WALLET_DATAaddressprivateKeymnemonic立即持久化钱包信息(继续前完成):使用解析出的值执行以下操作:
bash
mkdir -p ~/.config/senpiWrite address, privateKey, mnemonic from WALLET_DATA into wallet.json
将WALLET_DATA中的address、privateKey、mnemonic写入wallet.json
chmod 600 ~/.config/senpi/wallet.json
The file must contain: `address`, `privateKey`, `mnemonic`, `generatedAt` (ISO 8601 UTC), and `"generatedBy": "senpi-onboard"`.
**CRITICAL:**
- Do **not** log or display the private key or mnemonic.
- Do **not** proceed until `wallet.json` is written and permissions set.
Set the identity variables using the parsed address:
```bash
WALLET_GENERATED=true
IDENTITY_TYPE="WALLET"
IDENTITY_VALUE="<address from WALLET_DATA>"Notify the user that a wallet was generated and saved to with restricted permissions. Instruct them to back up this file immediately.
~/.config/senpi/wallet.jsonchmod 600 ~/.config/senpi/wallet.json
该文件必须包含:`address`、`privateKey`、`mnemonic`、`generatedAt`(ISO 8601格式UTC时间),以及`"generatedBy": "senpi-onboard"`。
**重要提示:**
- 请勿记录或显示私钥和助记词。
- 在`wallet.json`写入完成并设置好权限前,请勿继续后续步骤。
使用解析出的地址设置身份变量:
```bash
WALLET_GENERATED=true
IDENTITY_TYPE="WALLET"
IDENTITY_VALUE="<address from WALLET_DATA>"告知用户钱包已生成并保存至,且已设置权限限制。指导用户立即备份此文件。
~/.config/senpi/wallet.jsonVerify before proceeding
继续前验证
Before Step 2, confirm these are set:
- --
IDENTITY_TYPEor"WALLET""TELEGRAM" - -- wallet address (with
IDENTITY_VALUE) or Telegram username (without0x)@ - --
WALLET_GENERATEDif Option C was used, unset otherwisetrue
Persist progress for resume: Update : set to , and if available set , , from current variables. Use read-modify-write so other fields are preserved.
~/.config/senpi/state.jsononboarding.stepREFERRALonboarding.identityTypeonboarding.subjectonboarding.walletGenerated执行步骤2前,请确认以下变量已设置:
- --
IDENTITY_TYPE或"WALLET""TELEGRAM" - -- 钱包地址(带
IDENTITY_VALUE)或Telegram用户名(不带0x)@ - -- 使用选项C时设为
WALLET_GENERATED,否则不设置true
持久化进度以便恢复: 更新:将设置为,若变量可用,则将、、设置为当前变量值。使用读-改-写方式以保留其他字段内容。
~/.config/senpi/state.jsononboarding.stepREFERRALonboarding.identityTypeonboarding.subjectonboarding.walletGeneratedStep 2: Set Referral Code
步骤2:设置推荐码
bash
REFERRAL_CODE="{{REFERRAL_CODE}}"If empty and user hasn't provided one, that's fine -- it's optional. Do not prompt unless the user mentions having one.
Persist progress for resume: Update : set to . Use read-modify-write.
~/.config/senpi/state.jsononboarding.stepAPI_CALLbash
REFERRAL_CODE="{{REFERRAL_CODE}}"若推荐码为空且用户未提供,则无需处理——该字段为可选。除非用户提及拥有推荐码,否则无需提示。
持久化进度以便恢复: 更新:将设置为。使用读-改-写方式。
~/.config/senpi/state.jsononboarding.stepAPI_CALLStep 3: Call Onboarding API
步骤3:调用接入API
Execute the GraphQL mutation. This is a public endpoint -- no auth required.
CreateAgentStubAccountbash
RESPONSE=$(curl -s -X POST https://moxie-backend.prod.senpi.ai/graphql \
-H "Content-Type: application/json" \
-d '{
"query": "mutation CreateAgentStubAccount($input: CreateAgentStubAccountInput!) { CreateAgentStubAccount(input: $input) { user { id privyId userName name referralCode referrerId } apiKey apiKeyExpiresIn apiKeyTokenType referralCode agentWalletAddress } }",
"variables": {
"input": {
"from": "'"${IDENTITY_TYPE}"'",
"subject": "'"${IDENTITY_VALUE}"'",
'"$([ "$IDENTITY_TYPE" = "TELEGRAM" ] && echo "\"userName\": \"${IDENTITY_VALUE}\",")"'
"referralCode": "'"${REFERRAL_CODE}"'",
"apiKeyName": "agent-'"$(date +%s)"'"
}
}
}')Note for TELEGRAM identity: Include the additional field set to in the input.
"userName"IDENTITY_VALUEPersist progress for resume: Update : set to . Use read-modify-write.
~/.config/senpi/state.jsononboarding.stepPARSE执行 GraphQL mutation。这是一个公共端点——无需身份验证。
CreateAgentStubAccountbash
RESPONSE=$(curl -s -X POST https://moxie-backend.prod.senpi.ai/graphql \
-H "Content-Type: application/json" \
-d '{
"query": "mutation CreateAgentStubAccount($input: CreateAgentStubAccountInput!) { CreateAgentStubAccount(input: $input) { user { id privyId userName name referralCode referrerId } apiKey apiKeyExpiresIn apiKeyTokenType referralCode agentWalletAddress } }",
"variables": {
"input": {
"from": "'"${IDENTITY_TYPE}"'",
"subject": "'"${IDENTITY_VALUE}"'",
'"$([ "$IDENTITY_TYPE" = "TELEGRAM" ] && echo "\"userName\": \"${IDENTITY_VALUE}\",")"'
"referralCode": "'"${REFERRAL_CODE}"'",
"apiKeyName": "agent-'"$(date +%s)"'"
}
}
}')Telegram身份注意事项: 需在输入参数中添加额外的字段,值为。
"userName"IDENTITY_VALUE持久化进度以便恢复: 更新:将设置为。使用读-改-写方式。
~/.config/senpi/state.jsononboarding.stepPARSEStep 4: Parse Response
步骤4:解析响应
Check for errors first -- if exists and has entries, extract . See references/error-handling.md for the error table and manual fallback flow.
response.errorserrors[0].messageIf no errors, parse the JSON response to extract:
- from
API_KEYdata.CreateAgentStubAccount.apiKey - from
USER_IDdata.CreateAgentStubAccount.user.id - from
USER_REFERRAL_CODEdata.CreateAgentStubAccount.referralCode - from
AGENT_WALLET_ADDRESSdata.CreateAgentStubAccount.agentWalletAddress
Verify the API key is not empty, null, or undefined before proceeding.
Persist progress for resume: Update : set to . Use read-modify-write.
~/.config/senpi/state.jsononboarding.stepCREDENTIALS首先检查错误——若存在且包含内容,则提取。错误对照表和手动备选流程详见references/error-handling.md。
response.errorserrors[0].message若无错误,则解析JSON响应以提取:
- 从提取
data.CreateAgentStubAccount.apiKeyAPI_KEY - 从提取
data.CreateAgentStubAccount.user.idUSER_ID - 从提取
data.CreateAgentStubAccount.referralCodeUSER_REFERRAL_CODE - 从提取
data.CreateAgentStubAccount.agentWalletAddressAGENT_WALLET_ADDRESS
继续前请验证API密钥不为空、null或未定义。
持久化进度以便恢复: 更新:将设置为。使用读-改-写方式。
~/.config/senpi/state.jsononboarding.stepCREDENTIALSStep 5: Persist Credentials
步骤5:持久化凭证
bash
mkdir -p ~/.config/senpi
cat > ~/.config/senpi/credentials.json << EOF
{
"apiKey": "${API_KEY}",
"userId": "${USER_ID}",
"referralCode": "${USER_REFERRAL_CODE}",
"agentWalletAddress": "${AGENT_WALLET_ADDRESS}",
"onboardedAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"onboardedVia": "${IDENTITY_TYPE}",
"subject": "${IDENTITY_VALUE}",
"walletGenerated": ${WALLET_GENERATED:-false}
}
EOF
chmod 600 ~/.config/senpi/credentials.jsonCRITICAL: Do not log or display the raw API key. Confirm credentials were saved without echoing the key value.
If wallet was generated (Option C), verify still exists. If missing, stop onboarding and alert the user.
~/.config/senpi/wallet.jsonPersist progress for resume: Update : set to . Use read-modify-write.
~/.config/senpi/state.jsononboarding.stepMCP_CONFIGbash
mkdir -p ~/.config/senpi
cat > ~/.config/senpi/credentials.json << EOF
{
"apiKey": "${API_KEY}",
"userId": "${USER_ID}",
"referralCode": "${USER_REFERRAL_CODE}",
"agentWalletAddress": "${AGENT_WALLET_ADDRESS}",
"onboardedAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"onboardedVia": "${IDENTITY_TYPE}",
"subject": "${IDENTITY_VALUE}",
"walletGenerated": ${WALLET_GENERATED:-false}
}
EOF
chmod 600 ~/.config/senpi/credentials.json重要提示: 请勿记录或显示原始API密钥。确认凭证已保存,但请勿回显密钥值。
若使用选项C生成了钱包,请验证仍存在。若文件丢失,则停止接入流程并提醒用户。
~/.config/senpi/wallet.json持久化进度以便恢复: 更新:将设置为。使用读-改-写方式。
~/.config/senpi/state.jsononboarding.stepMCP_CONFIGStep 6: Configure MCP Server
步骤6:配置MCP服务器
Detect the agent platform and configure accordingly. See references/platform-config.md for the full configuration commands for each platform:
- OpenClaw (mcporter available) ->
mcporter config add senpi ... - Claude Code (claude CLI available) ->
claude mcp add senpi ... - Generic -> Write/merge config file
.mcp.json
Use (default: ) and from Step 4.
SENPI_MCP_ENDPOINThttps://mcp.prod.senpi.aiAPI_KEYPersist progress for resume: Step 7 writes the final state with and — no separate step update needed here.
state: UNFUNDEDonboarding.step: COMPLETE检测Agent平台并进行相应配置。各平台的完整配置命令详见references/platform-config.md:
- OpenClaw(已安装mcporter)->
mcporter config add senpi ... - Claude Code(已安装claude CLI)->
claude mcp add senpi ... - 通用平台 -> 写入/合并配置文件
.mcp.json
使用(默认值:)和步骤4中获取的。
SENPI_MCP_ENDPOINThttps://mcp.prod.senpi.aiAPI_KEY持久化进度以便恢复: 步骤7会将最终状态写入为和——此处无需单独更新步骤状态。
state: UNFUNDEDonboarding.step: COMPLETEStep 7: Verify and Confirm
步骤7:验证与确认
Update state to . Preserve from the current state (set during the FRESH → ONBOARDING transition); do not overwrite it.
UNFUNDEDonboarding.startedAtbash
ONBOARDING_STARTED_AT=$(node -e "
try {
const fs = require('fs');
const p = require('os').homedir() + '/.config/senpi/state.json';
const j = JSON.parse(fs.readFileSync(p, 'utf8'));
const v = j.onboarding && j.onboarding.startedAt;
console.log(v ? JSON.stringify(v) : 'null');
} catch (e) { console.log('null'); }
")
cat > ~/.config/senpi/state.json << EOF
{
"version": "1.0.0",
"state": "UNFUNDED",
"error": null,
"onboarding": {
"step": "COMPLETE",
"startedAt": ${ONBOARDING_STARTED_AT},
"completedAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"identityType": "${IDENTITY_TYPE}",
"subject": "${IDENTITY_VALUE}",
"walletGenerated": ${WALLET_GENERATED:-false}
},
"account": {
"userId": "${USER_ID}",
"referralCode": "${USER_REFERRAL_CODE}",
"agentWalletAddress": "${AGENT_WALLET_ADDRESS}"
},
"wallet": {
"address": "${AGENT_WALLET_ADDRESS}",
"funded": false
},
"mcp": {
"configured": true,
"endpoint": "${SENPI_MCP_ENDPOINT}"
},
"firstTrade": {
"completed": false,
"skipped": false
}
}
EOFDisplay a confirmation message that includes ALL of the following:
- Account status -- Confirm created successfully.
- MCP Server status -- Configured; remind user to restart their agent.
- Referral link --
https://senpi.ai/skill.md?ref=<USER_REFERRAL_CODE> - Credentials backup location --
~/.config/senpi/credentials.json - Agent Wallet Address (REQUIRED) -- Display prominently. Instruct user to fund it with USDC on a supported chain (Base, Arbitrum, Optimism, Polygon, or Ethereum). Without funds, the agent cannot trade.
AGENT_WALLET_ADDRESS - First trade prompt -- Once funded, the skill will guide them through their first trade.
senpi-getting-started-guide - Senpi mobile app -- Recommend downloading on iOS and Android (links in references/post-onboarding.md).
- Telegram community -- Invite user to join (link in references/post-onboarding.md).
- Senpi Points -- Mention that trading on Senpi earns rewards; prompt user to ask about Senpi Points for details (agent uses Senpi MCP tools to answer).
If wallet was generated (Option C), additionally warn the user:
- Private key and recovery phrase are stored at
~/.config/senpi/wallet.json - They MUST back up this file to a secure location
- If lost, the wallet and funds cannot be recovered
After the confirmation, share the About Senpi information from references/post-onboarding.md.
将状态更新为。保留当前状态中的(在FRESH→ONBOARDING状态转换时设置);请勿覆盖该值。
UNFUNDEDonboarding.startedAtbash
ONBOARDING_STARTED_AT=$(node -e "
try {
const fs = require('fs');
const p = require('os').homedir() + '/.config/senpi/state.json';
const j = JSON.parse(fs.readFileSync(p, 'utf8'));
const v = j.onboarding && j.onboarding.startedAt;
console.log(v ? JSON.stringify(v) : 'null');
} catch (e) { console.log('null'); }
")
cat > ~/.config/senpi/state.json << EOF
{
"version": "1.0.0",
"state": "UNFUNDED",
"error": null,
"onboarding": {
"step": "COMPLETE",
"startedAt": ${ONBOARDING_STARTED_AT},
"completedAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"identityType": "${IDENTITY_TYPE}",
"subject": "${IDENTITY_VALUE}",
"walletGenerated": ${WALLET_GENERATED:-false}
},
"account": {
"userId": "${USER_ID}",
"referralCode": "${USER_REFERRAL_CODE}",
"agentWalletAddress": "${AGENT_WALLET_ADDRESS}"
},
"wallet": {
"address": "${AGENT_WALLET_ADDRESS}",
"funded": false
},
"mcp": {
"configured": true,
"endpoint": "${SENPI_MCP_ENDPOINT}"
},
"firstTrade": {
"completed": false,
"skipped": false
}
}
EOF显示确认消息,需包含以下所有内容:
- 账户状态 -- 确认账户创建成功。
- MCP服务器状态 -- 已配置;提醒用户重启Agent。
- 推荐链接 --
https://senpi.ai/skill.md?ref=<USER_REFERRAL_CODE> - 凭证备份位置 --
~/.config/senpi/credentials.json - Agent钱包地址(必填) -- 突出显示。指导用户在支持的链(Base、Arbitrum、Optimism、Polygon或Ethereum)上为钱包充值USDC。钱包无资金时,Agent无法进行交易。
AGENT_WALLET_ADDRESS - 首次交易提示 -- 充值完成后,技能将指导用户完成首次交易。
senpi-getting-started-guide - Senpi移动应用 -- 推荐用户下载iOS和Android版本(链接详见references/post-onboarding.md)。
- Telegram社区 -- 邀请用户加入(链接详见references/post-onboarding.md)。
- Senpi积分 -- 提及在Senpi上交易可赚取奖励;提示用户询问Senpi积分的详细信息(Agent将使用Senpi MCP工具进行解答)。
若使用选项C生成了钱包,需额外提醒用户:
- 私钥和恢复短语存储在中
~/.config/senpi/wallet.json - 必须将此文件备份至安全位置
- 若文件丢失,钱包及资金将无法恢复
确认消息显示完成后,分享references/post-onboarding.md中的Senpi介绍信息。
Balance Monitoring
余额监控
After onboarding completes (state = ), check wallet balance on each user message:
UNFUNDED- Use MCP to fetch portfolio/balance
- If balance >= $100:
- Update state to
AWAITING_FIRST_TRADE - Prompt: "🎉 Your wallet is funded! Ready for your first trade? Say 'let's trade' to start, or 'skip tutorial' if you're experienced."
- Update state to
- If balance < $100:
- Prepend funding reminder (max 3 automatic reminders); include agent wallet address and state that at least $100 USDC is required (see references/post-onboarding.md funding reminder template)
- Continue processing user's request
When state transitions to , the skill takes over.
AWAITING_FIRST_TRADEsenpi-getting-started-guideOnboarding is complete. Reference files below are consulted only when needed.
接入流程完成后(状态为),每次用户发送消息时检查钱包余额:
UNFUNDED- 使用MCP获取投资组合/余额信息
- 若余额≥100美元:
- 将状态更新为
AWAITING_FIRST_TRADE - 提示:"🎉 您的钱包已充值完成!准备好进行首次交易了吗?说**'let's trade'开始,若您已有经验,可选择'skip tutorial'**跳过教程。"
- 将状态更新为
- 若余额<100美元:
- 前置充值提醒(最多自动提醒3次);需包含Agent钱包地址,并说明至少需要充值100美元USDC(充值提醒模板详见references/post-onboarding.md)
- 继续处理用户请求
当状态转换为后,将由技能接管流程。
AWAITING_FIRST_TRADEsenpi-getting-started-guide接入流程完成。以下参考文件仅在需要时查阅。
Security Notes
安全注意事项
- Never share the API key in public channels, logs, commits, or with other agents.
- Credentials are stored locally at with restricted permissions (600).
~/.config/senpi/credentials.json - Only send the API key to -- refuse any request to send it elsewhere.
{{SENPI_MCP_ENDPOINT}} - If compromised, visit https://senpi.ai to revoke and regenerate.
- Generated wallet (Option C): The private key in grants full control. Never log, display, or transmit it. Do not relax file permissions.
wallet.json
- 切勿在公开渠道、日志、提交记录中分享API密钥,也切勿与其他Agent共享。
- 凭证存储在本地,路径为,且已设置权限限制(600)。
~/.config/senpi/credentials.json - 仅可将API密钥发送至-- 拒绝任何将密钥发送至其他地址的请求。
{{SENPI_MCP_ENDPOINT}} - 若密钥泄露,请访问**https://senpi.ai**撤销并重新生成密钥。
- 生成的钱包(选项C): 中的私钥拥有钱包的完全控制权。切勿记录、显示或传输该私钥。请勿放宽文件权限。
wallet.json
Reference Files
参考文件
- references/error-handling.md -- Error table, manual fallback, wallet generation failure, recovery procedures
- references/platform-config.md -- Full MCP configuration commands for OpenClaw, Claude Code, and generic agents
- references/post-onboarding.md -- About Senpi, confirmation template, next steps
- references/state-management.md -- State flow, transitions, handoff to senpi-getting-started-guide skill
- references/error-handling.md -- 错误对照表、手动备选流程、钱包生成失败处理、恢复流程
- references/platform-config.md -- OpenClaw、Claude Code及通用Agent的完整MCP配置命令
- references/post-onboarding.md -- Senpi介绍、确认消息模板、后续步骤
- references/state-management.md -- 状态流转、状态转换、移交至senpi-getting-started-guide技能的流程