Skip to content
module

neo3.api.helpers.txbuilder

Builder for creating a Transaction. Calculate fees, add signers and sign.

Classes
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() Calculates and set the system 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() 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.

Calculates and set the system fee. Requires at least one signer.

Calculates and set the system fee. Requires at least one signer.

method

init()

Initialize the builder.

Set maximum time the transaction is valid in the mempool. Defaults to about 24h for a network with 15s blocktime.