@taquito/utils
Version:
Encoding, crypto, and utility helpers for Taquito.
46 lines (45 loc) • 3.54 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
* Error that indicates invalid protocol hash being passed or used
*/
class InvalidProtocolHashError extends core_1.ParameterValidationError {
constructor(protocolHash, errorDetails) {
super(`The protocol hash '${protocolHash}' is invalid`, errorDetails);
this.protocolHash = protocolHash;
this.name = 'InvalidProtocolHashError';
this.name = this.constructor.name;
}
}
exports.InvalidProtocolHashError = InvalidProtocolHashError;
/**
* @category Error
* Error that indicates unable to convert data type from one to another
*/
class ValueConversionError extends core_1.UnsupportedActionError {
constructor(value, desiredType) {
super(`Unable to convert ${value} to a ${desiredType}`);
this.value = value;
this.desiredType = desiredType;
this.name = this.constructor.name;
}
}
exports.ValueConversionError = ValueConversionError;