Skip to main content

Overview

Transaction-related types define the structure of Hive blockchain transactions, broadcasting results, and transaction status tracking.

TransactionType

Represents a complete Hive blockchain transaction.
number
Reference block number for transaction expiration (uses lower 16 bits of a block number)
number
Reference block prefix for transaction uniqueness (first 4 bytes of block ID)
string
Transaction expiration time in ISO 8601 format (e.g., “2024-03-04T12:00:00”)
[OperationName, OperationBody<OperationName>][]
Array of operations to execute in this transaction. Each operation is a tuple of [operationName, operationBody]
Extension[]
Transaction extensions (usually an empty array)
string[]
Array of cryptographic signatures authorizing the transaction

Example Structure

BroadcastResult

Result returned after successfully broadcasting a transaction.
string
Unique transaction ID (hash) that can be used to track the transaction on the blockchain
'unknown' | 'within_irreversible_block' | 'expired_irreversible' | 'too_old'
Current status of the transaction:
  • unknown: Status cannot be determined
  • within_irreversible_block: Transaction is included in an irreversible block
  • expired_irreversible: Transaction expired in an irreversible block
  • too_old: Transaction is too old to query

Example

TransactionStatus

Detailed status information for a transaction query.
'unknown' | 'within_mempool' | 'within_reversible_block' | 'within_irreversible_block' | 'expired_reversible' | 'expired_irreversible' | 'too_old'
Detailed transaction status:
  • unknown: Status cannot be determined
  • within_mempool: Transaction is in the memory pool, not yet in a block
  • within_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 block
  • expired_irreversible: Transaction expired in an irreversible block
  • too_old: Transaction is too old to track

Example

DigestData

Transaction digest data used for signing and transaction ID generation.
Uint8Array
SHA-256 digest of the transaction data (32 bytes)
string
Transaction ID derived from the digest (hex-encoded)

Example

BroadcastError

Error response when transaction broadcast fails.
number
JSON-RPC request ID
string
JSON-RPC version (“2.0”)
object
Error details object
number
Error code
string
Human-readable error message
any
Additional error data (optional)

Example Error Handling

CallResponse

Generic API call response type.
number
JSON-RPC request ID
string
JSON-RPC version (“2.0”)
T
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:
Some operations use specific extension formats:

Complete Transaction Example

Transaction Lifecycle

  1. Creation: Transaction is created with operations
  2. Preparation: Reference block and expiration are set
  3. Digest: Transaction is serialized and hashed
  4. Signing: Private key signs the digest
  5. Broadcasting: Signed transaction is sent to the network
  6. Mempool: Transaction enters the memory pool (within_mempool)
  7. Reversible Block: Transaction is included in a block (within_reversible_block)
  8. Irreversible: After ~45 seconds, block becomes irreversible (within_irreversible_block)

Status Transitions