UNPKG

@taquito/michel-codec

Version:

Michelson parser/validator/formatter

91 lines (90 loc) 3.05 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HexParseError = exports.LongIntegerError = exports.TezosIdEncodeError = exports.InvalidEntrypointError = exports.InvalidDataExpressionError = exports.InvalidTypeExpressionError = exports.InvalidMichelsonError = void 0; const core_1 = require("@taquito/core"); /** * @category Error * @description Error that indicates an invalid Michelson being passed or used */ class InvalidMichelsonError extends core_1.ParameterValidationError { constructor(message) { super(); this.message = message; this.name = 'InvalidMichelsonError'; } } exports.InvalidMichelsonError = InvalidMichelsonError; /** * @category Error * @description Error that indicates an invalid type expression being passed or used */ class InvalidTypeExpressionError extends core_1.ParameterValidationError { constructor(message) { super(); this.message = message; this.name = 'InvalidTypeExpressionError'; } } exports.InvalidTypeExpressionError = InvalidTypeExpressionError; /** * @category Error * @description Error that indicates an invalid data expression being passed or used */ class InvalidDataExpressionError extends core_1.ParameterValidationError { constructor(message) { super(); this.message = message; this.name = 'InvalidDataExpressionError'; } } exports.InvalidDataExpressionError = InvalidDataExpressionError; /** * @category Error * @description Error that indicates an invalid contract entrypoint being referenced or passed */ class InvalidEntrypointError extends core_1.ParameterValidationError { constructor(entrypoint) { super(); this.entrypoint = entrypoint; this.name = 'InvalidEntrypointError'; this.message = `Contract has no entrypoint named: "${entrypoint}"`; } } exports.InvalidEntrypointError = InvalidEntrypointError; /** * @category Error * @description Error that indicates a failure happening when trying to encode Tezos ID */ class TezosIdEncodeError extends core_1.ParameterValidationError { constructor(message) { super(); this.message = message; this.name = 'TezosIdEncodeError'; } } exports.TezosIdEncodeError = TezosIdEncodeError; /** * @category Error * @description Error that indicates a general error happening when trying to create a LongInteger */ class LongIntegerError extends core_1.TaquitoError { constructor(message) { super(); this.message = message; this.name = 'LongIntegerError'; } } exports.LongIntegerError = LongIntegerError; /** * @category Error * @description Error that indicates a failure occurring when trying to parse a hex byte */ class HexParseError extends core_1.TaquitoError { constructor(hexByte) { super(); this.hexByte = hexByte; this.name = 'HexParseError'; this.message = `Unable to parse hex byte "${hexByte}"`; } } exports.HexParseError = HexParseError;