Adds a certificate to the transaction.
Certificates are used to perform various on-chain actions like staking, delegation, or registering entities like stake pools and DReps.
The parameters for the function.
The certificate object to add to the transaction.
Optionalredeemer?: PlutusDataOptional. The redeemer data required if the certificate action is controlled by a Plutus script.
The builder instance for chaining.
Adds a Plutus datum to the transaction's witness set.
This allows the datum to be referenced by its hash from a transaction output, satisfying a script's requirement without including the full datum directly in the output itself.
The PlutusData object to add to the transaction witnesses.
The builder instance for chaining.
Adds an input to the transaction to be spent.
Optionally, a redeemer and datum can be provided. These are typically required when spending a UTxO that is locked at a Plutus script address.
The parameters for the function.
Optionaldatum?: PlutusDataOptional. The datum that was locking the script output.
Optionalredeemer?: PlutusDataOptional. The redeemer to use for unlocking the script.
The Unspent Transaction Output (UTxO) to be spent.
The builder instance for chaining.
Adds a transaction output to send a specific value to an address.
The transaction output to add.
The builder instance for chaining.
Adds a reference input to the transaction.
Reference inputs allow Plutus scripts to inspect the data, datum, and script of a UTxO without actually spending it. This is useful for looking up on-chain information.
The UTxO to be used as a reference input.
The builder instance for chaining.
Adds a script to the transaction's witness set.
This is necessary when using a script that is not already available on-chain via a reference input, such as a minting policy or a native script for a required signer.
The script object (Plutus or Native) to add.
The builder instance for chaining.
Adds a required signer to the transaction.
The public key hash (PKH) of the required signer as a hex string.
The builder instance for chaining.
Adds a stake delegation certificate to the transaction.
This delegates the staking power of a reward address to a specified stake pool. An optional redeemer can be provided for script-controlled stake credentials.
The parameters for the function.
The bech32-encoded ID of the stake pool to delegate to.
Optionalredeemer?: PlutusDataOptional. The redeemer for a script-controlled stake credential.
The bech32-encoded stake address to delegate from.
The builder instance for chaining.
Adds a voting delegation certificate to the transaction.
This delegates the voting power of a stake address to a specified DRep (Decentralized Representative) for on-chain governance.
The parameters for the function.
The bech32-encoded ID of the DRep to delegate to. The DRep ID can be in CIP-129 format or CIP-105 format.
Optionalredeemer?: PlutusDataOptional. The redeemer for a script-controlled stake credential.
The bech32-encoded stake address to delegate from.
The builder instance for chaining.
Adds a DRep deregistration certificate to the transaction.
This action retires the DRep, making them ineligible for future governance proposals. An optional redeemer can be provided for script-controlled DRep credentials.
The parameters for the function.
The bech32-encoded ID of the DRep to deregister. This can be in either CIP-105 or CIP-129 format.
Optionalredeemer?: PlutusDataOptional. The redeemer for a script-controlled DRep credential.
The builder instance for chaining.
Adds a stake deregistration certificate to the transaction.
This action retires the stake address and initiates the refund of the key deposit. An optional redeemer can be provided for script-controlled stake credentials.
The parameters for the function.
Optionalredeemer?: PlutusDataOptional. The redeemer for a script-controlled stake credential.
The stake address to deregister, as a bech32 string or a RewardAddress object.
The builder instance for chaining.
Sets the transaction's expiration to a specific, absolute date and time.
This function marks the transaction as invalid if it is not included in a block before the specified date.
The absolute date and time after which the transaction will be invalid.
The builder instance for chaining.
Sets the transaction to be valid for a specific duration from now.
This is a convenience method that calculates a future expiration date and sets it. The transaction will be marked as invalid if it is not included in a block within the specified duration.
The number of seconds from now that the transaction should remain valid.
The builder instance for chaining.
Adds a transaction output to lock a specific amount of lovelace at a script address.
This is used to send funds to a smart contract, where the funds are locked until the script conditions are met. A datum must be provided to be attached to the script output.
The builder instance for chaining.
Adds a transaction output to lock a value (lovelace and/or other assets) at a script address.
This is used to send funds to a smart contract, where they are locked until the script conditions are met. A datum must be provided with the output.
The builder instance for chaining.
Adds a token minting or burning operation to the transaction using a concatenated Asset ID.
The parameters for the function.
The quantity to mint (positive integer) or burn (negative integer).
The hex-encoded Asset ID (concatenation of the policy ID and asset name).
Optionalredeemer?: PlutusDataOptional. The redeemer required if the minting policy is a Plutus script.
The builder instance for chaining.
Pads the transaction with space for a specified number of additional signers.
This is used for fee calculation purposes to ensure the final transaction fee is sufficient to cover signatures that will be added after the transaction is built (e.g., by co-signers). This method does not add any actual required signers to the transaction witnesses.
The number of additional signer "slots" to account for in the fee calculation.
The builder instance for chaining.
Adds a proposal to update the constitutional committee to the transaction.
This governance action can add new members, remove existing members, and change the required quorum for committee votes.
The parameters for the function.
The anchor containing the URL and hash of off-chain metadata for the proposal.
OptionalgovernanceActionId?: GovernanceActionIdOptional. The ID of the most recent hard fork initiation action. Can be undefined if this is the first proposal of this type on the network.
An array of CommitteeMember objects (credential and epoch) for new members.
An array of Credential objects for committee members to be removed.
The new quorum for the committee, as a unit interval (e.g., { numerator: 1n, denominator: 2n }).
The reward address where the governance action deposit will be refunded.
The builder instance for chaining.
Adds a hard fork initiation proposal to the transaction.
This governance action is used to propose an upgrade to a new major protocol version.
The parameters for the function.
The anchor containing the URL and hash of off-chain metadata for the proposal.
OptionalgovernanceActionId?: GovernanceActionIdOptional. The ID of the most recent hard fork initiation action. Can be undefined if this is the first proposal of this type on the network.
The reward address where the governance action deposit will be refunded.
The protocol version to upgrade to.
The builder instance for chaining.
Adds an informational governance action proposal to the transaction.
This type of action has no direct on-chain effect but serves to record information or a statement on the blockchain, retrievable via its metadata anchor.
The parameters for the function.
The anchor containing the URL and hash of the off-chain information.
The reward address where the governance action deposit will be refunded.
The builder instance for chaining.
Adds a new constitution proposal to the transaction.
This governance action proposes to replace the current on-chain constitution with a new one.
The parameters for the function.
The anchor containing the URL and hash of off-chain metadata for this specific proposal.
The new constitution being proposed, which includes its own anchor and an optional script hash.
OptionalgovernanceActionId?: GovernanceActionIdOptional. The ID of the most recent hard fork initiation action. Can be undefined if this is the first proposal of this type on the network.
The reward address where the governance action deposit will be refunded.
The builder instance for chaining.
Adds a "no confidence" proposal to the transaction.
This governance action is used to express a lack of confidence in the current constitutional committee.
The parameters for the function.
The anchor containing the URL and hash of off-chain metadata for the proposal.
OptionalgovernanceActionId?: GovernanceActionIdOptional. The ID of the most recent hard fork initiation action. Can be undefined if this is the first proposal of this type on the network.
The reward address where the governance action deposit will be refunded.
The builder instance for chaining.
Adds a protocol parameter change proposal to the transaction.
This governance action is used to propose modifications to the network's protocol parameters.
The parameters for the function.
The anchor containing the URL and hash of off-chain metadata for the proposal.
OptionalgovernanceActionId?: GovernanceActionIdOptional. The ID of the most recent parameter change action. Can be undefined if this is the first proposal of this type on the network.
The hex-encoded hash of the governance action policy script (guardrails script).
An object containing the specific protocol parameters to be updated.
The reward address where the governance action deposit will be refunded.
The builder instance for chaining.
Adds a treasury withdrawals proposal to the transaction.
This governance action proposes the withdrawal of funds from the treasury to be distributed to a set of specified reward accounts.
The parameters for the function.
The anchor containing the URL and hash of off-chain metadata for the proposal.
OptionalpolicyHash?: stringOptional. The hex-encoded hash of the governance action policy script (guardrails script).
The reward address where the governance action deposit will be refunded.
A map where keys are the Bech32-encoded reward addresses of the recipients and values are the corresponding lovelace amounts to be withdrawn.
The builder instance for chaining.
Adds a DRep registration certificate to the transaction.
The parameters for the function.
An object containing the URL and hash of the DRep's metadata.
The bech32-encoded ID of the DRep to delegate to. The DRep ID can be in CIP-129 format or CIP-105 format.
Optionalredeemer?: PlutusDataOptional. The redeemer for a script-controlled DRep credential.
The builder instance for chaining.
Adds a stake registration certificate to the transaction.
This allows the specified stake address to start participating in staking and receiving rewards. An optional redeemer can be provided for script-controlled stake credentials.
The parameters for the function.
Optionalredeemer?: PlutusDataOptional. The redeemer for a script-controlled stake credential.
The stake address to register, as a bech32 string or a RewardAddress object.
The builder instance for chaining.
Adds a transaction output to send a specific amount of lovelace to an address.
The builder instance for chaining.
Adds a transaction output to send a value (lovelace and/or other assets) to an address.
The builder instance for chaining.
Sets the change address for the transaction. This is where any remaining funds from inputs will be sent after covering outputs and fees.
The change address as a bech32 string or an Address object.
The builder instance for chaining.
Sets a custom coin selection strategy for the transaction.
The coin selector determines how UTxOs are chosen to cover the transaction's required value. If this method is not called, the builder will use a default coin selection strategy ('largest-first').
The coin selection strategy to use.
The builder instance for chaining.
Sets the collateral change address for the transaction.
This address specifies where any remaining balance from collateral inputs will be sent. Collateral is required for transactions involving Plutus scripts.
The collateral return address as a bech32 string or an Address object.
The builder instance for chaining.
Sets a specific list of UTXOs to be used for collateral.
Collateral is required for transactions involving Plutus scripts. If this method
is not called, the builder will attempt to select collateral from the general
UTXO set provided via the setUtxos method.
An array of UTxOs to be designated for collateral.
The builder instance for chaining.
Sets the donation amount for the transaction being built.
Donations are a Conway-era feature that contribute a specific amount to the treasury.
The donation amount in lovelace.
The builder instance for chaining.
Sets the transaction's expiration, also known as Time To Live (TTL).
This function marks the transaction as invalid if it is not included in a block before the specified time.
The absolute slot number after which this transaction will be invalid.
The builder instance for chaining.
Sets the transaction's validity start time using an absolute slot number.
This function marks the transaction as invalid if it is included in a block created before the specified slot.
The absolute slot number before which this transaction is invalid.
The builder instance for chaining.
Attaches metadata to the transaction under a specific label (tag).
The parameters for the function.
The metadata content. Can be a plain object, or a pre-serialized JSON string.
A unique integer label for this piece of metadata.
The builder instance for chaining.
Sets a minimum transaction fee.
This function allows you to specify a minimum fee for the transaction in lovelace. The final fee calculated by the builder during the build process will be at least this amount.
The minimum fee amount in lovelace.
The builder instance for chaining.
Sets the network ID for the transaction.
This specifies the target network (e.g., Mainnet or a Testnet) for which the transaction is intended.
The network ID to assign to the transaction.
The builder instance for chaining.
Sets a custom transaction evaluator.
The evaluator is responsible for calculating the execution units (memory and steps) required for any Plutus scripts in the transaction. If this method is not called, the builder will use a default evaluator that relies on the configured provider.
The transaction evaluator to use.
The builder instance for chaining.
Sets the available UTXOs for the builder to use for coin selection.
An array of available UTxOs.
The builder instance for chaining.
Adds an update DRep certificate in the transaction.
The parameters for the function.
An object containing the URL and hash of the DRep's metadata.
The bech32-encoded ID of the DRep to deregister. This can be in either CIP-105 or CIP-129 format.
Optionalredeemer?: PlutusDataOptional redeemer data for script-based DReps.
The builder instance for chaining.
Sets the transaction to become valid only after a specified duration from now. This is a convenience method that calculates a future start date.
The number of seconds from now to wait before the transaction becomes valid.
The builder instance for chaining.
Sets the transaction's validity start time to a specific, absolute date and time. The transaction will be invalid if processed before this date.
The absolute date and time from which the transaction will be valid.
The builder instance for chaining.
Adds a vote for a specific governance action to the transaction.
This function allows a voter to submit their vote for a given governance action.
The parameters for the function.
The ID of the governance action being voted on.
Optionalredeemer?: PlutusDataOptional. Redeemer data required if the voter is script-controlled.
The voter participating in the governance action.
The voting procedure, including the vote choice.
The builder instance for chaining.
Adds a withdrawal from a reward account to the transaction.
The amount specified must be the full available reward balance for the account. An optional redeemer can be provided for script-locked withdrawals.
The parameters for the function.
The full amount of rewards to withdraw in lovelace.
Optionalredeemer?: PlutusDataOptional. The redeemer for a script-locked withdrawal.
The reward account address as a bech32 string or a RewardAddress object.
The builder instance for chaining.
StaticcreateCreates a new transaction builder instance.
The configuration object for the builder.
The protocol parameters for the network.
The slot timing configuration for the network.
A new, configured TransactionBuilder instance.
A high-level builder for constructing Cardano transactions.
This class provides a fluent interface to incrementally add inputs, outputs, certificates, metadata, and other components to a transaction. It encapsulates the complexities of transaction assembly, fee calculation, and balancing.