All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Support
memo
for Tokens, Accounts, and Files.
- Scheduled transaction support:
ScheduleCreateTransaction
,ScheduleDeleteTransaction
, andScheduleSignTransaction
- HMAC Calculation Does Not Include IV [NCC-E001154-010]
- Non-Constant Time Lookup of Mnemonic Words [NCC-E001154-009]
- Decreased
CHUNK_SIZE
4096->1024 and increased default max chunks 10->20 - Remove use of
computeIfAbsent
andputIfAbsent
from JDK7 builds
new TransactionId(AccountId, Instant)
- UseTransactionId.withValidStart()
instead.
TransferTransaction.addTokenTransfer()
was correctly adding tokens- HMAC Calculation Does Not Include IV [NCC-E001154-010]
- Non-Constant Time Lookup of Mnemonic Words [NCC-E001154-009]
- Decreased
CHUNK_SIZE
4096->1024 and increased default max chunks 10->20 - Renamed
ScheduleInfo.getTransaction()
->ScheduleInfo.getScheduledTransaction()
- Remove use of
computeIfAbsent
andputIfAbsent
from JDK7 builds
- Scheduled transactions should use new HAPI protobufs
ReceiptPrecheckException
should be thrown when the erroring status was in theTransactionReceipt
- Removed
nonce
fromTransactionId
Transaction[Receipt|Record]Query
should not error for statusIDENTICAL_SCHEDULE_ALREADY_CREATED
because the other fields on the receipt are present with that status.ScheduleMultiSigExample
should use updated scheduled transaction API
ScheduleCreateTransaction.addScheduledSignature()
ScheduleCreateTransaction.getScheduledSignatures()
ScheduleSignTransaction.addScheduledSignature()
ScheduleSignTransaction.getScheduledSignatures()
- Support for old
proto.Transaction
raw bytes inTransaction.fromBytes()
TransactionRecord.scheduleRef
- Reference to the scheduled transactionTransactionReceipt.scheduledTransactionId
ScheduleInfo.scheduledTransactionId
- Feature to copy
TransactionId
of a transaction being scheduled to the parentScheduleCreateTransaction
if one is set.
TransactionId.toBytes()
should supportnonce
if setTransactionId.fromBytes()
should supportnonce
if set
- Support
memo
for Tokens, Accounts, and Files. TransactionId.fromString()
should support nonce and scheduled.
TransactionId.toString()
will append?scheduled
for scheduled transaction IDs, and transaction IDs created from nonce will print in hex.
- Support for scheduled and nonce in
TransactionId
TransactionId.withNonce()
- Supports creating transaction ID with random bytes.TransactionId.[set|get]Scheduled()
- Supports scheduled transaction IDs.
TransactionId.withValidStart()
ScheduleCreateTransaction.setTransaction()
andTransaction.schedule()
not correctly setting existing signatures.
new TransactionId(AccountId, Instant)
- UseTransactionId.withValidStart()
instead.
Schedule[Create|Sign]Transaction.addScheduleSignature()
didn't save added signatures correctly.
- Support for scheduled transactions.
ScheduleCreateTransaction
- Create a new scheduled transactionScheduleSignTransaction
- Sign an existing scheduled transaction on the networkScheduleDeleteTransaction
- Delete a scheduled transactionScheduleInfoQuery
- Query the info includingbodyBytes
of a scheduled transactionScheduleId
- Implement
Client.forName()
to support construction of client from network name. - Implement
PrivateKey.verifyTransaction()
to allow a user to verify a transaction was signed with a partiular key. - Rename
HederaPreCheckStatusException
toPrecheckStatusException
and deprecateHederaPreCheckStatusException
- Rename
HederaReceipStatusException
toReceipStatusException
and deprecateHederaReceipStatusException
long getAutoRenewPeriod()
->Duration getAutoRenewPeriod()
setAutoRenewPeriod(long)
->setAutoRenewPeriod(Duration)
long getExpirationTime()
->Instant getExpirationTime()
setExpirationTime(long)
->setExpirationTime(Instant)
long getAutoRenewPeriod()
->Duration getAutoRenewPeriod()
setAutoRenewPeriod(long)
->setAutoRenewPeriod(Duration)
long getExpirationTime()
->Instant getExpirationTime()
setExpirationTime(long)
->setExpirationTime(Instant)
AccountId treasury()
->AccountId treasuryAccountId()
long autoRenewPeriod()
->Duration autoRenewPeriod()
long expirationTime()
->Instant expirationTime()
- No longer support the use of
long
forHbar
parameters. Meaning you can no longer doAccountCreateTransaction().setInitialBalance(5)
and instead mustAccountCreateTransaction().setInitialBalance(new Hbar(5))
. This of course applies to more than justsetInitialBalance()
. - Any method that used to require a
PublicKey
will now requireKey
.AccountCreateTransaction.setKey(PublicKey)
is nowAccountCreateTransaction.setKey(Key)
as an example.
- All
Id
types (Account
,File
,Contract
,Topic
, andTransactionId
)- Support
fromBytes()
andtoBytes()
- No longer have the
toProto()
method.
- Support
- The use of
Duration
in the SDK will be eitherjava.time.Duration
ororg.threeten.bp.Duration
depending on which JDK and platform you're developing on. - The use of
Instant
in the SDK will be eitherjava.time.Instant
ororg.threeten.bp.Instant
depending on which JDK and platform you're developing on. - All transactions and queries will now attempt to execute on more than one node.
- More
getCostAsync
andexecuteAsync
variantsvoid executeAsync(Client)
Future executeAsync(Client, BiConsumer<O, T>)
void executeAsync(Client, Duration timeout, BiConsumer<O, T>)
void getCostAsync(Client)
Future getCostAsync(Client, BiConsumer<O, T>)
void getCostAsync(Client, Duration timeout, BiConsumer<O, T>)
- Building different types from a protobuf type is no longer supported. Use
fromBytes
instead. getSignatureCase()
is no longer accessible- Field which were
byte[]
are nowByteString
to prevent extra copy operation. This includes the response type ofFileContentsQuery
ConsensusSubmitMessageTransaction
->MessageSubmitTransaction
ConsensusTopicCreateTransaction
->TopicCreateTransaction
ConsensusTopicDeleteTransaction
->TopicDeleteTransaction
ConsensusTopicUpdateTransaction
->TopicUpdateTransaction
ConsensusTopicId
->TopicId
Ed25519PublicKey
->PublicKey
Ed25519PrivateKey
->PrivateKey
HederaNetworkException
MnemonicValidationResult
HederaConstants
ThresholdKey
useKeyList.withThreshold()
instead.
- LiveHash: Support for Hedera LiveHashes
- Key: A common base for the signing authority or key entities in Hedera may have.
Client()
->Client.forNetwork()
Client.fromFile()
->Client.fromJsonFile()
Client.replaceNodes()
->Client.setNetwork()
sign()
no longer requires offset or length parameters
writePem()
verify()
verifies the message was signed by public key
as()
->to()
asTinybar()
->toTinybars()
fromTinybar()
->fromTinybars()
negated()
getValue()
Hbar(BigDecimal, HbarUnit)
Hbar.from(long)
Hbar.from(BigDecimal)
Hbar.of()
KeyList.withThreshold()
size()
isEmpty()
contains()
containsAll()
iterator()
toArray()
remove()
removeAll()
retainAll()
clear()
toString()
Mnemonic(List<? extends CharSequence>)
->Mnemonic.fromWords() throws BadMnemonicException
ContractId(long)
toKeyProto()
implements PublicKey
meaning it can no longer be used in place of a Key
FileId(long)
fromSolidityAddress()
toSolidityAddress()
TransactionId.withValidStart()
TransactionId.generate()
Transaction.hash()
Transaction.signWithOperator()
getReceipt()
getRecord()
toProto()
setPaymentTransaction()
List<LiveHash> liveHashes
setDeleteAccountId()
->setAccountId()
- Removed
addKey()
, usesetKeys(Key...)
instead.
- Removed
addKey()
, usesetKeys(Key...)
instead.
-
Support for loading Ed25519 keys from encrypted PEM files (generated from OpenSSL).
-
Add a method to validate a mnemonic word list for accurate entry.
- Fixed
TransactionReceiptQuery
not waiting for consensus some times.
- Add additional error classes to allow more introspection on errors:
HederaPrecheckStatusException
- Thrown when the transaction fails at the node (the precheck)HederaReceiptStatusException
- Thrown when the receipt is checked and has a failing status. The error object contains the full receipt.HederaRecordStatusException
- Thrown when the record is checked and it has a failing status. The error object contains the full record.
-
Add missing
setTransferAccountId
andsetTransferContractId
methods toContractDeleteTransaction
-
Override
executeAsync
to sign by the operator (if not already)
- Deprecate
toSolidityAddress
andfromSolidityAddress
onFileId
Add support for Hedera Consensus Service (HCS).
-
Add
ConsensusTopicCreateTransaction
,ConsensusTopicUpdateTransaction
,ConsensusTopicDeleteTransaction
, andConsensusMessageSubmitTransaction
transactions -
Add
ConsensusTopicInfoQuery
query (returnsConsensusTopicInfo
) -
Add
MirrorClient
andMirrorConsensusTopicQuery
which can be used to listen for HCS messages from a mirror node
Removed all deprecated APIs from v1.0.0.
-
Instead of returning
ResponseCodeEnum
from the generated protos, return a newStatus
type that wraps that and provides some Java conveniences. -
Rename
HederaException
toHederaStatusException
-
Rename
QueryBuilder.MaxPaymentExceededException
toMaxQueryPaymentExceededException
-
Change
AccountBalanceQuery
to returnHbar
(instead ofLong
) -
Change
ContractGetBytecodeQuery
to returnbyte[]
(instead of the internal proto type) -
Remove
GetBySolidityIdQuery
. Instead, you should useAccountId.toSolidityAddress
. -
Change
ContractRecordsQuery
to returnTransactionRecord[]
All changes are not immediately breaking as the previous method still should exist and be working. The previous methods are flagged as deprecated and will be removed upon v1.0
.
-
Transactions and queries do not take
Client
in the constructor; instead,Client
is passed toexecute
. -
Removed
Transaction.executeForReceipt
andTransaction.executeForRecord
These methods have been identified as harmful as they hide too much. If one fails, you do not know if the transaction failed to execute; or, the receipt/record could not be retrieved. In a mission-critical application, that is, of course, an important distinction.
Now there is only
Transaction.execute
which returns aTransactionId
. If you don't care about waiting for consensus or retrieving a receipt/record in your application, you're done. Otherwise you can now use anyTransactionId
and ask for the receipt/record (with a stepped retry interval until consensus) withTransactionId.getReceipt
andTransactionId.getRecord
.v0.8.x and below
AccountId newAccountId = new AccountCreateTransaction(hederaClient) .setKey(newKey.getPublicKey()) .setInitialBalance(1000) .executeForReceipt() // TransactionReceipt .getAccountId();
v0.9.x
AccountId newAccountId = new AccountCreateTransaction() .setKey(newKey.getPublicKey()) .setInitialBalance(1000) .execute(hederaClient) // TranactionId .getReceipt(hederaClient) // TransactionReceipt .getAccountId();
-
TransactionReceipt
,AccountInfo
,TransactionRecord
, etc. now expose public final fields instead of getters (where possible and it makes sense). -
Rename
getCallResult
andgetCreateResult
togetContractExecuteResult
andgetContractCreateResult
for consistency -
TransactionBuilder.setMemo
is renamed toTransactionBuilder.setTransactionMemo
to avoid confusion as there are 2 other kinds of memos on transactions -
CallParams
is removed in favor ofContractFunctionParams
and closely mirrors type names from solidityaddInt32
addInt256Array
addString
- etc.
-
ContractFunctionResult
now closely mirrors the solidity type namesgetInt32
- etc.
-
setFunctionParams(params)
onContractCallQuery
andContractExecuteTransaction
is nowsetFunction(name, params)
-
TransactionId.getReceipt
-
TransactionId.getRecord
-
FileId.ADDRESS_BOOK
,FileId.FEE_SCHEDULE
,FileId.EXCHANGE_RATES
-
Experimental support for the Hedera Consensus Service (HCS). HCS is not yet generally available but if you have access the SDK can work with the current iteration of it. Due to its experimental nature, a system property must be set before use.
System.setPropery("com.hedera.hashgraph.sdk.experimental", "true")
-
Client.forTestnet
makes a new client configured to talk to TestNet (use.setOperator
to set an operater) -
Client.forMainnet
makes a new client configured to talk to Mainnet (use.setOperator
to set an operater)
-
FileCreateTransaction
sets a default expiration time; fixesAUTORENEW_DURATION_NOT_IN_RANGE
. -
BUSY
is now internally retried in all cases. -
The maximum query payment is now defaulted to 1 Hbar. By default, just before a query is executed we ask Hedera how much the query will cost and if it costs under the defined maximum, an exact payment is sent.
Transaction
andQuery
types related to claims
Fixes compatibility with Android.
- The
Key
interface has been renamed toPublicKey
- You are now required to depend on the gRPC transport dependency for your specific environment
<!-- SELECT ONE: -->
<!-- netty transport (for server or desktop applications) -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.24.0</version>
</dependency>
<!-- netty transport, unshaded (if you have a matching Netty dependency already) -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>1.24.0</version>
</dependency>
<!-- okhttp transport (for lighter-weight applications or Android) -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-okhttp</artifactId>
<version>1.24.0</version>
</dependency>
// SELECT ONE:
// netty transport (for high throughput applications)
implementation 'io.grpc:grpc-netty-shaded:1.24.0'
// netty transport, unshaded (if you have a matching Netty dependency already)
implementation 'io.grpc:grpc-netty:1.24.0'
// okhttp transport (for lighter-weight applications or Android)
implementation 'io.grpc:grpc-okhttp:1.24.0'