TxBuilder
Extends: RefCounted
Description
The TxBuilder, which is a balanced and evaluated transaction that can be subsequently signed and submitted.
The TxBuilder, which is a balanced and evaluated transaction that can be subsequently signed and submitted.
Constants Descriptions
TxBuilderStatus
Method Descriptions
_init
You should not create a TxBuilder).
set_slot_config
Set the slot configuration. This is automatically done on initialization, do not use unless you know what you are doing.
set_cost_models
Set the cost models. This is automatically done on initialization, do not use unless you know what you are doing.
pay_to_address
Pay to a given [param address]. [param coin] specifies the quantity of lovelace to transfer, while the optional parameter [param assets] specifies any additional assets to transfer.[br] May optionally include a [param datum] and [param script_ref], and a flag [param hash_datum] determining whether the provided datum should be inline. NOTE: If [param assets] contains ADA it will be added to the amount set by [param coin].
pay_to_address_with_datum_hash
Similar to [method pay_to_address], but it also takes a [param datum] argument that will be used to embed the datum hash in the transaction. [param datum] should be convertable to PlutusData.
mint_assets
Mint tokens with the given [param minting_policy] and using the a list of specs defined in [param tokens]. A [param redeemer] is also required for the minting policy.
mint_cip68_pair
Mint a pair of CIP68 user and reference tokens using the given [param redeemer] and minting configuration in [param conf].
mint_cip68_user_tokens
Mint user tokens for a given [param conf]. This should generally be used for fungible tokens after the initial mint has been performed by [method mint_cip68_pair].
pay_cip68_ref_token
Pay the CIP68 reference token specified by [param minting_policy] and [param conf] to the given [param address].
pay_cip68_user_tokens
Pay the CIP68 user tokens specified by [param minting_policy] and [param conf] to the given [param address].
pay_cip68_user_tokens_with_datum
Pay the CIP68 user tokens specified by [param minting_policy] and [param conf] to the given [param address]. The output will contain a [param datum].
collect_from
Consume all the [param utxos] specified.
collect_from_script
Consume all the [param utxos] locked by the [param plutus_script_source] using the provided [param redeemer].
set_change_address
When the transaction is balanced (usually when [method complete] is called), send any change to the provided [param change_address].
set_wallet
Use the provided [param wallet] for balancing. This automatically sets the change address to that wallet's address.
valid_after
Set the time in POSIX seconds after which the transaction is valid
valid_before
Set the time in POSIX seconds before which the transaction is valid
add_required_signer
Add a required signer constraint to the transaction.
add_reference_input
Add a [param utxo] as a reference input. This input will not be consumed but will be available in the script evaluation context.
balance
Only balance the transaction and return the result.[br]The resulting transaction will not have been evaluated and will have inaccurate script execution units, which may cause the transaction to fail at submission and potentially consume the provided collateral.[br][br]Do not use this function unless you know what you are doing.
complete
Attempts to balance and evaluate the transaction. The provided [param utxos] can be used for balancing the transaction.
create (static)
TODO: This probably shouldn't be exposed. Create a TxBuilder object from a Provider. You should use [method Provider.new_tx] instead of this method, since that one will make sure to initialize other necessary fields.
Sub-classes
CreateResult
Property Descriptions
value
- Getter:
@value_getter
WARNING: This function may fail! First match on tag
or call is_ok
.
error
- Getter:
@error_getter
WARNING: This function may fail! First match on tag
or call is_err
.
Method Descriptions
_init
BalanceResult
Property Descriptions
value
- Getter:
@value_getter
WARNING: This function may fail! First match on tag
or call is_ok
.
error
- Getter:
@error_getter
WARNING: This function may fail! First match on tag
or call is_err
.
Method Descriptions
_init
CompleteResult
Property Descriptions
value
- Getter:
@value_getter
WARNING: This function may fail! First match on tag
or call is_ok
.
error
- Getter:
@error_getter
WARNING: This function may fail! First match on tag
or call is_err
.