Skip to main content
The ITransaction interface represents a Hive blockchain transaction. Transactions contain operations, can be signed with keys, and can be serialized for broadcasting.

Creating transactions

Create transactions using factory methods:

Properties

transaction

Returns the underlying proto transaction with TAPOS and expiration applied.
ProtoTransaction
Proto transaction object with all fields populated.

is_signed

Checks if the transaction has been signed at least once.
bool
True if transaction has one or more signatures, False otherwise.

sig_digest

Returns the transaction signature digest for signing (uses HF26 serialization).
SigDigest
Hexadecimal signature digest of the transaction.
Raises: WaxValidationFailedError if transaction or chain ID is invalid.

impacted_accounts

Returns list of account names impacted by the transaction.
list[AccountName]
List of unique account names impacted by all operations in the transaction.
Raises: WaxValidationFailedError if any account name is invalid.

id

Returns the transaction ID (uses HF26 serialization).
TransactionId
Hexadecimal transaction ID.
Raises: WaxValidationFailedError if transaction is invalid.

signature_keys

Returns public keys recovered from transaction signatures.
list[PublicKey]
List of public keys extracted from signatures.
Raises: WaxValidationFailedError if transaction is invalid.

required_authorities

Returns required authority accounts categorized by authority type.
ITransactionRequiredAuthorities
Object with properties:
  • posting_accounts: Set of accounts requiring posting authority
  • active_accounts: Set of accounts requiring active authority
  • owner_accounts: Set of accounts requiring owner authority
  • other_authorities: List of custom authority structures

Methods

push_operation

Adds an operation to the transaction.
WaxMetaOperation
required
Operation to add. Can be a proto operation (from wax.proto.operations).
Self
Returns the transaction instance for method chaining.

validate

Validates the transaction structure and contents.
Raises: WaxValidationFailedError if transaction is invalid.

sign

Signs the transaction asynchronously using a wallet.
AsyncUnlockedWallet
required
Unlocked Beekeeper wallet instance containing the private key.
PublicKey
required
Public key corresponding to the private key to use for signing. The key must exist in the wallet.
Signature
Hexadecimal transaction signature.
Raises: WaxValidationFailedError if transaction is invalid.

add_signature

Manually adds a signature to the transaction.
Signature
required
Hexadecimal signature to add to the transaction.
Signature
The signature that was added.

Serialization methods

to_string

Converts transaction to protobuf JSON string.
str
Protobuf JSON representation of the transaction.
Raises: WaxValidationFailedError if transaction is invalid.

to_binary_form

Serializes transaction to HF26 binary format as hex string.
Hex
Transaction serialized in HF26 binary format as hexadecimal string.

to_api

Converts transaction to Hive API string format.
str
Transaction in Hive API string format.
Raises: WaxValidationFailedError if transaction is invalid.

to_dict

Converts transaction to Hive API dictionary format.
dict[str, Any]
Transaction in Hive API dictionary format.
Raises: WaxValidationFailedError if transaction is invalid.

to_api_json

Converts transaction to Hive API JSON format.
JsonTransaction
Transaction in Hive API JSON format (string).
Raises: WaxValidationFailedError if transaction is invalid.

Online transaction interface

The IOnlineTransaction extends ITransaction with on-chain verification.

perform_on_chain_verification

Verifies the transaction against the blockchain.
This method:
  • Checks all impacted accounts exist on the blockchain
  • Scans operation contents for private key leaks
Raises:
  • AccountNotFoundError - If any impacted account doesn’t exist
  • PrivateKeyDetectedInMemoError - If private key detected in operation content
When using chain.broadcast() with an IOnlineTransaction, this verification is called automatically before broadcasting.

Complete example