ecashaddrjs
Version:
eCash cashaddr address format support for Node.js and web browsers.
37 lines (36 loc) • 1.01 kB
TypeScript
/**
* @license
* https://reviews.bitcoinabc.org
* Copyright (c) 2017-2020 Emilio Almansi
* Copyright (c) 2023 Bitcoin ABC
* Distributed under the MIT software license, see the accompanying
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
*/
/**
* Validation utility.
*
* @module validation
*/
/**
* Error thrown when encoding or decoding fail due to invalid input.
*
* @constructor ValidationError
* @param {string} message Error description.
*/
declare class ValidationError extends Error {
constructor(message: string);
}
/**
* Validates a given condition, throwing a {@link ValidationError} if
* the given condition does not hold.
*
* @static
* @param condition Condition to validate.
* @param message Error message in case the condition does not hold.
*/
declare function validate(condition: boolean, message: string): void;
declare const _default: {
ValidationError: typeof ValidationError;
validate: typeof validate;
};
export default _default;