Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- [Updated address validation](https://github.com/multiversx/mx-sdk-dapp/pull/1389)
- [Added conditional price radios visibility per radio button](https://github.com/multiversx/mx-sdk-dapp/pull/1388)

## [[v3.3.1](https://github.com/multiversx/mx-sdk-dapp/pull/1387)] - 2025-03-13

- [Added conditional price radios visibility](https://github.com/multiversx/mx-sdk-dapp/pull/1386)

## [[v3.3.0](https://github.com/multiversx/mx-sdk-dapp/pull/1380)] - 2025-03-11

- [Added gasPrice editing](https://github.com/multiversx/mx-sdk-dapp/pull/1377)

## [[v3.2.7](https://github.com/multiversx/mx-sdk-dapp/pull/1384)] - 2025-03-11
Expand All @@ -24,9 +27,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Fixed sign screen layout and move decoder styles inside the package](https://github.com/multiversx/mx-sdk-dapp/pull/1381)

## [[v3.2.5](https://github.com/multiversx/mx-sdk-dapp/pull/1379)] - 2025-03-11

- [Fixed websocket connection and fallback mechanism](https://github.com/multiversx/mx-sdk-dapp/pull/1378)

## [[v3.2.4](https://github.com/multiversx/mx-sdk-dapp/pull/1376)] - 2025-02-17

- [Added a warning toast when an unconfirmed guardian change took place](https://github.com/multiversx/mx-sdk-dapp/pull/1375)
- [Fixed metamask addon link to use new Chrome Web Store domain](https://github.com/multiversx/mx-sdk-dapp/pull/1374)

Expand Down
8 changes: 3 additions & 5 deletions src/utils/account/addressIsValid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import { Address } from '@multiversx/sdk-core';

function canTransformToPublicKey(address: string) {
try {
const checkAddress = new Address(address);
return Boolean(checkAddress.bech32());
return Address.isValid(address);
} catch {
return false;
}
}

export function addressIsValid(destinationAddress: string) {
const isValidBach =
destinationAddress?.length === 62 && /^\w+$/.test(destinationAddress);
const isValidString = /^\w+$/.test(destinationAddress);

return isValidBach && canTransformToPublicKey(destinationAddress);
return isValidString && canTransformToPublicKey(destinationAddress);
}