Overview
Transaction-related types define the structure of Hive blockchain transactions, broadcasting results, and transaction status tracking.TransactionType
Represents a complete Hive blockchain transaction.Reference block number for transaction expiration (uses lower 16 bits of a block number)
Reference block prefix for transaction uniqueness (first 4 bytes of block ID)
Transaction expiration time in ISO 8601 format (e.g., “2024-03-04T12:00:00”)
Array of operations to execute in this transaction. Each operation is a tuple of
[operationName, operationBody]Transaction extensions (usually an empty array)
Array of cryptographic signatures authorizing the transaction
Example Structure
BroadcastResult
Result returned after successfully broadcasting a transaction.Unique transaction ID (hash) that can be used to track the transaction on the blockchain
Current status of the transaction:
unknown: Status cannot be determinedwithin_irreversible_block: Transaction is included in an irreversible blockexpired_irreversible: Transaction expired in an irreversible blocktoo_old: Transaction is too old to query
Example
TransactionStatus
Detailed status information for a transaction query.status
'unknown' | 'within_mempool' | 'within_reversible_block' | 'within_irreversible_block' | 'expired_reversible' | 'expired_irreversible' | 'too_old'
Detailed transaction status:
unknown: Status cannot be determinedwithin_mempool: Transaction is in the memory pool, not yet in a blockwithin_reversible_block: Transaction is in a reversible block (not yet final)within_irreversible_block: Transaction is in an irreversible block (final)expired_reversible: Transaction expired while in a reversible blockexpired_irreversible: Transaction expired in an irreversible blocktoo_old: Transaction is too old to track
Example
DigestData
Transaction digest data used for signing and transaction ID generation.SHA-256 digest of the transaction data (32 bytes)
Transaction ID derived from the digest (hex-encoded)
Example
BroadcastError
Error response when transaction broadcast fails.JSON-RPC request ID
JSON-RPC version (“2.0”)
Error details object
Error code
Human-readable error message
Additional error data (optional)
Example Error Handling
CallResponse
Generic API call response type.JSON-RPC request ID
JSON-RPC version (“2.0”)
API response result (generic type)
Example
Extension Type
Flexible extension type used throughout the library.Common Usage
Most operations use an empty array for extensions:Complete Transaction Example
Transaction Lifecycle
- Creation: Transaction is created with operations
- Preparation: Reference block and expiration are set
- Digest: Transaction is serialized and hashed
- Signing: Private key signs the digest
- Broadcasting: Signed transaction is sent to the network
- Mempool: Transaction enters the memory pool (
within_mempool) - Reversible Block: Transaction is included in a block (
within_reversible_block) - Irreversible: After ~45 seconds, block becomes irreversible (
within_irreversible_block)