Skip to main content
Transactions are the fundamental way to interact with the Hive blockchain. This guide walks you through creating transactions from basic operations to complex multi-operation workflows.

Creating a transaction

Before you can build a transaction, you need to initialize a WAX instance. Use createWaxFoundation() for offline operations or createHiveChain() for online operations.
1

Initialize WAX

Choose between offline (foundation) and online (chain) modes based on your needs.
Online mode automatically fetches chain configuration and head block data, making it easier to build transactions that will be broadcast.
2

Create a transaction

Create a transaction with TAPOS (Transaction as Proof of Stake) data. For online mode, this is handled automatically.
TAPOS (Transaction as Proof of Stake) references a recent block to prove the transaction was created for a specific chain, preventing replay attacks.
3

Add operations

Push one or more operations to your transaction. Operations represent actions on the blockchain.
You can add multiple operations to a single transaction. They will be executed in order.
4

Set expiration time (optional)

By default, transactions expire after 1 minute. You can customize this when creating the transaction.
5

Validate the transaction

Before signing, validate that your transaction is well-formed.
Always validate transactions before signing to catch errors early.

Transaction properties

Once you’ve built a transaction, you can access various properties:

Converting transaction formats

WAX supports multiple transaction formats for interoperability:

Complete example

Here’s a complete example of building a transaction with multiple operations:

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