Create a swap
create_swapCreate the swap and get the deposit address. No funds move here: the user then sends amount_from of from_asset to deposit_address (with deposit_extra_id as the memo, when present), as instructions says. Follow it with get_swap.
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": {
"from_asset": "<from_asset>",
"to_asset": "<to_asset>",
"address": "<address>"
},
"name": "create_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | The user's email, when the chosen quote has email_required. | ||
| amount | No | Amount of from_asset the user sends. Pass this or amount_to. | |
| address | Yes | The user's payout address for to_asset, as they gave it. | |
| rate_id | No | The chosen quote's rate_id (fixed rate). | |
| extra_id | No | Memo/tag for the payout address, if the user's wallet needs one (XRP, XLM...). | |
| provider | No | The chosen quote's provider. Without it: the best quote now, then the next best, among exchanges without a notice. | |
| to_asset | Yes | Asset the user receives. | |
| amount_to | No | Exact amount of to_asset to receive, instead of amount (fixed rate only): the result's amount_from is what the user must send. | |
| rate_type | No | 'float' or 'fixed'. Default float, or fixed with amount_to. | |
| from_asset | Yes | Asset the user sends. | |
| to_network | No | Network of to_asset, when its ticker is on several. | |
| from_network | No | Network of from_asset, when its ticker is on several. | |
| refund_address | No | The user's from_asset address, for a refund if the swap fails. | |
| idempotency_key | No | A UUID made once per swap. A retry with the same one and the same arguments returns the swap already made. | |
| refund_extra_id | No | Memo/tag for the refund address. |