Skip to content

Commit 8110787

Browse files
Merge pull request #110 from OpenElements/hedera-to-hiero
project names and packages moved from Hedera to Hiero
2 parents d9e9ceb + 38fd642 commit 8110787

File tree

158 files changed

+1968
-1559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+1968
-1559
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Hedera Enterprise
2-
This project provides Java modules to integrate [Hedera network](https://hedera.com) smoothless in a Spring Boot or Microprofile (like Quarkus) application.
2+
This project provides Java modules to integrate [Hedera network](https://hedera.com) smoothless in a Spring Boot or Eclipse Microprofile (like Quarkus) application.
33
This module is based on the [Hedera Java SDK](https://github.com/hashgraph/hedera-sdk-java).
44

55
## Spring Boot support
@@ -95,17 +95,17 @@ The support for Microprofile is still in development and can not be used yet.
9595
The module provides a set of managed services that can be used to interact with the Hedera network.
9696
The following services are available in spring and microprofile:
9797

98-
- `com.openelements.hedera.base.AccountClient`: to interact with Hedera accounts
99-
- `com.openelements.hedera.base.FileClient`: to interact with Hedera files
100-
- `com.openelements.hedera.base.SmartContractClient`: to interact with Hedera smart contracts
101-
- `com.openelements.hedera.base.ContractVerificationClient`: to verify smart contracts
102-
- `com.openelements.hedera.base.NftClient`: to interact with Hedera NFTs
103-
- `com.openelements.hedera.base.NftRepository`: to query NFTs
98+
- `com.openelements.hiero.base.AccountClient`: to interact with Hedera accounts
99+
- `com.openelements.hiero.base.FileClient`: to interact with Hedera files
100+
- `com.openelements.hiero.base.SmartContractClient`: to interact with Hedera smart contracts
101+
- `com.openelements.hiero.base.ContractVerificationClient`: to verify smart contracts
102+
- `com.openelements.hiero.base.NftClient`: to interact with Hedera NFTs
103+
- `com.openelements.hiero.base.NftRepository`: to query NFTs
104104

105105
Next to that the following low-level services are available:
106106

107-
- `com.openelements.hedera.base.protocol.ProtocolLayerClient`: to interact with the Hedera protocol layer
108-
- `com.openelements.hedera.base.mirrornode.MirrorNodeClient`: to query the Hedera mirror node
107+
- `com.openelements.hiero.base.protocol.ProtocolLayerClient`: to interact with the Hedera protocol layer
108+
- `com.openelements.hiero.base.mirrornode.MirrorNodeClient`: to query the Hedera mirror node
109109

110110
## Built the project
111111

hedera-base/src/main/java/module-info.java

Lines changed: 0 additions & 10 deletions
This file was deleted.

hedera-base/src/test/java/com/openelements/hedera/base/test/ProtocolLayerDataCreationTests.java

Lines changed: 0 additions & 815 deletions
This file was deleted.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<parent>
8-
<groupId>com.open-elements.hedera</groupId>
9-
<artifactId>hedera-enterprise</artifactId>
8+
<groupId>com.open-elements.hiero</groupId>
9+
<artifactId>hiero-enterprise</artifactId>
1010
<version>0.12.0-SNAPSHOT</version>
1111
<relativePath>../pom.xml</relativePath>
1212
</parent>
1313

14-
<artifactId>hedera-base</artifactId>
14+
<artifactId>hiero-base</artifactId>
1515

16-
<name>Hedera Enterprise Base</name>
17-
<description>Base Library to work with Hedera in Spring and JakartaEE</description>
16+
<name>Hiero Enterprise Base</name>
17+
<description>Base Library to work with Hiero in Spring and JakartaEE</description>
1818
<url>https://github.com/OpenElements/hedera-enterprise</url>
1919

2020

@@ -23,11 +23,11 @@
2323
<groupId>com.hedera.hashgraph</groupId>
2424
<artifactId>sdk</artifactId>
2525
</dependency>
26-
<dependency>
27-
<groupId>io.github.cdimascio</groupId>
28-
<artifactId>dotenv-java</artifactId>
29-
<version>2.3.2</version>
30-
<scope>test</scope>
26+
<dependency>
27+
<groupId>io.github.cdimascio</groupId>
28+
<artifactId>dotenv-java</artifactId>
29+
<version>2.3.2</version>
30+
<scope>test</scope>
3131
</dependency>
3232
<dependency>
3333
<groupId>org.slf4j</groupId>

hedera-base/src/main/java/com/openelements/hedera/base/Account.java renamed to hiero-base/src/main/java/com/openelements/hiero/base/Account.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.openelements.hedera.base;
1+
package com.openelements.hiero.base;
22

33
import com.hedera.hashgraph.sdk.AccountId;
44
import com.hedera.hashgraph.sdk.PrivateKey;
@@ -8,8 +8,9 @@
88

99
/**
1010
* Represents a Hedera account.
11-
* @param accountId the ID of the account
12-
* @param publicKey the public key of the account
11+
*
12+
* @param accountId the ID of the account
13+
* @param publicKey the public key of the account
1314
* @param privateKey the private key of the account
1415
*/
1516
public record Account(@NonNull AccountId accountId, @NonNull PublicKey publicKey, @NonNull PrivateKey privateKey) {
@@ -22,19 +23,22 @@ public record Account(@NonNull AccountId accountId, @NonNull PublicKey publicKey
2223

2324
/**
2425
* Creates an account object.
25-
* @param accountId the ID of the account
26-
* @param publicKey the public key of the account
26+
*
27+
* @param accountId the ID of the account
28+
* @param publicKey the public key of the account
2729
* @param privateKey the private key of the account
2830
* @return the account
2931
*/
3032
@NonNull
31-
public static Account of(@NonNull AccountId accountId, @NonNull PublicKey publicKey, @NonNull PrivateKey privateKey) {
33+
public static Account of(@NonNull AccountId accountId, @NonNull PublicKey publicKey,
34+
@NonNull PrivateKey privateKey) {
3235
return new Account(accountId, publicKey, privateKey);
3336
}
3437

3538
/**
3639
* Creates an account object.
37-
* @param accountId the ID of the account
40+
*
41+
* @param accountId the ID of the account
3842
* @param privateKey the private key of the account
3943
* @return the account
4044
*/

hedera-base/src/main/java/com/openelements/hedera/base/AccountClient.java renamed to hiero-base/src/main/java/com/openelements/hiero/base/AccountClient.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
package com.openelements.hedera.base;
1+
package com.openelements.hiero.base;
22

33
import com.hedera.hashgraph.sdk.AccountId;
44
import com.hedera.hashgraph.sdk.Hbar;
55
import java.util.Objects;
66
import org.jspecify.annotations.NonNull;
77

88
/**
9-
* Interface for interacting with a Hedera network.
10-
* This interface provides methods for interacting with Hedera accounts, like creating and deleting accounts.
11-
* An implementation of this interface is using an internal account to interact with the Hedera network.
12-
* That account is the account that is used to pay for the transactions that are sent to the Hedera network and called 'operator account'.
9+
* Interface for interacting with a Hedera network. This interface provides methods for interacting with Hedera
10+
* accounts, like creating and deleting accounts. An implementation of this interface is using an internal account to
11+
* interact with the Hedera network. That account is the account that is used to pay for the transactions that are sent
12+
* to the Hedera network and called 'operator account'.
1313
*/
1414
public interface AccountClient {
1515

1616
/**
17-
* Creates a new Hedera account.
18-
* The account is created with an initial balance of 0 hbar.
19-
* The account is created by the operator account.
17+
* Creates a new Hedera account. The account is created with an initial balance of 0 hbar. The account is created by
18+
* the operator account.
2019
*
2120
* @return the created account
2221
* @throws HederaException if the account could not be created
@@ -27,8 +26,7 @@ default Account createAccount() throws HederaException {
2726
}
2827

2928
/**
30-
* Creates a new Hedera account with the given initial balance.
31-
* The account is created by the operator account.
29+
* Creates a new Hedera account with the given initial balance. The account is created by the operator account.
3230
*
3331
* @param initialBalance the initial balance of the account
3432
* @return the created account
@@ -38,38 +36,41 @@ default Account createAccount() throws HederaException {
3836
Account createAccount(@NonNull Hbar initialBalance) throws HederaException;
3937

4038
/**
41-
* Creates a new Hedera account with the given initial balance (in HBAR).
42-
* The account is created by the operator account.
39+
* Creates a new Hedera account with the given initial balance (in HBAR). The account is created by the operator
40+
* account.
4341
*
4442
* @param initialBalanceInHbar the initial balance of the account in HBAR
4543
* @return the created account
4644
* @throws HederaException if the account could not be created
4745
*/
4846
@NonNull
4947
default Account createAccount(long initialBalanceInHbar) throws HederaException {
50-
if(initialBalanceInHbar < 0) {
48+
if (initialBalanceInHbar < 0) {
5149
throw new IllegalArgumentException("initialBalanceInHbar must be non-negative");
5250
}
5351
return createAccount(Hbar.from(initialBalanceInHbar));
5452
}
5553

5654
/**
5755
* Deletes the account with the given ID. All fees of that account are transferred to the operator account.
56+
*
5857
* @param account the account to delete
5958
* @throws HederaException if the account could not be deleted
6059
*/
6160
void deleteAccount(@NonNull Account account) throws HederaException;
6261

6362
/**
6463
* Deletes the account with the given ID. All fees of that account are transferred to the given toAccount.
65-
* @param account the account to delete
64+
*
65+
* @param account the account to delete
6666
* @param toAccount the account to transfer the fees to
6767
* @throws HederaException if the account could not be deleted
6868
*/
6969
void deleteAccount(@NonNull Account account, @NonNull Account toAccount) throws HederaException;
7070

7171
/**
7272
* Returns the balance of the given account.
73+
*
7374
* @param accountId the ID of the account
7475
* @return the balance of the account
7576
* @throws HederaException if the balance could not be retrieved
@@ -79,6 +80,7 @@ default Account createAccount(long initialBalanceInHbar) throws HederaException
7980

8081
/**
8182
* Returns the balance of the given account.
83+
*
8284
* @param accountId the ID of the account
8385
* @return the balance of the account
8486
* @throws HederaException if the balance could not be retrieved

hedera-base/src/main/java/com/openelements/hedera/base/AccountRepository.java renamed to hiero-base/src/main/java/com/openelements/hiero/base/AccountRepository.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
package com.openelements.hedera.base;
1+
package com.openelements.hiero.base;
22

33
import com.hedera.hashgraph.sdk.AccountId;
4-
import com.openelements.hedera.base.mirrornode.AccountInfo;
5-
import org.jspecify.annotations.NonNull;
6-
4+
import com.openelements.hiero.base.mirrornode.AccountInfo;
75
import java.util.Objects;
86
import java.util.Optional;
7+
import org.jspecify.annotations.NonNull;
98

109
/**
1110
* Interface for interacting with a Hedera network. This interface provides methods for searching for Accounts.
@@ -14,7 +13,7 @@ public interface AccountRepository {
1413
/**
1514
* Return the AccountInfo of a given accountId.
1615
*
17-
* @param accountId id of the account
16+
* @param accountId id of the account
1817
* @return {@link Optional} containing the found AccountInfo or null
1918
* @throws HederaException if the search fails
2019
*/
@@ -23,7 +22,7 @@ public interface AccountRepository {
2322
/**
2423
* Return the AccountInfo of a given accountId.
2524
*
26-
* @param accountId id of the account
25+
* @param accountId id of the account
2726
* @return {@link Optional} containing the found AccountInfo or null
2827
* @throws HederaException if the search fails
2928
*/

hedera-base/src/main/java/com/openelements/hedera/base/ContractCallResult.java renamed to hiero-base/src/main/java/com/openelements/hiero/base/ContractCallResult.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,111 @@
1-
package com.openelements.hedera.base;
1+
package com.openelements.hiero.base;
22

33
import com.hedera.hashgraph.sdk.Hbar;
44
import java.math.BigInteger;
55

66
/**
7-
* Interface for the result of a contract call.
8-
* This is used to get the return values of a contract call.
9-
* The return values are indexed from 0 to n-1.
7+
* Interface for the result of a contract call. This is used to get the return values of a contract call. The return
8+
* values are indexed from 0 to n-1.
109
*/
1110
public interface ContractCallResult {
1211

1312
/**
1413
* Get the amount of gas used by the contract call.
14+
*
1515
* @return the amount of gas used by the contract call.
1616
*/
1717
long gasUsed();
1818

1919
/**
2020
* Get the amount of hbar used by the contract call.
21+
*
2122
* @return the amount of hbar used by the contract call.
2223
*/
2324
Hbar cost();
2425

2526
/**
2627
* Get a return value as a string.
28+
*
2729
* @param index the index of the return value.
2830
* @return the return value as a string.
2931
*/
3032
String getString(int index);
3133

3234
/**
3335
* Get a return value as an address.
36+
*
3437
* @param index the index of the return value.
3538
* @return the return value as an address.
3639
*/
3740
String getAddress(int index);
3841

3942
/**
4043
* Get a return value as a boolean.
44+
*
4145
* @param index the index of the return value.
4246
* @return the return value as a boolean.
4347
*/
4448
boolean getBool(int index);
4549

4650
/**
4751
* Get a return value as an int8.
52+
*
4853
* @param index the index of the return value.
4954
* @return the return value as an int8.
5055
*/
5156
byte getInt8(int index);
5257

5358
/**
5459
* Get a return value as an int32.
60+
*
5561
* @param index the index of the return value.
5662
* @return the return value as an int32.
5763
*/
5864
int getInt32(int index);
5965

6066
/**
6167
* Get a return value as an int64.
68+
*
6269
* @param index the index of the return value.
6370
* @return the return value as an int64.
6471
*/
6572
long getInt64(int index);
6673

6774
/**
6875
* Get a return value as an int256.
76+
*
6977
* @param index the index of the return value.
7078
* @return the return value as an int256.
7179
*/
7280
BigInteger getInt256(int index);
7381

7482
/**
7583
* Get a return value as an uint8.
84+
*
7685
* @param index the index of the return value.
7786
* @return the return value as an uint8.
7887
*/
7988
long getUint8(int index);
8089

8190
/**
8291
* Get a return value as an uint32.
92+
*
8393
* @param index the index of the return value.
8494
* @return the return value as an uint32.
8595
*/
8696
long getUint32(int index);
8797

8898
/**
8999
* Get a return value as an uint64.
100+
*
90101
* @param index the index of the return value.
91102
* @return the return value as an uint64.
92103
*/
93104
long getUint64(int index);
94105

95106
/**
96107
* Get a return value as an uint256.
108+
*
97109
* @param index the index of the return value.
98110
* @return the return value as an uint256.
99111
*/

0 commit comments

Comments
 (0)