@taquito/core 23.0.0-beta.0 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/errors.js +104 -92
- package/dist/lib/signer-interfaces.js +2 -0
- package/dist/lib/taquito-core.js +1 -0
- package/dist/lib/version.js +2 -2
- package/dist/taquito-core.es6.js +102 -91
- package/dist/taquito-core.es6.js.map +1 -1
- package/dist/taquito-core.umd.js +102 -90
- package/dist/taquito-core.umd.js.map +1 -1
- package/dist/types/errors.d.ts +36 -35
- package/dist/types/signer-interfaces.d.ts +38 -0
- package/dist/types/taquito-core.d.ts +1 -0
- package/package.json +2 -2
package/dist/taquito-core.umd.js
CHANGED
|
@@ -7,6 +7,23 @@
|
|
|
7
7
|
// ==========================================================================================
|
|
8
8
|
// parent error classes for Taquito
|
|
9
9
|
// ==========================================================================================
|
|
10
|
+
exports.ValidationResult = void 0;
|
|
11
|
+
(function (ValidationResult) {
|
|
12
|
+
ValidationResult[ValidationResult["NO_PREFIX_MATCHED"] = 0] = "NO_PREFIX_MATCHED";
|
|
13
|
+
ValidationResult[ValidationResult["INVALID_CHECKSUM"] = 1] = "INVALID_CHECKSUM";
|
|
14
|
+
ValidationResult[ValidationResult["INVALID_LENGTH"] = 2] = "INVALID_LENGTH";
|
|
15
|
+
ValidationResult[ValidationResult["VALID"] = 3] = "VALID";
|
|
16
|
+
ValidationResult[ValidationResult["PREFIX_NOT_ALLOWED"] = 4] = "PREFIX_NOT_ALLOWED";
|
|
17
|
+
ValidationResult[ValidationResult["INVALID_ENCODING"] = 5] = "INVALID_ENCODING";
|
|
18
|
+
ValidationResult[ValidationResult["OTHER"] = 6] = "OTHER";
|
|
19
|
+
})(exports.ValidationResult || (exports.ValidationResult = {}));
|
|
20
|
+
const resultDesc = {
|
|
21
|
+
[exports.ValidationResult.NO_PREFIX_MATCHED]: 'unsupported Base58 prefix',
|
|
22
|
+
[exports.ValidationResult.INVALID_CHECKSUM]: 'invalid checksum',
|
|
23
|
+
[exports.ValidationResult.INVALID_LENGTH]: 'invalid length',
|
|
24
|
+
[exports.ValidationResult.PREFIX_NOT_ALLOWED]: 'Base58 prefix not allowed in this context',
|
|
25
|
+
[exports.ValidationResult.INVALID_ENCODING]: 'invalid Base58 encoding',
|
|
26
|
+
};
|
|
10
27
|
/**
|
|
11
28
|
* @category Error
|
|
12
29
|
* @description Parent error class all taquito errors to extend from
|
|
@@ -18,6 +35,39 @@
|
|
|
18
35
|
* @description Error that indicates invalid user inputs
|
|
19
36
|
*/
|
|
20
37
|
class ParameterValidationError extends TaquitoError {
|
|
38
|
+
constructor(message, validationResult, errorDetail) {
|
|
39
|
+
let detail;
|
|
40
|
+
let result;
|
|
41
|
+
let msg;
|
|
42
|
+
if (message !== undefined) {
|
|
43
|
+
if (typeof message === 'string') {
|
|
44
|
+
msg = message;
|
|
45
|
+
if (validationResult !== undefined) {
|
|
46
|
+
if (typeof validationResult === 'string') {
|
|
47
|
+
detail = validationResult;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
result = validationResult;
|
|
51
|
+
if (errorDetail !== undefined) {
|
|
52
|
+
detail = errorDetail;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
detail = resultDesc[validationResult];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
result = message;
|
|
62
|
+
detail = resultDesc[message];
|
|
63
|
+
msg = detail;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
super(msg);
|
|
67
|
+
this.name = this.constructor.name;
|
|
68
|
+
this.result = result;
|
|
69
|
+
this.errorDetail = detail;
|
|
70
|
+
}
|
|
21
71
|
}
|
|
22
72
|
/**
|
|
23
73
|
* @category Error
|
|
@@ -58,30 +108,30 @@
|
|
|
58
108
|
*/
|
|
59
109
|
class InvalidAddressError extends ParameterValidationError {
|
|
60
110
|
constructor(address, errorDetail) {
|
|
61
|
-
super();
|
|
111
|
+
super(`Invalid address "${address}"`, errorDetail);
|
|
62
112
|
this.address = address;
|
|
63
|
-
this.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
113
|
+
this.name = this.constructor.name;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
class InvalidProofError extends ParameterValidationError {
|
|
117
|
+
constructor(proof, errorDetail) {
|
|
118
|
+
super(`Invalid proof "${proof}"`, errorDetail);
|
|
119
|
+
this.proof = proof;
|
|
120
|
+
this.name = this.constructor.name;
|
|
67
121
|
}
|
|
68
122
|
}
|
|
69
123
|
class InvalidStakingAddressError extends ParameterValidationError {
|
|
70
124
|
constructor(address, errorDetail) {
|
|
71
|
-
super();
|
|
125
|
+
super(`Invalid staking address "${address}", you can only set destination as your own address`, errorDetail);
|
|
72
126
|
this.address = address;
|
|
73
|
-
this.
|
|
74
|
-
this.name = 'InvalidStakingAddressError';
|
|
75
|
-
this.message = `Invalid staking address "${address}", you can only set destination as your own address`;
|
|
127
|
+
this.name = this.constructor.name;
|
|
76
128
|
}
|
|
77
129
|
}
|
|
78
130
|
class InvalidFinalizeUnstakeAmountError extends ParameterValidationError {
|
|
79
131
|
constructor(address, errorDetail) {
|
|
80
|
-
super();
|
|
132
|
+
super(`The amount can only be 0 when finalizing an unstake`, errorDetail);
|
|
81
133
|
this.address = address;
|
|
82
|
-
this.
|
|
83
|
-
this.name = 'InvalidFinalizeUnstakeAmountError';
|
|
84
|
-
this.message = `The amount can only be 0 when finalizing an unstake`;
|
|
134
|
+
this.name = this.constructor.name;
|
|
85
135
|
}
|
|
86
136
|
}
|
|
87
137
|
/**
|
|
@@ -90,12 +140,9 @@
|
|
|
90
140
|
*/
|
|
91
141
|
class InvalidBlockHashError extends ParameterValidationError {
|
|
92
142
|
constructor(blockHash, errorDetail) {
|
|
93
|
-
super();
|
|
143
|
+
super(`Invalid block hash "${blockHash}"`, errorDetail);
|
|
94
144
|
this.blockHash = blockHash;
|
|
95
|
-
this.
|
|
96
|
-
this.name = 'InvalidBlockHashError';
|
|
97
|
-
this.message = `Invalid block hash "${blockHash}"`;
|
|
98
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
145
|
+
this.name = this.constructor.name;
|
|
99
146
|
}
|
|
100
147
|
}
|
|
101
148
|
/**
|
|
@@ -103,11 +150,10 @@
|
|
|
103
150
|
* @description Error that indicates an invalid amount of tez being passed as a parameter
|
|
104
151
|
*/
|
|
105
152
|
class InvalidAmountError extends ParameterValidationError {
|
|
106
|
-
constructor(amount) {
|
|
107
|
-
super();
|
|
153
|
+
constructor(amount, errorDetail) {
|
|
154
|
+
super(`Invalid amount "${amount}"`, errorDetail);
|
|
108
155
|
this.amount = amount;
|
|
109
|
-
this.name =
|
|
110
|
-
this.message = `Invalid amount "${amount}"`;
|
|
156
|
+
this.name = this.constructor.name;
|
|
111
157
|
}
|
|
112
158
|
}
|
|
113
159
|
/**
|
|
@@ -116,12 +162,9 @@
|
|
|
116
162
|
*/
|
|
117
163
|
class InvalidDerivationPathError extends ParameterValidationError {
|
|
118
164
|
constructor(derivationPath, errorDetail) {
|
|
119
|
-
super();
|
|
165
|
+
super(`Invalid derivation path "${derivationPath}"`, errorDetail);
|
|
120
166
|
this.derivationPath = derivationPath;
|
|
121
|
-
this.
|
|
122
|
-
this.name = 'InvalidDerivationPathError';
|
|
123
|
-
this.message = `Invalid derivation path "${derivationPath}"`;
|
|
124
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
167
|
+
this.name = this.constructor.name;
|
|
125
168
|
}
|
|
126
169
|
}
|
|
127
170
|
/**
|
|
@@ -130,12 +173,9 @@
|
|
|
130
173
|
*/
|
|
131
174
|
class InvalidHexStringError extends ParameterValidationError {
|
|
132
175
|
constructor(hexString, errorDetail) {
|
|
133
|
-
super();
|
|
176
|
+
super(`Invalid hex string "${hexString}"`, errorDetail);
|
|
134
177
|
this.hexString = hexString;
|
|
135
|
-
this.
|
|
136
|
-
this.name = 'InvalidHexStringError';
|
|
137
|
-
this.message = `Invalid hex string "${hexString}"`;
|
|
138
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
178
|
+
this.name = this.constructor.name;
|
|
139
179
|
}
|
|
140
180
|
}
|
|
141
181
|
/**
|
|
@@ -144,12 +184,9 @@
|
|
|
144
184
|
*/
|
|
145
185
|
class InvalidMessageError extends ParameterValidationError {
|
|
146
186
|
constructor(msg, errorDetail) {
|
|
147
|
-
super();
|
|
187
|
+
super(`Invalid message "${msg}"`, errorDetail);
|
|
148
188
|
this.msg = msg;
|
|
149
|
-
this.
|
|
150
|
-
this.name = 'InvalidMessageError';
|
|
151
|
-
this.message = `Invalid message "${msg}"`;
|
|
152
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
189
|
+
this.name = this.constructor.name;
|
|
153
190
|
}
|
|
154
191
|
}
|
|
155
192
|
/**
|
|
@@ -157,14 +194,14 @@
|
|
|
157
194
|
* @description Error that indicates invalid view parameter of a smart contract
|
|
158
195
|
*/
|
|
159
196
|
class InvalidViewParameterError extends ParameterValidationError {
|
|
160
|
-
constructor(viewName, sigs, args, cause) {
|
|
161
|
-
|
|
197
|
+
constructor(viewName, sigs, args, cause, errorDetail) {
|
|
198
|
+
const message = `Invalid view arguments ${JSON.stringify(args)} received for name "${viewName}" expecting one of the following signatures ${JSON.stringify(sigs)}.`;
|
|
199
|
+
super(message, errorDetail);
|
|
162
200
|
this.viewName = viewName;
|
|
163
201
|
this.sigs = sigs;
|
|
164
202
|
this.args = args;
|
|
165
203
|
this.cause = cause;
|
|
166
|
-
this.name =
|
|
167
|
-
this.message = `Invalid view arguments ${JSON.stringify(args)} received for name "${viewName}" expecting one of the following signatures ${JSON.stringify(sigs)}.`;
|
|
204
|
+
this.name = this.constructor.name;
|
|
168
205
|
}
|
|
169
206
|
}
|
|
170
207
|
/**
|
|
@@ -173,11 +210,8 @@
|
|
|
173
210
|
*/
|
|
174
211
|
class InvalidKeyError extends ParameterValidationError {
|
|
175
212
|
constructor(errorDetail) {
|
|
176
|
-
super();
|
|
177
|
-
this.
|
|
178
|
-
this.name = 'InvalidKeyError';
|
|
179
|
-
this.message = `Invalid private key`;
|
|
180
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
213
|
+
super(`Invalid private key`, errorDetail);
|
|
214
|
+
this.name = this.constructor.name;
|
|
181
215
|
}
|
|
182
216
|
}
|
|
183
217
|
/**
|
|
@@ -186,12 +220,10 @@
|
|
|
186
220
|
*/
|
|
187
221
|
class InvalidPublicKeyError extends ParameterValidationError {
|
|
188
222
|
constructor(publicKey, errorDetail) {
|
|
189
|
-
|
|
223
|
+
const msg = publicKey !== undefined ? `Invalid public key "${publicKey}"` : `Invalid public key`;
|
|
224
|
+
super(msg, errorDetail);
|
|
190
225
|
this.publicKey = publicKey;
|
|
191
|
-
this.
|
|
192
|
-
this.name = 'InvalidPublicKeyError';
|
|
193
|
-
this.message = `Invalid public key "${publicKey}"`;
|
|
194
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
226
|
+
this.name = this.constructor.name;
|
|
195
227
|
}
|
|
196
228
|
}
|
|
197
229
|
/**
|
|
@@ -200,12 +232,9 @@
|
|
|
200
232
|
*/
|
|
201
233
|
class InvalidSignatureError extends ParameterValidationError {
|
|
202
234
|
constructor(signature, errorDetail) {
|
|
203
|
-
super();
|
|
235
|
+
super(`Invalid signature "${signature}"`, errorDetail);
|
|
204
236
|
this.signature = signature;
|
|
205
|
-
this.
|
|
206
|
-
this.name = 'InvalidSignatureError';
|
|
207
|
-
this.message = `Invalid signature "${signature}"`;
|
|
208
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
237
|
+
this.name = this.constructor.name;
|
|
209
238
|
}
|
|
210
239
|
}
|
|
211
240
|
/**
|
|
@@ -214,12 +243,9 @@
|
|
|
214
243
|
*/
|
|
215
244
|
class InvalidContractAddressError extends ParameterValidationError {
|
|
216
245
|
constructor(contractAddress, errorDetail) {
|
|
217
|
-
super();
|
|
246
|
+
super(`Invalid contract address "${contractAddress}"`, errorDetail);
|
|
218
247
|
this.contractAddress = contractAddress;
|
|
219
|
-
this.
|
|
220
|
-
this.name = 'InvalidContractAddressError';
|
|
221
|
-
this.message = `Invalid contract address "${contractAddress}"`;
|
|
222
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
248
|
+
this.name = this.constructor.name;
|
|
223
249
|
}
|
|
224
250
|
}
|
|
225
251
|
/**
|
|
@@ -228,12 +254,9 @@
|
|
|
228
254
|
*/
|
|
229
255
|
class InvalidChainIdError extends ParameterValidationError {
|
|
230
256
|
constructor(chainId, errorDetail) {
|
|
231
|
-
super();
|
|
257
|
+
super(`Invalid chain id "${chainId}"`, errorDetail);
|
|
232
258
|
this.chainId = chainId;
|
|
233
|
-
this.
|
|
234
|
-
this.name = 'InvalidChainIdError';
|
|
235
|
-
this.message = `Invalid chain id "${chainId}"`;
|
|
236
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
259
|
+
this.name = this.constructor.name;
|
|
237
260
|
}
|
|
238
261
|
}
|
|
239
262
|
/**
|
|
@@ -242,12 +265,9 @@
|
|
|
242
265
|
*/
|
|
243
266
|
class InvalidKeyHashError extends ParameterValidationError {
|
|
244
267
|
constructor(keyHash, errorDetail) {
|
|
245
|
-
super();
|
|
268
|
+
super(`Invalid public key hash "${keyHash}"`, errorDetail);
|
|
246
269
|
this.keyHash = keyHash;
|
|
247
|
-
this.
|
|
248
|
-
this.name = 'InvalidKeyHashError';
|
|
249
|
-
this.message = `Invalid public key hash "${keyHash}"`;
|
|
250
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
270
|
+
this.name = this.constructor.name;
|
|
251
271
|
}
|
|
252
272
|
}
|
|
253
273
|
/**
|
|
@@ -256,12 +276,9 @@
|
|
|
256
276
|
*/
|
|
257
277
|
class InvalidOperationHashError extends ParameterValidationError {
|
|
258
278
|
constructor(operationHash, errorDetail) {
|
|
259
|
-
super();
|
|
279
|
+
super(`Invalid operation hash "${operationHash}"`, errorDetail);
|
|
260
280
|
this.operationHash = operationHash;
|
|
261
|
-
this.
|
|
262
|
-
this.name = 'InvalidOperationHashError';
|
|
263
|
-
this.message = `Invalid operation hash "${operationHash}"`;
|
|
264
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
281
|
+
this.name = this.constructor.name;
|
|
265
282
|
}
|
|
266
283
|
}
|
|
267
284
|
/**
|
|
@@ -270,12 +287,9 @@
|
|
|
270
287
|
*/
|
|
271
288
|
class InvalidOperationKindError extends ParameterValidationError {
|
|
272
289
|
constructor(operationKind, errorDetail) {
|
|
273
|
-
super();
|
|
290
|
+
super(`Invalid operation kind "${operationKind}"`, errorDetail);
|
|
274
291
|
this.operationKind = operationKind;
|
|
275
|
-
this.
|
|
276
|
-
this.name = 'InvalidOperationKindError';
|
|
277
|
-
this.message = `Invalid operation kind "${operationKind}"`;
|
|
278
|
-
this.message += errorDetail ? ` ${errorDetail}.` : '.';
|
|
292
|
+
this.name = this.constructor.name;
|
|
279
293
|
}
|
|
280
294
|
}
|
|
281
295
|
/**
|
|
@@ -284,9 +298,8 @@
|
|
|
284
298
|
*/
|
|
285
299
|
class DeprecationError extends UnsupportedActionError {
|
|
286
300
|
constructor(message) {
|
|
287
|
-
super();
|
|
288
|
-
this.
|
|
289
|
-
this.name = 'DeprecationError';
|
|
301
|
+
super(message);
|
|
302
|
+
this.name = this.constructor.name;
|
|
290
303
|
}
|
|
291
304
|
}
|
|
292
305
|
/**
|
|
@@ -295,9 +308,8 @@
|
|
|
295
308
|
*/
|
|
296
309
|
class ProhibitedActionError extends UnsupportedActionError {
|
|
297
310
|
constructor(message) {
|
|
298
|
-
super();
|
|
299
|
-
this.
|
|
300
|
-
this.name = 'ProhibitedActionError';
|
|
311
|
+
super(message);
|
|
312
|
+
this.name = this.constructor.name;
|
|
301
313
|
}
|
|
302
314
|
}
|
|
303
315
|
/**
|
|
@@ -306,11 +318,10 @@
|
|
|
306
318
|
*/
|
|
307
319
|
class PublicKeyNotFoundError extends TaquitoError {
|
|
308
320
|
constructor(pkh, cause) {
|
|
309
|
-
super();
|
|
321
|
+
super(`Public key not found of this address "${pkh}" in either wallet or contract API.`);
|
|
310
322
|
this.pkh = pkh;
|
|
311
323
|
this.cause = cause;
|
|
312
|
-
this.name =
|
|
313
|
-
this.message = `Public key not found of this address "${pkh}" in either wallet or contract API.`;
|
|
324
|
+
this.name = this.constructor.name;
|
|
314
325
|
}
|
|
315
326
|
}
|
|
316
327
|
|
|
@@ -328,6 +339,7 @@
|
|
|
328
339
|
exports.InvalidMessageError = InvalidMessageError;
|
|
329
340
|
exports.InvalidOperationHashError = InvalidOperationHashError;
|
|
330
341
|
exports.InvalidOperationKindError = InvalidOperationKindError;
|
|
342
|
+
exports.InvalidProofError = InvalidProofError;
|
|
331
343
|
exports.InvalidPublicKeyError = InvalidPublicKeyError;
|
|
332
344
|
exports.InvalidSignatureError = InvalidSignatureError;
|
|
333
345
|
exports.InvalidStakingAddressError = InvalidStakingAddressError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-core.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-core.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export declare enum ValidationResult {
|
|
2
|
+
NO_PREFIX_MATCHED = 0,
|
|
3
|
+
INVALID_CHECKSUM = 1,
|
|
4
|
+
INVALID_LENGTH = 2,
|
|
5
|
+
VALID = 3,
|
|
6
|
+
PREFIX_NOT_ALLOWED = 4,
|
|
7
|
+
INVALID_ENCODING = 5,
|
|
8
|
+
OTHER = 6
|
|
9
|
+
}
|
|
1
10
|
/**
|
|
2
11
|
* @category Error
|
|
3
12
|
* @description Parent error class all taquito errors to extend from
|
|
@@ -9,6 +18,11 @@ export declare class TaquitoError extends Error {
|
|
|
9
18
|
* @description Error that indicates invalid user inputs
|
|
10
19
|
*/
|
|
11
20
|
export declare class ParameterValidationError extends TaquitoError {
|
|
21
|
+
readonly errorDetail?: string;
|
|
22
|
+
readonly result?: ValidationResult;
|
|
23
|
+
constructor(validationResult?: ValidationResult);
|
|
24
|
+
constructor(message?: string, errorDetail?: string | ValidationResult);
|
|
25
|
+
constructor(message?: string, validationResult?: ValidationResult, errorDetail?: string);
|
|
12
26
|
}
|
|
13
27
|
/**
|
|
14
28
|
* @category Error
|
|
@@ -46,18 +60,19 @@ export declare class PermissionDeniedError extends TaquitoError {
|
|
|
46
60
|
*/
|
|
47
61
|
export declare class InvalidAddressError extends ParameterValidationError {
|
|
48
62
|
readonly address: string;
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
constructor(address: string, errorDetail?: string | ValidationResult);
|
|
64
|
+
}
|
|
65
|
+
export declare class InvalidProofError extends ParameterValidationError {
|
|
66
|
+
readonly proof: string;
|
|
67
|
+
constructor(proof: string, errorDetail?: string | ValidationResult);
|
|
51
68
|
}
|
|
52
69
|
export declare class InvalidStakingAddressError extends ParameterValidationError {
|
|
53
70
|
readonly address: string;
|
|
54
|
-
|
|
55
|
-
constructor(address: string, errorDetail?: string | undefined);
|
|
71
|
+
constructor(address: string, errorDetail?: string | ValidationResult);
|
|
56
72
|
}
|
|
57
73
|
export declare class InvalidFinalizeUnstakeAmountError extends ParameterValidationError {
|
|
58
74
|
readonly address: string;
|
|
59
|
-
|
|
60
|
-
constructor(address: string, errorDetail?: string | undefined);
|
|
75
|
+
constructor(address: string, errorDetail?: string | ValidationResult);
|
|
61
76
|
}
|
|
62
77
|
/**
|
|
63
78
|
* @category Error
|
|
@@ -65,8 +80,7 @@ export declare class InvalidFinalizeUnstakeAmountError extends ParameterValidati
|
|
|
65
80
|
*/
|
|
66
81
|
export declare class InvalidBlockHashError extends ParameterValidationError {
|
|
67
82
|
readonly blockHash: string;
|
|
68
|
-
|
|
69
|
-
constructor(blockHash: string, errorDetail?: string | undefined);
|
|
83
|
+
constructor(blockHash: string, errorDetail?: string | ValidationResult);
|
|
70
84
|
}
|
|
71
85
|
/**
|
|
72
86
|
* @category Error
|
|
@@ -74,7 +88,7 @@ export declare class InvalidBlockHashError extends ParameterValidationError {
|
|
|
74
88
|
*/
|
|
75
89
|
export declare class InvalidAmountError extends ParameterValidationError {
|
|
76
90
|
readonly amount: string;
|
|
77
|
-
constructor(amount: string);
|
|
91
|
+
constructor(amount: string, errorDetail?: string | ValidationResult);
|
|
78
92
|
}
|
|
79
93
|
/**
|
|
80
94
|
* @category Error
|
|
@@ -82,8 +96,7 @@ export declare class InvalidAmountError extends ParameterValidationError {
|
|
|
82
96
|
*/
|
|
83
97
|
export declare class InvalidDerivationPathError extends ParameterValidationError {
|
|
84
98
|
readonly derivationPath: string;
|
|
85
|
-
|
|
86
|
-
constructor(derivationPath: string, errorDetail?: string | undefined);
|
|
99
|
+
constructor(derivationPath: string, errorDetail?: string | ValidationResult);
|
|
87
100
|
}
|
|
88
101
|
/**
|
|
89
102
|
* @category Error
|
|
@@ -91,8 +104,7 @@ export declare class InvalidDerivationPathError extends ParameterValidationError
|
|
|
91
104
|
*/
|
|
92
105
|
export declare class InvalidHexStringError extends ParameterValidationError {
|
|
93
106
|
readonly hexString: string;
|
|
94
|
-
|
|
95
|
-
constructor(hexString: string, errorDetail?: string | undefined);
|
|
107
|
+
constructor(hexString: string, errorDetail?: string | ValidationResult);
|
|
96
108
|
}
|
|
97
109
|
/**
|
|
98
110
|
* @category Error
|
|
@@ -100,8 +112,7 @@ export declare class InvalidHexStringError extends ParameterValidationError {
|
|
|
100
112
|
*/
|
|
101
113
|
export declare class InvalidMessageError extends ParameterValidationError {
|
|
102
114
|
readonly msg: string;
|
|
103
|
-
|
|
104
|
-
constructor(msg: string, errorDetail?: string | undefined);
|
|
115
|
+
constructor(msg: string, errorDetail?: string | ValidationResult);
|
|
105
116
|
}
|
|
106
117
|
/**
|
|
107
118
|
* @category Error
|
|
@@ -112,24 +123,22 @@ export declare class InvalidViewParameterError extends ParameterValidationError
|
|
|
112
123
|
readonly sigs: any;
|
|
113
124
|
readonly args: any;
|
|
114
125
|
readonly cause?: any;
|
|
115
|
-
constructor(viewName: string, sigs: any, args: any, cause?: any);
|
|
126
|
+
constructor(viewName: string, sigs: any, args: any, cause?: any, errorDetail?: string);
|
|
116
127
|
}
|
|
117
128
|
/**
|
|
118
129
|
* @category Error
|
|
119
130
|
* @description Error that indicates an invalid private key being passed or used
|
|
120
131
|
*/
|
|
121
132
|
export declare class InvalidKeyError extends ParameterValidationError {
|
|
122
|
-
|
|
123
|
-
constructor(errorDetail?: string | undefined);
|
|
133
|
+
constructor(errorDetail?: string | ValidationResult);
|
|
124
134
|
}
|
|
125
135
|
/**
|
|
126
136
|
* @category Error
|
|
127
137
|
* @description Error that indicates an Invalid Public Key being passed or used
|
|
128
138
|
*/
|
|
129
139
|
export declare class InvalidPublicKeyError extends ParameterValidationError {
|
|
130
|
-
readonly publicKey
|
|
131
|
-
|
|
132
|
-
constructor(publicKey: string, errorDetail?: string | undefined);
|
|
140
|
+
readonly publicKey?: string | undefined;
|
|
141
|
+
constructor(publicKey?: string | undefined, errorDetail?: string | ValidationResult);
|
|
133
142
|
}
|
|
134
143
|
/**
|
|
135
144
|
* @category Error
|
|
@@ -137,8 +146,7 @@ export declare class InvalidPublicKeyError extends ParameterValidationError {
|
|
|
137
146
|
*/
|
|
138
147
|
export declare class InvalidSignatureError extends ParameterValidationError {
|
|
139
148
|
readonly signature: string;
|
|
140
|
-
|
|
141
|
-
constructor(signature: string, errorDetail?: string | undefined);
|
|
149
|
+
constructor(signature: string, errorDetail?: string | ValidationResult);
|
|
142
150
|
}
|
|
143
151
|
/**
|
|
144
152
|
* @category Error
|
|
@@ -146,8 +154,7 @@ export declare class InvalidSignatureError extends ParameterValidationError {
|
|
|
146
154
|
*/
|
|
147
155
|
export declare class InvalidContractAddressError extends ParameterValidationError {
|
|
148
156
|
readonly contractAddress: string;
|
|
149
|
-
|
|
150
|
-
constructor(contractAddress: string, errorDetail?: string | undefined);
|
|
157
|
+
constructor(contractAddress: string, errorDetail?: string | ValidationResult);
|
|
151
158
|
}
|
|
152
159
|
/**
|
|
153
160
|
* @category Error
|
|
@@ -155,8 +162,7 @@ export declare class InvalidContractAddressError extends ParameterValidationErro
|
|
|
155
162
|
*/
|
|
156
163
|
export declare class InvalidChainIdError extends ParameterValidationError {
|
|
157
164
|
readonly chainId: string;
|
|
158
|
-
|
|
159
|
-
constructor(chainId: string, errorDetail?: string | undefined);
|
|
165
|
+
constructor(chainId: string, errorDetail?: string | ValidationResult);
|
|
160
166
|
}
|
|
161
167
|
/**
|
|
162
168
|
* @category Error
|
|
@@ -164,8 +170,7 @@ export declare class InvalidChainIdError extends ParameterValidationError {
|
|
|
164
170
|
*/
|
|
165
171
|
export declare class InvalidKeyHashError extends ParameterValidationError {
|
|
166
172
|
readonly keyHash: string;
|
|
167
|
-
|
|
168
|
-
constructor(keyHash: string, errorDetail?: string | undefined);
|
|
173
|
+
constructor(keyHash: string, errorDetail?: string | ValidationResult);
|
|
169
174
|
}
|
|
170
175
|
/**
|
|
171
176
|
* @category Error
|
|
@@ -173,8 +178,7 @@ export declare class InvalidKeyHashError extends ParameterValidationError {
|
|
|
173
178
|
*/
|
|
174
179
|
export declare class InvalidOperationHashError extends ParameterValidationError {
|
|
175
180
|
readonly operationHash: string;
|
|
176
|
-
|
|
177
|
-
constructor(operationHash: string, errorDetail?: string | undefined);
|
|
181
|
+
constructor(operationHash: string, errorDetail?: string | ValidationResult);
|
|
178
182
|
}
|
|
179
183
|
/**
|
|
180
184
|
* @category Error
|
|
@@ -182,15 +186,13 @@ export declare class InvalidOperationHashError extends ParameterValidationError
|
|
|
182
186
|
*/
|
|
183
187
|
export declare class InvalidOperationKindError extends ParameterValidationError {
|
|
184
188
|
readonly operationKind: string;
|
|
185
|
-
|
|
186
|
-
constructor(operationKind: string, errorDetail?: string | undefined);
|
|
189
|
+
constructor(operationKind: string, errorDetail?: string | ValidationResult);
|
|
187
190
|
}
|
|
188
191
|
/**
|
|
189
192
|
* @category Error
|
|
190
193
|
* @description General error that indicates something is no longer supported and/or deprecated
|
|
191
194
|
*/
|
|
192
195
|
export declare class DeprecationError extends UnsupportedActionError {
|
|
193
|
-
readonly message: string;
|
|
194
196
|
constructor(message: string);
|
|
195
197
|
}
|
|
196
198
|
/**
|
|
@@ -198,7 +200,6 @@ export declare class DeprecationError extends UnsupportedActionError {
|
|
|
198
200
|
* @description General error that indicates an action is prohibited or not allowed
|
|
199
201
|
*/
|
|
200
202
|
export declare class ProhibitedActionError extends UnsupportedActionError {
|
|
201
|
-
readonly message: string;
|
|
202
203
|
constructor(message: string);
|
|
203
204
|
}
|
|
204
205
|
/**
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Signer interface which is used across taquito in order to sign and inject operation
|
|
3
|
+
*/
|
|
4
|
+
export interface Signer {
|
|
5
|
+
/**
|
|
6
|
+
* @param op Message to sign
|
|
7
|
+
* @param magicByte Magic bytes 11 for block, 12 for preattestation, 13 for attestation, 3 for generic, 5 for the PACK format of michelson
|
|
8
|
+
* @description Sign the message and return an object with bytes, sig, prefixSig and sbytes
|
|
9
|
+
*/
|
|
10
|
+
sign(op: string, magicByte?: Uint8Array): Promise<SignResult>;
|
|
11
|
+
/**
|
|
12
|
+
* @description Return the public key of the account used by the signer
|
|
13
|
+
*/
|
|
14
|
+
publicKey(): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* @description Return the public key hash of the account used by the signer
|
|
17
|
+
*/
|
|
18
|
+
publicKeyHash(): Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* @description Optionally return the secret key of the account used by the signer
|
|
21
|
+
*/
|
|
22
|
+
secretKey(): Promise<string | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* @description Sign the public key to prove possession for bls key and return an object with bytes, sig, prefixSig and sbytes
|
|
25
|
+
*/
|
|
26
|
+
provePossession?(): Promise<RawSignResult>;
|
|
27
|
+
}
|
|
28
|
+
export interface SignResult {
|
|
29
|
+
bytes: string;
|
|
30
|
+
sig: string;
|
|
31
|
+
prefixSig: string;
|
|
32
|
+
sbytes: string;
|
|
33
|
+
}
|
|
34
|
+
export interface RawSignResult {
|
|
35
|
+
sig: string;
|
|
36
|
+
prefixSig: string;
|
|
37
|
+
rawSignature: Uint8Array;
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/core",
|
|
3
|
-
"version": "23.0.0
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "Classes, interfaces, and types shared across Taquito packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tezos",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"rollup": "^4.22.4",
|
|
69
69
|
"rollup-plugin-typescript2": "^0.36.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "4ac77876be144da54f292e639b5b977a13642de9"
|
|
72
72
|
}
|