java.lang.Object
com.hedera.hashgraph.sdk.EntityIdHelper
Utility class used internally by the sdk.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Duration(package private) static final intThe length of a Solidity address in bytes.(package private) static final intThe length of a hexadecimal-encoded Solidity address, in ASCII characters (bytes). -
Method Summary
Modifier and TypeMethodDescription(package private) static StringGenerate a checksum.(package private) static byte[]decodeEvmAddress(String address) Decode the solidity address from a string.(package private) static <R> RfromSolidityAddress(String address, EntityIdHelper.WithIdNums<R> withAddress) Generate an R object from a solidity address.(package private) static <R> RfromString(String idString, EntityIdHelper.WithIdNums<R> constructObjectWithIdNums) Generate an R object from a string.(package private) static CompletableFuture<Long> getAccountNumFromMirrorNodeAsync(Client client, String evmAddress) Get AccountId num from mirror node using evm address.static CompletableFuture<Long> getContractNumFromMirrorNodeAsync(Client client, String evmAddress) Get ContractId num from mirror node using evm address.static CompletableFuture<EvmAddress> getEvmAddressFromMirrorNodeAsync(Client client, long num) Get EvmAddress from mirror node using account num.(package private) static booleanisLongZeroAddress(byte[] address) Takes an address as `byte[]` and returns whether this is a long-zero address(package private) static CompletableFuture<String> performQueryToMirrorNodeAsync(Client client, String apiEndpoint, String jsonBody) (package private) static CompletableFuture<String> performQueryToMirrorNodeAsync(String baseUrl, String apiEndpoint, String jsonBody) (package private) static StringtoSolidityAddress(long shard, long realm, long num) Generate a solidity address.(package private) static StringtoString(long shard, long realm, long num) Generate a string representation.(package private) static StringtoStringWithChecksum(long shard, long realm, long num, Client client, String checksum) Generate a string representation with a checksum.(package private) static voidValidate the configured client.
-
Field Details
-
SOLIDITY_ADDRESS_LEN
static final int SOLIDITY_ADDRESS_LENThe length of a Solidity address in bytes.- See Also:
-
SOLIDITY_ADDRESS_LEN_HEX
static final int SOLIDITY_ADDRESS_LEN_HEXThe length of a hexadecimal-encoded Solidity address, in ASCII characters (bytes).- See Also:
-
MIRROR_NODE_CONNECTION_TIMEOUT
-
-
Method Details
-
fromString
Generate an R object from a string.- Type Parameters:
R-- Parameters:
idString- the id stringconstructObjectWithIdNums- the R object generator- Returns:
- the R type object
-
fromSolidityAddress
Generate an R object from a solidity address.- Type Parameters:
R-- Parameters:
address- the string representationwithAddress- the R object generator- Returns:
- the R type object
-
decodeEvmAddress
Decode the solidity address from a string.- Parameters:
address- the string representation- Returns:
- the decoded address
-
toSolidityAddress
Generate a solidity address.- Parameters:
shard- the shard partrealm- the realm partnum- the num part- Returns:
- the solidity address
-
checksum
Generate a checksum.- Parameters:
ledgerId- the ledger idaddr- the address- Returns:
- the checksum
-
validate
static void validate(long shard, long realm, long num, Client client, @Nullable String checksum) throws BadEntityIdException Validate the configured client.- Parameters:
shard- the shard partrealm- the realm partnum- the num partclient- the configured clientchecksum- the checksum- Throws:
BadEntityIdException
-
toString
Generate a string representation.- Parameters:
shard- the shard partrealm- the realm partnum- the num part- Returns:
- the string representation
-
toStringWithChecksum
static String toStringWithChecksum(long shard, long realm, long num, Client client, @Nullable String checksum) Generate a string representation with a checksum.- Parameters:
shard- the shard partrealm- the realm partnum- the num partclient- the configured clientchecksum- the checksum- Returns:
- the string representation with checksum
-
isLongZeroAddress
static boolean isLongZeroAddress(byte[] address) Takes an address as `byte[]` and returns whether this is a long-zero address- Parameters:
address-- Returns:
-
getAccountNumFromMirrorNodeAsync
Get AccountId num from mirror node using evm address.Note: This method requires API level 33 or higher. It will not work on devices running API versions below 33 because it uses features introduced in API level 33 (Android 13).
*- Parameters:
client-evmAddress-
-
getEvmAddressFromMirrorNodeAsync
public static CompletableFuture<EvmAddress> getEvmAddressFromMirrorNodeAsync(Client client, long num) Get EvmAddress from mirror node using account num.Note: This method requires API level 33 or higher. It will not work on devices running API versions below 33 because it uses features introduced in API level 33 (Android 13).
*- Parameters:
client-num-
-
getContractNumFromMirrorNodeAsync
public static CompletableFuture<Long> getContractNumFromMirrorNodeAsync(Client client, String evmAddress) Get ContractId num from mirror node using evm address.Note: This method requires API level 33 or higher. It will not work on devices running API versions below 33 because it uses features introduced in API level 33 (Android 13).
*- Parameters:
client-evmAddress-
-
performQueryToMirrorNodeAsync
static CompletableFuture<String> performQueryToMirrorNodeAsync(Client client, String apiEndpoint, String jsonBody) -
performQueryToMirrorNodeAsync
static CompletableFuture<String> performQueryToMirrorNodeAsync(String baseUrl, String apiEndpoint, String jsonBody)
-