Skip to main content
Complex operations are high-level wrappers that simplify creating sophisticated blockchain operations. They handle the complexity of building protocol buffer messages and provide intuitive APIs.

What are complex operations?

Complex operations extend the base OperationBase class and provide:
  • Type-safe APIs - IntelliSense and autocomplete support
  • Automatic validation - Built-in checks for valid data
  • Simplified workflows - Handle common patterns automatically
  • Protocol compliance - Ensure operations match blockchain requirements
Complex operations implement a finalize() method that converts high-level data into protocol buffer operations when you push them to a transaction.

Account update operations

Update account authorities (owner, active, posting) and memo keys.
The create_for() method automatically fetches current account authorities from the blockchain, making it easy to modify existing permissions.

Working with authority categories

You can iterate over authority categories or access roles directly.

Recurrent transfer operations

Create recurring transfers that execute automatically.
  • Minimum recurrence is 24 hours
  • Minimum executions is 2
  • Maximum execution date is 730 days in the future
  • Since HF28, you can have multiple recurrent transfers to the same account using pair_id

Comment and blog post operations

Create posts and comments with rich metadata.
The BlogPostOperation automatically generates metadata in the correct format and can create comment_options operations for beneficiaries and payout settings.

Witness operations

Update witness properties for block production.

Proposal voting operations

Vote on Hive DAO proposals.

Creating custom complex operations

You can create your own complex operation classes for application-specific workflows.
Custom operations are perfect for:
  • Application-specific workflows
  • Batching related operations
  • Encapsulating business logic
  • Building reusable components

Best practices

Instead of manually constructing protocol buffer messages, use complex operations for common tasks like account updates and recurrent transfers.
Check that your data meets requirements before creating complex operations.
Many complex operations support method chaining for cleaner code.
The finalize() method can throw errors if data is invalid. Handle these appropriately.

Next steps

API extensions

Extend the API with custom endpoints

Formatters

Format output data for display

Operations reference

Complete operations API documentation

Protocol documentation

Hive protocol specifications