Prepare Own Wallet Swap
prepare_own_wallet_swapSwap any token for any token from the caller's OWN wallet: returns the exact unsigned transaction (EVM tx dict or base64 Solana tx) for that wallet to sign and broadcast. Non-custodial — no key leaves the user, nothing is held, no ledger, no identity step; the wallet is the account. Chains: GET /api/v1/swap/chains; tokens: GET /api/v1/swap/tokens/{chain_id} (Solana is chain_id 501). Platform fee: GET /api/v1/promo/status (0% while the promo runs); the user pays chain gas. Tickers (USDC, ETH, SOL) or contract/mint addresses are accepted. When an ERC-20 sell needs allowance, approval carries the exact approve tx to sign first. Optionally record the signed tx in swap history with POST /api/v1/swap/broadcast (X-API-Key).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chain_id": "<chain_id>",
"sell_token": "<sell_token>",
"buy_token": "<buy_token>",
"sell_amount": "<sell_amount>",
"wallet_address": "<wallet_address>"
},
"name": "prepare_own_wallet_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain_id | Yes | Chain id (1 Ethereum, 8453 Base, 56 BNB, 137 Polygon, 42161 Arbitrum, 10 Optimism, 43114 Avalanche, 501 Solana) | |
| buy_token | Yes | Token to buy: symbol or contract/mint address | |
| sell_token | Yes | Token to sell: symbol or contract/mint address | |
| sell_amount | Yes | Amount of sell_token in whole units (e.g. "25") | |
| slippage_bps | No | Max slippage in basis points (1-5000) | |
| wallet_address | Yes | The user's OWN wallet address that will sign (0x… on EVM, base58 on Solana) |