module
neo3.api.helpers.txbuilder
Builder for creating a Transaction. Calculate fees, add signers and sign.
Classes
TxBuilder— Transaction builder.
class
neo3.api.helpers.txbuilder.TxBuilder(client, script=None)
Transaction builder.
Methods
add_signer(func,signer)— Add a Signer with scopes to the transaction and its signing function.build_and_sign()(Transaction) — Sign the transaction with all signers and return the finalized result.build_unsigned()(Transaction) — Return the unsigned transaction. For example for use in an offline signing scenario.calculate_network_fee()— Calculate and set the network fee. Requires at least one signer.calculate_system_fee()— Calculates and set the system fee. Requires at least one signer.init()— Initialize the builder.set_valid_until_block(blocks)— Set maximum time the transaction is valid in the mempool. Defaults to about 24h for a network with 15s blocktime.
method
add_signer(func, signer)
Add a Signer with scopes to the transaction and its signing function.
Parameters
func(callable(Transaction, SigningDetails: Awaitable)) — one of neo3.api.helpers.signing.signer() — a Signer determining the validity of the signature.
method
build_and_sign() → Transaction
Sign the transaction with all signers and return the finalized result.
method
build_unsigned() → Transaction
Return the unsigned transaction. For example for use in an offline signing scenario.
method
calculate_network_fee()
Calculate and set the network fee. Requires at least one signer.
method
calculate_system_fee()
Calculates and set the system fee. Requires at least one signer.
method
init()
Initialize the builder.
method
set_valid_until_block(blocks=1500)
Set maximum time the transaction is valid in the mempool. Defaults to about 24h for a network with 15s blocktime.
Parameters
blocks(, optional) — until how many blocks from the current chain height is the transaction valid. Defaults to ~24 hours.