Basic Transaction Flow
1
Import the Transaction class
2
Create a new transaction
Default expiration is 60 seconds (60,000 ms). Maximum is 24 hours (86,400,000 ms).
3
Add operations to the transaction
Use
addOperation() to add operations. This method automatically creates the transaction structure on first call:4
Sign and broadcast
Transfer Operation
Send HIVE or HBD tokens between accounts:Vote Operation
Upvote or downvote content:Vote weight ranges from -10000 (100% downvote) to 10000 (100% upvote). Use posting key for voting.
Comment Operation
Create posts and comments:Custom JSON Operation
Execute custom operations for apps and games:Delegate Vesting Shares
Delegate HIVE Power to another account:Multiple Operations in One Transaction
You can add multiple operations to a single transaction:Transaction Expiration
Control when your transaction expires:Transactions that haven’t been included in a block when they expire will be dropped from the mempool.
Error Handling
Always wrap transaction creation and broadcasting in try-catch blocks:Common Errors
Next Steps
- Learn about Signing and Broadcasting transactions
- Explore Key Management best practices
- Set up Encrypted Memos for private transfers