Creating a transaction
Before you can build a transaction, you need to initialize a WAX instance. UsecreateWaxFoundation() for offline operations or createHiveChain() for online operations.
Initialize WAX
Choose between offline (foundation) and online (chain) modes based on your needs.
- TypeScript
- Python
Online mode automatically fetches chain configuration and head block data, making it easier to build transactions that will be broadcast.
Create a transaction
Create a transaction with TAPOS (Transaction as Proof of Stake) data. For online mode, this is handled automatically.
- TypeScript
- Python
TAPOS (Transaction as Proof of Stake) references a recent block to prove the transaction was created for a specific chain, preventing replay attacks.
Add operations
Push one or more operations to your transaction. Operations represent actions on the blockchain.
- TypeScript
- Python
Set expiration time (optional)
By default, transactions expire after 1 minute. You can customize this when creating the transaction.
- TypeScript
- Python
Transaction properties
Once you’ve built a transaction, you can access various properties:- TypeScript
- Python
Converting transaction formats
WAX supports multiple transaction formats for interoperability:- TypeScript
- Python
Complete example
Here’s a complete example of building a transaction with multiple operations:- TypeScript
- Python
Next steps
Signing transactions
Learn how to sign transactions with different providers
Broadcasting transactions
Send your signed transactions to the network
Complex operations
Use high-level operations for advanced workflows
Transaction API
Explore the full transaction API reference