Loading...
Loading...
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 skill4agent add 6551team/opentrade opentrade-walletIMPORTANT: 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.
.envOPEN_TOKEN=your_token_hereBASE_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/open/trader/custodial/create" \
-H "$AUTH_HEADER" -H "Content-Type: application/json"
# 2. Get custodial account addresses
curl -s "$BASE_URL/open/trader/custodial/account" \
-H "$AUTH_HEADER"
# 3. Custodial swap (auto-sign + broadcast)
curl -s -X POST "$BASE_URL/open/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/open/trader/custodial/withdraw" \
-H "$AUTH_HEADER" -H "Content-Type: application/json" \
-d '{"network":"bsc","to":"0xRecipientAddress","amount":1000000000000000000}'| # | Endpoint | Method | Description |
|---|---|---|---|
| 1 | | POST | 创建托管钱包(同时生成 EVM 和 Solana 地址) |
| 2 | | GET | 获取托管钱包地址 |
| 3 | | POST | 托管钱包执行 DEX swap(自动签名+广播) |
| 4 | | POST | 从托管钱包提现原生代币(BSC/SOL) |
Custodial wallet only supports BSC and Solana.
| Chain | chainIndex | Native Token | Withdraw Network |
|---|---|---|---|
| BSC | | BNB | |
| Solana | | SOL | |
User: "Create a custodial wallet and swap 1 BNB for USDT"
1. opentrade-wallet POST /open/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 /open/trader/custodial/swap
{"chainIndex":"56","fromTokenAddress":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress":"0x55d398326f99059fF775485246999027B3197955",
"amount":"1000000000000000000","slippagePercent":"1"}
→ returns tx_hashevm_address--addressUser: "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 /open/trader/custodial/swap
→ auto-sign and broadcast, returns tx_hashUser: "Swap BNB to USDT, then withdraw BNB to my external wallet"
1. opentrade-wallet POST /open/trader/custodial/swap → swap tokens
2. opentrade-wallet POST /open/trader/custodial/withdraw
{"network":"bsc","to":"0xExternalWallet","amount":1000000000000000000}
→ returns tx_hashPOST /open/trader/custodial/createGET /open/trader/custodial/accountPOST /open/trader/custodial/swapPOST /open/trader/custodial/withdrawGET /open/trader/custodial/accountPOST /open/trader/custodial/createopentrade-tokenbscsol| 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 → |
| Account queried | 1. Check balance → |
| Swap executed | 1. Check updated balance → |
| Withdraw completed | 1. Check remaining balance → |
curl -s -X POST "$BASE_URL/open/trader/custodial/create" \
-H "$AUTH_HEADER" \
-H "Content-Type: application/json"{
"success": true,
"data": {
"evm_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"sol_address": "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV"
}
}| Field | Type | Description |
|---|---|---|
| String | BSC 链地址 |
| String | Solana 链地址 |
curl -s "$BASE_URL/open/trader/custodial/account" \
-H "$AUTH_HEADER"{
"success": true,
"data": {
"evm_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"sol_address": "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV"
}
}| Field | Type | Description |
|---|---|---|
| String | BSC 链地址 |
| String | Solana 链地址 |
curl -s -X POST "$BASE_URL/open/trader/custodial/swap" \
-H "$AUTH_HEADER" \
-H "Content-Type: application/json" \
-d '{
"chainIndex": "56",
"fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"toTokenAddress": "0x55d398326f99059fF775485246999027B3197955",
"amount": "1000000000000000000",
"slippagePercent": "1"
}'| Field | Type | Required | Description |
|---|---|---|---|
| String | Yes | 链 ID: |
| String | Yes | 源代币合约地址 |
| String | Yes | 目标代币合约地址 |
| String | Yes | 交易数量(最小单位) |
| String | No | 滑点百分比(默认 |
{
"success": true,
"data": {
"tx_hash": "0xabc123def456...",
"error": ""
}
}| Field | Type | Description |
|---|---|---|
| String | 交易哈希(成功时返回) |
| String | 错误信息(失败时返回) |
errorcurl -s -X POST "$BASE_URL/open/trader/custodial/withdraw" \
-H "$AUTH_HEADER" \
-H "Content-Type: application/json" \
-d '{
"network": "bsc",
"to": "0xRecipientAddress",
"amount": 1000000000000000000
}'| Field | Type | Required | Description |
|---|---|---|---|
| String | Yes | 网络类型: |
| String | Yes | 接收地址 |
| Integer | Yes | 提现数量(最小单位,必须大于 0)。BSC 单位为 wei(1 BNB = 10^18 wei),Solana 单位为 lamports(1 SOL = 10^9 lamports) |
{
"success": true,
"data": {
"tx_hash": "0xdef789...",
"network": "bsc"
}
}| Field | Type | Description |
|---|---|---|
| String | 提现交易哈希 |
| String | 执行提现的网络 |
| Chain | Native Token Address |
|---|---|
| BSC | |
| Solana | |
curl -s -X POST "$BASE_URL/open/trader/custodial/create" -H "$AUTH_HEADER" -H "Content-Type: application/json"
# → Wallet created! BSC: 0x742d..., Solana: 7EcD...# Amount: 0.1 BNB = 100000000000000000 wei
curl -s -X POST "$BASE_URL/open/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...# Amount: 1 SOL = 1000000000 lamports
curl -s -X POST "$BASE_URL/open/trader/custodial/withdraw" \
-H "$AUTH_HEADER" -H "Content-Type: application/json" \
-d '{"network":"sol","to":"ExternalSolanaAddress","amount":1000000000}'
# → Withdrawal successful! Tx Hash: 5xYz...POST /open/trader/custodial/createGET /open/trader/custodial/accountopentrade-dex-swapopentrade-gatewayopentrade-portfoliobscsolamountService is not available in your region. Please switch to a supported region and try again.0.1 BNB50 USDT1 BNB"1000000000000000000"1 SOL1000000000Authorization: Bearer <token>