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.
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.
WaxValidationFailedError if any account name is invalid.
id
Returns the transaction ID (uses HF26 serialization).TransactionId
Hexadecimal transaction ID.
WaxValidationFailedError if transaction is invalid.
signature_keys
Returns public keys recovered from transaction signatures.list[PublicKey]
List of public keys extracted from signatures.
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 authorityactive_accounts: Set of accounts requiring active authorityowner_accounts: Set of accounts requiring owner authorityother_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.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.
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.
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.
WaxValidationFailedError if transaction is invalid.
to_dict
Converts transaction to Hive API dictionary format.dict[str, Any]
Transaction in Hive API dictionary format.
WaxValidationFailedError if transaction is invalid.
to_api_json
Converts transaction to Hive API JSON format.JsonTransaction
Transaction in Hive API JSON format (string).
WaxValidationFailedError if transaction is invalid.
Online transaction interface
TheIOnlineTransaction extends ITransaction with on-chain verification.
perform_on_chain_verification
Verifies the transaction against the blockchain.- Checks all impacted accounts exist on the blockchain
- Scans operation contents for private key leaks
AccountNotFoundError- If any impacted account doesn’t existPrivateKeyDetectedInMemoError- If private key detected in operation content
When using
chain.broadcast() with an IOnlineTransaction, this verification is called automatically before broadcasting.