java.lang.Object
com.google.protobuf.AbstractMessageLite<AccountID,AccountID.Builder>
com.google.protobuf.GeneratedMessageLite<AccountID,AccountID.Builder>
com.hedera.hashgraph.sdk.proto.AccountID
- All Implemented Interfaces:
com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,AccountIDOrBuilder
@Generated
public final class AccountID
extends com.google.protobuf.GeneratedMessageLite<AccountID,AccountID.Builder>
implements AccountIDOrBuilder
* A unique identifier for an Hedera account. An account identifier is of the form `shard.realm.[number|alias]`.<br/> The identifier MAY use the alias form when transferring HBAR to a public key before the account for that key is created, when only the alias value is known, or in some smart contracts that use the EVM address style alias to refer to Accounts.<br/> When the account entry is completed, the alias SHALL be stored separately in the Account record, and the identifier in the Account SHALL use the `accountNum` form. --- ### Additional Notes #### Alias There is considerable complexity with `alias` (aka `evm_address`) for Accounts. Much of this comes from the existence of a "hidden" alias for almost all accounts, and the reuse of the alias field for both EVM reference and "automatic" account creation.<br/> For the purposes of this specification, we will use the following terms for clarity. - `key_alias`<br/> The account public key as a protobuf serialized message and used for auto-creation and subsequent lookup. This is only valid if the account key is a single `primitive` key, either Ed25519 or ECDSA_SECP256K1. - `evm_address`<br/> Exists for every account and is one of - `contract_address`<br/> The 20 byte EVM address prescribed by `CREATE` or `CREATE2` - `evm_key_address`<br/> An arbitrary 20 byte EVM address that, for a usable externally owned account (EOA) SHALL be the rightmost 20 bytes of the Keccak-256 hash of a ECDSA_SECP256K1 key.<br/> Such accounts may be created in one of three ways: - Sending hbar or fungible tokens to an unused ECDSA_SECP256K1 key alias. - Sending hbar or fungible tokens to an unassigned 20-byte EVM address. - Submitting a `CryptoCreate` signed with the corresponding private key. - `long_zero`<br/> A synthetic 20 byte address inferred for "normally" created accounts. It is constructed from the "standard" AccountID as follows. 1. 4 byte big-endian shard number 1. 8 byte big-endian realm number 1. 8 byte big-endian entity number<br/> The `alias` field in the `Account` message SHALL contain one of four values for any given account. - The `key_alias`, if the account was created by transferring HBAR to the `key_alias` public key value. - The `evm_key_address` if the account was created from an EVM public key - The `contract_address` if the account belongs to an EVM contract - Not-Set/null/Bytes.EMPTY (collectively `null`) if the account was created normally If the `alias` field of an `Account` is any form of `null`, then the account MAY be referred to by `alias` in an `AccountID` by using the `long_zero` address for the account.<br/> This "hidden default" alias SHALL NOT be stored, but is synthesized by the node software as needed, and may be synthesized by an EVM contract or client software as well. --- #### Alias forms An `AccountID` in a transaction MAY reference an `Account` with `shard.realm.alias`.<br/> If the account `alias` field is set for an Account, that value SHALL be the account alias.<br/> If the account `alias` field is not set for an Account, the `long_zero` alias SHALL be the account alias.Protobuf type
proto.AccountID-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final class* A unique identifier for an Hedera account.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite
com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType, BuilderType>, BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType, BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite, Type>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageLite
unknownFieldsFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionprotected final ObjectdynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) long* A whole number account number, unique within its realm and shard.com.google.protobuf.ByteStringgetAlias()* An alias value.<br/> Alias is a value used in some contexts to refer to an account when account number is not available, and may be an alias public key, or an EVM address.static AccountIDlong* A whole number realm identifier.long* A whole number shard identifier.boolean* A whole number account number, unique within its realm and shard.booleanhasAlias()* An alias value.<br/> Alias is a value used in some contexts to refer to an account when account number is not available, and may be an alias public key, or an EVM address.static AccountID.Builderstatic AccountID.BuildernewBuilder(AccountID prototype) static AccountIDparseDelimitedFrom(InputStream input) static AccountIDparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static AccountIDparseFrom(byte[] data) static AccountIDparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static AccountIDparseFrom(com.google.protobuf.ByteString data) static AccountIDparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static AccountIDparseFrom(com.google.protobuf.CodedInputStream input) static AccountIDparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static AccountIDparseFrom(InputStream input) static AccountIDparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static AccountIDparseFrom(ByteBuffer data) static AccountIDparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<AccountID> parser()Methods inherited from class com.google.protobuf.GeneratedMessageLite
createBuilder, createBuilder, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeToMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Field Details
-
SHARDNUM_FIELD_NUMBER
public static final int SHARDNUM_FIELD_NUMBER- See Also:
-
REALMNUM_FIELD_NUMBER
public static final int REALMNUM_FIELD_NUMBER- See Also:
-
ACCOUNTNUM_FIELD_NUMBER
public static final int ACCOUNTNUM_FIELD_NUMBER- See Also:
-
ALIAS_FIELD_NUMBER
public static final int ALIAS_FIELD_NUMBER- See Also:
-
-
Method Details
-
getAccountCase
- Specified by:
getAccountCasein interfaceAccountIDOrBuilder
-
getShardNum
public long getShardNum()* A whole number shard identifier.
int64 shardNum = 1;- Specified by:
getShardNumin interfaceAccountIDOrBuilder- Returns:
- The shardNum.
-
getRealmNum
public long getRealmNum()* A whole number realm identifier.
int64 realmNum = 2;- Specified by:
getRealmNumin interfaceAccountIDOrBuilder- Returns:
- The realmNum.
-
hasAccountNum
public boolean hasAccountNum()* A whole number account number, unique within its realm and shard. <p> For any AccountID fields in the query response, transaction records, transaction receipts, or block stream `accountNum` MUST be used.
int64 accountNum = 3;- Specified by:
hasAccountNumin interfaceAccountIDOrBuilder- Returns:
- Whether the accountNum field is set.
-
getAccountNum
public long getAccountNum()* A whole number account number, unique within its realm and shard. <p> For any AccountID fields in the query response, transaction records, transaction receipts, or block stream `accountNum` MUST be used.
int64 accountNum = 3;- Specified by:
getAccountNumin interfaceAccountIDOrBuilder- Returns:
- The accountNum.
-
hasAlias
public boolean hasAlias()* An alias value.<br/> Alias is a value used in some contexts to refer to an account when account number is not available, and may be an alias public key, or an EVM address.
bytes alias = 4;- Specified by:
hasAliasin interfaceAccountIDOrBuilder- Returns:
- Whether the alias field is set.
-
getAlias
public com.google.protobuf.ByteString getAlias()* An alias value.<br/> Alias is a value used in some contexts to refer to an account when account number is not available, and may be an alias public key, or an EVM address.
bytes alias = 4;- Specified by:
getAliasin interfaceAccountIDOrBuilder- Returns:
- The alias.
-
parseFrom
public static AccountID parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static AccountID parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static AccountID parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static AccountID parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static AccountID parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static AccountID parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static AccountID parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static AccountID parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static AccountID parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilder
-
newBuilder
-
dynamicMethod
protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) - Specified by:
dynamicMethodin classcom.google.protobuf.GeneratedMessageLite<AccountID,AccountID.Builder>
-
getDefaultInstance
-
parser
-