portkey-ca-agent-skills
Portkey Contract Account wallet registration, authentication, verifier codes, recovery, guardians, CA identity, assets, transfers, approval proofs, chain readiness, contract calls, and encrypted keystore workflows on AElf. Use when CA hash, guardian, registration, recovery, or manager-forward behavior is required; use the EOA skill for mnemonic or direct private-key wallet lifecycle workflows.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- portkey-ca-agent-skills
- description
- Portkey Contract Account wallet registration, authentication, verifier codes, recovery, guardians, CA identity, assets, transfers, approval proofs, chain readiness, contract calls, and encrypted keystore workflows on AElf. Use when CA hash, guardian, registration, recovery, or manager-forward behavior is required; use the EOA skill for mnemonic or direct private-key wallet lifecycle workflows.
02 资源文件 96
- 脚本__tests__/unit/aelf-client-encode.test.ts1.6 KB
- 脚本__tests__/unit/aelf-client-tx-result.test.ts1.8 KB
- 脚本__tests__/unit/aelf-client-view-call.test.ts1.9 KB
- 脚本__tests__/unit/aelf-client.test.ts2.0 KB
- 脚本__tests__/unit/config.test.ts3.6 KB
- 脚本__tests__/unit/core-account.test.ts12.0 KB
- 脚本__tests__/unit/core-assets.test.ts8.2 KB
- 脚本__tests__/unit/core-auth-session.test.ts3.4 KB
- 脚本__tests__/unit/core-auth.test.ts8.5 KB
- 脚本__tests__/unit/core-contract.test.ts9.7 KB
- 脚本__tests__/unit/core-guardian.test.ts4.1 KB
- 脚本__tests__/unit/core-keystore.test.ts16.6 KB
- 脚本__tests__/unit/core-manager-sync.test.ts3.2 KB
- 脚本__tests__/unit/core-mock-state.ts6.9 KB
- 脚本__tests__/unit/core-security.test.ts10.8 KB
- 脚本__tests__/unit/core-transfer.test.ts9.2 KB
- 脚本__tests__/unit/exports.test.ts3.4 KB
- 脚本__tests__/unit/helpers/aelf-client-encode-check.ts2.2 KB
- 脚本__tests__/unit/helpers/aelf-client-real-check.ts1.5 KB
- 脚本__tests__/unit/helpers/aelf-client-tx-result-check.ts3.1 KB
- 脚本__tests__/unit/helpers/aelf-client-view-call-check.ts3.6 KB
- 脚本__tests__/unit/http-security.test.ts2.5 KB
- 脚本__tests__/unit/http.test.ts1.5 KB
- 脚本__tests__/unit/ironclaw-config.test.ts2.5 KB
- 脚本__tests__/unit/ironclaw-setup.test.ts2.8 KB
- 脚本__tests__/unit/ironclaw-skill.test.ts1.9 KB
- 脚本__tests__/unit/mcp-annotations-raw.test.ts3.5 KB
- 脚本__tests__/unit/mcp-annotations.test.ts2.5 KB
- 脚本__tests__/unit/mcp-error.test.ts1.7 KB
- 脚本__tests__/unit/openclaw-schema.test.ts3.3 KB
- 脚本__tests__/unit/require-wallet.test.ts5.1 KB
- 脚本__tests__/unit/transfer.test.ts869 B
- 脚本__tests__/unit/types.test.ts2.7 KB
- 脚本__tests__/unit/wallet-context.test.ts5.5 KB
- 参考文档_meta.json434 B
- 参考文档.cursor/plans/unified_signer_integration_plan_ca9e2f93.plan.md14.7 KB
- 其他.env.example1.4 KB
- 参考文档.github/workflows/coverage-badge.yml666 B
- 参考文档.github/workflows/publish.yml1.2 KB
- 参考文档.github/workflows/test.yml1001 B
- 其他.gitignore70 B
- 脚本bin/generate-coverage-badge.ts6.6 KB
- 脚本bin/generate-openclaw.ts8.7 KB
- 脚本bin/platforms/claude.ts1.0 KB
- 脚本bin/platforms/cursor.ts1.2 KB
- 脚本bin/platforms/ironclaw.ts6.9 KB
- 脚本bin/platforms/openclaw.ts1.2 KB
- 脚本bin/platforms/utils.ts4.6 KB
- 脚本bin/setup.js40 B
- 脚本bin/setup.ts8.4 KB
- 其他bun.lock74.3 KB
- 脚本cli-helpers.ts813 B
- 参考文档deps-baseline.json126 B
- 脚本index.ts4.2 KB
- 脚本lib/aelf-client.ts13.5 KB
- 脚本lib/aelf-sdk.d.ts2.5 KB
- 脚本lib/config.ts4.0 KB
- 脚本lib/error-hints.ts659 B
- 脚本lib/http.ts6.4 KB
- 脚本lib/runtime-version.ts416 B
- 脚本lib/signer-error-codes.ts519 B
- 脚本lib/types.ts16.2 KB
- 脚本lib/wallet-context.ts8.7 KB
- 许可证LICENSE1.0 KB
- 参考文档mcp-config.example.json272 B
- 参考文档openclaw.json22.7 KB
- 参考文档package.json2.1 KB
- 脚本portkey_auth_skill.ts10.3 KB
- 脚本portkey_query_skill.ts8.6 KB
- 脚本portkey_tx_skill.ts8.9 KB
- 参考文档README.md19.3 KB
- 参考文档README.zh-CN.md18.4 KB
- 参考文档schemas/wallet-context.v1.schema.json2.0 KB
- 脚本scripts/check-deps-baseline.ts2.7 KB
- 脚本scripts/coverage-gate.ts2.7 KB
- 参考文档SOURCE.md401 B
- 脚本src/core/account.ts8.8 KB
- 脚本src/core/assets.ts10.1 KB
- 脚本src/core/auth-session.ts3.2 KB
- 脚本src/core/auth.ts11.5 KB
- 脚本src/core/contract.ts5.0 KB
- 脚本src/core/errors.ts317 B
- 脚本src/core/guardian-approval.ts4.0 KB
- 脚本src/core/guardian.ts4.5 KB
- 脚本src/core/keystore.ts25.4 KB
- 脚本src/core/manager-sync.ts1.7 KB
- 脚本src/core/security.ts7.9 KB
- 脚本src/core/transfer.ts9.5 KB
- 脚本src/mcp/error.ts1.6 KB
- 脚本src/mcp/require-wallet.ts389 B
- 脚本src/mcp/server.ts42.9 KB
- 参考文档TRUST.auto.yaml2.1 KB
- 参考文档tsconfig.base.json379 B
- 参考文档tsconfig.json39 B
- 参考文档tsconfig.src.json308 B
- 参考文档tsconfig.test.json316 B
03 SKILL.md 正文
Portkey CA Agent Skill
Capabilities
- Auth operations: verifier, email code, register, recover, status
- Query operations: account, guardian, assets, chain config, transfer preflight
- Tx operations: transfer, contract call, approvals, keystore workflows
- Shared wallet context: auto-set active CA profile for cross-skill signer resolution
- Supports SDK, CLI, MCP, OpenClaw, and IronClaw integration from one codebase.
Online configuration
- Portkey CA currently supports
mainnetonly; the testnet deployment is decommissioned. - Public services: AA API
https://aa-portkey.portkey.finance, EOA asset fallbackhttps://eoa-portkey.portkey.finance, and GraphQLhttps://indexer-api.aefinder.io/api/app/graphql/portkey. - Chain RPC, CA contract, and default MultiToken addresses are returned by the Portkey chain-info API as
endPoint,caContractAddress, anddefaultToken.address; they are intentionally not duplicated as static deployment constants. - Public account, chain, and asset reads need no local private key. Registration, recovery, and writes use an encrypted CA keystore or explicit signer variables listed in
.env.example. PORTKEY_*overrides, AA-to-EOA fallback controls, and the shared wallet-context path are all included in the packaged.env.example.
Safe usage rules
- Never print private keys, mnemonics, or tokens in channel outputs.
- For write operations, require explicit user confirmation and validate parameters before sending transactions.
- Prefer read-only preflight checks first when available.
- Route
Get*and other read-only contract methods throughview-call/callContractViewMethod, notforward-call. - Route
forward-call/managerForwardCallonly to state-changing methods. - For
Empty-input view methods such asGetConfig, omit params entirely so the runtime performs.call()with no arguments. - Treat backend
3002 / Guardian not exist.as an unregistered account and route toregister. - Before
transfer/cross-chain-transfer, runtransfer-preflightto decide whether the path is:- direct transfer
- one-time guardian approval
- transfer-limit modification
- wallet security upgrade / guardian sync
- Recommended stable write path is:
recover-and-save- poll
manager-sync-statuson the target chain - collect fresh
transferApproveproofs - submit
transfer/cross-chain-transferwithloginEmail + password
- Older AA/CA accounts recovered on
AELFand then written ontDVVare a high-risk sync scenario; always checkmanager-sync-statusbefore the firstforward-call/ claim / transfer ontDVV. transfer-preflightreports both the transferred asset balance and the chain default fee-token balance (feeSymbol/feeBalance/feeDecimals) when deciding one-time approval eligibility.send-code/verify-codesupporttransferApprovefor one-time transfer approval proof collection.transfer,cross-chain-transfer, and transfer-relatedforward-callaccept optionalguardiansApproved.transfer,cross-chain-transfer, and genericforward-callnow block early when the current manager has not yet synced to the target chain.- CLI write commands can resolve signer directly from CA keystore options (
loginEmail/password/keystoreFile) instead of relying on a previous in-memoryunlock. wallet-statusreturnsrecommendedAction/userHintwhen a local keystore exists but is still locked.recommendedAction=unlockis the next machine step;userHintexplains how to verify the selectedloginEmail/keystoreFilefirst and then route torecover-and-saveonly if the password was truly forgotten.VirtualTransactionCreatedis forwarded-write evidence only; it is not a decoded view payload and not a standalone proof that a read-only contract query succeeded.
Command recipes
- Start MCP server:
bun run mcp - Run CLI entry:
bun run portkey_query_skill.ts chain-info - Run transfer preflight:
bun run portkey_query_skill.ts transfer-preflight --ca-hash <hash> --ca-address <addr> --chain-id tDVV --symbol ELF --amount 100000000 - Run manager sync status:
bun run portkey_query_skill.ts manager-sync-status --ca-hash <hash> --chain-id tDVV --manager-address <addr-from-recover-and-save-or-selected-signer> - Read active wallet context:
portkey_get_active_wallet - Set active wallet context:
portkey_set_active_wallet - Install into IronClaw:
bun run setup ironclaw - Generate OpenClaw config:
bun run build:openclaw - Verify OpenClaw config:
bun run build:openclaw:check - Run CI coverage gate:
bun run test:coverage:ci
Distribution / Activation
- GitHub repo/tree URLs are discovery-only for hosts and agents.
- Preferred IronClaw activation from npm:
bunx -p @portkey/ca-agent-skills portkey-ca-setup ironclaw - Preferred OpenClaw activation from npm when managed install is unavailable:
bunx -p @portkey/ca-agent-skills portkey-ca-setup openclaw - Local repo checkout is for development and smoke tests only.
- Migration note:
portkey-setupwas removed in2.0.0; useportkey-ca-setupfor npm-based activation.
Limits / Non-goals
- This skill focuses on domain operations and adapters; it is not a full wallet custody system.
- Do not hardcode environment secrets in source code or docs.
- Avoid bypassing validation for external service calls.
- Do not use this skill for EOA mnemonic/private-key wallet lifecycle flows.
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.