Hedera.AccountId (Hedera v0.8.0)

Copy Markdown View Source

A Hedera account identifier shard.realm.num (e.g. 0.0.8260469).

Summary

Functions

Parse "shard.realm.num" (e.g. "0.0.1001") into a struct. Raises ArgumentError on a malformed id — call this with known-format ids; for untrusted input, guard with a rescue or validate first.

Encode as the entity's protobuf message (shard=1, realm=2, num=3).

Format as "shard.realm.num".

Types

t()

@type t() :: %Hedera.AccountId{
  num: non_neg_integer(),
  realm: non_neg_integer(),
  shard: non_neg_integer()
}

Functions

parse(string)

@spec parse(binary()) :: t()

Parse "shard.realm.num" (e.g. "0.0.1001") into a struct. Raises ArgumentError on a malformed id — call this with known-format ids; for untrusted input, guard with a rescue or validate first.

to_proto(account_id)

@spec to_proto(t()) :: binary()

Encode as the entity's protobuf message (shard=1, realm=2, num=3).

to_string(account_id)

@spec to_string(t()) :: binary()

Format as "shard.realm.num".