Skip to content

Releases: multiversx/mx-sdk-js-core

v12.3.0

13 Jun 08:49
2c47a1d
Compare
Choose a tag to compare

What's Changed

Full Changelog: v12.2.1...v12.3.0

v12.2.1

12 May 09:26
315bde0
Compare
Choose a tag to compare

What's Changed

Full Changelog: v12.2.0...v12.2.1

v12.2.0

25 Apr 16:53
b5998e7
Compare
Choose a tag to compare

What's Changed

  • Allow one to mix typed and untyped values on "smartContract.methods" by @andreibancioiu in #282

Full Changelog: v12.1.1...v12.2.0

v12.1.1

11 Apr 13:18
d0975e7
Compare
Choose a tag to compare

What's Changed

  • Change BinaryCodecConstraints default values by @popenta in #289

New Contributors

Full Changelog: v12.1.0...v12.1.1

v12.1.0

07 Apr 14:57
e447929
Compare
Choose a tag to compare

Quick-fix post-release: just like transaction.getSignature(), signableMessage.getSignature() should also be a buffer.

Theoretically, this is a breaking change. Practically, it should not be - the major release has only been published for ~1 hour.

What's Changed

  • Fix design inconsistency (post-release): message.getSignature() should also be a "Buffer" by @andreibancioiu in #284

Full Changelog: v12.0.1...v12.1.0

v12.0.1

07 Apr 11:51
bb59728
Compare
Choose a tag to compare

sdk-core v12 is now released 🎉

See the updated cookbook. Also, see the migration notes.

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:

const transaction = new Transaction({
    nonce: 42
    sender: addressOfAlice,
    receiver: addressOfBob,
    value: "1000000000000000000"
    gasLimit: 100000
    chainID: "D"
    guardian: addressOfTheGuardian,
    options: TransactionOptions.withOptions({ guarded: true }),
    version: TransactionVersion.withTxOptions(),
});

...

transaction.applySignature(...);
transaction.applyGuardianSignature(...);

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).

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:

const serialized: Buffer = transaction.serializeForSigning();
const signature: Buffer = await signer.sign(serialized);
transaction.applySignature(signature);

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:

const abiRegistry = AbiRegistry.create({ ... });
const contract = new SmartContract({ address: existingAddress, abi: abiRegistry });

Breaking changes

  • transaction.getSignature() and message.getSignature() now return a Buffer, instead of a ISignature object.
  • TransfersFactory has been renamed to TransferTransactionsFactory
  • tokenPayment.toRationalNumber() has been renamed to toAmount() - 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_SIGN has been renamed to TRANSACTION_VERSION_WITH_OPTIONS.
  • We've removed SmartContractAbi and ContractInterface - they were over-engineered, designed to handle multiple sets of contract endpoints (namespaces / separate interfaces etc.). We've kept AbiRegistry, which is sufficient.
  • abiRegistry.getAllEndpoints has been renamed to getEndpoints().
  • 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 the AbiRegistry.
  • Removed ContractFunction.equals() - was already deprecated for some time.

Deprecations

  • TokenPayment has been deprecated (renamed). Use the new name: TokenTransfer, instead. ITokenPayment became ITokenTransfer, as well. The old names will be removed in the next major version.
  • Deprecated the parameter sender of interaction.withSingleESDTNFTTransfer() and interaction.withMultiESDTNFTTransfer(). Use interaction.withSender() instead.
  • Directly reading or setting the fields transaction.options, transaction.version is now deprecated. Use the get* and set* functions, instead.

Pull Requests

New Contributors

v12.0.1-beta.4

03 Apr 15:17
49d94c9
Compare
Choose a tag to compare
v12.0.1-beta.4 Pre-release
Pre-release

What's Changed

Full Changelog: v12.0.1-beta.0...v12.0.1-beta.4

v11.6.0

03 Apr 18:04
678350a
Compare
Choose a tag to compare

What's Changed

Full Changelog: v11.5.0...v11.6.0

v11.5.0

22 Mar 15:57
bc45a7a
Compare
Choose a tag to compare

What's Changed

Also see: multiversx/mx-sdk-js-wallet#33

Full Changelog: v11.4.1...v11.5.0

v11.4.1

27 Feb 10:35
0b8839f
Compare
Choose a tag to compare

What's Changed

  • Hotfix: on "TokenOperationsFactory", use "BigNumber.Value" instead of "number" by @andreibancioiu in #267

Full Changelog: v11.4.0...v11.4.1