Skip to content
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ changes.

### Fixed

- hotfix for ada handle and payment address validation order [Issue 3155](https://github.com/IntersectMBO/govtool/issues/3155)

### Changed

### Removed

## [v2.0.15](https://github.com/IntersectMBO/govtool/releases/tag/v2.0.15) 2025-03-11


### Added

- Add support for ada handle in drep payment address [Issue 3155](https://github.com/IntersectMBO/govtool/issues/3155)
Expand Down
10 changes: 6 additions & 4 deletions govtool/frontend/src/utils/isValidFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ export async function isReceivingAddress(address?: string) {
return true;
}

const receivingAddress = Address.from_bech32(address);
if (receivingAddress) {
return true;
}
// Validation for ada handles needs to go first as
// handles might be shorter then bech32 addresses
const isValidAdaHandle = await adaHandleService.isValidAdaHandle(address);

if (isValidAdaHandle) {
return true;
}

const receivingAddress = Address.from_bech32(address);
if (receivingAddress) {
return true;
}
return i18n.t("forms.errors.mustBeReceivingAddress");
} catch (e) {
return i18n.t("forms.errors.mustBeReceivingAddress");
Expand Down