Skip to content

Commit

Permalink
chore: rename examples packages
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Ivanov <[email protected]>
  • Loading branch information
0xivanov committed Dec 20, 2024
1 parent ec64334 commit 2944dfa
Show file tree
Hide file tree
Showing 104 changed files with 3,174 additions and 4,349 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ jobs:
env:
NEXUS_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: ./gradlew releaseMavenCentral -PpublishingPackageGroup=org.hiero -PpublishSigningEnabled=true --scan --no-configuration-cache
run: ./gradlew releaseMavenCentral -PpublishingPackageGroup=org.hiero.sdk -PpublishSigningEnabled=true --scan --no-configuration-cache
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020 Hedera Hashgraph LLC
Copyright 2024 Hiero LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hedera™ Hashgraph Java SDK
# Hiero Java SDK

![](https://img.shields.io/badge/java-17%2B-blue?style=flat-square)
![](https://img.shields.io/badge/android-26%2B-blue?style=flat-square)
Expand All @@ -15,35 +15,43 @@ Please install the latest version 2.x.x or migrate from v1 to the latest 2.x.x v
You can reference the [migration documentation](docs/sdk/MIGRATING_V1.md).

## Java app quickstart

[The Java application quickstart guide](docs/java-app/java-app-quickstart.md) covers how to properly set up the dependencies
needed to start developing your Java project using the Hedera™ Java SDK.

## Android app quickstart

[The Android application quickstart guide](docs/android-app/android-app-quickstart.md) covers how to properly set up the dependencies
needed to start developing your Android project using the Hedera™ Java SDK.

## Examples

This repository includes [Java examples](examples/README.md) and [an Android example](example-android/README.md)
that showcase different use cases and workflows.

## Developer quickstart

The [developer quickstart guide](docs/sdk/developer-guide.md) provides instructions on how to set up the environment,
run unit and integration tests, and configure the project to work with different networks
such as the Hedera test network, preview network, etc.

## Support

If you have a question on how to use the product, please see our
[support guide](https://github.com/hashgraph/.github/blob/main/SUPPORT.md).

## Contributing

We welcome participation from all developers!\
For instructions on how to contribute to this repo, please
review the [Contributing Guide](docs/sdk/CONTRIBUTING.md).\
More instructions for contribution can be found in the [Global Contributing Guide](https://github.com/hashgraph/.github/blob/main/CONTRIBUTING.md).

## Code of Conduct

This project is governed by the [Contributor Covenant Code of Conduct](https://github.com/hashgraph/.github/blob/main/CODE_OF_CONDUCT.md). By participating, you are
expected to uphold this code of conduct.

## License

[Apache License 2.0](LICENSE)
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tasks:

"update:snapshots":
cmds:
- rm sdk/src/test/java/com/hedera/hashgraph/sdk/*.snap
- rm sdk/src/test/java/org/hiero/sdk/*.snap
- ./gradlew clean test

"update:proto":
Expand Down
6 changes: 3 additions & 3 deletions example-android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ repositories {

android {
compileSdk = 34
namespace = "com.hedera.android_example"
namespace = "org.hiero.android_example"

defaultConfig {
applicationId = "com.hedera.android_example"
applicationId = "org.hiero.android_example"
minSdk = 26
targetSdk = 34
versionCode = 1
Expand Down Expand Up @@ -50,7 +50,7 @@ dependencies {
implementation(platform("com.hedera.hashgraph:hiero-dependency-versions"))
// ---------------------------------------------

implementation("com.hedera.hashgraph:sdk:2.46.0")
implementation("org.hiero.sdk:sdk:2.46.0")

implementation("com.google.android.material:material:1.11.0")

Expand Down
2 changes: 1 addition & 1 deletion example-android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:name="org.hiero.android_example.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: Apache-2.0
package com.hedera.android_example
package org.hiero.android_example

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.hedera.android_example.ui.main.SectionsPagerAdapter
import org.hiero.android_example.ui.main.SectionsPagerAdapter
import androidx.viewpager2.widget.ViewPager2
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
package com.hedera.android_example.ui.main
package org.hiero.android_example.ui.main

import android.os.Bundle
import android.view.LayoutInflater
Expand All @@ -11,11 +11,11 @@ import android.widget.ProgressBar
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.hedera.android_example.R
import com.hedera.hashgraph.sdk.AccountBalanceQuery
import com.hedera.hashgraph.sdk.AccountId
import com.hedera.hashgraph.sdk.Client
import com.hedera.hashgraph.sdk.PrecheckStatusException
import org.hiero.android_example.R
import org.hiero.sdk.AccountBalanceQuery
import org.hiero.sdk.AccountId
import org.hiero.sdk.Client
import org.hiero.sdk.PrecheckStatusException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
package com.hedera.android_example.ui.main
package org.hiero.android_example.ui.main

import android.os.Bundle
import android.view.LayoutInflater
Expand All @@ -11,8 +11,8 @@ import android.widget.ProgressBar
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.hedera.android_example.R
import com.hedera.hashgraph.sdk.*
import org.hiero.android_example.R
import org.hiero.sdk.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: Apache-2.0
package com.hedera.android_example.ui.main
package org.hiero.android_example.ui.main

import android.widget.TextView
import android.view.LayoutInflater
import android.view.ViewGroup
import android.os.Bundle
import android.view.View
import com.hedera.android_example.R
import org.hiero.android_example.R
import androidx.fragment.app.Fragment
import com.hedera.hashgraph.sdk.PrivateKey
import org.hiero.sdk.PrivateKey

class PrivateKeyFragment : Fragment() {
private lateinit var privateKey: TextView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
package com.hedera.android_example.ui.main
package org.hiero.android_example.ui.main

import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
Expand Down
2 changes: 2 additions & 0 deletions example-android/gradle/module.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.hiero.sdk=org.hiero.sdk:sdk
org.hiero.sdk.full=org.hiero.sdk:sdk-full
121 changes: 67 additions & 54 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,98 @@
## Java examples

### SDK
* [Construct a client](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConstructClientExample.java)
* [Generate a key](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyExample.java)
* [Generate a key (with mnemonic)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/GenerateKeyWithMnemonicExample.java)
* [Get address book](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAddressBookExample.java)
* [Get exchange rates](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetExchangeRatesExample.java)
* [Logger](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/LoggerFunctionalitiesExample.java)

* [Construct a client](../examples/src/main/java/org/hiero/sdk/examples/ConstructClientExample.java)
* [Generate a key](../examples/src/main/java/org/hiero/sdk/examples/GenerateKeyExample.java)
* [Generate a key (with mnemonic)](../examples/src/main/java/org/hiero/sdk/examples/GenerateKeyWithMnemonicExample.java)
* [Get address book](../examples/src/main/java/org/hiero/sdk/examples/GetAddressBookExample.java)
* [Get exchange rates](../examples/src/main/java/org/hiero/sdk/examples/GetExchangeRatesExample.java)
* [Logger](../examples/src/main/java/org/hiero/sdk/examples/LoggerFunctionalitiesExample.java)

### Transactions
* [Sign a transaction](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/SignTransactionExample.java)
* [Transaction serialization (HIP-745)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransactionSerializationExample.java)

* [Sign a transaction](../examples/src/main/java/org/hiero/sdk/examples/SignTransactionExample.java)
* [Transaction serialization (HIP-745)](../examples/src/main/java/org/hiero/sdk/examples/TransactionSerializationExample.java)

### Schedule Transaction
* [Sign a scheduled transfer transaction](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleExample.java)
* [Sign a scheduled transfer transaction (with comments)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransferExample.java)
* [Schedule identical transaction](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleIdenticalTransactionExample.java)
* [Schedule multisig transaction](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduleMultiSigTransactionExample.java)
* [Schedule multisig transaction (with threshold)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java)

* [Sign a scheduled transfer transaction](../examples/src/main/java/org/hiero/sdk/examples/ScheduleExample.java)
* [Sign a scheduled transfer transaction (with comments)](../examples/src/main/java/org/hiero/sdk/examples/ScheduledTransferExample.java)
* [Schedule identical transaction](../examples/src/main/java/org/hiero/sdk/examples/ScheduleIdenticalTransactionExample.java)
* [Schedule multisig transaction](../examples/src/main/java/org/hiero/sdk/examples/ScheduleMultiSigTransactionExample.java)
* [Schedule multisig transaction (with threshold)](../examples/src/main/java/org/hiero/sdk/examples/ScheduledTransactionMultiSigThresholdExample.java)

### Accounts and HBAR
* [Create an account](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountExample.java)
* [Create an account (threshold key)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountThresholdKeyExample.java)
* [Create an account (with alias)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasExample.java)
* [Create an account (with alias and receiver signature required)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java)
* [Account creation ways](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreationWaysExample.java)
* [Create an account with Hts](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountCreateWithHtsExample.java)
* [Auto create an account with transfer transaction](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/AutoCreateAccountTransferTransactionExample.java)
* [Account alias](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAliasExample.java)
* [Account allowance](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/AccountAllowanceExample.java)
* [Get account info](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountInfoExample.java)
* [Get account balance](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetAccountBalanceExample.java)
* [Update an account](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/UpdateAccountPublicKeyExample.java)
* [Delete an account](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteAccountExample.java)
* [Staking](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingExample.java)
* [Staking (with update)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/StakingWithUpdateExample.java)
* [Multisig](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiSigOfflineExample.java)

* [Create an account](../examples/src/main/java/org/hiero/sdk/examples/CreateAccountExample.java)
* [Create an account (threshold key)](../examples/src/main/java/org/hiero/sdk/examples/CreateAccountThresholdKeyExample.java)
* [Create an account (with alias)](../examples/src/main/java/org/hiero/sdk/examples/CreateAccountWithAliasExample.java)
* [Create an account (with alias and receiver signature required)](../examples/src/main/java/org/hiero/sdk/examples/CreateAccountWithAliasAndReceiverSignatureRequiredExample.java)
* [Account creation ways](../examples/src/main/java/org/hiero/sdk/examples/AccountCreationWaysExample.java)
* [Create an account with Hts](../examples/src/main/java/org/hiero/sdk/examples/AccountCreateWithHtsExample.java)
* [Auto create an account with transfer transaction](../examples/src/main/java/org/hiero/sdk/examples/AutoCreateAccountTransferTransactionExample.java)
* [Account alias](../examples/src/main/java/org/hiero/sdk/examples/AccountAliasExample.java)
* [Account allowance](../examples/src/main/java/org/hiero/sdk/examples/AccountAllowanceExample.java)
* [Get account info](../examples/src/main/java/org/hiero/sdk/examples/GetAccountInfoExample.java)
* [Get account balance](../examples/src/main/java/org/hiero/sdk/examples/GetAccountBalanceExample.java)
* [Update an account](../examples/src/main/java/org/hiero/sdk/examples/UpdateAccountPublicKeyExample.java)
* [Delete an account](../examples/src/main/java/org/hiero/sdk/examples/DeleteAccountExample.java)
* [Staking](../examples/src/main/java/org/hiero/sdk/examples/StakingExample.java)
* [Staking (with update)](../examples/src/main/java/org/hiero/sdk/examples/StakingWithUpdateExample.java)
* [Multisig](../examples/src/main/java/org/hiero/sdk/examples/MultiSigOfflineExample.java)

### Consensus Service
* [Create a topic](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateTopicExample.java)
* [Topic management](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/TopicWithAdminKeyExample.java)
* [Consensus Pub Sub](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubExample.java)
* [Consensus Pub Sub (chunked)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubChunkedExample.java)
* [Consensus Pub Sub (with submit key)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java)

* [Create a topic](../examples/src/main/java/org/hiero/sdk/examples/CreateTopicExample.java)
* [Topic management](../examples/src/main/java/org/hiero/sdk/examples/TopicWithAdminKeyExample.java)
* [Consensus Pub Sub](../examples/src/main/java/org/hiero/sdk/examples/ConsensusPubSubExample.java)
* [Consensus Pub Sub (chunked)](../examples/src/main/java/org/hiero/sdk/examples/ConsensusPubSubChunkedExample.java)
* [Consensus Pub Sub (with submit key)](../examples/src/main/java/org/hiero/sdk/examples/ConsensusPubSubWithSubmitKeyExample.java)

### Token Service
* [Transfer Hbar](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferCryptoExample.java)
* [Transfer Hbar (multi app)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/MultiAppTransferExample.java)
* [Transfer tokens](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferTokensExample.java)
* [Transfer using EVM address](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/TransferUsingEvmAddressExample.java)
* [Custom fees](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CustomFeesExample.java)
* [Custom fees (exempt)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ExemptCustomFeesExample.java)
* [NFT Allowances](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/NftAddRemoveAllowancesExample.java)
* [Zero token operations](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ZeroTokenOperationsExample.java)
* [Change Or Remove Existing Keys From A Token (HIP-540)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ChangeRemoveTokenKeys.java)
* [Reject A Token (HIP-904)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/TokenRejectExample.java)

* [Transfer Hbar](../examples/src/main/java/org/hiero/sdk/examples/TransferCryptoExample.java)
* [Transfer Hbar (multi app)](../examples/src/main/java/org/hiero/sdk/examples/MultiAppTransferExample.java)
* [Transfer tokens](../examples/src/main/java/org/hiero/sdk/examples/TransferTokensExample.java)
* [Transfer using EVM address](../examples/src/main/java/org/hiero/sdk/examples/TransferUsingEvmAddressExample.java)
* [Custom fees](../examples/src/main/java/org/hiero/sdk/examples/CustomFeesExample.java)
* [Custom fees (exempt)](../examples/src/main/java/org/hiero/sdk/examples/ExemptCustomFeesExample.java)
* [NFT Allowances](../examples/src/main/java/org/hiero/sdk/examples/NftAddRemoveAllowancesExample.java)
* [Zero token operations](../examples/src/main/java/org/hiero/sdk/examples/ZeroTokenOperationsExample.java)
* [Change Or Remove Existing Keys From A Token (HIP-540)](../examples/src/main/java/org/hiero/sdk/examples/ChangeRemoveTokenKeys.java)
* [Reject A Token (HIP-904)](../examples/src/main/java/org/hiero/sdk/examples/TokenRejectExample.java)

### File Service
* [Create a file](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateFileExample.java)
* [File append (chunked)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/FileAppendChunkedExample.java)
* [Get file contents](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/GetFileContentsExample.java)
* [Delete a file](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/DeleteFileExample.java)

* [Create a file](../examples/src/main/java/org/hiero/sdk/examples/CreateFileExample.java)
* [File append (chunked)](../examples/src/main/java/org/hiero/sdk/examples/FileAppendChunkedExample.java)
* [Get file contents](../examples/src/main/java/org/hiero/sdk/examples/GetFileContentsExample.java)
* [Delete a file](../examples/src/main/java/org/hiero/sdk/examples/DeleteFileExample.java)

### Smart Contract Service
* [Create a contract](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateSimpleContractExample.java)
* [Create a stateful contract](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/CreateStatefulContractExample.java)
* [Contract nonce (HIP-729)](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ContractNoncesExample.java)
* [Interaction with a contract](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/SolidityPrecompileExample.java)

* [Create a contract](../examples/src/main/java/org/hiero/sdk/examples/CreateSimpleContractExample.java)
* [Create a stateful contract](../examples/src/main/java/org/hiero/sdk/examples/CreateStatefulContractExample.java)
* [Contract nonce (HIP-729)](../examples/src/main/java/org/hiero/sdk/examples/ContractNoncesExample.java)
* [Interaction with a contract](../examples/src/main/java/org/hiero/sdk/examples/SolidityPrecompileExample.java)

### Miscellaneous
* [Checksum validation](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/ValidateChecksumExample.java)
* [Pseudorandom Number Generator](../examples/src/main/java/com/hedera/hashgraph/sdk/examples/PrngExample.java)

* [Checksum validation](../examples/src/main/java/org/hiero/sdk/examples/ValidateChecksumExample.java)
* [Pseudorandom Number Generator](../examples/src/main/java/org/hiero/sdk/examples/PrngExample.java)

## Usage

### Configuration

Running the examples requires `.env` file to exist in the [`examples`](.) folder if running with Gradle:

```sh
cp .env.sample .env
```

And in the root project folder if running with Intellij IDEA:

```sh
cp .env.sample ../.env
```
Expand Down Expand Up @@ -121,4 +133,5 @@ Concrete example:
```

### Running with Intellij

Simply execute the main function of the desired example.
2 changes: 2 additions & 0 deletions examples/gradle/modules.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.hiero.sdk=org.hiero.sdk:sdk
org.hiero.sdk.full=org.hiero.sdk:sdk-full
Loading

0 comments on commit 2944dfa

Please sign in to comment.