Class AccountID

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 Classes
    Modifier and Type
    Class
    Description
    static enum 
     
    static 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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageLite

    unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    dynamicMethod(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.ByteString
    * 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
     
    long
    * A whole number realm identifier.
    long
    * A whole number shard identifier.
    boolean
    * A whole number account number, unique within its realm and shard.
    boolean
    * 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.
     
    newBuilder(AccountID prototype)
     
    static AccountID
     
    static AccountID
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static AccountID
    parseFrom(byte[] data)
     
    static AccountID
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static AccountID
    parseFrom(com.google.protobuf.ByteString data)
     
    static AccountID
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static AccountID
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    static AccountID
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static AccountID
     
    static AccountID
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static AccountID
     
    static AccountID
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<AccountID>
     

    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, writeTo

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Field Details

  • Method Details

    • getAccountCase

      public AccountID.AccountCase getAccountCase()
      Specified by:
      getAccountCase in interface AccountIDOrBuilder
    • getShardNum

      public long getShardNum()
       *
       A whole number shard identifier.
       
      int64 shardNum = 1;
      Specified by:
      getShardNum in interface AccountIDOrBuilder
      Returns:
      The shardNum.
    • getRealmNum

      public long getRealmNum()
       *
       A whole number realm identifier.
       
      int64 realmNum = 2;
      Specified by:
      getRealmNum in interface AccountIDOrBuilder
      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:
      hasAccountNum in interface AccountIDOrBuilder
      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:
      getAccountNum in interface AccountIDOrBuilder
      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:
      hasAlias in interface AccountIDOrBuilder
      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:
      getAlias in interface AccountIDOrBuilder
      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

      public static AccountID parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static AccountID parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static AccountID parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static AccountID parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static AccountID parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static AccountID parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilder

      public static AccountID.Builder newBuilder()
    • newBuilder

      public static AccountID.Builder newBuilder(AccountID prototype)
    • dynamicMethod

      protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
      Specified by:
      dynamicMethod in class com.google.protobuf.GeneratedMessageLite<AccountID,AccountID.Builder>
    • getDefaultInstance

      public static AccountID getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<AccountID> parser()