Skip to content
Merged

5.6.20 #1726

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [[5.6.20](https://github.com/multiversx/mx-sdk-dapp/pull/1726)] - 2026-03-10

- [Added missing option to skip guardian checks in signTransactions function](https://github.com/multiversx/mx-sdk-dapp/pull/1726)

## [[5.6.19](https://github.com/multiversx/mx-sdk-dapp/pull/1725)] - 2026-02-27

- [Update sdk-dapp-ui](https://github.com/multiversx/mx-sdk-dapp/pull/1725)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-dapp",
"version": "5.6.19",
"version": "5.6.20",
"description": "A library to hold the main logic for a dapp on the MultiversX blockchain",
"author": "MultiversX",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export async function signTransactions({
}
}

const optionallyGuardedTransactions =
await guardTransactions(signedTransactions);
const optionallyGuardedTransactions = options?.skipGuardian
? signedTransactions
: await guardTransactions(signedTransactions);
Comment on lines +59 to +61

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic for conditionally applying guardian checks is duplicated later in the file (lines 253-255). To improve maintainability and reduce code duplication, consider extracting this logic into a local helper function within signTransactions.

For example:

const applyGuardian = (txs: Transaction[]) =>
  options?.skipGuardian ? Promise.resolve(txs) : guardTransactions(txs);

Then you could simplify this to:

const optionallyGuardedTransactions = await applyGuardian(signedTransactions);

And apply the same simplification on line 253 for finalizedTransactions.


return optionallyGuardedTransactions;
} finally {
Expand Down Expand Up @@ -249,9 +250,9 @@ export async function signTransactions({
(await options?.callback?.(signedTransactions)) ||
signedTransactions;

const optionallyGuardedTransactions = await guardTransactions(
finalizedTransactions
);
const optionallyGuardedTransactions = options?.skipGuardian
? finalizedTransactions
: await guardTransactions(finalizedTransactions);
manager.closeUI();
return resolve(optionallyGuardedTransactions);
}
Expand Down