Hedera.MirrorNode (Hedera v0.7.0)

Copy Markdown View Source

Thin client for the public Hedera mirror node REST API — the read side of the network (consensus results, topic messages). Complements the gRPC client, which handles writes and receipts.

Summary

Functions

Read a smart-contract call's result — the contract's return value (from the transaction record) that isn't in the receipt. Accepts a TransactionId or its string form. The returned JSON map includes "call_result" (hex-encoded return bytes), "gas_used", "error_message" and more. Subject to mirror-node ingestion lag after consensus.

Fetch a single topic message by sequence number. Returns the decoded JSON map.

Look up a transaction by id (shard.realm.num@secs.nanos).

Functions

contract_result(tx_id, opts \\ [])

@spec contract_result(
  Hedera.TransactionId.t() | binary(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Read a smart-contract call's result — the contract's return value (from the transaction record) that isn't in the receipt. Accepts a TransactionId or its string form. The returned JSON map includes "call_result" (hex-encoded return bytes), "gas_used", "error_message" and more. Subject to mirror-node ingestion lag after consensus.

topic_message(topic_id, sequence_number, opts \\ [])

@spec topic_message(Hedera.TopicId.t(), non_neg_integer(), keyword()) ::
  {:ok, map()} | {:error, term()}

Fetch a single topic message by sequence number. Returns the decoded JSON map.

transaction(transaction_id, opts)

@spec transaction(
  binary(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Look up a transaction by id (shard.realm.num@secs.nanos).