From 38f371872b13fe0300e07c140224a053d5056d70 Mon Sep 17 00:00:00 2001 From: Dominik Toton Date: Fri, 17 May 2024 14:25:16 +0200 Subject: [PATCH] docs: improve transaction bulder docs --- .../lib/src/builders/transaction_builder.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/catalyst_voices_packages/catalyst_cardano_serialization/lib/src/builders/transaction_builder.dart b/catalyst_voices_packages/catalyst_cardano_serialization/lib/src/builders/transaction_builder.dart index 9666cc7f72..d86993bb76 100644 --- a/catalyst_voices_packages/catalyst_cardano_serialization/lib/src/builders/transaction_builder.dart +++ b/catalyst_voices_packages/catalyst_cardano_serialization/lib/src/builders/transaction_builder.dart @@ -11,6 +11,11 @@ import 'package:catalyst_cardano_serialization/src/witness.dart'; import 'package:cbor/cbor.dart'; /// A builder which helps to create the [TransactionBody]. +/// +/// The class collects the [inputs], [outputs], calculates the [fee] +/// and adds a change address if some UTXOs are not fully spent. +/// +/// Algorithms inspired by [cardano-multiplatform-lib](https://github.com/dcSpark/cardano-multiplatform-lib/blob/255500b3c683618849fb38107896170ea09c95dc/chain/rust/src/builders/tx_builder.rs#L380) implementation. class TransactionBuilder { /// Contains the protocol parameters for Cardano blockchain. final TransactionBuilderConfig config; @@ -28,6 +33,9 @@ class TransactionBuilder { /// The amount of lovelaces that will be charged as the fee /// for adding the transaction to the blockchain. + /// + /// If left null then it will be auto calculated, + /// set explicitly with [withFee] to specify a custom fee. final Coin? fee; /// The absolute slot value before the tx becomes invalid.