1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | class 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 | }
|
18 | exports.CryptoError = CryptoError;
|
19 | class Bip38CompressionError extends CryptoError {
|
20 | constructor(expected, given) {
|
21 | super(`Expected flag to be ${expected}, but got ${given}.`);
|
22 | }
|
23 | }
|
24 | exports.Bip38CompressionError = Bip38CompressionError;
|
25 | class Bip38LengthError extends CryptoError {
|
26 | constructor(expected, given) {
|
27 | super(`Expected length to be ${expected}, but got ${given}.`);
|
28 | }
|
29 | }
|
30 | exports.Bip38LengthError = Bip38LengthError;
|
31 | class Bip38PrefixError extends CryptoError {
|
32 | constructor(expected, given) {
|
33 | super(`Expected prefix to be ${expected}, but got ${given}.`);
|
34 | }
|
35 | }
|
36 | exports.Bip38PrefixError = Bip38PrefixError;
|
37 | class Bip38TypeError extends CryptoError {
|
38 | constructor(expected, given) {
|
39 | super(`Expected type to be ${expected}, but got ${given}.`);
|
40 | }
|
41 | }
|
42 | exports.Bip38TypeError = Bip38TypeError;
|
43 | class NetworkVersionError extends CryptoError {
|
44 | constructor(expected, given) {
|
45 | super(`Expected version to be ${expected}, but got ${given}.`);
|
46 | }
|
47 | }
|
48 | exports.NetworkVersionError = NetworkVersionError;
|
49 | class NotImplementedError extends CryptoError {
|
50 | constructor() {
|
51 | super(`Feature is not available.`);
|
52 | }
|
53 | }
|
54 | exports.NotImplementedError = NotImplementedError;
|
55 | class PrivateKeyLengthError extends CryptoError {
|
56 | constructor(expected, given) {
|
57 | super(`Expected length to be ${expected}, but got ${given}.`);
|
58 | }
|
59 | }
|
60 | exports.PrivateKeyLengthError = PrivateKeyLengthError;
|
61 | class PublicKeyError extends CryptoError {
|
62 | constructor(given) {
|
63 | super(`Expected ${given} to be a valid public key.`);
|
64 | }
|
65 | }
|
66 | exports.PublicKeyError = PublicKeyError;
|
67 | class TransactionTypeError extends CryptoError {
|
68 | constructor(given) {
|
69 | super(`Type ${given} not supported.`);
|
70 | }
|
71 | }
|
72 | exports.TransactionTypeError = TransactionTypeError;
|
73 | class MalformedTransactionBytesError extends CryptoError {
|
74 | constructor() {
|
75 | super(`Failed to deserialize transaction, because the bytes are malformed.`);
|
76 | }
|
77 | }
|
78 | exports.MalformedTransactionBytesError = MalformedTransactionBytesError;
|
79 | class TransactionSchemaError extends CryptoError {
|
80 | constructor(what) {
|
81 | super(what);
|
82 | }
|
83 | }
|
84 | exports.TransactionSchemaError = TransactionSchemaError;
|
85 | class TransactionVersionError extends CryptoError {
|
86 | constructor(given) {
|
87 | super(`Version ${given} not supported.`);
|
88 | }
|
89 | }
|
90 | exports.TransactionVersionError = TransactionVersionError;
|
91 | class UnkownTransactionError extends CryptoError {
|
92 | constructor(given) {
|
93 | super(`Transaction type ${given} is not registered.`);
|
94 | }
|
95 | }
|
96 | exports.UnkownTransactionError = UnkownTransactionError;
|
97 | class TransactionAlreadyRegisteredError extends CryptoError {
|
98 | constructor(name) {
|
99 | super(`Transaction type ${name} is already registered.`);
|
100 | }
|
101 | }
|
102 | exports.TransactionAlreadyRegisteredError = TransactionAlreadyRegisteredError;
|
103 | class TransactionTypeInvalidRangeError extends CryptoError {
|
104 | constructor(given) {
|
105 | super(`Custom transaction type must be in the range 100-255 (${given}).`);
|
106 | }
|
107 | }
|
108 | exports.TransactionTypeInvalidRangeError = TransactionTypeInvalidRangeError;
|
109 | class MissingMilestoneFeeError extends CryptoError {
|
110 | constructor(name) {
|
111 | super(`Missing milestone fee for '${name}'.`);
|
112 | }
|
113 | }
|
114 | exports.MissingMilestoneFeeError = MissingMilestoneFeeError;
|
115 | class MaximumPaymentCountExceededError extends CryptoError {
|
116 | constructor(given) {
|
117 | super(`Expected a maximum of 2258 payments, but got ${given}.`);
|
118 | }
|
119 | }
|
120 | exports.MaximumPaymentCountExceededError = MaximumPaymentCountExceededError;
|
121 | class MissingTransactionSignatureError extends CryptoError {
|
122 | constructor() {
|
123 | super(`Expected the transaction to be signed.`);
|
124 | }
|
125 | }
|
126 | exports.MissingTransactionSignatureError = MissingTransactionSignatureError;
|
127 | class BlockSchemaError extends CryptoError {
|
128 | constructor(what) {
|
129 | super(what);
|
130 | }
|
131 | }
|
132 | exports.BlockSchemaError = BlockSchemaError;
|
133 | class PreviousBlockIdFormatError extends CryptoError {
|
134 | constructor(thisBlockHeight, previousBlockId) {
|
135 | super(`The config denotes that the block at height ${thisBlockHeight - 1} ` +
|
136 | `must use full SHA256 block id, but the next block (at ${thisBlockHeight}) ` +
|
137 | `contains previous block id "${previousBlockId}"`);
|
138 | }
|
139 | }
|
140 | exports.PreviousBlockIdFormatError = PreviousBlockIdFormatError;
|
141 |
|
\ | No newline at end of file |