Releases: multiversx/mx-sdk-js-core
v12.3.0
What's Changed
- Toggle global burn, registerAndSetAllRoles etc. by @andreibancioiu in #297
Full Changelog: v12.2.1...v12.3.0
v12.2.1
What's Changed
- Workaround: fix import of "proto" by @andreibancioiu in #295
Full Changelog: v12.2.0...v12.2.1
v12.2.0
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
v12.1.0
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
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()
andmessage.getSignature()
now return aBuffer
, instead of aISignature
object.TransfersFactory
has 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_SIGN
has been renamed toTRANSACTION_VERSION_WITH_OPTIONS
. - We've removed
SmartContractAbi
andContractInterface
- they were over-engineered, designed to handle multiple sets of contract endpoints (namespaces / separate interfaces etc.). We've keptAbiRegistry
, which is sufficient. abiRegistry.getAllEndpoints
has 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
TokenPayment
has been deprecated (renamed). Use the new name:TokenTransfer
, instead.ITokenPayment
becameITokenTransfer
, as well. The old names will be removed in the next major version.- Deprecated the parameter
sender
ofinteraction.withSingleESDTNFTTransfer()
andinteraction.withMultiESDTNFTTransfer()
. Useinteraction.withSender()
instead. - Directly reading or setting the fields
transaction.options
,transaction.version
is now deprecated. Use theget*
andset*
functions, instead.
Pull Requests
- Guarded transaction by @schimih in #239
- support for guarded transactions for v1 relayed tx by @schimih in #251
- TokenPayment -> TokenTransfer by @andreibancioiu in #266
- Make v12 work both with wallet v3 and wallet-next. GetSignature() now returns Buffer. by @andreibancioiu in #269
- Breaking change / simplification: remove "SmartContractAbi"; "AbiRegistry" is sufficient in #281.
- A few improvements, a few deprecations (v12) by @andreibancioiu in #265
- Adjust interface of transaction in #280
- Fix sort custom types abi by @nvergez in #224
- fix: Update type of abiRegistry types by @maximechbt in #223
- Adjust construction of transaction options (breaking change) by @andreibancioiu in #275
- fix relayed V1 tests by @schimih in #252
- Add a new parameter to the TransactionWatcher: "patience" by @andreibancioiu in #260
New Contributors
- @maximechbt made their first contribution in #223
- @schimih made their first contribution in #238
v12.0.1-beta.4
What's Changed
- A few improvements, a few deprecations (v12) by @andreibancioiu in #265
- Hotfix: on "TokenOperationsFactory", use "BigNumber.Value" instead of "number" by @andreibancioiu in #267
- TokenPayment -> TokenTransfer by @andreibancioiu in #266
- Ensure that sdk-core v11 works with sdk-wallet v4 (next) by @andreibancioiu in #270
- Bump version by @andreibancioiu in #271
- Merge main into v12 by @andreibancioiu in #273
- Make v12 work both with wallet v3 and wallet-next. GetSignature() now returns Buffer. by @andreibancioiu in #269
- Add a new parameter to the TransactionWatcher: "patience" by @andreibancioiu in #260
- Adjust construction of transaction options (breaking change) by @andreibancioiu in #275
Full Changelog: v12.0.1-beta.0...v12.0.1-beta.4
v11.6.0
What's Changed
- Add Transaction.setSender(), Interaction.withSender() by @andreibancioiu in #276
Full Changelog: v11.5.0...v11.6.0
v11.5.0
What's Changed
- Ensure that sdk-core v11 works with sdk-wallet v4 by @andreibancioiu in #270
Also see: multiversx/mx-sdk-js-wallet#33
Full Changelog: v11.4.1...v11.5.0
v11.4.1
What's Changed
- Hotfix: on "TokenOperationsFactory", use "BigNumber.Value" instead of "number" by @andreibancioiu in #267
Full Changelog: v11.4.0...v11.4.1