TransactionBuilderConfigBuilder now has a new setter function .ex_unit_prices(ExUnitPrices). This property is optional and only required to calculate the fees correctly in case you are using Plutus inputs. The property is NOT required by default for backward compatibility and in case you are not using Plutus inputs at all or in case you are not calculating the fee and change automatically - it will not be required at all.
NOTE: in case you DON'T specify this parameter and you use Plutus inputs with redeemers - calling .add_inputs_from, .fee_for_input, .fee_for_output, .add_change_if_needed, or .min_feewill fail with an error.
Handling collateral inputs with .set_inputs and .set_collateral
All functions related to adding inputs are extracted into a new type TxInputsBuilder, specifically:
.add_input
.add_key_input
.add_script_input
.add_native_script_input
.add_plutus_script_input
.add_bootstrap_input
.count_missing_input_scripts
.add_required_native_input_scripts
.add_required_plutus_input_scripts
.get_native_input_scripts
.get_plutus_input_scripts
The TransactionBuilder still has all these functions for backward compatibility in relation to regular inputs, but they are deprecated now and will be removed in one of the next major versions.
Instead, there are two new function in the TransactionBuilder:
.set_inputs(TxInputsBuilder)
.set_collateral(TxInputsBuilder)
So instead of
txBuilder.add_input(address, input, value);
The proper way of doing it from now on is:
let inputBuilder = TxInputsBuilder.new();
inputBuilder.add_input(address, input, value);
txBuilder.set_inputs(inputBuilder);
Collateral inputs
For collateral inputs there are no functions on the transaction-builder itself, they must be entirely handled though a TxInputsBuilder instance and then added to the transaction-builder using .set_collateral
NOTE: a copy of the inputs is taken when .set_inputs or .set_collateral is called, so changing the TxInputsBuilder instance after that will not affect the transaction-builder itself in any way.
You can trigger a rebase of this PR by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps @emurgo/cardano-serialization-lib-nodejs from 12.0.0-alpha.26 to 12.0.0-alpha.31.
Release notes
Sourced from
@emurgo/cardano-serialization-lib-nodejs
's releases.... (truncated)
Commits
You can trigger a rebase of this PR by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show