- Construct a client
- Generate a key
- Generate a key (with mnemonic)
- Get address book
- Get exchange rates
- Logger
- Sign a scheduled transfer transaction
- Sign a scheduled transfer transaction (with comments)
- Schedule identical transaction
- Schedule multisig transaction
- Schedule multisig transaction (with threshold)
- Create an account
- Create an account (threshold key)
- Create an account (with alias)
- Create an account (with alias and receiver signature required)
- Account creation ways
- Create an account with Hts
- Auto create an account with transfer transaction
- Account alias
- Account allowance
- Get account info
- Get account balance
- Update an account
- Delete an account
- Staking
- Staking (with update)
- Multisig
- Create a topic
- Topic management
- Consensus Pub Sub
- Consensus Pub Sub (chunked)
- Consensus Pub Sub (with submit key)
- Transfer Hbar
- Transfer Hbar (multi app)
- Transfer tokens
- Transfer using EVM address
- Custom fees
- Custom fees (exempt)
- NFT Allowances
- Zero token operations
- Change Or Remove Existing Keys From A Token (HIP-540)
- Reject A Token (HIP-904)
Running the examples requires .env
file to exist in the examples
folder if running with Gradle:
cp .env.sample .env
And in the root project folder if running with Intellij IDEA:
cp .env.sample ../.env
The OPERATOR_ID
and OPERATOR_KEY
variables should be set in a .env
file.
Optionally, you can set the HEDERA_NETWORK
and SDK_LOG_LEVEL
variables:
- You can set the
HEDERA_NETWORK
tolocalhost
,testnet
,previewnet
ormainnet
for configuring the network. If theHEDERA_NETWORK
is not set, it will default totestnet
. - You can set the
SDK_LOG_LEVEL
toTRACE
,DEBUG
,INFO
,WARN
,ERROR
orSILENT
for configuring the logging. If theSDK_LOG_LEVEL
is not set, it will default toSILENT
. Important pre-requisite to see logs: set simple logger log level to same level as theSDK_LOG_LEVEL
, for example via VM options:-Dorg.slf4j.simpleLogger.log.com.hedera.hashgraph=trace
.
Therefore, the format of the configuration file should be as follows:
OPERATOR_ID=0.0.102...
OPERATOR_KEY=0xeae...
# Optionally set HEDERA_NETWORK and SDK_LOG_LEVEL
HEDERA_NETWORK=previewnet
SDK_LOG_LEVEL=WARN
Note that the below
./gradlew
commands should be run from the root of the project.
Template:
./gradlew -q :examples:run<NameOfExample>
Concrete example:
./gradlew -q :examples:runGenerateKey
Simply execute the main function of the desired example.