Agent flow
An AI agent quotes and opens a Canton Coin order
The agent prices the swap and opens the order. The user pays from their own wallet. The agent never holds the funds, and it does not send them.
Steps
- Ask the user for the asset to send, the amount, and their Canton party ID.
- Check the symbol and network with list_assets.
- Price the swap with get_quote and rateType float. Show amountOut and any warning.
- Show the plan: asset, amount, the amount the user receives, and the party ID. Get a yes.
- Open the order with create_order. Pass the user's party ID as destination.
- Show the user depositAddress, the exact amountIn, the network and depositDeadline. Give them status_link.
- The user sends from their own wallet. The agent does not send.
- Check get_order_status until the state is final. Report the state in plain words.
The calls
list_assets { "query": "USDT" }
get_quote { "direction": "in", "from": "USDT", "amount": "100", "rateType": "float" }
create_order { "direction": "in", "from": "USDT", "amount": "100", "rateType": "float",
"destination": "<user Canton party ID>" }
get_order_status { "order_id": "<claimToken from create_order>" }Rules for the agent
- Amounts are decimal strings, such as “100” or “12.5”. Never a float.
- Get CC needs refundAddress only when get_quote says needsRefundAddress. refundParty is for Withdraw CC.
- If the deposit window closes with nothing received, say so. Do not tell the user to send.
- The minimum is $3 USD equivalent. A smaller amount fails with code below_minimum. Partner routes can set a higher minimum.
- There is no sandbox. Do not open an order to test a flow.
Withdraw CC
To send CC out, set direction to out, give to (the asset), amount (in CC) and destination (an address on that chain). Add refundParty, the user’s own Canton party. The user sends CC to the order’s own deposit address, with no memo. The full field list is in the API reference.
The state list, with what the agent should say for each one, is in skill.md.