Unsigned swap transaction (nothing is signed or sent)
build_swap_transactionBuild an unsigned Cardano swap transaction for a wallet that signs for itself, through the DexHunter aggregator. Returns the transaction as CBOR hex with its hash, what it does (network fee, validity, every output with address, ADA and tokens, and which outputs return to the wallet), the expected and the minimum amount received, the fees (DEX batcher, aggregator and partner fee, network fee, all in ADA), what the trade costs worked out from the transaction itself next to what the aggregator states (cost, with a warning when the transaction takes more), and the steps to sign and submit it. Fees are fixed ADA amounts, so a small trade can cost a large share of itself. Realtap never signs, holds keys or submits: nothing happens until the owner of address signs the transaction and sends it. Call it only when that owner asked for this trade, and check the token with get_token first (liquidity, safety). Limited to a few calls per minute.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of tokenIn to sell, decimal-adjusted (100 = 100 ADA when tokenIn is ADA). | |
| address | Yes | Mainnet payment address (addr1…) of the wallet that will sign: its UTxOs are spent and it receives the result. | |
| tokenIn | Yes | What is sold: a token unit, or "lovelace" / "ADA" for ADA. | |
| tokenOut | Yes | What is bought: a token unit, or "lovelace" / "ADA" for ADA. | |
| slippagePct | No | How far the price may move against the trade before the order must not execute, in percent (1 = 1 %). |