Abstract Transaction
Abstract base class for transaction classes.
Stellar supports two types of transactions:
Transaction - Standard transaction containing operations
FeeBumpTransaction - Transaction that wraps another transaction to bump its fee
This abstract class provides common functionality for signing, hashing, and serializing transactions.
Transaction Lifecycle
Build - Create transaction using TransactionBuilder
Sign - Add signatures using sign() methods
Serialize - Convert to XDR for network submission
Submit - Send to Horizon or RPC server
Signing
Transactions must be signed by the source account and any other required signers. Signatures are added using the sign() methods:
val transaction = TransactionBuilder(...)
.build()
// Sign with keypair
transaction.sign(keypair)
// Sign with hash(x) preimage
transaction.signHashX(preimage)Network Passphrase
Each transaction is tied to a specific network (PUBLIC, TESTNET, etc.) through its network passphrase. The network ID (SHA-256 hash of passphrase) is included in the transaction hash to prevent replay attacks across different networks.