What's Changed
This release introduces enhancements for async client initialization across both web and native (React Native / Expo) environments, support for HIP-1046, and stricter validations across multiple APIs. These updates improve client reliability, developer experience, and transaction safety.
Enhancements
-
setStakedAccountIdandsetStakedNodeIdare now explicitly mutually exclusive. Setting one clears the other. -
setTransferAccountIdandsetTransferContractIdare now explicitly mutually exclusive. Setting one clears the other. -
Async Client Initialization (WebClient):
Added new async initialization methods that fetch the latest address book during setup unless explicitly disabled viascheduleNetworkUpdate = false:WebClient.forMainnetAsync()WebClient.forTestnetAsync()WebClient.forPreviewnetAsync()WebClient.forNameAsync(name)
-
Async Client Initialization (NativeClient):
Added async initialization methods for React Native / Expo users, also defaulting to auto-updating the address book:NativeClient.forMainnetAsync()NativeClient.forTestnetAsync()NativeClient.forPreviewnetAsync()NativeClient.forNameAsync(networkName)
-
HIP-1046 Support: Enabled in native environments, expanding protocol support. HIP-1046.
-
Contract Deletion:
ImplementedpermanentRemovalinContractDeleteTransaction, enabling permanent contract deletion behavior. -
Contract Updates:
Added ability to remove the auto-renew account inContractUpdateTransactionby setting it to0.0.0. -
Contract Creation:
Validation added to rejectgas < 0inContractCreateTransaction. -
Validation Improvements:
Added validations inhex.jsto reject invalid hex string decoding. -
Networking (Native Clients):
Native clients now attempt to retrieve node addresses from mirror nodes before falling back to hardcoded values in web environments.
Bug Fixes
- Fixed a bug where an error status triggered the error callback twice.
Documentation
- Added API usage, examples, and migration guidance for async client initialization.
Full Changelog: v2.70.0...v2.71.0