* Adjust isHex with template return * Unneeded assignment * CHANGELOG * typo * Additional HexString types * Additional HexString inputs * Use U8aLike as applicable * typo * Unneeded type * HexString outputs * Export types
12 lines
449 B
TypeScript
12 lines
449 B
TypeScript
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { HexString } from '@polkadot/util/types';
|
|
import type { Prefix } from './types';
|
|
|
|
import { decodeAddress } from './decode';
|
|
|
|
export function validateAddress (encoded?: HexString | string | null, ignoreChecksum?: boolean, ss58Format?: Prefix): encoded is string {
|
|
return !!decodeAddress(encoded, ignoreChecksum, ss58Format);
|
|
}
|