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.
- Scheduled transaction support:
ScheduleCreateTransaction,ScheduleDeleteTransaction, andScheduleSignTransaction - React Native support
- Support for raw
proto.Transactionbytes inTransaction.fromBytes()- This means v1 SDK's
Transaction.toBytes()will now be supported in v2Transaction.fromBytes()However,Transaction.toBytes()andTransaction.getTransactionHas()in v2 will produce different results in the v1 SDK's.
- This means v1 SDK's
- addSignature() Behavior Differs Between Implementations [NCC-E001154-005]
- Decreased
CHUNK_SIZE4096->1024 and increased default max chunks 10->20 - Export
StatusError,PrecheckStatusError,ReceiptStatusError, andBadKeyError KeyList.toString()AccountBalance.toString()
new TransactionId(AccountId, Instant)- UseTransactionId.withValidStart()instead.
- addSignature() Behavior Differs Between Implementations [NCC-E001154-005]
- Decreased
CHUNK_SIZE4096->1024 and increased default max chunks 10->20 - Renamed
ScheduleInfo.getTransaction()->ScheduleInfo.getScheduledTransaction()
- React Native support
- Scheduled transactions should use new HAPI protobufs
- Removed
noncefromTransactionId schedule-multi-sig-transactionexample to use new scheduled transaction API
ScheduleCreateTransaction.addScheduledSignature()ScheduleCreateTransaction.scheduledSignatures()ScheduleSignTransaction.addScheduledSignature()ScheduleSignTransaction.scheduledSignatures()
- Support for raw
proto.Transactionbytes inTransaction.fromBytes()- This means v1 SDK's
Transaction.toBytes()will now be supported in v2Transaction.fromBytes()However,Transaction.toBytes()andTransaction.getTransactionHas()in v2 will produce different results in the v1 SDK's.
- This means v1 SDK's
- Export
StatusError,PrecheckStatusError,ReceiptStatusError, andBadKeyError
- A few examples that did not work with
CONFIG_FILEenvironment variable
- Support for setting signatures on the underlying scheduled transaction
TransactionReceipt.scheduledTransactionIdScheduleInfo.scheduledTransactionIdTransactionRecord.scheduleRef- Support for scheduled and nonce in
TransactionIdTransactionId.withNonce()- Supports creating transaction ID with random bytes.TransactionId.[set|get]Scheduled()- Supports scheduled transaction IDs.
memofields for both create and update transactions and info queriesAccount[Create|Update]Transaction.[set|get]AccountMemo()File[Create|Update]Transaction.[set|get]AccountMemo()Token[Create|Update]Transaction.[set|get]AccountMemo()AccountInfoQuery.accountMemoFileInfoQuery.fileMemoTokenInfoQuery.tokenMemo
ScheduleInfo.*IDfield names should useIdEx.ScheduleInfo.creatorAccountID->ScheduleInfo.creatorAccountId- Renamed
ScheduleInfo.memo->ScheduleInfo.scheduleMemo - Chunked transactions should not support scheduling if the data provided is too large
TopicMessageSubmitTransactionFileAppendTransaction
- 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 includingbodyBytesof a scheduled transactionScheduleId
KeyList.toString()AccountBalance.toString()
new TransactionId(AccountId, Instant)- UseTransactionId.withValidStart()instead.
- 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.
* All queries and transactions support setting fields in the constructor using
an object, e.g. `new AccountBalanceQuery({ accountId: "0.0.3" })`, or
`new AccountCreateTransaction({ key: client.operatorPublicKey, initialBalance: 10 })`.
* Almost all instances of `BigNumber` have been replaced with `Long`
-
Ed25519PrivateKey.fromMnemonicregressed in v1.1.8 and was not working in the browser. -
Use detached signatures when signing the transaction. This should allow for much larger transactions to be submitted.
Ed25519PrivateKey.fromKeystoreregressed in v1.1.9 and was not working in the browser
-
Client.ping(id: AccountIdLike)Pings a node by account ID. -
Ed25519PrivateKey.fromMnemonicworks with legacy 22-word phrases.
Client.getAccountBalance()to match the Java SDK. UseAccountBalanceQuerydirectly instead.
-
Allow BigNumber or String to be used as Tinybar where Tinybar was accepted
-
Add support for decoding
Ed25519PrivateKeyfrom a PEM file usingEd25519PrivateKey.fromPem() -
Add support for passing no argument to
ContractFunctionResult.get*()methods. -
Add
MnemonicValidationResultwhich is the response type forMnemonic.validte() -
Add public method
Mnemonic.validate(): MnemonicValidationResultwhich validates if the mnemonic came from the same wordlist, in the right order, and without misspellings. -
Add
BadPemFileErrorwhich is thrown when decoding a pem file fails.
-
Fixes
AddBytes32Array -
Fixes
Hbar.isNegative()failing withundefined. -
Fixes
CryptoTransferTransaction.addTransfer()not supportingBigNumberornumberas arguments. -
Fixes
ConsensusTopicInfoQuery.setTopicId()not supportingConsensusTopicIdLike.
-
Deprecates
Client.maxTransactionFeeandClient.maxQueryPaymentgetters. -
Deprecates
ConsensusTopicCreateTransaction.setAutoRenewAccount()was simply renamed toConsensusTopicCreateTransaction.setAutoRenewAccountId(). -
Deprecates
ConsensusTopicCreateTransaction.setExpirationTime()with no replacement. -
Deprecates
ConsensusTopicCreateTransaction.setValidStart()with no replacement. -
Deprecates
ConsensusTopicUpdateTransaction.setAutoRenewAccount()with no replacement.
-
TransactionRecord.getContractCallResultandTransactionRecord.getContractExecuteResultwere swapped internally and neither worked before. -
Export
ConsensusMessageSubmitTransaction.
- Do not provide (and sign) a payment transaction for
AccountBalanceQuery. It is not required.
-
Add
TransactionBuilder.getCost()to return a very close estimate of the transaction fee (within 1%). -
Add additional error classes to allow more introspection on errors:
HederaPrecheckStatusError- Thrown when the transaction fails at the node (the precheck)HederaReceiptStatusError- Thrown when the receipt is checked and has a failing status. The error object contains the full receipt.HederaRecordStatusError- Thrown when the record is checked and it has a failing status. The error object contains the full record.
-
console.log(obj)now prints out nice debug information for several types in the SDK including receipts
-
Add
TransactionReceipt.getConsensusTopicId(). -
Add
TransactionReceipt.getConsensusTopicRunningHash(). -
Add
TransactionReceipt.getConsensusTopicSequenceNumber(). -
Adds support for addresses with a leading
0xprefix withContractFunctionParams.addAddress().
-
Deprecates
Client.putNode(). UseClient.replaceNodes()instead. -
Depreactes
Transaction.getReceipt()andTransaction.getRecord(). UseTransactionId.getReceipt()orTransactionId.getRecord()instead. Theexecutemethod onTransactionreturns aTransactionId. -
Deprecates
ConsensusSubmitMessageTransaction. This was renamed toConsensusMessageSubmitTransactionto match the Java SDK.
RECEIPT_NOT_FOUNDis properly considered and internally retried withinTransactionReceiptQuery
- Contract parameter encoding with BigNumbers
Add support for Hedera Consensus Service (HCS).
-
Add
ConsensusTopicCreateTransaction,ConsensusTopicUpdateTransaction,ConsensusTopicDeleteTransaction, andConsensusMessageSubmitTransactiontransactions -
Add
ConsensusTopicInfoQueryquery (returnsConsensusTopicInfo) -
Add
MirrorClientandMirrorConsensusTopicQuerywhich can be used to listen for HCS messages from a mirror node.
Minor version bumps may add deprecations as we improve parity between SDKs or fix reported issues. Do not worry about upgrading in a timely manner. All v1+ APIs will be continuously supported.
-
Deprecated
SystemDelete#setId; replaced withSystemDelete#setFileIdorSystemDelete#setContractId -
Deprecated
SystemUndelete#setId; replaced withSystemUndelete#setFileIdorSystemUndelete#setContractId -
Deprecated
Hbar.of(val); replaced withnew Hbar(val) -
Deprecated
FreezeTransaction#setStartTime(Date); replaced withFreezeTransaction#setStartTime(hour: number, minute: number) -
Deprecated
FreezeTransaction#setEndTime(Date); replaced withFreezeTransaction#setEndTime(hour: number, minute: number) -
All previous exception types are no longer thrown. Instead there are a set of new exception types to match the Java SDK.
HederaErrorbecomesHederaStatusErrorValidationErrorbecomesLocalValidationErrorTinybarValueErrorbecomesHbarRangeErrorMaxPaymentExceededErrorbecomesMaxQueryPaymentExceededErrorBadKeyErroris a new exception type when attempting to parse or otherwise use a key that doesn't look like a key
- Allow passing a string for a private key in
Client.setOperator
- Correct list of testnet node addresses
No significant changes since v1.0.0-beta.5
- Fix
getCostfor entity Info queries where the entity was deleted
-
Add support for unsigned integers (incl. Arrays) for contract encoding and decoding
-
Add
AccountUpdateTransaction.setReceiverSignatureRequired -
Add
AccountUpdateTransaction.setProxyAccountId
- Rename
ContractExecuteTransaction.setAmount()toContractExecuteTransaction.setPayableAmount()
-
Client.forTestnetmakes a new client configured to talk to TestNet (use.setOperatorto set an operater) -
Client.forMainnetmakes a new client configured to talk to Mainnet (use.setOperatorto set an operater)
-
Renamed
TransactionReceipt.accountId,TransactionReceipt.contractId,TransactionReceipt.fileId, andTransactionReceipt.contractIdtoTransactionReceipt.getAccountId(), etc. to add an explicit illegal state check as these fields are mutually exclusive -
Renamed
TransactionRecord.contractCallResulttoTransactionRecord.getContractExecuteResult() -
Renamed
TransactionRecord.contractCreateResulttoTransactionRecord.getContractCreateResult()
TransactionBuilder.setMemois renamed toTransactionBuilder.setTransactionMemoto avoid confusion as there are 2 other kinds of memos on transactions
- Fix usage on Node versions less than 12.x
-
CallParamsis removed in favor ofContractFunctionParamsand closely mirrors type names from solidityaddInt32addInt256ArrayaddString- etc.
-
ContractFunctionResultnow closely mirrors the solidity type namesgetInt32- etc.
-
setFunctionParams(params)onContractCallQueryandContractExecuteTransactionis nowsetFunction(name, params) -
ContractLogInfo.topicList->ContractLogInfo.topics -
FileInfo.deleted->FileInfo.isDeleted -
FileContentsQuery.executenow directly returnsUint8Array -
ContractRecordsQuery.executenow directly returnsTransactionRecord[] -
AccountAmount.amount(String) ->AccountAmount.amount(Hbar) -
TransactionReceipt
receiverSigRequired->isReceiverSignatureRequiredautoRenewPeriodSeconds->autoRenewPeriod
-
Remove incorrect local validation for FileCreateTransaction and FileUpdateTransaction
-
Any
keyfields on response types (e.g.,AccountInfo) are nowPublicKeyand can be any of the applicable key types -
Fix transaction back-off when BUSY is returned
-
Default autoRenewPeriod on ContractCreate appropriately
-
Client constructor takes the network as
{ network: ... }instead of{ nodes: ... } -
Transactions and queries do not take
Clientin the constructor; instead,Clientis passed toexecute. -
Removed
Transaction.executeForReceiptandTransaction.executeForRecordThese 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.executewhich 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 anyTransactionIdand ask for the receipt/record (with a stepped retry interval until consensus) withTransactionId.getReceiptandTransactionId.getRecord.v0.7.x and below
let newAccountId = new AccountCreateTransaction(hederaClient) .setKey(newKey.publicKey) .setInitialBalance(1000) .executeForReceipt() // TransactionReceipt .accountId;
v0.8.x and above
let newAccountId = new AccountCreateTransaction() .setKey(newKey.publicKey) .setInitialBalance(1000) .execute(hederaClient) // TranactionId .getReceipt(hederaClient) // TransactionReceipt .accountId;
-
Rename
setPaymentDefaulttosetPaymentAmount
-
All transaction and query types that were in the Java SDK but not yet in the JS SDK (GetBySolidityIdQuery, AccountStakersQuery, etc.)
-
TransactionId.getReceipt -
TransactionId.getRecord -
Transaction.toString. This will dump the transaction (incl. the body) to a stringified JSON object representation of the transaction. Useful for debugging. -
A default of 1 Hbar is now set for both maximum transaction fees and maximum query payments.
-
Smart Contract type encoding and decoding to match Java.
-
To/From string methods on AccountId, FileId, etc.
-
Internal retry handling for Transactions and Queries (incl. BUSY)
TransactionandQuerytypes related to claims