@cardananium/cquisitor-lib 0.1.0-beta.2 → 0.1.0-beta.20
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/browser/cquisitor_lib.d.ts +1085 -3
- package/browser/cquisitor_lib.js +4 -39213
- package/browser/cquisitor_lib_bg.js +39450 -0
- package/browser/cquisitor_lib_bg.wasm +0 -0
- package/browser/cquisitor_lib_bg.wasm.d.ts +2260 -2254
- package/node/cquisitor_lib.d.ts +1085 -3
- package/node/cquisitor_lib.js +514 -259
- package/node/cquisitor_lib_bg.wasm +0 -0
- package/node/cquisitor_lib_bg.wasm.d.ts +2260 -2254
- package/package.json +3 -2
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {string} tx_hex
|
|
3
|
+
* @returns {string}
|
|
4
|
+
*/
|
|
5
|
+
export function get_necessary_data_list_js(tx_hex: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* @param {string} tx_hex
|
|
8
|
+
* @param {ValidationInputContext} validation_context
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
export function validate_transaction_js(tx_hex: string, validation_context: string): string;
|
|
12
|
+
|
|
1
13
|
/**
|
|
2
14
|
* @returns {(string)[]}
|
|
3
15
|
*/
|
|
@@ -8,7 +20,7 @@ export function get_decodable_types(): (string)[];
|
|
|
8
20
|
* @param {any} params_json
|
|
9
21
|
* @returns {any}
|
|
10
22
|
*/
|
|
11
|
-
export function decode_specific_type(input: string, type_name: string, params_json: DecodingParams):
|
|
23
|
+
export function decode_specific_type(input: string, type_name: string, params_json: DecodingParams): any;
|
|
12
24
|
/**
|
|
13
25
|
* @param {string} input
|
|
14
26
|
* @returns {(string)[]}
|
|
@@ -18,9 +30,33 @@ export function get_possible_types_for_input(input: string): (string)[];
|
|
|
18
30
|
* @param {string} cbor_hex
|
|
19
31
|
* @returns {any}
|
|
20
32
|
*/
|
|
21
|
-
export function cbor_to_json(cbor_hex: string):
|
|
33
|
+
export function cbor_to_json(cbor_hex: string): CborValue;
|
|
22
34
|
|
|
23
|
-
export function check_block_or_tx_signatures(hex_str: string):
|
|
35
|
+
export function check_block_or_tx_signatures(hex_str: string): CheckSignaturesResult;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param {string} tx_hex
|
|
39
|
+
* @returns {(string)[]}
|
|
40
|
+
*/
|
|
41
|
+
export function get_utxo_list_from_tx(tx_hex: string): string[];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param {string} tx_hex
|
|
45
|
+
* @param {UTxO[]} utxo_json
|
|
46
|
+
* @param {CostModels} cost_models_json
|
|
47
|
+
* @returns {ExecuteTxScriptsResult}
|
|
48
|
+
*/
|
|
49
|
+
export function execute_tx_scripts(tx_hex: string, utxo_json: UTxO[], cost_models_json: CostModels): ExecuteTxScriptsResult;
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} hex
|
|
52
|
+
* @returns {ProgramJson}
|
|
53
|
+
*/
|
|
54
|
+
export function decode_plutus_program_uplc_json(hex: string): ProgramJson;
|
|
55
|
+
/**
|
|
56
|
+
* @param {string} hex
|
|
57
|
+
* @returns {string}
|
|
58
|
+
*/
|
|
59
|
+
export function decode_plutus_program_pretty_uplc(hex: string): string;
|
|
24
60
|
|
|
25
61
|
export interface CborPosition {
|
|
26
62
|
offset: number;
|
|
@@ -119,4 +155,1050 @@ export interface CheckSignaturesResult {
|
|
|
119
155
|
invalidCatalystWitnesses: string[];
|
|
120
156
|
/** An array of invalid VKey witness signatures (hex strings). */
|
|
121
157
|
invalidVkeyWitnesses: string[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
// The execution units object contains two numeric fields.
|
|
162
|
+
export type ExUnits = {
|
|
163
|
+
steps: number;
|
|
164
|
+
mem: number;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// The redeemer tag is one of the following literal strings.
|
|
168
|
+
export type RedeemerTag = "Spend" | "Mint" | "Cert" | "Reward" | "Propose" | "Vote";
|
|
169
|
+
|
|
170
|
+
// A successful redeemer evaluation contains the original execution units,
|
|
171
|
+
// the calculated execution units, and additional redeemer info.
|
|
172
|
+
export interface RedeemerSuccess {
|
|
173
|
+
original_ex_units: ExUnits;
|
|
174
|
+
calculated_ex_units: ExUnits;
|
|
175
|
+
redeemer_index: number;
|
|
176
|
+
redeemer_tag: RedeemerTag;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// A failed redeemer evaluation contains the original execution units,
|
|
180
|
+
// an error message, and additional redeemer info.
|
|
181
|
+
export interface RedeemerError {
|
|
182
|
+
original_ex_units: ExUnits;
|
|
183
|
+
error: string;
|
|
184
|
+
redeemer_index: number;
|
|
185
|
+
redeemer_tag: RedeemerTag;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// The result from executing the transaction scripts is an array of redeemer results.
|
|
189
|
+
// Each result can be either a success or an error.
|
|
190
|
+
export type RedeemerResult = RedeemerSuccess | RedeemerError;
|
|
191
|
+
|
|
192
|
+
// Type for the `execute_tx_scripts` response after JSON-parsing.
|
|
193
|
+
export type ExecuteTxScriptsResult = RedeemerResult[];
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
// The overall JSON produced by `to_json_program`:
|
|
197
|
+
export interface ProgramJson {
|
|
198
|
+
program: {
|
|
199
|
+
version: string;
|
|
200
|
+
term: Term;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// A UPLC term can be one of several forms.
|
|
205
|
+
export type Term =
|
|
206
|
+
| VarTerm
|
|
207
|
+
| DelayTerm
|
|
208
|
+
| LambdaTerm
|
|
209
|
+
| ApplyTerm
|
|
210
|
+
| ConstantTerm
|
|
211
|
+
| ForceTerm
|
|
212
|
+
| ErrorTerm
|
|
213
|
+
| BuiltinTerm
|
|
214
|
+
| ConstrTerm
|
|
215
|
+
| CaseTerm;
|
|
216
|
+
|
|
217
|
+
export interface VarTerm {
|
|
218
|
+
var: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface DelayTerm {
|
|
222
|
+
delay: Term;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface LambdaTerm {
|
|
226
|
+
lambda: {
|
|
227
|
+
parameter_name: string;
|
|
228
|
+
body: Term;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface ApplyTerm {
|
|
233
|
+
apply: {
|
|
234
|
+
function: Term;
|
|
235
|
+
argument: Term;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface ConstantTerm {
|
|
240
|
+
constant: Constant;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface ForceTerm {
|
|
244
|
+
force: Term;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface ErrorTerm {
|
|
248
|
+
error: "error";
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface BuiltinTerm {
|
|
252
|
+
builtin: string;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface ConstrTerm {
|
|
256
|
+
constr: {
|
|
257
|
+
tag: number;
|
|
258
|
+
fields: Term[];
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface CaseTerm {
|
|
263
|
+
case: {
|
|
264
|
+
constr: Term;
|
|
265
|
+
branches: Term[];
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// The UPLC constant is one of several union types.
|
|
270
|
+
export type Constant =
|
|
271
|
+
| IntegerConstant
|
|
272
|
+
| ByteStringConstant
|
|
273
|
+
| StringConstant
|
|
274
|
+
| UnitConstant
|
|
275
|
+
| BoolConstant
|
|
276
|
+
| ListConstant
|
|
277
|
+
| PairConstant
|
|
278
|
+
| DataConstant
|
|
279
|
+
| Bls12_381G1ElementConstant
|
|
280
|
+
| Bls12_381G2ElementConstant;
|
|
281
|
+
|
|
282
|
+
export interface IntegerConstant {
|
|
283
|
+
integer: string; // represented as a string
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface ByteStringConstant {
|
|
287
|
+
bytestring: string; // hex-encoded string
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface StringConstant {
|
|
291
|
+
string: string;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export interface UnitConstant {
|
|
295
|
+
unit: "()";
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export interface BoolConstant {
|
|
299
|
+
bool: boolean;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export interface ListConstant {
|
|
303
|
+
list: {
|
|
304
|
+
type: Type;
|
|
305
|
+
items: Constant[];
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface PairConstant {
|
|
310
|
+
pair: {
|
|
311
|
+
type_left: Type;
|
|
312
|
+
type_right: Type;
|
|
313
|
+
left: Constant;
|
|
314
|
+
right: Constant;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface DataConstant {
|
|
319
|
+
data: PlutusData;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface Bls12_381G1ElementConstant {
|
|
323
|
+
bls12_381_G1_element: {
|
|
324
|
+
x: number;
|
|
325
|
+
y: number;
|
|
326
|
+
z: number;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export interface Bls12_381G2ElementConstant {
|
|
331
|
+
bls12_381_G2_element: BlstP2;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// The UPLC type is represented either as a string literal or an object.
|
|
335
|
+
export type Type =
|
|
336
|
+
| "bool"
|
|
337
|
+
| "integer"
|
|
338
|
+
| "string"
|
|
339
|
+
| "bytestring"
|
|
340
|
+
| "unit"
|
|
341
|
+
| "data"
|
|
342
|
+
| "bls12_381_G1_element"
|
|
343
|
+
| "bls12_381_G2_element"
|
|
344
|
+
| "bls12_381_mlresult"
|
|
345
|
+
| ListType
|
|
346
|
+
| PairType;
|
|
347
|
+
|
|
348
|
+
export interface ListType {
|
|
349
|
+
list: Type;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export interface PairType {
|
|
353
|
+
pair: {
|
|
354
|
+
left: Type;
|
|
355
|
+
right: Type;
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// The JSON representation for a blst_p2 element: each coordinate is an array of numbers.
|
|
360
|
+
export interface BlstP2 {
|
|
361
|
+
x: number[];
|
|
362
|
+
y: number[];
|
|
363
|
+
z: number[];
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Plutus data is also a tagged union.
|
|
367
|
+
export type PlutusData =
|
|
368
|
+
| ConstrData
|
|
369
|
+
| MapData
|
|
370
|
+
| BigIntData
|
|
371
|
+
| BoundedBytesData
|
|
372
|
+
| ArrayData;
|
|
373
|
+
|
|
374
|
+
export interface ConstrData {
|
|
375
|
+
constr: {
|
|
376
|
+
tag: number;
|
|
377
|
+
any_constructor: boolean;
|
|
378
|
+
fields: PlutusData[];
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export interface MapData {
|
|
383
|
+
map: Array<{
|
|
384
|
+
key: PlutusData;
|
|
385
|
+
value: PlutusData;
|
|
386
|
+
}>;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export interface BigIntData {
|
|
390
|
+
integer: string; // big integers are represented as strings
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface BoundedBytesData {
|
|
394
|
+
bytestring: string; // hex-encoded
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export interface ArrayData {
|
|
398
|
+
list: PlutusData[];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export interface Asset {
|
|
402
|
+
unit: string;
|
|
403
|
+
quantity: string;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export interface TxInput {
|
|
407
|
+
outputIndex: number;
|
|
408
|
+
txHash: string;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface TxOutput {
|
|
412
|
+
address: string;
|
|
413
|
+
amount: Asset[];
|
|
414
|
+
dataHash?: string;
|
|
415
|
+
plutusData?: string;
|
|
416
|
+
scriptRef?: string;
|
|
417
|
+
scriptHash?: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export interface UTxO {
|
|
421
|
+
input: TxInput;
|
|
422
|
+
output: TxOutput;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export interface CostModels {
|
|
426
|
+
plutusV1?: number[];
|
|
427
|
+
plutusV2?: number[];
|
|
428
|
+
plutusV3?: number[];
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
///AUTOGENERATED
|
|
433
|
+
|
|
434
|
+
export interface NecessaryInputData {
|
|
435
|
+
accounts: string[];
|
|
436
|
+
committeeMembers: LocalCredential[];
|
|
437
|
+
dReps: string[];
|
|
438
|
+
govActions: GovernanceActionId[];
|
|
439
|
+
lastEnactedGovAction: GovernanceActionType[];
|
|
440
|
+
pools: string[];
|
|
441
|
+
utxos: TxInput[];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Phase 1 validation errors
|
|
446
|
+
*/
|
|
447
|
+
export type Phase1Error =
|
|
448
|
+
| (
|
|
449
|
+
| "GenesisKeyDelegationCertificateIsNotSupported"
|
|
450
|
+
| "MoveInstantaneousRewardsCertificateIsNotSupported"
|
|
451
|
+
)
|
|
452
|
+
| {
|
|
453
|
+
BadInputsUTxO: {
|
|
454
|
+
invalid_input: TxInput;
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
| {
|
|
458
|
+
OutsideValidityIntervalUTxO: {
|
|
459
|
+
current_slot: bigint;
|
|
460
|
+
interval_end: bigint;
|
|
461
|
+
interval_start: bigint;
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
| {
|
|
465
|
+
MaxTxSizeUTxO: {
|
|
466
|
+
actual_size: bigint;
|
|
467
|
+
max_size: bigint;
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
| "InputSetEmptyUTxO"
|
|
471
|
+
| {
|
|
472
|
+
FeeTooSmallUTxO: {
|
|
473
|
+
actual_fee: bigint;
|
|
474
|
+
fee_decomposition: FeeDecomposition;
|
|
475
|
+
min_fee: bigint;
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
| {
|
|
479
|
+
ValueNotConservedUTxO: {
|
|
480
|
+
difference: Value;
|
|
481
|
+
input_sum: Value;
|
|
482
|
+
output_sum: Value;
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
| {
|
|
486
|
+
WrongNetwork: {
|
|
487
|
+
wrong_addresses: string[];
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
| {
|
|
491
|
+
WrongNetworkWithdrawal: {
|
|
492
|
+
wrong_addresses: string[];
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
| {
|
|
496
|
+
WrongNetworkInTxBody: {
|
|
497
|
+
actual_network: number;
|
|
498
|
+
expected_network: number;
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
| {
|
|
502
|
+
OutputTooSmallUTxO: {
|
|
503
|
+
min_amount: number;
|
|
504
|
+
output_amount: number;
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
| {
|
|
508
|
+
CollateralReturnTooSmall: {
|
|
509
|
+
min_amount: number;
|
|
510
|
+
output_amount: number;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
| {
|
|
514
|
+
OutputBootAddrAttrsTooBig: {
|
|
515
|
+
actual_size: bigint;
|
|
516
|
+
max_size: bigint;
|
|
517
|
+
output: unknown;
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
| {
|
|
521
|
+
OutputTooBigUTxO: {
|
|
522
|
+
actual_size: bigint;
|
|
523
|
+
max_size: bigint;
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
| {
|
|
527
|
+
InsufficientCollateral: {
|
|
528
|
+
required_collateral: number;
|
|
529
|
+
total_collateral: number;
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
| {
|
|
533
|
+
ExUnitsTooBigUTxO: {
|
|
534
|
+
actual_memory_units: bigint;
|
|
535
|
+
actual_steps_units: bigint;
|
|
536
|
+
max_memory_units: bigint;
|
|
537
|
+
max_steps_units: bigint;
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
| "CalculatedCollateralContainsNonAdaAssets"
|
|
541
|
+
| {
|
|
542
|
+
CollateralInputContainsNonAdaAssets: {
|
|
543
|
+
collateral_input: string;
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
| {
|
|
547
|
+
CollateralIsLockedByScript: {
|
|
548
|
+
invalid_collateral: string;
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
| {
|
|
552
|
+
TooManyCollateralInputs: {
|
|
553
|
+
actual_count: number;
|
|
554
|
+
max_count: number;
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
| "NoCollateralInputs"
|
|
558
|
+
| {
|
|
559
|
+
IncorrectTotalCollateralField: {
|
|
560
|
+
actual_sum: number;
|
|
561
|
+
declared_total: number;
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
| {
|
|
565
|
+
InvalidSignature: {
|
|
566
|
+
invalid_signature: string;
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
| {
|
|
570
|
+
ExtraneousSignature: {
|
|
571
|
+
extraneous_signature: string;
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
| {
|
|
575
|
+
NativeScriptIsUnsuccessful: {
|
|
576
|
+
native_script_hash: string;
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
| {
|
|
580
|
+
PlutusScriptIsUnsuccessful: {
|
|
581
|
+
plutus_script_hash: string;
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
| {
|
|
585
|
+
MissingVKeyWitnesses: {
|
|
586
|
+
missing_key_hash: string;
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
| {
|
|
590
|
+
MissingScriptWitnesses: {
|
|
591
|
+
missing_script_hash: string;
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
| {
|
|
595
|
+
MissingRedeemer: {
|
|
596
|
+
index: number;
|
|
597
|
+
tag: string;
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
| "MissingTxBodyMetadataHash"
|
|
601
|
+
| "MissingTxMetadata"
|
|
602
|
+
| {
|
|
603
|
+
ConflictingMetadataHash: {
|
|
604
|
+
actual_hash: string;
|
|
605
|
+
expected_hash: string;
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
| {
|
|
609
|
+
InvalidMetadata: {
|
|
610
|
+
message: string;
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
| {
|
|
614
|
+
ExtraneousScriptWitnesses: {
|
|
615
|
+
extraneous_script: string;
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
| {
|
|
619
|
+
StakeAlreadyRegistered: {
|
|
620
|
+
reward_address: string;
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
| {
|
|
624
|
+
StakeNotRegistered: {
|
|
625
|
+
reward_address: string;
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
| {
|
|
629
|
+
StakeNonZeroAccountBalance: {
|
|
630
|
+
remaining_balance: bigint;
|
|
631
|
+
reward_address: string;
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
| {
|
|
635
|
+
RewardAccountNotExisting: {
|
|
636
|
+
reward_address: string;
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
| {
|
|
640
|
+
WrongRequestedWithdrawalAmount: {
|
|
641
|
+
expected_amount: number;
|
|
642
|
+
requested_amount: bigint;
|
|
643
|
+
reward_address: string;
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
| {
|
|
647
|
+
StakePoolNotRegistered: {
|
|
648
|
+
pool_id: string;
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
| {
|
|
652
|
+
WrongRetirementEpoch: {
|
|
653
|
+
current_epoch: bigint;
|
|
654
|
+
max_epoch: bigint;
|
|
655
|
+
min_epoch: bigint;
|
|
656
|
+
specified_epoch: bigint;
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
| {
|
|
660
|
+
StakePoolCostTooLow: {
|
|
661
|
+
min_cost: bigint;
|
|
662
|
+
specified_cost: bigint;
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
| {
|
|
666
|
+
InsufficientFundsForMir: {
|
|
667
|
+
available_amount: bigint;
|
|
668
|
+
requested_amount: bigint;
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
| {
|
|
672
|
+
InvalidCommitteeVote: {
|
|
673
|
+
message: string;
|
|
674
|
+
voter: unknown;
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
| {
|
|
678
|
+
DRepIncorrectDeposit: {
|
|
679
|
+
cert_index: number;
|
|
680
|
+
required_deposit: number;
|
|
681
|
+
supplied_deposit: number;
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
| {
|
|
685
|
+
DRepDeregistrationWrongRefund: {
|
|
686
|
+
cert_index: number;
|
|
687
|
+
required_refund: number;
|
|
688
|
+
supplied_refund: number;
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
| {
|
|
692
|
+
StakeRegistrationWrongDeposit: {
|
|
693
|
+
cert_index: number;
|
|
694
|
+
required_deposit: number;
|
|
695
|
+
supplied_deposit: number;
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
| {
|
|
699
|
+
StakeDeregistrationWrongRefund: {
|
|
700
|
+
cert_index: number;
|
|
701
|
+
required_refund: number;
|
|
702
|
+
supplied_refund: number;
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
| {
|
|
706
|
+
PoolRegistrationWrongDeposit: {
|
|
707
|
+
cert_index: number;
|
|
708
|
+
required_deposit: number;
|
|
709
|
+
supplied_deposit: number;
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
| {
|
|
713
|
+
CommitteeHasPreviouslyResigned: {
|
|
714
|
+
committee_credential: LocalCredential;
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
| {
|
|
718
|
+
TreasuryValueMismatch: {
|
|
719
|
+
actual_value: bigint;
|
|
720
|
+
declared_value: bigint;
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
| {
|
|
724
|
+
RefScriptsSizeTooBig: {
|
|
725
|
+
actual_size: bigint;
|
|
726
|
+
max_size: bigint;
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
| {
|
|
730
|
+
WithdrawalNotAllowedBecauseNotDelegatedToDRep: {
|
|
731
|
+
reward_address: string;
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
| {
|
|
735
|
+
CommitteeIsUnknown: {
|
|
736
|
+
/**
|
|
737
|
+
* The committee key hash
|
|
738
|
+
*/
|
|
739
|
+
committee_key_hash:
|
|
740
|
+
| {
|
|
741
|
+
keyHash: number[];
|
|
742
|
+
}
|
|
743
|
+
| {
|
|
744
|
+
scriptHash: number[];
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
| {
|
|
749
|
+
GovActionsDoNotExist: {
|
|
750
|
+
/**
|
|
751
|
+
* The list of invalid governance action IDs
|
|
752
|
+
*/
|
|
753
|
+
invalid_action_ids: GovernanceActionId[];
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
| {
|
|
757
|
+
MalformedProposal: {
|
|
758
|
+
gov_action: GovernanceActionId;
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
| {
|
|
762
|
+
ProposalProcedureNetworkIdMismatch: {
|
|
763
|
+
/**
|
|
764
|
+
* The expected network ID
|
|
765
|
+
*/
|
|
766
|
+
expected_network: number;
|
|
767
|
+
/**
|
|
768
|
+
* The reward account
|
|
769
|
+
*/
|
|
770
|
+
reward_account: string;
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
| {
|
|
774
|
+
TreasuryWithdrawalsNetworkIdMismatch: {
|
|
775
|
+
/**
|
|
776
|
+
* The expected network ID
|
|
777
|
+
*/
|
|
778
|
+
expected_network: number;
|
|
779
|
+
/**
|
|
780
|
+
* The set of mismatched reward accounts
|
|
781
|
+
*/
|
|
782
|
+
mismatched_account: string;
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
| {
|
|
786
|
+
VotingProposalIncorrectDeposit: {
|
|
787
|
+
proposal_index: number;
|
|
788
|
+
/**
|
|
789
|
+
* The required deposit amount
|
|
790
|
+
*/
|
|
791
|
+
required_deposit: number;
|
|
792
|
+
/**
|
|
793
|
+
* The supplied deposit amount
|
|
794
|
+
*/
|
|
795
|
+
supplied_deposit: number;
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
| {
|
|
799
|
+
DisallowedVoters: {
|
|
800
|
+
/**
|
|
801
|
+
* List of disallowed voter and action ID pairs
|
|
802
|
+
*/
|
|
803
|
+
disallowed_pairs: [unknown, unknown][];
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
| {
|
|
807
|
+
ConflictingCommitteeUpdate: {
|
|
808
|
+
/**
|
|
809
|
+
* The set of conflicting credentials
|
|
810
|
+
*/
|
|
811
|
+
conflicting_credentials:
|
|
812
|
+
| {
|
|
813
|
+
keyHash: number[];
|
|
814
|
+
}
|
|
815
|
+
| {
|
|
816
|
+
scriptHash: number[];
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
| {
|
|
821
|
+
ExpirationEpochTooSmall: {
|
|
822
|
+
/**
|
|
823
|
+
* Map of credentials to their invalid expiration epochs
|
|
824
|
+
*/
|
|
825
|
+
invalid_expirations: {
|
|
826
|
+
[k: string]: number;
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
| {
|
|
831
|
+
InvalidPrevGovActionId: {
|
|
832
|
+
/**
|
|
833
|
+
* The invalid proposal
|
|
834
|
+
*/
|
|
835
|
+
proposal: {
|
|
836
|
+
[k: string]: unknown;
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
| {
|
|
841
|
+
VotingOnExpiredGovAction: {
|
|
842
|
+
expired_gov_action: GovernanceActionId;
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
| {
|
|
846
|
+
ProposalCantFollow: {
|
|
847
|
+
/**
|
|
848
|
+
* The expected protocol version
|
|
849
|
+
*/
|
|
850
|
+
expected_versions: ProtocolVersion[];
|
|
851
|
+
/**
|
|
852
|
+
* Previous governance action ID
|
|
853
|
+
*/
|
|
854
|
+
prev_gov_action_id?: GovernanceActionId | null;
|
|
855
|
+
supplied_version: ProtocolVersion;
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
| {
|
|
859
|
+
InvalidConstitutionPolicyHash: {
|
|
860
|
+
/**
|
|
861
|
+
* The expected policy hash
|
|
862
|
+
*/
|
|
863
|
+
expected_hash?: string | null;
|
|
864
|
+
/**
|
|
865
|
+
* The supplied policy hash
|
|
866
|
+
*/
|
|
867
|
+
supplied_hash?: string | null;
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
| {
|
|
871
|
+
VoterDoNotExist: {
|
|
872
|
+
/**
|
|
873
|
+
* List of non-existent voters
|
|
874
|
+
*/
|
|
875
|
+
missing_voter: {
|
|
876
|
+
[k: string]: unknown;
|
|
877
|
+
};
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
| {
|
|
881
|
+
ZeroTreasuryWithdrawals: {
|
|
882
|
+
gov_action: GovernanceActionId;
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
| {
|
|
886
|
+
ProposalReturnAccountDoesNotExist: {
|
|
887
|
+
/**
|
|
888
|
+
* The invalid return account
|
|
889
|
+
*/
|
|
890
|
+
return_account: string;
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
| {
|
|
894
|
+
TreasuryWithdrawalReturnAccountsDoNotExist: {
|
|
895
|
+
/**
|
|
896
|
+
* List of non-existent return accounts
|
|
897
|
+
*/
|
|
898
|
+
missing_account: string;
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
| {
|
|
902
|
+
AuxiliaryDataHashMismatch: {
|
|
903
|
+
/**
|
|
904
|
+
* The actual auxiliary data hash
|
|
905
|
+
*/
|
|
906
|
+
actual_hash?: string | null;
|
|
907
|
+
/**
|
|
908
|
+
* The expected auxiliary data hash
|
|
909
|
+
*/
|
|
910
|
+
expected_hash: string;
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
| "AuxiliaryDataHashMissing"
|
|
914
|
+
| "AuxiliaryDataHashPresentButNotExpected"
|
|
915
|
+
| {
|
|
916
|
+
UnknownError: {
|
|
917
|
+
message: string;
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
| {
|
|
921
|
+
MissingDatum: {
|
|
922
|
+
datum_hash: string;
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
| {
|
|
926
|
+
ExtraneousDatumWitnesses: {
|
|
927
|
+
datum_hash: string;
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
| {
|
|
931
|
+
ScriptDataHashMismatch: {
|
|
932
|
+
/**
|
|
933
|
+
* The expected script data hash
|
|
934
|
+
*/
|
|
935
|
+
expected_hash?: string | null;
|
|
936
|
+
/**
|
|
937
|
+
* The actual script data hash
|
|
938
|
+
*/
|
|
939
|
+
provided_hash?: string | null;
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
export type Phase1Warning =
|
|
944
|
+
| ("InputsAreNotSorted" | "CollateralIsUnnecessary" | "TotalCollateralIsNotDeclared")
|
|
945
|
+
| {
|
|
946
|
+
FeeIsBiggerThanMinFee: {
|
|
947
|
+
actual_fee: bigint;
|
|
948
|
+
fee_decomposition: FeeDecomposition;
|
|
949
|
+
min_fee: bigint;
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
| {
|
|
953
|
+
InputUsesRewardAddress: {
|
|
954
|
+
invalid_input: string;
|
|
955
|
+
};
|
|
956
|
+
}
|
|
957
|
+
| {
|
|
958
|
+
CollateralInputUsesRewardAddress: {
|
|
959
|
+
invalid_collateral: string;
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
| {
|
|
963
|
+
CannotCheckStakeDeregistrationRefund: {
|
|
964
|
+
cert_index: number;
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
| {
|
|
968
|
+
CannotCheckDRepDeregistrationRefund: {
|
|
969
|
+
cert_index: number;
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
| {
|
|
973
|
+
PoolAlreadyRegistered: {
|
|
974
|
+
pool_id: string;
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
| {
|
|
978
|
+
DRepAlreadyRegistered: {
|
|
979
|
+
drep_id: string;
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
| {
|
|
983
|
+
CommitteeAlreadyAuthorized: {
|
|
984
|
+
committee_key: string;
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
| {
|
|
988
|
+
DRepNotRegistered: {
|
|
989
|
+
cert_index: number;
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
| {
|
|
993
|
+
DuplicateRegistrationInTx: {
|
|
994
|
+
cert_index: number;
|
|
995
|
+
entity_id: string;
|
|
996
|
+
entity_type: string;
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
| {
|
|
1000
|
+
DuplicateCommitteeColdResignationInTx: {
|
|
1001
|
+
cert_index: number;
|
|
1002
|
+
committee_credential: LocalCredential;
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
| {
|
|
1006
|
+
DuplicateCommitteeHotRegistrationInTx: {
|
|
1007
|
+
cert_index: number;
|
|
1008
|
+
committee_credential: LocalCredential;
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
export interface ValidationResult {
|
|
1013
|
+
errors: ValidationError[];
|
|
1014
|
+
warnings: ValidationWarning[];
|
|
1015
|
+
}
|
|
1016
|
+
export interface ValidationError {
|
|
1017
|
+
error: Phase1Error;
|
|
1018
|
+
error_message: string;
|
|
1019
|
+
hint?: string | null;
|
|
1020
|
+
locations: string[];
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
export interface FeeDecomposition {
|
|
1024
|
+
executionUnitsFee: bigint;
|
|
1025
|
+
referenceScriptsFee: bigint;
|
|
1026
|
+
txSizeFee: bigint;
|
|
1027
|
+
}
|
|
1028
|
+
export interface Value {
|
|
1029
|
+
assets: MultiAsset;
|
|
1030
|
+
coins: number;
|
|
1031
|
+
}
|
|
1032
|
+
export interface MultiAsset {
|
|
1033
|
+
assets: ValidatorAsset[];
|
|
1034
|
+
}
|
|
1035
|
+
export interface ValidatorAsset {
|
|
1036
|
+
asset_name: string;
|
|
1037
|
+
policy_id: string;
|
|
1038
|
+
quantity: number;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
export interface ProtocolVersion {
|
|
1043
|
+
major: bigint;
|
|
1044
|
+
minor: bigint;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
export interface ValidationWarning {
|
|
1049
|
+
hint?: string | null;
|
|
1050
|
+
locations: string[];
|
|
1051
|
+
warning: Phase1Warning;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
export type LocalCredential =
|
|
1055
|
+
| {
|
|
1056
|
+
keyHash: number[];
|
|
1057
|
+
}
|
|
1058
|
+
| {
|
|
1059
|
+
scriptHash: number[];
|
|
1060
|
+
};
|
|
1061
|
+
export type GovernanceActionType =
|
|
1062
|
+
| "parameterChangeAction"
|
|
1063
|
+
| "hardForkInitiationAction"
|
|
1064
|
+
| "treasuryWithdrawalsAction"
|
|
1065
|
+
| "noConfidenceAction"
|
|
1066
|
+
| "updateCommitteeAction"
|
|
1067
|
+
| "newConstitutionAction"
|
|
1068
|
+
| "infoAction";
|
|
1069
|
+
export type NetworkType = "mainnet" | "testnet";
|
|
1070
|
+
|
|
1071
|
+
export interface ValidationInputContext {
|
|
1072
|
+
accountContexts: AccountInputContext[];
|
|
1073
|
+
committeeContext: CommitteeInputContext;
|
|
1074
|
+
drepContexts: DrepInputContext[];
|
|
1075
|
+
govActionContexts: GovActionInputContext[];
|
|
1076
|
+
lastEnactedGovAction: GovActionInputContext[];
|
|
1077
|
+
networkType: NetworkType;
|
|
1078
|
+
poolContexts: PoolInputContext[];
|
|
1079
|
+
protocolParameters: ProtocolParameters;
|
|
1080
|
+
slot: bigint;
|
|
1081
|
+
treasuryValue: bigint;
|
|
1082
|
+
utxoSet: UtxoInputContext[];
|
|
1083
|
+
}
|
|
1084
|
+
export interface AccountInputContext {
|
|
1085
|
+
balance?: number | null;
|
|
1086
|
+
bech32Address: string;
|
|
1087
|
+
delegatedToDrep?: string | null;
|
|
1088
|
+
delegatedToPool?: string | null;
|
|
1089
|
+
isRegistered: boolean;
|
|
1090
|
+
payedDeposit?: number | null;
|
|
1091
|
+
}
|
|
1092
|
+
export interface CommitteeInputContext {
|
|
1093
|
+
activeCommitteeMembers: LocalCredential[];
|
|
1094
|
+
potentialCommitteeMembers: LocalCredential[];
|
|
1095
|
+
resignedCommitteeMembers: LocalCredential[];
|
|
1096
|
+
}
|
|
1097
|
+
export interface DrepInputContext {
|
|
1098
|
+
bech32Drep: string;
|
|
1099
|
+
isRegistered: boolean;
|
|
1100
|
+
payedDeposit?: number | null;
|
|
1101
|
+
}
|
|
1102
|
+
export interface GovActionInputContext {
|
|
1103
|
+
actionId: GovernanceActionId;
|
|
1104
|
+
actionType: GovernanceActionType;
|
|
1105
|
+
isActive: boolean;
|
|
1106
|
+
}
|
|
1107
|
+
export interface GovernanceActionId {
|
|
1108
|
+
index: number;
|
|
1109
|
+
txHash: number[];
|
|
1110
|
+
}
|
|
1111
|
+
export interface PoolInputContext {
|
|
1112
|
+
isRegistered: boolean;
|
|
1113
|
+
poolId: string;
|
|
1114
|
+
retirementEpoch?: number | null;
|
|
1115
|
+
}
|
|
1116
|
+
export interface ProtocolParameters {
|
|
1117
|
+
/**
|
|
1118
|
+
* Cost per UTxO byte in lovelace
|
|
1119
|
+
*/
|
|
1120
|
+
adaPerUtxoByte: bigint;
|
|
1121
|
+
/**
|
|
1122
|
+
* Percentage of transaction fee required as collateral
|
|
1123
|
+
*/
|
|
1124
|
+
collateralPercentage: number;
|
|
1125
|
+
costModels: CostModels;
|
|
1126
|
+
/**
|
|
1127
|
+
* Deposit amount required for registering as a DRep
|
|
1128
|
+
*/
|
|
1129
|
+
drepDeposit: bigint;
|
|
1130
|
+
executionPrices: ExUnitPrices;
|
|
1131
|
+
/**
|
|
1132
|
+
* Deposit amount required for submitting a governance action
|
|
1133
|
+
*/
|
|
1134
|
+
governanceActionDeposit: bigint;
|
|
1135
|
+
/**
|
|
1136
|
+
* Maximum block body size in bytes
|
|
1137
|
+
*/
|
|
1138
|
+
maxBlockBodySize: number;
|
|
1139
|
+
maxBlockExecutionUnits: ExUnits;
|
|
1140
|
+
/**
|
|
1141
|
+
* Maximum block header size in bytes
|
|
1142
|
+
*/
|
|
1143
|
+
maxBlockHeaderSize: number;
|
|
1144
|
+
/**
|
|
1145
|
+
* Maximum number of collateral inputs
|
|
1146
|
+
*/
|
|
1147
|
+
maxCollateralInputs: number;
|
|
1148
|
+
/**
|
|
1149
|
+
* Maximum number of epochs that can be used for pool retirement ahead
|
|
1150
|
+
*/
|
|
1151
|
+
maxEpochForPoolRetirement: number;
|
|
1152
|
+
/**
|
|
1153
|
+
* Maximum transaction size in bytes
|
|
1154
|
+
*/
|
|
1155
|
+
maxTransactionSize: number;
|
|
1156
|
+
maxTxExecutionUnits: ExUnits;
|
|
1157
|
+
/**
|
|
1158
|
+
* Maximum size of a Value in bytes
|
|
1159
|
+
*/
|
|
1160
|
+
maxValueSize: number;
|
|
1161
|
+
/**
|
|
1162
|
+
* Linear factor for the minimum fee calculation formula
|
|
1163
|
+
*/
|
|
1164
|
+
minFeeCoefficientA: bigint;
|
|
1165
|
+
/**
|
|
1166
|
+
* Constant factor for the minimum fee calculation formula
|
|
1167
|
+
*/
|
|
1168
|
+
minFeeConstantB: bigint;
|
|
1169
|
+
/**
|
|
1170
|
+
* Minimum pool cost in lovelace
|
|
1171
|
+
*/
|
|
1172
|
+
minPoolCost: bigint;
|
|
1173
|
+
/**
|
|
1174
|
+
* Protocol version (major, minor)
|
|
1175
|
+
*
|
|
1176
|
+
* @minItems 2
|
|
1177
|
+
* @maxItems 2
|
|
1178
|
+
*/
|
|
1179
|
+
protocolVersion: [unknown, unknown];
|
|
1180
|
+
referenceScriptCostPerByte: SubCoin;
|
|
1181
|
+
/**
|
|
1182
|
+
* Deposit amount required for registering a stake key
|
|
1183
|
+
*/
|
|
1184
|
+
stakeKeyDeposit: bigint;
|
|
1185
|
+
/**
|
|
1186
|
+
* Deposit amount required for registering a stake pool
|
|
1187
|
+
*/
|
|
1188
|
+
stakePoolDeposit: bigint;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
export interface ExUnitPrices {
|
|
1192
|
+
memPrice: SubCoin;
|
|
1193
|
+
stepPrice: SubCoin;
|
|
1194
|
+
}
|
|
1195
|
+
export interface SubCoin {
|
|
1196
|
+
denominator: bigint;
|
|
1197
|
+
numerator: bigint;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
export interface UtxoInputContext {
|
|
1202
|
+
isSpent: boolean;
|
|
1203
|
+
utxo: UTxO;
|
|
122
1204
|
}
|