@taquito/utils
Version:
converts michelson data and types into convenient JS/TS objects
50 lines (49 loc) • 3.71 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueConversionError = exports.InvalidProtocolHashError = exports.ProhibitedActionError = exports.DeprecationError = exports.InvalidOperationKindError = exports.InvalidOperationHashError = exports.InvalidKeyHashError = exports.InvalidChainIdError = exports.InvalidContractAddressError = exports.InvalidSignatureError = exports.InvalidPublicKeyError = exports.InvalidKeyError = exports.InvalidMessageError = exports.InvalidHexStringError = exports.InvalidBlockHashError = exports.InvalidAddressError = void 0;
const core_1 = require("@taquito/core");
var core_2 = require("@taquito/core");
Object.defineProperty(exports, "InvalidAddressError", { enumerable: true, get: function () { return core_2.InvalidAddressError; } });
Object.defineProperty(exports, "InvalidBlockHashError", { enumerable: true, get: function () { return core_2.InvalidBlockHashError; } });
Object.defineProperty(exports, "InvalidHexStringError", { enumerable: true, get: function () { return core_2.InvalidHexStringError; } });
Object.defineProperty(exports, "InvalidMessageError", { enumerable: true, get: function () { return core_2.InvalidMessageError; } });
Object.defineProperty(exports, "InvalidKeyError", { enumerable: true, get: function () { return core_2.InvalidKeyError; } });
Object.defineProperty(exports, "InvalidPublicKeyError", { enumerable: true, get: function () { return core_2.InvalidPublicKeyError; } });
Object.defineProperty(exports, "InvalidSignatureError", { enumerable: true, get: function () { return core_2.InvalidSignatureError; } });
Object.defineProperty(exports, "InvalidContractAddressError", { enumerable: true, get: function () { return core_2.InvalidContractAddressError; } });
Object.defineProperty(exports, "InvalidChainIdError", { enumerable: true, get: function () { return core_2.InvalidChainIdError; } });
Object.defineProperty(exports, "InvalidKeyHashError", { enumerable: true, get: function () { return core_2.InvalidKeyHashError; } });
Object.defineProperty(exports, "InvalidOperationHashError", { enumerable: true, get: function () { return core_2.InvalidOperationHashError; } });
Object.defineProperty(exports, "InvalidOperationKindError", { enumerable: true, get: function () { return core_2.InvalidOperationKindError; } });
Object.defineProperty(exports, "DeprecationError", { enumerable: true, get: function () { return core_2.DeprecationError; } });
Object.defineProperty(exports, "ProhibitedActionError", { enumerable: true, get: function () { return core_2.ProhibitedActionError; } });
/**
* @category Error
* @description Error that indicates invalid protocol hash being passed or used
*/
class InvalidProtocolHashError extends core_1.ParameterValidationError {
constructor(protocolHash, errorDetails) {
super();
this.protocolHash = protocolHash;
this.errorDetails = errorDetails;
this.name = 'InvalidProtocolHashError';
this.name = 'InvalidProtocolHashError';
this.message = `The protocol hash '${protocolHash}' is invalid`;
errorDetails ? (this.message += `: ${errorDetails}`) : null;
}
}
exports.InvalidProtocolHashError = InvalidProtocolHashError;
/**
* @category Error
* @description Error that indicates unable to convert data type from one to another
*/
class ValueConversionError extends core_1.UnsupportedActionError {
constructor(value, desiredType) {
super();
this.value = value;
this.desiredType = desiredType;
this.name = 'ValueConversionError';
this.message = `Unable to convert ${value} to a ${desiredType}`;
}
}
exports.ValueConversionError = ValueConversionError;
;