UNPKG

6.51 kBJavaScriptView Raw
1"use strict";
2// tslint:disable:max-classes-per-file
3Object.defineProperty(exports, "__esModule", { value: true });
4class CryptoError extends Error {
5 constructor(message) {
6 super(message);
7 Object.defineProperty(this, "message", {
8 enumerable: false,
9 value: message,
10 });
11 Object.defineProperty(this, "name", {
12 enumerable: false,
13 value: this.constructor.name,
14 });
15 Error.captureStackTrace(this, this.constructor);
16 }
17}
18exports.CryptoError = CryptoError;
19class Bip38CompressionError extends CryptoError {
20 constructor(expected, given) {
21 super(`Expected flag to be ${expected}, but got ${given}.`);
22 }
23}
24exports.Bip38CompressionError = Bip38CompressionError;
25class Bip38LengthError extends CryptoError {
26 constructor(expected, given) {
27 super(`Expected length to be ${expected}, but got ${given}.`);
28 }
29}
30exports.Bip38LengthError = Bip38LengthError;
31class Bip38PrefixError extends CryptoError {
32 constructor(expected, given) {
33 super(`Expected prefix to be ${expected}, but got ${given}.`);
34 }
35}
36exports.Bip38PrefixError = Bip38PrefixError;
37class Bip38TypeError extends CryptoError {
38 constructor(expected, given) {
39 super(`Expected type to be ${expected}, but got ${given}.`);
40 }
41}
42exports.Bip38TypeError = Bip38TypeError;
43class NetworkVersionError extends CryptoError {
44 constructor(expected, given) {
45 super(`Expected version to be ${expected}, but got ${given}.`);
46 }
47}
48exports.NetworkVersionError = NetworkVersionError;
49class NotImplementedError extends CryptoError {
50 constructor() {
51 super(`Feature is not available.`);
52 }
53}
54exports.NotImplementedError = NotImplementedError;
55class PrivateKeyLengthError extends CryptoError {
56 constructor(expected, given) {
57 super(`Expected length to be ${expected}, but got ${given}.`);
58 }
59}
60exports.PrivateKeyLengthError = PrivateKeyLengthError;
61class PublicKeyError extends CryptoError {
62 constructor(given) {
63 super(`Expected ${given} to be a valid public key.`);
64 }
65}
66exports.PublicKeyError = PublicKeyError;
67class AddressNetworkError extends CryptoError {
68 constructor(what) {
69 super(what);
70 }
71}
72exports.AddressNetworkError = AddressNetworkError;
73class TransactionTypeError extends CryptoError {
74 constructor(given) {
75 super(`Type ${given} not supported.`);
76 }
77}
78exports.TransactionTypeError = TransactionTypeError;
79class InvalidTransactionBytesError extends CryptoError {
80 constructor(message) {
81 super(`Failed to deserialize transaction, encountered invalid bytes: ${message}`);
82 }
83}
84exports.InvalidTransactionBytesError = InvalidTransactionBytesError;
85class TransactionSchemaError extends CryptoError {
86 constructor(what) {
87 super(what);
88 }
89}
90exports.TransactionSchemaError = TransactionSchemaError;
91class TransactionVersionError extends CryptoError {
92 constructor(given) {
93 super(`Version ${given} not supported.`);
94 }
95}
96exports.TransactionVersionError = TransactionVersionError;
97class UnkownTransactionError extends CryptoError {
98 constructor(given) {
99 super(`Unknown transaction type: ${given}`);
100 }
101}
102exports.UnkownTransactionError = UnkownTransactionError;
103class TransactionAlreadyRegisteredError extends CryptoError {
104 constructor(name) {
105 super(`Transaction type ${name} is already registered.`);
106 }
107}
108exports.TransactionAlreadyRegisteredError = TransactionAlreadyRegisteredError;
109class TransactionKeyAlreadyRegisteredError extends CryptoError {
110 constructor(name) {
111 super(`Transaction key ${name} is already registered.`);
112 }
113}
114exports.TransactionKeyAlreadyRegisteredError = TransactionKeyAlreadyRegisteredError;
115class CoreTransactionTypeGroupImmutableError extends CryptoError {
116 constructor() {
117 super(`The Core transaction type group is immutable.`);
118 }
119}
120exports.CoreTransactionTypeGroupImmutableError = CoreTransactionTypeGroupImmutableError;
121class MissingMilestoneFeeError extends CryptoError {
122 constructor(name) {
123 super(`Missing milestone fee for '${name}'.`);
124 }
125}
126exports.MissingMilestoneFeeError = MissingMilestoneFeeError;
127class MaximumPaymentCountExceededError extends CryptoError {
128 constructor(limit) {
129 super(`Number of payments exceeded the allowed maximum of ${limit}.`);
130 }
131}
132exports.MaximumPaymentCountExceededError = MaximumPaymentCountExceededError;
133class MinimumPaymentCountSubceededError extends CryptoError {
134 constructor() {
135 super(`Number of payments subceeded the required minimum of 2.`);
136 }
137}
138exports.MinimumPaymentCountSubceededError = MinimumPaymentCountSubceededError;
139class VendorFieldLengthExceededError extends CryptoError {
140 constructor(limit) {
141 super(`Length of vendor field exceeded the allowed maximum ${limit}.`);
142 }
143}
144exports.VendorFieldLengthExceededError = VendorFieldLengthExceededError;
145class MissingTransactionSignatureError extends CryptoError {
146 constructor() {
147 super(`Expected the transaction to be signed.`);
148 }
149}
150exports.MissingTransactionSignatureError = MissingTransactionSignatureError;
151class BlockSchemaError extends CryptoError {
152 constructor(height, what) {
153 super(`Height (${height}): ${what}`);
154 }
155}
156exports.BlockSchemaError = BlockSchemaError;
157class PreviousBlockIdFormatError extends CryptoError {
158 constructor(thisBlockHeight, previousBlockId) {
159 super(`The config denotes that the block at height ${thisBlockHeight - 1} ` +
160 `must use full SHA256 block id, but the next block (at ${thisBlockHeight}) ` +
161 `contains previous block id "${previousBlockId}"`);
162 }
163}
164exports.PreviousBlockIdFormatError = PreviousBlockIdFormatError;
165class InvalidMilestoneConfigurationError extends CryptoError {
166 constructor(message) {
167 super(message);
168 }
169}
170exports.InvalidMilestoneConfigurationError = InvalidMilestoneConfigurationError;
171class InvalidMultiSignatureAssetError extends CryptoError {
172 constructor() {
173 super(`The multi signature asset is invalid.`);
174 }
175}
176exports.InvalidMultiSignatureAssetError = InvalidMultiSignatureAssetError;
177class DuplicateParticipantInMultiSignatureError extends CryptoError {
178 constructor() {
179 super(`Invalid multi signature, because duplicate participant found.`);
180 }
181}
182exports.DuplicateParticipantInMultiSignatureError = DuplicateParticipantInMultiSignatureError;
183//# sourceMappingURL=errors.js.map
\No newline at end of file