Changed
-
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
let newAccountId = new AccountCreateTransaction() .setKey(newKey.publicKey) .setInitialBalance(1000) .execute(hederaClient) // TranactionId .getReceipt(hederaClient) // TransactionReceipt .accountId;
-
Rename
setPaymentDefaulttosetPaymentAmount
Added
-
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)
Removed
TransactionandQuerytypes related to claims