中文版 | English
AI Agent Skills for Portkey EOA Wallet on aelf blockchain. Provides MCP, CLI, and SDK interfaces for wallet management, token transfers, asset queries, and smart contract interactions.
- Wallet Management: Create, import, list, and backup EOA wallets with AES-encrypted local storage
- Token Queries: Check balances, prices, and token lists across aelf chains
- NFT Queries: Browse NFT collections and items
- Transaction History: Query and inspect past transactions
- Token Transfers: Same-chain and cross-chain transfers within aelf
- Contract Interactions: Generic view/send calls, approve, fee estimation
- eBridge: Cross-chain transfers between aelf and EVM chains
| Mode | Entry | Use Case |
|---|---|---|
| MCP | src/mcp/server.ts |
Claude Desktop, Cursor, GPT, and other AI tools |
| CLI | portkey_eoa_skill.ts |
Terminal scripts, OpenClaw |
| SDK | index.ts |
LangChain, LlamaIndex, custom agents |
# Local repo checkout / smoke test only
bun install- Managed install / ClawHub when available.
- For OpenClaw when managed install is unavailable, use
bunx -p @portkey/eoa-agent-skills portkey-setup openclaw. This path requires Bun or a managed runtime that provides Bun. - Local repo checkout after
bun installfor development and smoke tests only. - Copying raw source into
~/.codex/skills/portkey-eoawithout installing dependencies is not a supported install path and is not guaranteed to boot.
# Claude Desktop
bun run bin/setup.ts claude
# Cursor (project-level)
bun run bin/setup.ts cursor
# Cursor (global)
bun run bin/setup.ts cursor --global
# OpenClaw (output config)
bun run bin/setup.ts openclaw
# OpenClaw (merge into existing config)
bun run bin/setup.ts openclaw --config-path /path/to/openclaw-config.json
# Check status
bun run bin/setup.ts list# Build staged assets and package the release bundle locally
bun run ironclaw:wasm:build
bun run ironclaw:wasm:bundle
# Install the staged local artifact into IronClaw
ironclaw tool install ./artifacts/ironclaw/portkey-eoa-ironclaw.wasmRelease assets follow this naming contract:
portkey-eoa-ironclaw-v<version>-wasm32-wasip2.tar.gzportkey-eoa-ironclaw-v<version>-wasm32-wasip2.sha256portkey-eoa-ironclaw.wasmportkey-eoa-ironclaw.capabilities.json
cp .env.example .env
# Edit .env with your values| Variable | Description | Default |
|---|---|---|
PORTKEY_NETWORK |
mainnet |
mainnet |
PORTKEY_API_URL |
Override API base URL | Auto from network |
PORTKEY_PRIVATE_KEY |
Plaintext private key (optional) | — |
PORTKEY_WALLET_DIR |
Custom wallet storage directory | ~/.portkey/eoa/wallets/ |
PORTKEY_WALLET_PASSWORD |
Password for local wallet encryption | — |
PORTKEY_SKILL_WALLET_CONTEXT_PATH |
Override shared wallet context path | ~/.portkey/skill-wallet/context.v1.json |
- After
portkey_create_wallet/portkey_import_wallet, this skill auto-updates shared active wallet context. - Other write-capable skills can resolve signer by
explicit -> active context -> env(auto mode). - No plaintext private key is written to the shared context file.
bun run src/mcp/server.tsOr add to your MCP client config (see mcp-config.example.json):
{
"mcpServers": {
"portkey-eoa-agent-skills": {
"command": "bun",
"args": ["run", "/path/to/src/mcp/server.ts"],
"env": {
"PORTKEY_NETWORK": "mainnet",
"PORTKEY_WALLET_PASSWORD": "your_password"
}
}
}
}# Local development install
ironclaw tool install ./artifacts/ironclaw/portkey-eoa-ironclaw.wasmNative-wasm notes:
- The EOA native tool lives in
ironclaw-wasm/and is published as GitHub Release assets. - The primary release payload is a versioned
.tar.gzbundle that contains exactlyportkey-eoa-ironclaw.wasmandportkey-eoa-ironclaw.capabilities.json. - Current native-wasm state is isolated from the Bun/MCP wallet store.
- The current experimental build implements the full 23-action EOA surface in isolated native-wasm state, including wallet lifecycle, asset queries, contract calls, transfers, approvals, fee estimation, and eBridge flows.
- The native chain layer is now backed by
aelf-web3.rust@0.1.0-alpha.1instead of the earlier hand-rolled AElf transaction helpers. - Chain write actions currently use submit-plus-immediate-status-check semantics in native-wasm; mined-state parity with the Bun runtime still needs real IronClaw validation.
- IronClaw runtime delivery is wasm-only in this rollout.
- The native tool uses IronClaw-native capabilities and a
portkey-eoa/workspace namespace. - Native wallet lifecycle actions require an explicit
password. - Native-wasm keeps the same public wallet action contracts as JS/MCP and adds keystore-backed
walletExport(portkey-eoa-export-v2) for native recovery. - Compatible wallet actions can still return mnemonic/privateKey fields; treat them as one-time tool output and do not repeat them in conversational summaries.
- ClawHub should be treated as discovery / install-shell only, not the final write-capable runtime for this skill.
Remote activation contract:
- GitHub repo/tree URLs are discovery sources only, not the final IronClaw install payload.
- Preferred IronClaw activation is the GitHub Release bundle URL: download the versioned
.tar.gzasset and import it through IronClaw's WASM extension flow. - Local smoke tests can use the staged bare artifact at
./artifacts/ironclaw/portkey-eoa-ironclaw.wasm. - Preferred ClawHub role is discovery / install-shell that routes users to the native-wasm artifact.
- Prefer ClawHub / managed install for OpenClaw when available; otherwise use
bunx -p @portkey/eoa-agent-skills portkey-setup openclawwith Bun or a managed runtime that provides Bun. - Local repo checkout remains a development smoke-test path only after
bun install. - Copying raw source into
~/.codex/skills/portkey-eoawithout dependency installation is not a supported runtime path.
# Wallet
bun run portkey_eoa_skill.ts wallet create --password mypass
bun run portkey_eoa_skill.ts wallet list
bun run portkey_eoa_skill.ts wallet import --mnemonic "word1 word2 ..." --password mypass
# Queries
bun run portkey_eoa_skill.ts query tokens --address YOUR_ADDRESS
bun run portkey_eoa_skill.ts query balance --address YOUR_ADDRESS --symbol ELF --chain-id AELF
bun run portkey_eoa_skill.ts query price --symbols ELF,USDT
bun run portkey_eoa_skill.ts query history --address YOUR_ADDRESS
bun run portkey_eoa_skill.ts query chains
# Transfer
bun run portkey_eoa_skill.ts transfer --to RECIPIENT --symbol ELF --amount 100000000 --chain-id AELF
# Contract
bun run portkey_eoa_skill.ts contract view --contract-address ADDR --method GetBalance --params '{"symbol":"ELF","owner":"..."}' --chain-id AELF
bun run portkey_eoa_skill.ts contract send --contract-address ADDR --method Approve --params '{"symbol":"ELF","spender":"...","amount":"100000000"}' --chain-id AELF --address YOUR_ADDRESS --password mypassChoose the contract tool by method type:
portkey_call_view_method/ CLIcontract vieware forGet*and other read-only methods.portkey_call_send_method/ CLIcontract sendare for state-changing methods only.- For
Empty-input view methods such asGetConfig, omit--paramsentirely so the read call stays argument-free. - Do not call
GetConfig,GetPairQueueStatus, or other resonanceGet*methods through the send path. A send receipt cannot replace a direct view response.
Resonance examples:
# Read-only queue status lookup
bun run portkey_eoa_skill.ts contract view \
--contract-address 28Lot71VrWm1WxrEjuDqaepywi7gYyZwHysUcztjkHGFsPPrZy \
--method GetPairQueueStatus \
--params '"<address>"' \
--chain-id tDVV
# State-changing queue join
bun run portkey_eoa_skill.ts contract send \
--contract-address 28Lot71VrWm1WxrEjuDqaepywi7gYyZwHysUcztjkHGFsPPrZy \
--method JoinPairQueue \
--params '{}' \
--chain-id tDVV \
--address YOUR_ADDRESS \
--password mypassimport { getConfig, createWallet, getTokenList, transfer } from '@portkey/eoa-agent-skills';
const config = getConfig('mainnet');
// Create wallet
const wallet = await createWallet(config, { password: 'mypass' });
console.log('Address:', wallet.address);
// Query tokens
const tokens = await getTokenList(config, { address: wallet.address });
console.log('Tokens:', tokens.data);
// Transfer
const result = await transfer(config, {
privateKey: 'YOUR_PRIVATE_KEY',
to: 'RECIPIENT_ADDRESS',
symbol: 'ELF',
amount: '100000000',
chainId: 'AELF',
});
console.log('TX:', result.transactionId);Chain list discovery remains CLI/SDK only via bun run portkey_eoa_skill.ts query chains or getChainInfo(). It is intentionally not exposed as an MCP tool in this package.
portkey_create_wallet— Create new wallet with encrypted local storageportkey_import_wallet— Import from mnemonic, private key, or encryptedwalletExportportkey_get_wallet_info— View wallet public infoportkey_list_wallets— List all local walletsportkey_backup_wallet— Export compatible mnemonic/privateKey fields and additive encryptedwalletExportportkey_delete_wallet— Delete a local wallet (requires password)portkey_get_active_wallet— Read shared active wallet contextportkey_set_active_wallet— Set shared active wallet context manually
portkey_get_token_list— Token portfolio with balancesportkey_get_token_balance— Single token balanceportkey_get_token_prices— Token USD pricesportkey_get_nft_collections— NFT collection listportkey_get_nft_items— NFT items in collectionportkey_get_transaction_history— Transaction historyportkey_get_transaction_detail— Single transaction detail
portkey_transfer— Same-chain token transferportkey_cross_chain_transfer— Cross-chain aelf transfer
portkey_approve— Token spending approvalportkey_call_view_method— Generic contract read (Get*/ read-only only)portkey_call_send_method— Generic contract write (state-changing only)portkey_estimate_fee— Transaction fee estimation
portkey_ebridge_transfer— eBridge cross-chain transferportkey_ebridge_info— eBridge limits and fees
index.ts (SDK) ─┐
server.ts (MCP) ─┼─> src/core/ ──> lib/
portkey_eoa_skill.ts (CLI) ─┘ (pure logic) (infra)
Three adapters call the same core functions — zero duplicated logic.
bun test # All tests
bun test tests/unit/ # Unit tests
bun run tests/e2e/mcp-verify.ts # MCP verificationAfter you install IronClaw locally, run this minimal verification:
bun run ironclaw:wasm:buildbun run ironclaw:wasm:bundleironclaw tool install ./artifacts/ironclaw/portkey-eoa-ironclaw.wasm- Start IronClaw and ask for a read-only action such as "check ELF balance" or "show token prices"
- Verify ClawHub / installed-skill discovery does not claim direct write-capable runtime access
- elliptic <= 6.6.1:
aelf-sdkhas a transitive dependency onellipticwith a known low-severity vulnerability. This is an upstream issue — tracked for resolution whenaelf-sdkupdates its dependency.
MIT