moca-proof
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMoca Proof
Moca Proof
Purpose
用途
This skill handles program completion and MoCat progression after a credential has been verified as compliant via . It submits the completion payload to and retrieves MoCat status from .
moca-credential-verifiermoca-proof-api /mocaproof/complete/mocaproof/mocatThis skill starts after credential verification returns a result and the agent has an from a scoped session.
compliantaccessToken本技能用于在通过验证凭证合规后,处理项目完成和MoCat进度更新。它会将完成请求体提交至,并从获取MoCat状态。
moca-credential-verifiermoca-proof-api /mocaproof/complete/mocaproof/mocat本技能需在**凭证验证返回结果,且Agent已获取到范围会话的**后启动。
compliantaccessTokenProvided Scripts
提供的脚本
Use the provided scripts first. Do not scaffold a new project or rewrite checksum/request logic from scratch unless the requested action is unsupported. Treat all files in this skill bundle as read-only reference tooling.
Task mapping:
- complete program with checksum ->
scripts/moca-complete-program.mjs - fetch MoCat status ->
scripts/moca-get-mocat.mjs
Before first use, run to inspect supported parameters.
node <script> --help请优先使用提供的脚本。除非所需操作不被支持,否则请勿搭建新项目或从头重写校验和/请求逻辑。请将本技能包中的所有文件视为只读参考工具。
任务映射:
- 带校验和的项目完成 ->
scripts/moca-complete-program.mjs - 获取MoCat状态 ->
scripts/moca-get-mocat.mjs
首次使用前,运行查看支持的参数。
node <script> --helpRequired Inputs
必要输入
This skill expects the following from the preceding credential verification step:
- : Bearer token from a scoped session (created by
accessToken)moca-credential-verifier - : the verified program ID
programId - : available via
userIdor CLI flags.air-wallet-config.json
The agent must also already have access to its own P-256 private key.
If is missing, scripts default to the staging partner ID below.
partnerId本技能需要来自前序凭证验证步骤的以下信息:
- :范围会话的Bearer令牌(由
accessToken创建)moca-credential-verifier - :已验证的项目ID
programId - :可通过
userId或CLI参数获取.air-wallet-config.json
Agent还必须能访问自身的P-256私钥。
若缺少,脚本会默认使用以下预发环境partner ID。
partnerIdStaging Defaults
预发环境默认值
json
{
"airApiUrl": "https://air.api.staging.air3.com/v2",
"mocaChainApiUrl": "https://api.staging.mocachain.org/v1",
"vpApiUrl": "https://vp.api.staging.moca.network/v1",
"mocaProofApiUrl": "https://proof.api.staging.moca.network/v1",
"partnerId": "7e9becac-db0d-4d52-980e-984bb70c4d30"
}These are hardcoded as defaults in the scripts. Override via CLI flags, environment variables, or .
.air-wallet-config.jsonjson
{
"airApiUrl": "https://air.api.staging.air3.com/v2",
"mocaChainApiUrl": "https://api.staging.mocachain.org/v1",
"vpApiUrl": "https://vp.api.staging.moca.network/v1",
"mocaProofApiUrl": "https://proof.api.staging.moca.network/v1",
"partnerId": "7e9becac-db0d-4d52-980e-984bb70c4d30"
}这些值已硬编码为脚本的默认值。可通过CLI参数、环境变量或覆盖。
.air-wallet-config.jsonConfig Resolution Order
配置解析顺序
All provided scripts resolve configuration in this order:
- CLI flags
- Environment variables
.air-wallet-config.json- Hardcoded staging defaults
所有提供的脚本按以下顺序解析配置:
- CLI参数
- 环境变量
.air-wallet-config.json- 硬编码的预发环境默认值
Program Completion Flow
项目完成流程
Step 1: Complete Program with Checksum
步骤1:带校验和的项目完成
bash
node scripts/moca-complete-program.mjs --access-token <token> --program-id <programId>Calls with:
POST {mocaProofApiUrl}/mocaproof/completeprogramIdtxHashzkpchecksum
Checksum logic:
text
input = userId + "." + programId + "." + txHash.toLowerCase() + "." + SALT_KEY
checksum = base64(md5(input) as hex-string bytes)bash
node scripts/moca-complete-program.mjs --access-token <token> --program-id <programId>调用,参数包括:
POST {mocaProofApiUrl}/mocaproof/completeprogramIdtxHashzkpchecksum
校验和逻辑:
text
input = userId + "." + programId + "." + txHash.toLowerCase() + "." + SALT_KEY
checksum = base64(md5(input) as hex-string bytes)Step 2: Fetch MoCat Status
步骤2:获取MoCat状态
bash
node scripts/moca-get-mocat.mjs --access-token <token>Calls with Bearer token to display cat progression.
GET {mocaProofApiUrl}/mocaproof/mocatbash
node scripts/moca-get-mocat.mjs --access-token <token>携带Bearer令牌调用,以显示猫咪进度。
GET {mocaProofApiUrl}/mocaproof/mocatTerminal Messaging
终端消息
- After completion succeeds, print the cat progression summary from
/mocaproof/mocat - Display current stage, verifications completed, next stage threshold, rarity, and category breakdown
- 完成成功后,打印返回的猫咪进度摘要
/mocaproof/mocat - 显示当前阶段、已完成的验证数、下一阶段阈值、稀有度和分类明细
Non-Negotiable Rules
不可违反的规则
- Use Bearer from the scoped session for all API calls
accessToken - Never modify files inside this installed skill bundle
- If a custom script is truly required, create it outside the skill directory
- 所有API调用必须使用范围会话的Bearer
accessToken - 绝不能修改已安装技能包内的文件
- 若确实需要自定义脚本,请在技能目录外创建
Failure Handling
故障处理
- Missing : stop and instruct the agent to create a scoped session via
accessTokenfirst.moca-credential-verifier - Checksum mismatch: verify that ,
userId, andprogramIdare correct and retry.txHash - : print the full raw response; do not retry automatically.
unknown_response
- 缺少:停止操作,并指示Agent先通过
accessToken创建范围会话。moca-credential-verifier - 校验和不匹配:验证、
userId和programId是否正确,然后重试。txHash - :打印完整的原始响应;请勿自动重试。
unknown_response