Balance¶
::: {.module}
Cardano.Node.Client.Balance
:::
Iterative exact-fee transaction balancing for Conway-era transactions.
balanceTx
:: PParams ConwayEra
-> [(TxIn, TxOut ConwayEra)]
-> Addr
-> Tx ConwayEra
-> Either BalanceError (Tx ConwayEra)
Algorithm¶
- Collect all input UTxOs and compute total available ADA
- Start with fee = 0
- Build candidate transaction with change output
- Compute exact fee via
getMinFeeTx - Add 106-byte VKey witness padding using
ppMinFeeAL - If new fee > current fee, repeat from step 3
- Converges in at most 10 rounds
Errors¶
Limitations¶
- ADA-only fee inputs (no multi-asset coin selection)
- Single key witness assumed
- Callers must construct script inputs separately