@cardananium/cquisitor-lib 0.1.0-beta.13 → 0.1.0-beta.16

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.
@@ -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: ValidationInputContext): string;
12
+
1
13
  /**
2
14
  * @returns {(string)[]}
3
15
  */
@@ -414,4 +426,563 @@ export interface CostModels {
414
426
  plutusV1?: number[];
415
427
  plutusV2?: number[];
416
428
  plutusV3?: number[];
417
- }
429
+ }
430
+
431
+
432
+ ///AUTOGENERATED
433
+
434
+ export interface GovernanceActionId {
435
+ index: number;
436
+ txHash: number[];
437
+ }
438
+
439
+ export type GovernanceActionType = "parameterChangeAction" | "hardForkInitiationAction" | "treasuryWithdrawalsAction" | "noConfidenceAction" | "updateCommitteeAction" | "newConstitutionAction" | "infoAction";
440
+
441
+ export type LocalCredential = {
442
+ keyHash: number[];
443
+ } | {
444
+ scriptHash: number[];
445
+ };
446
+
447
+ export interface TxInput {
448
+ outputIndex: number;
449
+ txHash: string;
450
+ }
451
+
452
+ export interface FeeDecomposition {
453
+ executionUnitsFee: number;
454
+ referenceScriptsFee: number;
455
+ txSizeFee: number;
456
+ }
457
+
458
+ export interface MultiAsset {
459
+ assets: ValidatorAsset[];
460
+ }
461
+
462
+ export type Phase1Error = "GenesisKeyDelegationCertificateIsNotSupported" | "MoveInstantaneousRewardsCertificateIsNotSupported" | {
463
+ BadInputsUTxO: {
464
+ invalid_input: TxInput;
465
+ };
466
+ } | {
467
+ OutsideValidityIntervalUTxO: {
468
+ current_slot: number;
469
+ interval_end: number;
470
+ interval_start: number;
471
+ };
472
+ } | {
473
+ MaxTxSizeUTxO: {
474
+ actual_size: number;
475
+ max_size: number;
476
+ };
477
+ } | string | {
478
+ FeeTooSmallUTxO: {
479
+ actual_fee: number;
480
+ fee_decomposition: FeeDecomposition;
481
+ min_fee: number;
482
+ };
483
+ } | {
484
+ ValueNotConservedUTxO: {
485
+ difference: Value;
486
+ input_sum: Value;
487
+ output_sum: Value;
488
+ };
489
+ } | {
490
+ WrongNetwork: {
491
+ wrong_addresses: string[];
492
+ };
493
+ } | {
494
+ WrongNetworkWithdrawal: {
495
+ wrong_addresses: string[];
496
+ };
497
+ } | {
498
+ WrongNetworkInTxBody: {
499
+ actual_network: number;
500
+ expected_network: number;
501
+ };
502
+ } | {
503
+ OutputTooSmallUTxO: {
504
+ min_amount: number;
505
+ output_amount: number;
506
+ };
507
+ } | {
508
+ CollateralReturnTooSmall: {
509
+ min_amount: number;
510
+ output_amount: number;
511
+ };
512
+ } | {
513
+ OutputBootAddrAttrsTooBig: {
514
+ actual_size: number;
515
+ max_size: number;
516
+ output: any;
517
+ };
518
+ } | {
519
+ OutputTooBigUTxO: {
520
+ max_size: number;
521
+ oversized_outputs: string[];
522
+ };
523
+ } | {
524
+ InsufficientCollateral: {
525
+ required_collateral: number;
526
+ total_collateral: number;
527
+ };
528
+ } | {
529
+ ScriptsNotPaidUTxO: {
530
+ missing_witness: string[];
531
+ };
532
+ } | {
533
+ ExUnitsTooBigUTxO: {
534
+ actual_units: number;
535
+ max_units: number;
536
+ };
537
+ } | string | {
538
+ CollateralInputContainsNonAdaAssets: {
539
+ collateral_input: string;
540
+ };
541
+ } | {
542
+ CollateralIsLockedByScript: {
543
+ invalid_collateral: string;
544
+ };
545
+ } | {
546
+ OutsideForecast: {
547
+ current_slot: number;
548
+ max_forecast_slot: number;
549
+ };
550
+ } | {
551
+ TooManyCollateralInputs: {
552
+ actual_count: number;
553
+ max_count: number;
554
+ };
555
+ } | string | {
556
+ IncorrectTotalCollateralField: {
557
+ actual_sum: number;
558
+ exportd_total: number;
559
+ };
560
+ } | {
561
+ InvalidSignature: {
562
+ invalid_signature: string;
563
+ };
564
+ } | {
565
+ ExtraneousSignature: {
566
+ extraneous_signature: string;
567
+ };
568
+ } | {
569
+ NativeScriptIsUnsuccessful: {
570
+ native_script_hash: string;
571
+ };
572
+ } | {
573
+ PlutusScriptIsUnsuccessful: {
574
+ plutus_script_hash: string;
575
+ };
576
+ } | {
577
+ MissingVKeyWitnesses: {
578
+ missing_key_hash: string;
579
+ };
580
+ } | {
581
+ MissingScriptWitnesses: {
582
+ missing_script_hash: string;
583
+ };
584
+ } | {
585
+ MissingRedeemer: {
586
+ index: number;
587
+ tag: string;
588
+ };
589
+ } | string | string | {
590
+ ConflictingMetadataHash: {
591
+ actual_hash: string;
592
+ expected_hash: string;
593
+ };
594
+ } | {
595
+ InvalidMetadata: {
596
+ message: string;
597
+ };
598
+ } | {
599
+ ExtraneousScriptWitnesses: {
600
+ extraneous_scripts: string[];
601
+ };
602
+ } | {
603
+ StakeAlreadyRegistered: {
604
+ reward_address: string;
605
+ };
606
+ } | {
607
+ StakeNotRegistered: {
608
+ reward_address: string;
609
+ };
610
+ } | {
611
+ StakeNonZeroAccountBalance: {
612
+ remaining_balance: number;
613
+ reward_address: string;
614
+ };
615
+ } | {
616
+ RewardAccountNotExisting: {
617
+ reward_address: string;
618
+ };
619
+ } | {
620
+ WrongRequestedWithdrawalAmount: {
621
+ expected_amount: number;
622
+ requested_amount: number;
623
+ reward_address: string;
624
+ };
625
+ } | {
626
+ StakePoolNotRegistered: {
627
+ pool_id: string;
628
+ };
629
+ } | {
630
+ WrongRetirementEpoch: {
631
+ current_epoch: number;
632
+ max_epoch: number;
633
+ min_epoch: number;
634
+ specified_epoch: number;
635
+ };
636
+ } | {
637
+ StakePoolCostTooLow: {
638
+ min_cost: number;
639
+ specified_cost: number;
640
+ };
641
+ } | {
642
+ InsufficientFundsForMir: {
643
+ available_amount: number;
644
+ requested_amount: number;
645
+ };
646
+ } | {
647
+ InvalidCommitteeVote: {
648
+ message: string;
649
+ voter: any;
650
+ };
651
+ } | {
652
+ DRepIncorrectDeposit: {
653
+ cert_index: number;
654
+ required_deposit: number;
655
+ supplied_deposit: number;
656
+ };
657
+ } | {
658
+ DRepDeregistrationWrongRefund: {
659
+ cert_index: number;
660
+ required_refund: number;
661
+ supplied_refund: number;
662
+ };
663
+ } | {
664
+ StakeRegistrationWrongDeposit: {
665
+ cert_index: number;
666
+ required_deposit: number;
667
+ supplied_deposit: number;
668
+ };
669
+ } | {
670
+ StakeDeregistrationWrongRefund: {
671
+ cert_index: number;
672
+ required_refund: number;
673
+ supplied_refund: number;
674
+ };
675
+ } | {
676
+ PoolRegistrationWrongDeposit: {
677
+ cert_index: number;
678
+ required_deposit: number;
679
+ supplied_deposit: number;
680
+ };
681
+ } | {
682
+ CommitteeHasPreviouslyResigned: {
683
+ committee_credential: LocalCredential;
684
+ };
685
+ } | {
686
+ TreasuryValueMismatch: {
687
+ actual_value: number;
688
+ exportd_value: number;
689
+ };
690
+ } | {
691
+ RefScriptsSizeTooBig: {
692
+ actual_size: number;
693
+ max_size: number;
694
+ };
695
+ } | {
696
+ WdrlNotDelegatedToDRep: {
697
+ stake_credential: LocalCredential;
698
+ };
699
+ } | {
700
+ CommitteeIsUnknown: {
701
+ committee_key_hash: LocalCredential;
702
+ };
703
+ } | {
704
+ GovActionsDoNotExist: {
705
+ invalid_action_ids: GovernanceActionId[];
706
+ };
707
+ } | {
708
+ MalformedProposal: {
709
+ gov_action: GovernanceActionId;
710
+ };
711
+ } | {
712
+ ProposalProcedureNetworkIdMismatch: {
713
+ expected_network: number;
714
+ reward_account: string;
715
+ };
716
+ } | {
717
+ TreasuryWithdrawalsNetworkIdMismatch: {
718
+ expected_network: number;
719
+ mismatched_account: string;
720
+ };
721
+ } | {
722
+ VotingProposalIncorrectDeposit: {
723
+ proposal_index: number;
724
+ required_deposit: number;
725
+ supplied_deposit: number;
726
+ };
727
+ } | {
728
+ DisallowedVoters: {
729
+ disallowed_pairs: any[][];
730
+ };
731
+ } | {
732
+ ConflictingCommitteeUpdate: {
733
+ conflicting_credentials: LocalCredential;
734
+ };
735
+ } | {
736
+ ExpirationEpochTooSmall: {
737
+ invalid_expirations: Record<string, any>;
738
+ };
739
+ } | {
740
+ InvalidPrevGovActionId: {
741
+ proposal: any;
742
+ };
743
+ } | {
744
+ VotingOnExpiredGovAction: {
745
+ expired_gov_action: GovernanceActionId;
746
+ };
747
+ } | {
748
+ ProposalCantFollow: {
749
+ expected_versions: ProtocolVersion[];
750
+ prev_gov_action_id?: GovernanceActionId | null;
751
+ supplied_version: ProtocolVersion;
752
+ };
753
+ } | {
754
+ InvalidConstitutionPolicyHash: {
755
+ expected_hash?: any;
756
+ supplied_hash?: any;
757
+ };
758
+ } | {
759
+ VotersDoNotExist: {
760
+ missing_voter: any;
761
+ };
762
+ } | {
763
+ ZeroTreasuryWithdrawals: {
764
+ gov_action: GovernanceActionId;
765
+ };
766
+ } | {
767
+ ProposalReturnAccountDoesNotExist: {
768
+ return_account: string;
769
+ };
770
+ } | {
771
+ TreasuryWithdrawalReturnAccountsDoNotExist: {
772
+ missing_account: string;
773
+ };
774
+ } | {
775
+ AuxiliaryDataHashMismatch: {
776
+ actual_hash?: any;
777
+ expected_hash: string;
778
+ };
779
+ } | string | string;
780
+
781
+ export type Phase1Warning = "InputsAreNotSorted" | "CollateralIsUnnecessary" | "TotalCollateralIsNotDeclared" | {
782
+ FeeIsBiggerThanMinFee: {
783
+ actual_fee: number;
784
+ fee_decomposition: FeeDecomposition;
785
+ min_fee: number;
786
+ };
787
+ } | {
788
+ InputUsesRewardAddress: {
789
+ invalid_input: string;
790
+ };
791
+ } | {
792
+ CollateralInputUsesRewardAddress: {
793
+ invalid_collateral: string;
794
+ };
795
+ } | {
796
+ CannotCheckStakeDeregistrationRefund: {
797
+ cert_index: number;
798
+ };
799
+ } | {
800
+ CannotCheckDRepDeregistrationRefund: {
801
+ cert_index: number;
802
+ };
803
+ } | {
804
+ PoolAlreadyRegistered: {
805
+ pool_id: string;
806
+ };
807
+ } | {
808
+ DRepAlreadyRegistered: {
809
+ drep_id: string;
810
+ };
811
+ } | {
812
+ CommitteeAlreadyAuthorized: {
813
+ committee_key: string;
814
+ };
815
+ } | {
816
+ DRepNotRegistered: {
817
+ cert_index: number;
818
+ };
819
+ } | {
820
+ DuplicateRegistrationInTx: {
821
+ cert_index: number;
822
+ entity_id: string;
823
+ entity_type: string;
824
+ };
825
+ } | {
826
+ DuplicateCommitteeColdResignationInTx: {
827
+ cert_index: number;
828
+ committee_credential: LocalCredential;
829
+ };
830
+ } | {
831
+ DuplicateCommitteeHotRegistrationInTx: {
832
+ cert_index: number;
833
+ committee_credential: LocalCredential;
834
+ };
835
+ };
836
+
837
+ export interface ProtocolVersion {
838
+ major: number;
839
+ minor: number;
840
+ }
841
+
842
+ export interface ValidationError {
843
+ error: Phase1Error;
844
+ error_message: string;
845
+ hint?: any;
846
+ locations: string[];
847
+ }
848
+
849
+ export interface ValidationWarning {
850
+ hint?: any;
851
+ locations: string[];
852
+ warning: Phase1Warning;
853
+ }
854
+
855
+ export interface ValidatorAsset {
856
+ asset_name: string;
857
+ policy_id: string;
858
+ quantity: number;
859
+ }
860
+
861
+ export interface Value {
862
+ assets: MultiAsset;
863
+ coins: number;
864
+ }
865
+
866
+ export type Voter = {
867
+ constitutionalCommitteeHotScriptHash: number[];
868
+ } | {
869
+ constitutionalCommitteeHotKeyHash: number[];
870
+ } | {
871
+ dRepScriptHash: number[];
872
+ } | {
873
+ dRepKeyHash: number[];
874
+ } | {
875
+ stakingPoolKeyHash: number[];
876
+ };
877
+
878
+ export interface AccountInputContext {
879
+ balance?: any;
880
+ bech32Address: string;
881
+ isRegistered: boolean;
882
+ payedDeposit?: any;
883
+ }
884
+
885
+ export interface Asset {
886
+ quantity: string;
887
+ unit: string;
888
+ }
889
+
890
+ export interface CommitteeInputContext {
891
+ activeCommitteeMembers: LocalCredential[];
892
+ potentialCommitteeMembers: LocalCredential[];
893
+ resignedCommitteeMembers: LocalCredential[];
894
+ }
895
+
896
+ export interface DrepInputContext {
897
+ bech32Drep: string;
898
+ isRegistered: boolean;
899
+ payedDeposit?: any;
900
+ }
901
+
902
+ export interface ExUnitPrices {
903
+ memPrice: SubCoin;
904
+ stepPrice: SubCoin;
905
+ }
906
+
907
+ export interface GovActionInputContext {
908
+ actionId: GovernanceActionId;
909
+ actionType: GovernanceActionType;
910
+ isActive: boolean;
911
+ }
912
+
913
+ export type NetworkType = "mainnet" | "testnet";
914
+
915
+ export interface PoolInputContext {
916
+ isRegistered: boolean;
917
+ poolId: string;
918
+ retirementEpoch?: any;
919
+ }
920
+
921
+ export interface ProtocolParameters {
922
+ adaPerUtxoByte: number;
923
+ collateralPercentage: number;
924
+ costModels: CostModels;
925
+ drepDeposit: number;
926
+ executionPrices: ExUnitPrices;
927
+ governanceActionDeposit: number;
928
+ maxBlockBodySize: number;
929
+ maxBlockExecutionUnits: ExUnits;
930
+ maxBlockHeaderSize: number;
931
+ maxCollateralInputs: number;
932
+ maxEpochForPoolRetirement: number;
933
+ maxTransactionSize: number;
934
+ maxTxExecutionUnits: ExUnits;
935
+ maxValueSize: number;
936
+ minFeeCoefficientA: number;
937
+ minFeeConstantB: number;
938
+ minPoolCost: number;
939
+ protocolVersion: any[];
940
+ referenceScriptCostPerByte: SubCoin;
941
+ stakeKeyDeposit: number;
942
+ stakePoolDeposit: number;
943
+ }
944
+
945
+ export interface SubCoin {
946
+ denominator: number;
947
+ numerator: number;
948
+ }
949
+
950
+ export interface UTxO {
951
+ input: TxInput;
952
+ output: TxOutput;
953
+ }
954
+
955
+ export interface UtxoInputContext {
956
+ isSpent: boolean;
957
+ utxo: UTxO;
958
+ }
959
+
960
+ export interface NecessaryInputData {
961
+ accounts: string[];
962
+ committeeMembers: LocalCredential[];
963
+ dReps: string[];
964
+ govActions: GovernanceActionId[];
965
+ lastEnactedGovAction: GovernanceActionType[];
966
+ pools: string[];
967
+ utxos: TxInput[];
968
+ }
969
+
970
+ export interface ValidationResult {
971
+ errors: ValidationError[];
972
+ warnings: ValidationWarning[];
973
+ }
974
+
975
+ export interface ValidationInputContext {
976
+ accountContexts: AccountInputContext[];
977
+ committeeContext: CommitteeInputContext;
978
+ drepContexts: DrepInputContext[];
979
+ govActionContexts: GovActionInputContext[];
980
+ lastEnactedGovAction: GovActionInputContext[];
981
+ networkType: NetworkType;
982
+ poolContexts: PoolInputContext[];
983
+ protocolParameters: ProtocolParameters;
984
+ slot: number;
985
+ treasuryValue: number;
986
+ utxoSet: UtxoInputContext[];
987
+ }
988
+