skills/opentrade/opentrade-wallet/SKILL.md
This skill should be used when the user asks to 'create a custodial wallet', 'create a managed wallet', 'get my wallet address', 'show my custodial account', 'custodial swap', 'swap with managed wallet', 'withdraw from custodial wallet', 'withdraw BNB', 'withdraw SOL', 'send native tokens from custodial wallet', or mentions creating, managing, swapping, or withdrawing with a custodial (managed/hosted) wallet. Only supports BSC and Solana networks. Do NOT use for non-custodial wallet operations, general balance queries (use opentrade-portfolio), or swap quotes without custodial execution (use opentrade-dex-swap).
npx skillsauth add 6551team/openskills opentrade-walletInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
4 API endpoints for custodial wallet creation, account query, swap execution, and native token withdrawal.
IMPORTANT: Custodial wallet only supports BSC and Solana networks.
IMPORTANT: Newly created wallets have zero balance. You must deposit BNB (to the BSC address) or SOL (to the Solana address) before you can swap or withdraw. Do NOT send tokens from other chains (e.g., Ethereum, Polygon, Arbitrum) to these addresses — funds sent from unsupported chains will be lost.
Every time before running any custodial wallet command, always follow these steps in order:
.env file in the project root to load the API credentials:OPEN_TOKEN=your_token_here
Get your API token at: https://6551.io/mcp
Security warning: Never commit .env to git (add it to .gitignore) and never expose credentials in logs, screenshots, or chat messages.
BASE_URL="https://ai.6551.io"
AUTH_HEADER="Authorization: Bearer $OPEN_TOKEN"
opentrade-dex-swapopentrade-tokenopentrade-marketopentrade-portfolioopentrade-gatewayopentrade-wallet)# 1. Create a custodial wallet (EVM + Solana)
curl -s -X POST "$BASE_URL/trader/custodial/create" \
-H "$AUTH_HEADER" -H "Content-Type: application/json"
# 2. Get custodial account addresses
curl -s "$BASE_URL/trader/custodial/account" \
-H "$AUTH_HEADER"
# 3. Custodial swap (auto-sign + broadcast)
curl -s -X POST "$BASE_URL/trader/custodial/swap" \
-H "$AUTH_HEADER" -H "Content-Type: application/json" \
-d '{"chainIndex":"56","fromTokenAddress":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","toTokenAddress":"0x55d398326f99059fF775485246999027B3197955","amount":"1000000000000000000","slippagePercent":"1"}'
# 4. Withdraw native tokens
curl -s -X POST "$BASE_URL/trader/custodial/withdraw" \
-H "$AUTH_HEADER" -H "Content-Type: application/json" \
-d '{"network":"bsc","to":"0xRecipientAddress","amount":1000000000000000000}'
| # | Endpoint | Method | Description |
|---|---|---|---|
| 1 | /trader/custodial/create | POST | 创建托管钱包(同时生成 EVM 和 Solana 地址) |
| 2 | /trader/custodial/account | GET | 获取托管钱包地址 |
| 3 | /trader/custodial/swap | POST | 托管钱包执行 DEX swap(自动签名+广播) |
| 4 | /trader/custodial/withdraw | POST | 从托管钱包提现原生代币(BSC/SOL) |
Custodial wallet only supports BSC and Solana.
| Chain | chainIndex | Native Token | Withdraw Network |
|---|---|---|---|
| BSC | 56 | BNB | bsc |
| Solana | 501 | SOL | sol |
User: "Create a custodial wallet and swap 1 BNB for USDT"
1. opentrade-wallet POST /trader/custodial/create → get evm_address, sol_address
→ Tell user to deposit BNB (BSC) or SOL (Solana) to the new address
→ WARNING: only accept BNB/SOL, do NOT send other chain assets
2. opentrade-portfolio opentrade portfolio all-balances --address <evm_address> --chains bsc
→ verify BNB balance >= 1 (user must have deposited first)
3. opentrade-wallet POST /trader/custodial/swap
{"chainIndex":"56","fromTokenAddress":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress":"0x55d398326f99059fF775485246999027B3197955",
"amount":"1000000000000000000","slippagePercent":"1"}
→ returns tx_hash
Data handoff:
evm_address from step 1 → --address in step 2User: "Get a quote for swapping BNB to USDT, then execute with custodial wallet"
1. opentrade-dex-swap opentrade swap quote \
--from 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee \
--to 0x55d398326f99059fF775485246999027B3197955 \
--amount 1000000000000000000 --chain bsc
→ display quote: expected output, price impact
↓ user confirms
2. opentrade-wallet POST /trader/custodial/swap
→ auto-sign and broadcast, returns tx_hash
User: "Swap BNB to USDT, then withdraw BNB to my external wallet"
1. opentrade-wallet POST /trader/custodial/swap → swap tokens
2. opentrade-wallet POST /trader/custodial/withdraw
{"network":"bsc","to":"0xExternalWallet","amount":1000000000000000000}
→ returns tx_hash
Note: Withdraw only supports native tokens (BNB on BSC, SOL on Solana).
POST /trader/custodial/createGET /trader/custodial/accountPOST /trader/custodial/swapPOST /trader/custodial/withdrawGET /trader/custodial/account first, or create one with POST /trader/custodial/createopentrade-token to search token by namebsc or sol supported| Just completed | Suggest |
|---|---|
| Wallet created | 1. Deposit BNB (BSC) or SOL (Solana) to the new address — do NOT send other chain assets 2. Check balance → opentrade-portfolio |
| Account queried | 1. Check balance → opentrade-portfolio 2. Execute a swap → custodial swap (this skill) |
| Swap executed | 1. Check updated balance → opentrade-portfolio 2. Withdraw to external wallet → custodial withdraw (this skill) |
| Withdraw completed | 1. Check remaining balance → opentrade-portfolio 2. Swap another token → custodial swap (this skill) |
Present conversationally — never expose endpoint paths to the user.
创建托管钱包,同时生成 EVM(BSC)和 Solana 地址。每个用户只能创建一个钱包。
curl -s -X POST "$BASE_URL/trader/custodial/create" \
-H "$AUTH_HEADER" \
-H "Content-Type: application/json"
Parameters: None (user identity from JWT token)
Response:
{
"success": true,
"data": {
"evm_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"sol_address": "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV"
}
}
Return fields:
| Field | Type | Description |
|---|---|---|
| evm_address | String | BSC 链地址 |
| sol_address | String | Solana 链地址 |
Display to user:
获取当前用户的托管钱包地址。
curl -s "$BASE_URL/trader/custodial/account" \
-H "$AUTH_HEADER"
Parameters: None
Response:
{
"success": true,
"data": {
"evm_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"sol_address": "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV"
}
}
Return fields:
| Field | Type | Description |
|---|---|---|
| evm_address | String | BSC 链地址 |
| sol_address | String | Solana 链地址 |
使用托管钱包执行 DEX swap。服务端自动完成签名和广播。仅支持 BSC(chainIndex: 56)和 Solana(chainIndex: 501)。
curl -s -X POST "$BASE_URL/trader/custodial/swap" \
-H "$AUTH_HEADER" \
-H "Content-Type: application/json" \
-d '{
"chainIndex": "56",
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0x55d398326f99059fF775485246999027B3197955",
"amount": "1000000000000000000",
"slippagePercent": "1"
}'
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
| chainIndex | String | Yes | 链 ID:"56"(BSC)或 "501"(Solana) |
| fromTokenAddress | String | Yes | 源代币合约地址 |
| toTokenAddress | String | Yes | 目标代币合约地址 |
| amount | String | Yes | 交易数量(最小单位) |
| slippagePercent | String | No | 滑点百分比(默认 "1",即 1%) |
Response:
{
"success": true,
"data": {
"tx_hash": "0xabc123def456...",
"error": ""
}
}
Return fields:
| Field | Type | Description |
|---|---|---|
| tx_hash | String | 交易哈希(成功时返回) |
| error | String | 错误信息(失败时返回) |
Display to user:
error is non-empty, display the error message从托管钱包提现原生代币。仅支持 BSC (BNB) 和 Solana (SOL)。
curl -s -X POST "$BASE_URL/trader/custodial/withdraw" \
-H "$AUTH_HEADER" \
-H "Content-Type: application/json" \
-d '{
"network": "bsc",
"to": "0xRecipientAddress",
"amount": 1000000000000000000
}'
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
| network | String | Yes | 网络类型:bsc 或 sol |
| to | String | Yes | 接收地址 |
| amount | Integer | Yes | 提现数量(最小单位,必须大于 0)。BSC 单位为 wei(1 BNB = 10^18 wei),Solana 单位为 lamports(1 SOL = 10^9 lamports) |
Response:
{
"success": true,
"data": {
"tx_hash": "0xdef789...",
"network": "bsc"
}
}
Return fields:
| Field | Type | Description |
|---|---|---|
| tx_hash | String | 提现交易哈希 |
| network | String | 执行提现的网络 |
Display to user:
| Chain | Native Token Address |
|---|---|
| BSC | 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
| Solana | 11111111111111111111111111111111 |
User says: "Create a custodial wallet for me"
curl -s -X POST "$BASE_URL/trader/custodial/create" -H "$AUTH_HEADER" -H "Content-Type: application/json"
# → Wallet created! BSC: 0x742d..., Solana: 7EcD...
User says: "Swap 0.1 BNB for USDT on BSC using my custodial wallet"
# Amount: 0.1 BNB = 100000000000000000 wei
curl -s -X POST "$BASE_URL/trader/custodial/swap" \
-H "$AUTH_HEADER" -H "Content-Type: application/json" \
-d '{"chainIndex":"56","fromTokenAddress":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","toTokenAddress":"0x55d398326f99059fF775485246999027B3197955","amount":"100000000000000000","slippagePercent":"1"}'
# → Swap executed! Tx Hash: 0xabc...
User says: "Withdraw 1 SOL to my external wallet"
# Amount: 1 SOL = 1000000000 lamports
curl -s -X POST "$BASE_URL/trader/custodial/withdraw" \
-H "$AUTH_HEADER" -H "Content-Type: application/json" \
-d '{"network":"sol","to":"ExternalSolanaAddress","amount":1000000000}'
# → Withdrawal successful! Tx Hash: 5xYz...
POST /trader/custodial/create will return an error if the user already has a wallet. Use GET /trader/custodial/account to retrieve existing addresses.opentrade-dex-swap + opentrade-gateway.opentrade-portfolio first.bsc and sol are supported for withdraw.amount field for withdraw must be greater than 0.Service is not available in your region. Please switch to a supported region and try again.0.1 BNB, 50 USDT)1 BNB = "1000000000000000000", 1 SOL = 1000000000)Authorization: Bearer <token> headerdevelopment
Twitter/X data via the 6551 API. Supports user profiles, tweet search, user tweets, follower events, deleted tweets, and KOL followers.
development
This skill should be used when the user asks to 'find a token', 'search for a token', 'look up PEPE', 'what's trending', 'top tokens', 'trending tokens on Solana', 'token rankings', 'who holds this token', 'holder distribution', 'token market cap', 'token liquidity', 'research a token', 'tell me about this token', 'token info', or mentions searching for tokens by name or address, discovering trending tokens, viewing token rankings, checking holder distribution, or analyzing token market cap and liquidity. Covers token search, metadata, market cap, liquidity, volume, trending token rankings, and holder analysis across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, and 20+ other chains. Do NOT use when the user says only a single generic word like 'tokens' or 'crypto' without specifying a token name, action, or question. For simple current price checks, price charts, candlestick data, or trade history, use opentrade-market instead. For meme token safety analysis, developer reputation, rug pull checks, bundle/sniper detection, or finding tokens by same creator, use opentrade-market instead.
development
This skill should be used when the user asks to 'check my wallet balance', 'show my token holdings', 'how much OKB do I have', 'what tokens do I have', 'check my portfolio value', 'view my assets', 'how much is my portfolio worth', 'what\'s in my wallet', or mentions checking wallet balance, total assets, token holdings, portfolio value, remaining funds, DeFi positions, or multi-chain balance lookup. Supports XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, and 20+ other chains. Do NOT use for general programming questions about balance variables or API documentation. Do NOT use when the user is asking how to build or integrate a balance feature into code.
testing
This skill should be used when the user asks to 'place a CEX order', 'trade on centralized exchange', 'buy BTC on CEX', 'sell ETH futures', 'open a long position', 'open a short position', 'close my position', 'set leverage', 'check my CEX balance', 'show my open orders', 'cancel my order', 'check CEX ticker', 'get K-line data', 'set margin mode', 'check my CEX positions', 'view trade history', 'manage wallet agent', or mentions CEX trading, futures, contracts, leverage, margin, limit orders, market orders, stop-loss, take-profit, or newsliquid. This is for centralized exchange operations only. Do NOT use for DEX swaps (use opentrade-dex-swap), on-chain balances (use opentrade-portfolio), on-chain market data (use opentrade-market), token search (use opentrade-token), custodial wallet (use opentrade-wallet), or transaction broadcasting (use opentrade-gateway).