Skip to main content
The IHiveChainInterface extends IWaxBaseInterface with online blockchain operations. It provides API access, transaction broadcasting, and automatic TAPOS data retrieval.

Properties

api

Returns the API collection for making RPC calls to the Hive node.
WaxApiCollection
Collection of API endpoints including:
  • database_api - Account, block, and state queries
  • account_history_api - Transaction history
  • network_broadcast_api - Transaction broadcasting
  • rc_api - Resource credit queries
  • And more…

endpoint_url

Gets or sets the Hive node endpoint URL.
HttpUrl
Current endpoint URL being used for API calls.
Setter raises: InvalidEndpointUrlFormatError if the URL format is invalid.

Inherited properties

All properties from IWaxBaseInterface are available:
  • chain_id - Chain identifier
  • config - Protocol configuration
  • address_prefix - Public key prefix
  • hive - HIVE asset factory
  • hbd - HBD asset factory
  • vests - VESTS asset factory
See Wax base interface for details.

Transaction methods

create_transaction

Creates an online transaction with automatic TAPOS data from the blockchain.
TTimestamp | None
default:"timedelta(minutes=1)"
Transaction expiration time. Can be:
  • datetime - Absolute UTC expiration time
  • timedelta - Duration from now
  • None - Uses default 1 minute
IOnlineTransaction
Online transaction object with TAPOS data automatically filled from the current head block.
Raises: AssertionError if expiration type is invalid.

broadcast

Broadcasts a signed transaction to the blockchain.
ITransaction | IOnlineTransaction
required
Signed transaction to broadcast.
Raises:
  • TransactionNotSignedError - Transaction has no signatures
  • WaxValidationFailedError - Transaction validation failed
  • AccountNotFoundError - One or more impacted accounts not found (IOnlineTransaction only)
  • PrivateKeyDetectedInMemoError - Private key detected in operation content (IOnlineTransaction only)
When broadcasting an IOnlineTransaction, the perform_on_chain_verification() method is called automatically to verify accounts exist and scan for leaked private keys.

Account authority methods

collect_account_authorities

Retrieves authority information for one or more accounts.
*AccountName
required
One or more account names to retrieve authorities for.
WaxAccountAuthorityInfo | list[WaxAccountAuthorityInfo]
If single account provided, returns single WaxAccountAuthorityInfo. If multiple accounts provided, returns list.Each WaxAccountAuthorityInfo contains:
  • account - Account name
  • authorities - Owner, active, and posting authorities
  • memo_key - Memo public key
  • last_owner_update - Last owner key update time
  • previous_owner_update - Previous owner key update time
Raises:
  • InvalidAccountNameError - Account name is invalid
  • AccountNotFoundError - Account not found on the blockchain

API extension methods

extends

Extends the API collection with custom API classes.
type[ExtendedApiCollectionT]
required
New API collection class to add. Must contain API classes as attributes.
IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]
New chain instance with extended API collection. Original instance remains unchanged.
API class requirements:
  • Extend existing API classes (like DatabaseApi) or use AbstractAsyncApi for new APIs
  • Use @endpoint_jsonrpc decorator for endpoint methods
  • Endpoint parameters must be keyword-only (use * before params)
  • Class name must match the Hive API name (e.g., BlockApi for block_api)

extend_rest

Extends the REST API collection with custom REST API classes.
type[ExtendedApiCollectionT]
required
New REST API collection class to add.
IHiveChainInterface[ExtendedApiCollectionT | ApiCollectionT]
New chain instance with extended REST API collection.
REST API requirements:
  • Use AbstractAsyncApi as base class
  • Use @endpoint_rest decorator for REST endpoints
  • Endpoint methods should return parsed response data

Cleanup methods

teardown

Cleans up API communication resources. Call this when finished with the chain instance.
Always call teardown() when finished with a chain instance to properly close connections and free resources. Use a try/finally block to ensure cleanup happens even if errors occur.

Complete example

Here’s a complete example showing common operations: