Specialized Types
An AccountId
is composed of a <shardNum>.<realmNum>.<accountNum> (eg. 0.0.10).
Shard number (
shardNum
) represents the shard number (shardId
). It will default to 0 today, as Hedera only performs in one shard.Realm number (
realmNum
) represents the realm number (realmId
). It will default to 0 today, as realms are not yet supported.Account represents either an account number or an account alias
Account number (
accountNum
) represents the account number (accountId
)Account alias (alias) represented by the public key bytes
The public key bytes are the result of serializing a protobuf Key message for any primitive key type
Currently, only primitive key bytes are supported as an alias
Threshold keys, key list, contract ID, and delegatable_contract_id are not supported
The alias can only be used in place of an account ID in transfer transactions in its current version
Together these values make up your AccountId
. When an AccountId
is specified, be sure all three values are included.
Constructor
Constructor | Type | Description |
| long, long, long | Constructs an |
Methods
Methods | Type | Description |
| String | Constructs an |
| String | Constructs an |
| byte[] | Constructs an |
| String | Constructs a solidity address from |
| String | Constructs an |
| PublicKey | The alias key of the |
| EVM address | The EVM address of the |
| byte[] | Constructs an |
Example
A FileId
is composed of a <shardNum>.<realmNum>.<fileNum> (eg. 0.0.15).
shardNum represents the shard number (
shardId
). It will default to 0 today, as Hedera only performs in one shard.realmNum represents the realm number (
realmId
). It will default to 0 today, as realms are not yet supported.fileNum represents the file number
Together these values make up your accountId. When an FileId
is requested, be sure all three values are included.
Constructor
Constructor | Type | Description |
| long, long, long | Constructs a |
Methods
Methods | Type | Description |
| String | Constructs an <shardNum>.<realmNum>.<fileNum> |
| String | Constructs an |
| FileId | The public node address book for the current network |
| FileId | The current exchange rate of HBAR to USD |
| FileId | The current fee schedule for the network |
Example
A ContractId
is composed of a <shardNum>.<realmNum>.<contractNum> (eg. 0.0.20).
shardNum represents the shard number (
shardId
). It will default to 0 today, as Hedera only performs in one shard.realmNum represents the realm number (
realmId
). It will default to 0 today, as realms are not yet supported.contractNum represents the contract number
Together these values make up your ContractId
. When an ContractId
is requested, be sure all three values are included. ContractId's are automatically assigned when you create a new smart contract.
Constructor
Constructor | Type | Description |
| long, long, long | Constructs a |
Methods
Methods | Type | Description |
| String | Constructs a <shardNum>.<realmNum>.<contractNum> |
| String | Constructs a |
| String | Contruct a Solidity address from a Hedera contract ID |
| long, long, String | Constructs a |
Example
A topicId
is composed of a <shardNum>.<realmNum>.<topicNum> (eg. 0.0.100).
shardNum represents the shard number (
shardId
). It will default to 0 today, as Hedera only performs in one shard.realmNum represents the realm number (
realmId
). It will default to 0 today, as realms are not yet supported.topicNum represents the topic number (
topicId
)
Constructor
Constructor | Type | Description |
| long, long, long | Constructs a |
Methods | Type | Description |
| String | Constructs a topic ID from a String |
| Constructs a topic ID to String format |
Example
Last updated