Updated cookbook
Guardians are coming to Mainnet
And to this regards we've added support for guarded transactions. See the new fields transaction.guardian, transaction.guardianSignature and the function transaction.applyGuardianSignature().
Creating a guarded transaction looks as follows:
Passing the sender is now required
Passing the sender is now required on most transaction builders (not only on the Transaction constructor). For example, you are required to pass the caller when using smartContract.call() or the deployer when using smartContract.deploy(). When using the interactions API, make sure to call interaction.withSender(). transaction.setSender() is also supported (if needed).
Developers of wallet/wallet-like applications, please read!
For developers of wallet / wallet-like applications: sdk-core v12 supports both sdk-wallet v3 and sdk-wallet v4. Though, we recommend migrating to sdk-wallet v4. Then, signing transactions would look as follows:
Loading ABI got easier
We've slightly simplified the loading of an ABI and feeding it to a SmartContract object. See #281. In v12, this is done as follows:
Breaking changes
Not one, not two, but quite a few. Here's an entire list of them:
transaction.getSignature()now returns aBuffer, instead of aISignatureobject.TransfersFactoryhas been renamed toTransferTransactionsFactory;tokenPayment.toRationalNumber()has been renamed totoAmount()- and, actually, it became private, you cannot use (should not use) it anymore.toPrettyString()is still available, but it may be deprecated in a future release, in favor of a separate, more customizable formatter;- We've removed the static function
TransactionOptions.withTxHashSignOptions. Use the constructor instead, and pass it the necessary flags (options); - We've slightly altered the constructor of
TransactionWatcher; - The constant
TRANSACTION_VERSION_TX_HASH_SIGNhas been renamed toTRANSACTION_VERSION_WITH_OPTIONS; - We've removed
SmartContractAbiandContractInterface- they were over-engineered, designed to handle multiple sets of contract endpoints (namespaces / separate interfaces etc.). We've keptAbiRegistry, which is sufficient; abiRegistry.getAllEndpointshas been renamed togetEndpoints();SmartContract.setAbi()has been removed. The ABI is passed in constructor only;SmartContract.getAbi()is not exposed anymore. When an ABI definition is needed (e.g. endpoint, type), it should be found in theAbiRegistry;- Removed
ContractFunction.equals()- was already deprecated for some time.
Deprecations
TokenPaymenthas been deprecated (renamed). Use the new name:TokenTransfer, instead.ITokenPaymentbecameITokenTransfer, as well. The old names will be removed in the next major version.- Deprecated the parameter
senderofinteraction.withSingleESDTNFTTransfer()andinteraction.withMultiESDTNFTTransfer(). Useinteraction.withSender()instead. - Directly reading or setting the fields
transaction.options,transaction.versionis now deprecated. Use theget*andset*functions, instead.
Full Github Release Notes: mx-sdk-js-core - v12.0.1
We'd like to invite you joining us on Discord, where you can connect with other builders and developers, stay up-to-date on all things happening behind the scenes, and receive support from the community.
Latest Releases
Do you need more information?
Discover the Ecosystem


