Constructs a new instance of the TxBuilder class. Initializes a new transaction body with an empty set of inputs, outputs, and no fee.
Optional
tracing: booleanReturns the burn address.
Returns the number of transaction outputs in the current transaction body.
The number of transaction outputs.
The additional signers field is used to add additional signing counts for fee calculation. These will be included in the signing phase at a later stage. This is needed due to native scripts signees being non-deterministic.
The amount of additional signers
The same transaction builder
Adds an input to the transaction. This method is responsible for including a new input, which represents a reference to an unspent transaction output (UTxO) that will be consumed by the transaction. Optionally, a redeemer and an unhashed datum can be provided for script validation purposes.
The UTxO to be consumed as an input.
Optional
redeemer: PlutusDataOptional. The redeemer data for script validation, required for spending Plutus script-locked UTxOs.
Optional
unhashDatum: PlutusDataOptional. The unhashed datum, required if the UTxO being spent includes a datum hash instead of inline datum.
The same transaction builder
Adds minting information to the transaction. This includes specifying the policy under which assets are minted, the assets to be minted, and an optional redeemer for Plutus scripts.
The policy ID under which the assets are minted.
A map of asset names to the amounts being minted.
Optional
redeemer: PlutusDataOptional. A redeemer to be used if the minting policy requires Plutus script validation.
Adds a transaction output to the current transaction body. This method also ensures that the minimum ada requirements are met for the output. After adding the output, it updates the transaction body's outputs. It also checks if the output value exceeds the maximum value size.
The transaction output to be added.
The same transaction builder
Adds a pre-complete hook to the transaction builder. This hook will be executed before the transaction is finalized.
Pre-complete hooks are useful for performing last-minute modifications or validations on the transaction before it's completed. Multiple hooks can be added, and they will be executed in the order they were added.
The same transaction builder instance for method chaining.
Adds a reference input to the transaction. Reference inputs are used to refer to outputs from previous transactions without spending them, allowing scripts to read their data. This can be useful for various contract logic, such as checking the state of a datum without consuming the UTxO that holds it.
The unspent transaction output to add as a reference input.
The same transaction builder
Adds a required signer to the transaction. This is necessary for transactions that must be explicitly signed by a particular key.
The hash of the Ed25519 public key that is required to sign the transaction.
The same transaction builder
Adds unspent transaction outputs (UTxOs) to the set of UTxOs available for this transaction. These UTxOs can then be used for balancing the transaction, ensuring that inputs and outputs are equal.
The unspent transaction outputs to add.
The same transaction builder
Adds a withdrawal to the transaction. This method allows for the withdrawal of funds from a staking reward account. Optionally, a redeemer can be provided for script validation purposes.
The reward account from which to withdraw.
The amount of ADA to withdraw.
Optional
redeemer: PlutusDataOptional. The redeemer data for script validation.
The same transaction builder
Completes the transaction by performing several key operations:
Optional
__namedParameters: UseCoinSelectionArgsA new Transaction object with all components set and ready for submission.
Deploys a script by creating a new UTxO with the script as its reference.
The script to be deployed.
Optional
address: AddressThe address to lock the script to. Defaults to a burn address where the UTxO will be unspendable.
The same transaction builder.
Locks a specified amount of assets to a script. The difference between 'pay' and 'lock' is that you pay to a public key/user, and you lock at a script. This method ensures that the address is valid and the assets are locked to the script.
The same transaction builder
Locks a specified amount of lovelace to a script. The difference between 'pay' and 'lock' is that you pay to a public key/user, and you lock at a script. This method ensures that the address is valid and the lovelace is locked to the script.
The same transaction builder
Adds unspent transaction outputs (UTxOs) to the set of collateral UTxOs available for this transaction. These UTxOs can then be used to provide collateral for the transaction, if necessary. If provided, they will b If there are specific, valid collateral UTxOs provided, Blaze will use them before using any other UTxO.
the UTxOs to add as collateral
The same transaction builder
Adds a Plutus datum to the transaction. This datum is not directly associated with any particular output but may be used by scripts during transaction validation. This method is useful for including additional information that scripts may need to validate the transaction without requiring it to be attached to a specific output.
The Plutus datum to be added to the transaction.
The same transaction builder
Adds a script to the transaction's script scope. If the script is already provided via a reference script, it will not be explicitly used again. This method ensures that each script is only included once in the transaction, either directly or by reference, to optimize the transaction size and processing.
The script to be added to the transaction's script scope.
The same transaction builder
Sets the change address for the transaction. This address will receive any remaining funds not allocated to outputs or fees.
The address to receive the change.
Optional
override: booleanWhether to override the change address if one is already set.
The same transaction builder
Sets an additional padding to add onto the transactions. Use this only in emergencies, and please open a ticket at https://github.com/butaneprotocol/blaze-cardano so we can correct the fee calculation!
The padding to add onto the transaction fee
the same transaction builder
Sets a custom coin selector function for the transaction builder. This function will be used to select inputs during the transaction building process.
The coin selector function to use.
The same transaction builder
A builder class for constructing Cardano transactions with various components like inputs, outputs, and scripts.