@cardananium/cquisitor-lib 0.1.0-beta.22 → 0.1.0-beta.23

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.
@@ -430,9 +430,17 @@ export interface CostModels {
430
430
 
431
431
 
432
432
  ///AUTOGENERATED
433
+
434
+ // Auto-generated TypeScript types from JSON schemas
435
+ // Generated at: 2025-08-03T17:09:36.018Z
436
+ //
437
+ // This file contains exported TypeScript types that can be imported in other modules.
438
+ // Large integers (uint64, int64) are represented as bigint for safe handling.
439
+
433
440
  export interface NecessaryInputData {
434
441
  accounts: string[];
435
- committeeMembers: LocalCredential[];
442
+ committeeMembersCold: LocalCredential[];
443
+ committeeMembersHot: LocalCredential[];
436
444
  dReps: string[];
437
445
  govActions: GovernanceActionId[];
438
446
  lastEnactedGovAction: GovernanceActionType[];
@@ -592,7 +600,7 @@ export type Phase1Error =
592
600
  }
593
601
  | {
594
602
  MissingRedeemer: {
595
- index: number;
603
+ index: bigint;
596
604
  tag: string;
597
605
  };
598
606
  }
@@ -675,35 +683,30 @@ export type Phase1Error =
675
683
  }
676
684
  | {
677
685
  DRepIncorrectDeposit: {
678
- cert_index: number;
679
686
  required_deposit: number;
680
687
  supplied_deposit: number;
681
688
  };
682
689
  }
683
690
  | {
684
691
  DRepDeregistrationWrongRefund: {
685
- cert_index: number;
686
692
  required_refund: number;
687
693
  supplied_refund: number;
688
694
  };
689
695
  }
690
696
  | {
691
697
  StakeRegistrationWrongDeposit: {
692
- cert_index: number;
693
698
  required_deposit: number;
694
699
  supplied_deposit: number;
695
700
  };
696
701
  }
697
702
  | {
698
703
  StakeDeregistrationWrongRefund: {
699
- cert_index: number;
700
704
  required_refund: number;
701
705
  supplied_refund: number;
702
706
  };
703
707
  }
704
708
  | {
705
709
  PoolRegistrationWrongDeposit: {
706
- cert_index: number;
707
710
  required_deposit: number;
708
711
  supplied_deposit: number;
709
712
  };
@@ -944,6 +947,54 @@ export type Phase1Error =
944
947
  };
945
948
  };
946
949
 
950
+ /**
951
+ * Phase 1 validation errors
952
+ */
953
+ export type Phase2Error =
954
+ | "NativeScriptIsReferencedByRedeemer"
955
+ | {
956
+ NoEnoughBudget: {
957
+ actual_budget: ExUnits;
958
+ expected_budget: ExUnits;
959
+ };
960
+ }
961
+ | {
962
+ InvalidRedeemerIndex: {
963
+ index: bigint;
964
+ tag: string;
965
+ };
966
+ }
967
+ | {
968
+ MachineError: {
969
+ error: string;
970
+ };
971
+ }
972
+ | {
973
+ CostModelNotFound: {
974
+ language: string;
975
+ };
976
+ }
977
+ | {
978
+ ScriptDecodeError: {
979
+ error: string;
980
+ };
981
+ }
982
+ | {
983
+ BuildTxContextError: {
984
+ error: string;
985
+ };
986
+ }
987
+ | {
988
+ MissingScriptForRedeemer: {
989
+ error: string;
990
+ };
991
+ };
992
+ export type Phase2Warning = {
993
+ BudgetIsBiggerThanExpected: {
994
+ actual_budget: ExUnits;
995
+ expected_budget: ExUnits;
996
+ };
997
+ };
947
998
  export type Phase1Warning =
948
999
  | ("InputsAreNotSorted" | "CollateralIsUnnecessary" | "TotalCollateralIsNotDeclared")
949
1000
  | {
@@ -963,16 +1014,8 @@ export type Phase1Warning =
963
1014
  invalid_collateral: string;
964
1015
  };
965
1016
  }
966
- | {
967
- CannotCheckStakeDeregistrationRefund: {
968
- cert_index: number;
969
- };
970
- }
971
- | {
972
- CannotCheckDRepDeregistrationRefund: {
973
- cert_index: number;
974
- };
975
- }
1017
+ | "CannotCheckStakeDeregistrationRefund"
1018
+ | "CannotCheckDRepDeregistrationRefund"
976
1019
  | {
977
1020
  PoolAlreadyRegistered: {
978
1021
  pool_id: string;
@@ -1014,10 +1057,13 @@ export type Phase1Warning =
1014
1057
  };
1015
1058
 
1016
1059
  export interface ValidationResult {
1017
- errors: ValidationError[];
1018
- warnings: ValidationWarning[];
1060
+ errors: ValidationPhase1Error[];
1061
+ eval_redeemer_results: EvalRedeemerResult[];
1062
+ phase2_errors: ValidationPhase2Error[];
1063
+ phase2_warnings: ValidationPhase2Warning[];
1064
+ warnings: ValidationPhase1Warning[];
1019
1065
  }
1020
- export interface ValidationError {
1066
+ export interface ValidationPhase1Error {
1021
1067
  error: Phase1Error;
1022
1068
  error_message: string;
1023
1069
  hint?: string | null;
@@ -1065,7 +1111,28 @@ export interface ProtocolVersion {
1065
1111
  * The governance action with zero withdrawals
1066
1112
  */
1067
1113
 
1068
- export interface ValidationWarning {
1114
+ export interface EvalRedeemerResult {
1115
+ calculated_ex_units: ExUnits;
1116
+ error?: string | null;
1117
+ index: bigint;
1118
+ logs: string[];
1119
+ provided_ex_units: ExUnits;
1120
+ success: boolean;
1121
+ tag: RedeemerTag;
1122
+ }
1123
+
1124
+ export interface ValidationPhase2Error {
1125
+ error: Phase2Error;
1126
+ error_message: string;
1127
+ hint?: string | null;
1128
+ locations: string[];
1129
+ }
1130
+ export interface ValidationPhase2Warning {
1131
+ hint?: string | null;
1132
+ locations: string[];
1133
+ warning: Phase2Warning;
1134
+ }
1135
+ export interface ValidationPhase1Warning {
1069
1136
  hint?: string | null;
1070
1137
  locations: string[];
1071
1138
  warning: Phase1Warning;
@@ -1086,16 +1153,17 @@ export type GovernanceActionType =
1086
1153
  | "updateCommitteeAction"
1087
1154
  | "newConstitutionAction"
1088
1155
  | "infoAction";
1089
- export type NetworkType = "mainnet" | "testnet";
1156
+ export type NetworkType = "mainnet" | "preview" | "preprod";
1090
1157
 
1091
1158
  export interface ValidationInputContext {
1092
1159
  accountContexts: AccountInputContext[];
1093
- committeeContext: CommitteeInputContext;
1160
+ currentCommitteeMembers: CommitteeInputContext[];
1094
1161
  drepContexts: DrepInputContext[];
1095
1162
  govActionContexts: GovActionInputContext[];
1096
1163
  lastEnactedGovAction: GovActionInputContext[];
1097
1164
  networkType: NetworkType;
1098
1165
  poolContexts: PoolInputContext[];
1166
+ potentialCommitteeMembers: CommitteeInputContext[];
1099
1167
  protocolParameters: ProtocolParameters;
1100
1168
  slot: bigint;
1101
1169
  treasuryValue: bigint;
@@ -1110,9 +1178,9 @@ export interface AccountInputContext {
1110
1178
  payedDeposit?: number | null;
1111
1179
  }
1112
1180
  export interface CommitteeInputContext {
1113
- activeCommitteeMembers: LocalCredential[];
1114
- potentialCommitteeMembers: LocalCredential[];
1115
- resignedCommitteeMembers: LocalCredential[];
1181
+ committeeMemberCold: LocalCredential;
1182
+ committeeMemberHot?: LocalCredential | null;
1183
+ isResigned: boolean;
1116
1184
  }
1117
1185
  export interface DrepInputContext {
1118
1186
  bech32Drep: string;
@@ -1125,7 +1193,7 @@ export interface GovActionInputContext {
1125
1193
  isActive: boolean;
1126
1194
  }
1127
1195
  export interface GovernanceActionId {
1128
- index: number;
1196
+ index: bigint;
1129
1197
  txHash: number[];
1130
1198
  }
1131
1199
  export interface PoolInputContext {
@@ -1198,10 +1266,18 @@ export interface ProtocolParameters {
1198
1266
  */
1199
1267
  protocolVersion: [unknown, unknown];
1200
1268
  referenceScriptCostPerByte: SubCoin;
1269
+ /**
1270
+ * Deposit amount required for registering a stake key
1271
+ */
1201
1272
  stakeKeyDeposit: bigint;
1273
+ /**
1274
+ * Deposit amount required for registering a stake pool
1275
+ */
1202
1276
  stakePoolDeposit: bigint;
1203
1277
  }
1204
-
1278
+ /**
1279
+ * Price of execution units for script execution
1280
+ */
1205
1281
  export interface ExUnitPrices {
1206
1282
  memPrice: SubCoin;
1207
1283
  stepPrice: SubCoin;
@@ -290,67 +290,46 @@ export function get_possible_types_for_input(input) {
290
290
  }
291
291
 
292
292
  /**
293
- * @param {string} tx_hex
294
- * @returns {string}
293
+ * @param {string} cbor_hex
294
+ * @returns {any}
295
295
  */
296
- export function get_necessary_data_list_js(tx_hex) {
297
- let deferred3_0;
298
- let deferred3_1;
296
+ export function cbor_to_json(cbor_hex) {
299
297
  try {
300
298
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
301
- const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
299
+ const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
302
300
  const len0 = WASM_VECTOR_LEN;
303
- wasm.get_necessary_data_list_js(retptr, ptr0, len0);
301
+ wasm.cbor_to_json(retptr, ptr0, len0);
304
302
  var r0 = getInt32Memory0()[retptr / 4 + 0];
305
303
  var r1 = getInt32Memory0()[retptr / 4 + 1];
306
304
  var r2 = getInt32Memory0()[retptr / 4 + 2];
307
- var r3 = getInt32Memory0()[retptr / 4 + 3];
308
- var ptr2 = r0;
309
- var len2 = r1;
310
- if (r3) {
311
- ptr2 = 0; len2 = 0;
312
- throw takeObject(r2);
305
+ if (r2) {
306
+ throw takeObject(r1);
313
307
  }
314
- deferred3_0 = ptr2;
315
- deferred3_1 = len2;
316
- return getStringFromWasm0(ptr2, len2);
308
+ return takeObject(r0);
317
309
  } finally {
318
310
  wasm.__wbindgen_add_to_stack_pointer(16);
319
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
320
311
  }
321
312
  }
322
313
 
323
314
  /**
324
- * @param {string} tx_hex
325
- * @param {string} validation_context
326
- * @returns {string}
315
+ * @param {string} hex_str
316
+ * @returns {any}
327
317
  */
328
- export function validate_transaction_js(tx_hex, validation_context) {
329
- let deferred4_0;
330
- let deferred4_1;
318
+ export function check_block_or_tx_signatures(hex_str) {
331
319
  try {
332
320
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
333
- const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
321
+ const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
322
  const len0 = WASM_VECTOR_LEN;
335
- const ptr1 = passStringToWasm0(validation_context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
336
- const len1 = WASM_VECTOR_LEN;
337
- wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
323
+ wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
338
324
  var r0 = getInt32Memory0()[retptr / 4 + 0];
339
325
  var r1 = getInt32Memory0()[retptr / 4 + 1];
340
326
  var r2 = getInt32Memory0()[retptr / 4 + 2];
341
- var r3 = getInt32Memory0()[retptr / 4 + 3];
342
- var ptr3 = r0;
343
- var len3 = r1;
344
- if (r3) {
345
- ptr3 = 0; len3 = 0;
346
- throw takeObject(r2);
327
+ if (r2) {
328
+ throw takeObject(r1);
347
329
  }
348
- deferred4_0 = ptr3;
349
- deferred4_1 = len3;
350
- return getStringFromWasm0(ptr3, len3);
330
+ return takeObject(r0);
351
331
  } finally {
352
332
  wasm.__wbindgen_add_to_stack_pointer(16);
353
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
354
333
  }
355
334
  }
356
335
 
@@ -457,46 +436,67 @@ export function execute_tx_scripts(tx_hex, utxo_json, cost_models_json) {
457
436
  }
458
437
 
459
438
  /**
460
- * @param {string} cbor_hex
461
- * @returns {any}
439
+ * @param {string} tx_hex
440
+ * @returns {string}
462
441
  */
463
- export function cbor_to_json(cbor_hex) {
442
+ export function get_necessary_data_list_js(tx_hex) {
443
+ let deferred3_0;
444
+ let deferred3_1;
464
445
  try {
465
446
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
466
- const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
447
+ const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
467
448
  const len0 = WASM_VECTOR_LEN;
468
- wasm.cbor_to_json(retptr, ptr0, len0);
449
+ wasm.get_necessary_data_list_js(retptr, ptr0, len0);
469
450
  var r0 = getInt32Memory0()[retptr / 4 + 0];
470
451
  var r1 = getInt32Memory0()[retptr / 4 + 1];
471
452
  var r2 = getInt32Memory0()[retptr / 4 + 2];
472
- if (r2) {
473
- throw takeObject(r1);
453
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
454
+ var ptr2 = r0;
455
+ var len2 = r1;
456
+ if (r3) {
457
+ ptr2 = 0; len2 = 0;
458
+ throw takeObject(r2);
474
459
  }
475
- return takeObject(r0);
460
+ deferred3_0 = ptr2;
461
+ deferred3_1 = len2;
462
+ return getStringFromWasm0(ptr2, len2);
476
463
  } finally {
477
464
  wasm.__wbindgen_add_to_stack_pointer(16);
465
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
478
466
  }
479
467
  }
480
468
 
481
469
  /**
482
- * @param {string} hex_str
483
- * @returns {any}
470
+ * @param {string} tx_hex
471
+ * @param {string} validation_context
472
+ * @returns {string}
484
473
  */
485
- export function check_block_or_tx_signatures(hex_str) {
474
+ export function validate_transaction_js(tx_hex, validation_context) {
475
+ let deferred4_0;
476
+ let deferred4_1;
486
477
  try {
487
478
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
488
- const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
479
+ const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
489
480
  const len0 = WASM_VECTOR_LEN;
490
- wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
481
+ const ptr1 = passStringToWasm0(validation_context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
482
+ const len1 = WASM_VECTOR_LEN;
483
+ wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
491
484
  var r0 = getInt32Memory0()[retptr / 4 + 0];
492
485
  var r1 = getInt32Memory0()[retptr / 4 + 1];
493
486
  var r2 = getInt32Memory0()[retptr / 4 + 2];
494
- if (r2) {
495
- throw takeObject(r1);
487
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
488
+ var ptr3 = r0;
489
+ var len3 = r1;
490
+ if (r3) {
491
+ ptr3 = 0; len3 = 0;
492
+ throw takeObject(r2);
496
493
  }
497
- return takeObject(r0);
494
+ deferred4_0 = ptr3;
495
+ deferred4_1 = len3;
496
+ return getStringFromWasm0(ptr3, len3);
498
497
  } finally {
499
498
  wasm.__wbindgen_add_to_stack_pointer(16);
499
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
500
500
  }
501
501
  }
502
502
 
@@ -1086,94 +1086,38 @@ function handleError(f, args) {
1086
1086
  }
1087
1087
  /**
1088
1088
  */
1089
- export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1090
- /**
1091
- */
1092
- export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1093
- /**
1094
- */
1095
- export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1096
- /**
1097
- */
1098
- export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1099
- /**
1100
- * Used to choosed the schema for a script JSON string
1101
- */
1102
- export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1089
+ export const AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
1103
1090
  /**
1104
1091
  */
1105
1092
  export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1106
1093
  /**
1107
1094
  */
1108
- export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1109
- /**
1110
- */
1111
- export const CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",GenesisKeyDelegation:5,"5":"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,"6":"MoveInstantaneousRewardsCert",CommitteeHotAuth:7,"7":"CommitteeHotAuth",CommitteeColdResign:8,"8":"CommitteeColdResign",DRepDeregistration:9,"9":"DRepDeregistration",DRepRegistration:10,"10":"DRepRegistration",DRepUpdate:11,"11":"DRepUpdate",StakeAndVoteDelegation:12,"12":"StakeAndVoteDelegation",StakeRegistrationAndDelegation:13,"13":"StakeRegistrationAndDelegation",StakeVoteRegistrationAndDelegation:14,"14":"StakeVoteRegistrationAndDelegation",VoteDelegation:15,"15":"VoteDelegation",VoteRegistrationAndDelegation:16,"16":"VoteRegistrationAndDelegation", });
1112
- /**
1113
- */
1114
- export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1115
- /**
1116
- */
1117
1095
  export const GovernanceActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidenceAction:3,"3":"NoConfidenceAction",UpdateCommitteeAction:4,"4":"UpdateCommitteeAction",NewConstitutionAction:5,"5":"NewConstitutionAction",InfoAction:6,"6":"InfoAction", });
1118
1096
  /**
1119
1097
  */
1120
- export const PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
1121
- /**
1122
- */
1123
- export const CoinSelectionStrategyCIP2 = Object.freeze({
1124
- /**
1125
- * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
1126
- */
1127
- LargestFirst:0,"0":"LargestFirst",
1128
- /**
1129
- * Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
1130
- */
1131
- RandomImprove:1,"1":"RandomImprove",
1132
- /**
1133
- * Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
1134
- */
1135
- LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1098
+ export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1136
1099
  /**
1137
- * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1138
1100
  */
1139
- RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1101
+ export const NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
1140
1102
  /**
1141
1103
  */
1142
1104
  export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1143
1105
  /**
1106
+ * Used to choosed the schema for a script JSON string
1144
1107
  */
1145
- export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1146
- /**
1147
- */
1148
- export const NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
1108
+ export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1149
1109
  /**
1150
1110
  */
1151
- export const BlockEra = Object.freeze({ Byron:0,"0":"Byron",Shelley:1,"1":"Shelley",Allegra:2,"2":"Allegra",Mary:3,"3":"Mary",Alonzo:4,"4":"Alonzo",Babbage:5,"5":"Babbage",Conway:6,"6":"Conway",Unknown:7,"7":"Unknown", });
1111
+ export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1152
1112
  /**
1153
1113
  */
1154
- export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1155
- /**
1156
- * Each new language uses a different namespace for hashing its script
1157
- * This is because you could have a language where the same bytes have different semantics
1158
- * So this avoids scripts in different languages mapping to the same hash
1159
- * Note that the enum value here is different than the enum value for deciding the cost model of a script
1160
- */
1161
- export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1114
+ export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1162
1115
  /**
1163
1116
  */
1164
1117
  export const TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"MetadataMap",MetadataList:1,"1":"MetadataList",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
1165
1118
  /**
1166
1119
  */
1167
- export const AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
1168
- /**
1169
- */
1170
- export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1171
- /**
1172
- */
1173
- export const VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
1174
- /**
1175
- */
1176
- export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1120
+ export const RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
1177
1121
  /**
1178
1122
  * JSON <-> PlutusData conversion schemas.
1179
1123
  * Follows ScriptDataJsonSchema in cardano-cli defined at:
@@ -1227,10 +1171,66 @@ BasicConversions:0,"0":"BasicConversions",
1227
1171
  DetailedSchema:1,"1":"DetailedSchema", });
1228
1172
  /**
1229
1173
  */
1230
- export const RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
1174
+ export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1175
+ /**
1176
+ */
1177
+ export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1178
+ /**
1179
+ */
1180
+ export const PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
1181
+ /**
1182
+ */
1183
+ export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1231
1184
  /**
1232
1185
  */
1233
1186
  export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1187
+ /**
1188
+ */
1189
+ export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1190
+ /**
1191
+ * Each new language uses a different namespace for hashing its script
1192
+ * This is because you could have a language where the same bytes have different semantics
1193
+ * So this avoids scripts in different languages mapping to the same hash
1194
+ * Note that the enum value here is different than the enum value for deciding the cost model of a script
1195
+ */
1196
+ export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1197
+ /**
1198
+ */
1199
+ export const CoinSelectionStrategyCIP2 = Object.freeze({
1200
+ /**
1201
+ * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
1202
+ */
1203
+ LargestFirst:0,"0":"LargestFirst",
1204
+ /**
1205
+ * Performs CIP2's Random Improve ada-only selection. Will error if outputs contain non-ADA assets.
1206
+ */
1207
+ RandomImprove:1,"1":"RandomImprove",
1208
+ /**
1209
+ * Same as LargestFirst, but before adding ADA, will insert by largest-first for each asset type.
1210
+ */
1211
+ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1212
+ /**
1213
+ * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1214
+ */
1215
+ RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1216
+ /**
1217
+ */
1218
+ export const BlockEra = Object.freeze({ Byron:0,"0":"Byron",Shelley:1,"1":"Shelley",Allegra:2,"2":"Allegra",Mary:3,"3":"Mary",Alonzo:4,"4":"Alonzo",Babbage:5,"5":"Babbage",Conway:6,"6":"Conway",Unknown:7,"7":"Unknown", });
1219
+ /**
1220
+ */
1221
+ export const VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
1222
+ /**
1223
+ */
1224
+ export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1225
+ /**
1226
+ */
1227
+ export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1228
+ /**
1229
+ */
1230
+ export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1231
+ /**
1232
+ */
1233
+ export const CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",GenesisKeyDelegation:5,"5":"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,"6":"MoveInstantaneousRewardsCert",CommitteeHotAuth:7,"7":"CommitteeHotAuth",CommitteeColdResign:8,"8":"CommitteeColdResign",DRepDeregistration:9,"9":"DRepDeregistration",DRepRegistration:10,"10":"DRepRegistration",DRepUpdate:11,"11":"DRepUpdate",StakeAndVoteDelegation:12,"12":"StakeAndVoteDelegation",StakeRegistrationAndDelegation:13,"13":"StakeRegistrationAndDelegation",StakeVoteRegistrationAndDelegation:14,"14":"StakeVoteRegistrationAndDelegation",VoteDelegation:15,"15":"VoteDelegation",VoteRegistrationAndDelegation:16,"16":"VoteRegistrationAndDelegation", });
1234
1234
 
1235
1235
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1236
1236
  ? { register: () => {}, unregister: () => {} }
Binary file
@@ -4,14 +4,14 @@ export const memory: WebAssembly.Memory;
4
4
  export function get_decodable_types(a: number): void;
5
5
  export function decode_specific_type(a: number, b: number, c: number, d: number, e: number, f: number): void;
6
6
  export function get_possible_types_for_input(a: number, b: number, c: number): void;
7
- export function get_necessary_data_list_js(a: number, b: number, c: number): void;
8
- export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
7
+ export function cbor_to_json(a: number, b: number, c: number): void;
8
+ export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
9
9
  export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
10
10
  export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
11
11
  export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
12
12
  export function execute_tx_scripts(a: number, b: number, c: number, d: number, e: number): void;
13
- export function cbor_to_json(a: number, b: number, c: number): void;
14
- export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
13
+ export function get_necessary_data_list_js(a: number, b: number, c: number): void;
14
+ export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
15
15
  export function __wbg_noconfidenceaction_free(a: number): void;
16
16
  export function noconfidenceaction_to_bytes(a: number, b: number): void;
17
17
  export function noconfidenceaction_from_bytes(a: number, b: number, c: number): void;
@@ -430,9 +430,17 @@ export interface CostModels {
430
430
 
431
431
 
432
432
  ///AUTOGENERATED
433
+
434
+ // Auto-generated TypeScript types from JSON schemas
435
+ // Generated at: 2025-08-03T17:09:36.018Z
436
+ //
437
+ // This file contains exported TypeScript types that can be imported in other modules.
438
+ // Large integers (uint64, int64) are represented as bigint for safe handling.
439
+
433
440
  export interface NecessaryInputData {
434
441
  accounts: string[];
435
- committeeMembers: LocalCredential[];
442
+ committeeMembersCold: LocalCredential[];
443
+ committeeMembersHot: LocalCredential[];
436
444
  dReps: string[];
437
445
  govActions: GovernanceActionId[];
438
446
  lastEnactedGovAction: GovernanceActionType[];
@@ -592,7 +600,7 @@ export type Phase1Error =
592
600
  }
593
601
  | {
594
602
  MissingRedeemer: {
595
- index: number;
603
+ index: bigint;
596
604
  tag: string;
597
605
  };
598
606
  }
@@ -675,35 +683,30 @@ export type Phase1Error =
675
683
  }
676
684
  | {
677
685
  DRepIncorrectDeposit: {
678
- cert_index: number;
679
686
  required_deposit: number;
680
687
  supplied_deposit: number;
681
688
  };
682
689
  }
683
690
  | {
684
691
  DRepDeregistrationWrongRefund: {
685
- cert_index: number;
686
692
  required_refund: number;
687
693
  supplied_refund: number;
688
694
  };
689
695
  }
690
696
  | {
691
697
  StakeRegistrationWrongDeposit: {
692
- cert_index: number;
693
698
  required_deposit: number;
694
699
  supplied_deposit: number;
695
700
  };
696
701
  }
697
702
  | {
698
703
  StakeDeregistrationWrongRefund: {
699
- cert_index: number;
700
704
  required_refund: number;
701
705
  supplied_refund: number;
702
706
  };
703
707
  }
704
708
  | {
705
709
  PoolRegistrationWrongDeposit: {
706
- cert_index: number;
707
710
  required_deposit: number;
708
711
  supplied_deposit: number;
709
712
  };
@@ -944,6 +947,54 @@ export type Phase1Error =
944
947
  };
945
948
  };
946
949
 
950
+ /**
951
+ * Phase 1 validation errors
952
+ */
953
+ export type Phase2Error =
954
+ | "NativeScriptIsReferencedByRedeemer"
955
+ | {
956
+ NoEnoughBudget: {
957
+ actual_budget: ExUnits;
958
+ expected_budget: ExUnits;
959
+ };
960
+ }
961
+ | {
962
+ InvalidRedeemerIndex: {
963
+ index: bigint;
964
+ tag: string;
965
+ };
966
+ }
967
+ | {
968
+ MachineError: {
969
+ error: string;
970
+ };
971
+ }
972
+ | {
973
+ CostModelNotFound: {
974
+ language: string;
975
+ };
976
+ }
977
+ | {
978
+ ScriptDecodeError: {
979
+ error: string;
980
+ };
981
+ }
982
+ | {
983
+ BuildTxContextError: {
984
+ error: string;
985
+ };
986
+ }
987
+ | {
988
+ MissingScriptForRedeemer: {
989
+ error: string;
990
+ };
991
+ };
992
+ export type Phase2Warning = {
993
+ BudgetIsBiggerThanExpected: {
994
+ actual_budget: ExUnits;
995
+ expected_budget: ExUnits;
996
+ };
997
+ };
947
998
  export type Phase1Warning =
948
999
  | ("InputsAreNotSorted" | "CollateralIsUnnecessary" | "TotalCollateralIsNotDeclared")
949
1000
  | {
@@ -963,16 +1014,8 @@ export type Phase1Warning =
963
1014
  invalid_collateral: string;
964
1015
  };
965
1016
  }
966
- | {
967
- CannotCheckStakeDeregistrationRefund: {
968
- cert_index: number;
969
- };
970
- }
971
- | {
972
- CannotCheckDRepDeregistrationRefund: {
973
- cert_index: number;
974
- };
975
- }
1017
+ | "CannotCheckStakeDeregistrationRefund"
1018
+ | "CannotCheckDRepDeregistrationRefund"
976
1019
  | {
977
1020
  PoolAlreadyRegistered: {
978
1021
  pool_id: string;
@@ -1014,10 +1057,13 @@ export type Phase1Warning =
1014
1057
  };
1015
1058
 
1016
1059
  export interface ValidationResult {
1017
- errors: ValidationError[];
1018
- warnings: ValidationWarning[];
1060
+ errors: ValidationPhase1Error[];
1061
+ eval_redeemer_results: EvalRedeemerResult[];
1062
+ phase2_errors: ValidationPhase2Error[];
1063
+ phase2_warnings: ValidationPhase2Warning[];
1064
+ warnings: ValidationPhase1Warning[];
1019
1065
  }
1020
- export interface ValidationError {
1066
+ export interface ValidationPhase1Error {
1021
1067
  error: Phase1Error;
1022
1068
  error_message: string;
1023
1069
  hint?: string | null;
@@ -1065,7 +1111,28 @@ export interface ProtocolVersion {
1065
1111
  * The governance action with zero withdrawals
1066
1112
  */
1067
1113
 
1068
- export interface ValidationWarning {
1114
+ export interface EvalRedeemerResult {
1115
+ calculated_ex_units: ExUnits;
1116
+ error?: string | null;
1117
+ index: bigint;
1118
+ logs: string[];
1119
+ provided_ex_units: ExUnits;
1120
+ success: boolean;
1121
+ tag: RedeemerTag;
1122
+ }
1123
+
1124
+ export interface ValidationPhase2Error {
1125
+ error: Phase2Error;
1126
+ error_message: string;
1127
+ hint?: string | null;
1128
+ locations: string[];
1129
+ }
1130
+ export interface ValidationPhase2Warning {
1131
+ hint?: string | null;
1132
+ locations: string[];
1133
+ warning: Phase2Warning;
1134
+ }
1135
+ export interface ValidationPhase1Warning {
1069
1136
  hint?: string | null;
1070
1137
  locations: string[];
1071
1138
  warning: Phase1Warning;
@@ -1086,16 +1153,17 @@ export type GovernanceActionType =
1086
1153
  | "updateCommitteeAction"
1087
1154
  | "newConstitutionAction"
1088
1155
  | "infoAction";
1089
- export type NetworkType = "mainnet" | "testnet";
1156
+ export type NetworkType = "mainnet" | "preview" | "preprod";
1090
1157
 
1091
1158
  export interface ValidationInputContext {
1092
1159
  accountContexts: AccountInputContext[];
1093
- committeeContext: CommitteeInputContext;
1160
+ currentCommitteeMembers: CommitteeInputContext[];
1094
1161
  drepContexts: DrepInputContext[];
1095
1162
  govActionContexts: GovActionInputContext[];
1096
1163
  lastEnactedGovAction: GovActionInputContext[];
1097
1164
  networkType: NetworkType;
1098
1165
  poolContexts: PoolInputContext[];
1166
+ potentialCommitteeMembers: CommitteeInputContext[];
1099
1167
  protocolParameters: ProtocolParameters;
1100
1168
  slot: bigint;
1101
1169
  treasuryValue: bigint;
@@ -1110,9 +1178,9 @@ export interface AccountInputContext {
1110
1178
  payedDeposit?: number | null;
1111
1179
  }
1112
1180
  export interface CommitteeInputContext {
1113
- activeCommitteeMembers: LocalCredential[];
1114
- potentialCommitteeMembers: LocalCredential[];
1115
- resignedCommitteeMembers: LocalCredential[];
1181
+ committeeMemberCold: LocalCredential;
1182
+ committeeMemberHot?: LocalCredential | null;
1183
+ isResigned: boolean;
1116
1184
  }
1117
1185
  export interface DrepInputContext {
1118
1186
  bech32Drep: string;
@@ -1125,7 +1193,7 @@ export interface GovActionInputContext {
1125
1193
  isActive: boolean;
1126
1194
  }
1127
1195
  export interface GovernanceActionId {
1128
- index: number;
1196
+ index: bigint;
1129
1197
  txHash: number[];
1130
1198
  }
1131
1199
  export interface PoolInputContext {
@@ -1198,10 +1266,18 @@ export interface ProtocolParameters {
1198
1266
  */
1199
1267
  protocolVersion: [unknown, unknown];
1200
1268
  referenceScriptCostPerByte: SubCoin;
1269
+ /**
1270
+ * Deposit amount required for registering a stake key
1271
+ */
1201
1272
  stakeKeyDeposit: bigint;
1273
+ /**
1274
+ * Deposit amount required for registering a stake pool
1275
+ */
1202
1276
  stakePoolDeposit: bigint;
1203
1277
  }
1204
-
1278
+ /**
1279
+ * Price of execution units for script execution
1280
+ */
1205
1281
  export interface ExUnitPrices {
1206
1282
  memPrice: SubCoin;
1207
1283
  stepPrice: SubCoin;
@@ -285,67 +285,46 @@ module.exports.get_possible_types_for_input = function(input) {
285
285
  };
286
286
 
287
287
  /**
288
- * @param {string} tx_hex
289
- * @returns {string}
288
+ * @param {string} cbor_hex
289
+ * @returns {any}
290
290
  */
291
- module.exports.get_necessary_data_list_js = function(tx_hex) {
292
- let deferred3_0;
293
- let deferred3_1;
291
+ module.exports.cbor_to_json = function(cbor_hex) {
294
292
  try {
295
293
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
296
- const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
294
+ const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
297
295
  const len0 = WASM_VECTOR_LEN;
298
- wasm.get_necessary_data_list_js(retptr, ptr0, len0);
296
+ wasm.cbor_to_json(retptr, ptr0, len0);
299
297
  var r0 = getInt32Memory0()[retptr / 4 + 0];
300
298
  var r1 = getInt32Memory0()[retptr / 4 + 1];
301
299
  var r2 = getInt32Memory0()[retptr / 4 + 2];
302
- var r3 = getInt32Memory0()[retptr / 4 + 3];
303
- var ptr2 = r0;
304
- var len2 = r1;
305
- if (r3) {
306
- ptr2 = 0; len2 = 0;
307
- throw takeObject(r2);
300
+ if (r2) {
301
+ throw takeObject(r1);
308
302
  }
309
- deferred3_0 = ptr2;
310
- deferred3_1 = len2;
311
- return getStringFromWasm0(ptr2, len2);
303
+ return takeObject(r0);
312
304
  } finally {
313
305
  wasm.__wbindgen_add_to_stack_pointer(16);
314
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
315
306
  }
316
307
  };
317
308
 
318
309
  /**
319
- * @param {string} tx_hex
320
- * @param {string} validation_context
321
- * @returns {string}
310
+ * @param {string} hex_str
311
+ * @returns {any}
322
312
  */
323
- module.exports.validate_transaction_js = function(tx_hex, validation_context) {
324
- let deferred4_0;
325
- let deferred4_1;
313
+ module.exports.check_block_or_tx_signatures = function(hex_str) {
326
314
  try {
327
315
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
328
- const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
316
+ const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
329
317
  const len0 = WASM_VECTOR_LEN;
330
- const ptr1 = passStringToWasm0(validation_context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
331
- const len1 = WASM_VECTOR_LEN;
332
- wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
318
+ wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
333
319
  var r0 = getInt32Memory0()[retptr / 4 + 0];
334
320
  var r1 = getInt32Memory0()[retptr / 4 + 1];
335
321
  var r2 = getInt32Memory0()[retptr / 4 + 2];
336
- var r3 = getInt32Memory0()[retptr / 4 + 3];
337
- var ptr3 = r0;
338
- var len3 = r1;
339
- if (r3) {
340
- ptr3 = 0; len3 = 0;
341
- throw takeObject(r2);
322
+ if (r2) {
323
+ throw takeObject(r1);
342
324
  }
343
- deferred4_0 = ptr3;
344
- deferred4_1 = len3;
345
- return getStringFromWasm0(ptr3, len3);
325
+ return takeObject(r0);
346
326
  } finally {
347
327
  wasm.__wbindgen_add_to_stack_pointer(16);
348
- wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
349
328
  }
350
329
  };
351
330
 
@@ -452,46 +431,67 @@ module.exports.execute_tx_scripts = function(tx_hex, utxo_json, cost_models_json
452
431
  };
453
432
 
454
433
  /**
455
- * @param {string} cbor_hex
456
- * @returns {any}
434
+ * @param {string} tx_hex
435
+ * @returns {string}
457
436
  */
458
- module.exports.cbor_to_json = function(cbor_hex) {
437
+ module.exports.get_necessary_data_list_js = function(tx_hex) {
438
+ let deferred3_0;
439
+ let deferred3_1;
459
440
  try {
460
441
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
461
- const ptr0 = passStringToWasm0(cbor_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
+ const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
462
443
  const len0 = WASM_VECTOR_LEN;
463
- wasm.cbor_to_json(retptr, ptr0, len0);
444
+ wasm.get_necessary_data_list_js(retptr, ptr0, len0);
464
445
  var r0 = getInt32Memory0()[retptr / 4 + 0];
465
446
  var r1 = getInt32Memory0()[retptr / 4 + 1];
466
447
  var r2 = getInt32Memory0()[retptr / 4 + 2];
467
- if (r2) {
468
- throw takeObject(r1);
448
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
449
+ var ptr2 = r0;
450
+ var len2 = r1;
451
+ if (r3) {
452
+ ptr2 = 0; len2 = 0;
453
+ throw takeObject(r2);
469
454
  }
470
- return takeObject(r0);
455
+ deferred3_0 = ptr2;
456
+ deferred3_1 = len2;
457
+ return getStringFromWasm0(ptr2, len2);
471
458
  } finally {
472
459
  wasm.__wbindgen_add_to_stack_pointer(16);
460
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
473
461
  }
474
462
  };
475
463
 
476
464
  /**
477
- * @param {string} hex_str
478
- * @returns {any}
465
+ * @param {string} tx_hex
466
+ * @param {string} validation_context
467
+ * @returns {string}
479
468
  */
480
- module.exports.check_block_or_tx_signatures = function(hex_str) {
469
+ module.exports.validate_transaction_js = function(tx_hex, validation_context) {
470
+ let deferred4_0;
471
+ let deferred4_1;
481
472
  try {
482
473
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
483
- const ptr0 = passStringToWasm0(hex_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
474
+ const ptr0 = passStringToWasm0(tx_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
484
475
  const len0 = WASM_VECTOR_LEN;
485
- wasm.check_block_or_tx_signatures(retptr, ptr0, len0);
476
+ const ptr1 = passStringToWasm0(validation_context, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
477
+ const len1 = WASM_VECTOR_LEN;
478
+ wasm.validate_transaction_js(retptr, ptr0, len0, ptr1, len1);
486
479
  var r0 = getInt32Memory0()[retptr / 4 + 0];
487
480
  var r1 = getInt32Memory0()[retptr / 4 + 1];
488
481
  var r2 = getInt32Memory0()[retptr / 4 + 2];
489
- if (r2) {
490
- throw takeObject(r1);
482
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
483
+ var ptr3 = r0;
484
+ var len3 = r1;
485
+ if (r3) {
486
+ ptr3 = 0; len3 = 0;
487
+ throw takeObject(r2);
491
488
  }
492
- return takeObject(r0);
489
+ deferred4_0 = ptr3;
490
+ deferred4_1 = len3;
491
+ return getStringFromWasm0(ptr3, len3);
493
492
  } finally {
494
493
  wasm.__wbindgen_add_to_stack_pointer(16);
494
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
495
495
  }
496
496
  };
497
497
 
@@ -1081,7 +1081,26 @@ function handleError(f, args) {
1081
1081
  }
1082
1082
  /**
1083
1083
  */
1084
- module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1084
+ module.exports.CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",GenesisKeyDelegation:5,"5":"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,"6":"MoveInstantaneousRewardsCert",CommitteeHotAuth:7,"7":"CommitteeHotAuth",CommitteeColdResign:8,"8":"CommitteeColdResign",DRepDeregistration:9,"9":"DRepDeregistration",DRepRegistration:10,"10":"DRepRegistration",DRepUpdate:11,"11":"DRepUpdate",StakeAndVoteDelegation:12,"12":"StakeAndVoteDelegation",StakeRegistrationAndDelegation:13,"13":"StakeRegistrationAndDelegation",StakeVoteRegistrationAndDelegation:14,"14":"StakeVoteRegistrationAndDelegation",VoteDelegation:15,"15":"VoteDelegation",VoteRegistrationAndDelegation:16,"16":"VoteRegistrationAndDelegation", });
1085
+ /**
1086
+ * Each new language uses a different namespace for hashing its script
1087
+ * This is because you could have a language where the same bytes have different semantics
1088
+ * So this avoids scripts in different languages mapping to the same hash
1089
+ * Note that the enum value here is different than the enum value for deciding the cost model of a script
1090
+ */
1091
+ module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1092
+ /**
1093
+ */
1094
+ module.exports.GovernanceActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidenceAction:3,"3":"NoConfidenceAction",UpdateCommitteeAction:4,"4":"UpdateCommitteeAction",NewConstitutionAction:5,"5":"NewConstitutionAction",InfoAction:6,"6":"InfoAction", });
1095
+ /**
1096
+ */
1097
+ module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1098
+ /**
1099
+ */
1100
+ module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1101
+ /**
1102
+ */
1103
+ module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1085
1104
  /**
1086
1105
  */
1087
1106
  module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
@@ -1103,10 +1122,13 @@ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1103
1122
  RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1104
1123
  /**
1105
1124
  */
1106
- module.exports.TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"MetadataMap",MetadataList:1,"1":"MetadataList",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
1125
+ module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1107
1126
  /**
1108
1127
  */
1109
- module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1128
+ module.exports.AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
1129
+ /**
1130
+ */
1131
+ module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1110
1132
  /**
1111
1133
  * JSON <-> PlutusData conversion schemas.
1112
1134
  * Follows ScriptDataJsonSchema in cardano-cli defined at:
@@ -1160,72 +1182,50 @@ BasicConversions:0,"0":"BasicConversions",
1160
1182
  DetailedSchema:1,"1":"DetailedSchema", });
1161
1183
  /**
1162
1184
  */
1163
- module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1164
- /**
1165
- */
1166
- module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1185
+ module.exports.NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
1167
1186
  /**
1168
1187
  */
1169
1188
  module.exports.BlockEra = Object.freeze({ Byron:0,"0":"Byron",Shelley:1,"1":"Shelley",Allegra:2,"2":"Allegra",Mary:3,"3":"Mary",Alonzo:4,"4":"Alonzo",Babbage:5,"5":"Babbage",Conway:6,"6":"Conway",Unknown:7,"7":"Unknown", });
1170
1189
  /**
1171
1190
  */
1172
- module.exports.AddressKind = Object.freeze({ Base:0,"0":"Base",Pointer:1,"1":"Pointer",Enterprise:2,"2":"Enterprise",Reward:3,"3":"Reward",Byron:4,"4":"Byron",Malformed:5,"5":"Malformed", });
1173
- /**
1174
- */
1175
- module.exports.CertificateKind = Object.freeze({ StakeRegistration:0,"0":"StakeRegistration",StakeDeregistration:1,"1":"StakeDeregistration",StakeDelegation:2,"2":"StakeDelegation",PoolRegistration:3,"3":"PoolRegistration",PoolRetirement:4,"4":"PoolRetirement",GenesisKeyDelegation:5,"5":"GenesisKeyDelegation",MoveInstantaneousRewardsCert:6,"6":"MoveInstantaneousRewardsCert",CommitteeHotAuth:7,"7":"CommitteeHotAuth",CommitteeColdResign:8,"8":"CommitteeColdResign",DRepDeregistration:9,"9":"DRepDeregistration",DRepRegistration:10,"10":"DRepRegistration",DRepUpdate:11,"11":"DRepUpdate",StakeAndVoteDelegation:12,"12":"StakeAndVoteDelegation",StakeRegistrationAndDelegation:13,"13":"StakeRegistrationAndDelegation",StakeVoteRegistrationAndDelegation:14,"14":"StakeVoteRegistrationAndDelegation",VoteDelegation:15,"15":"VoteDelegation",VoteRegistrationAndDelegation:16,"16":"VoteRegistrationAndDelegation", });
1176
- /**
1177
- */
1178
- module.exports.RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
1179
- /**
1180
- */
1181
- module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1182
- /**
1183
- */
1184
- module.exports.NativeScriptKind = Object.freeze({ ScriptPubkey:0,"0":"ScriptPubkey",ScriptAll:1,"1":"ScriptAll",ScriptAny:2,"2":"ScriptAny",ScriptNOfK:3,"3":"ScriptNOfK",TimelockStart:4,"4":"TimelockStart",TimelockExpiry:5,"5":"TimelockExpiry", });
1191
+ module.exports.TransactionMetadatumKind = Object.freeze({ MetadataMap:0,"0":"MetadataMap",MetadataList:1,"1":"MetadataList",Int:2,"2":"Int",Bytes:3,"3":"Bytes",Text:4,"4":"Text", });
1185
1192
  /**
1186
1193
  */
1187
1194
  module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1188
1195
  /**
1189
1196
  */
1190
- module.exports.PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
1191
- /**
1192
- */
1193
- module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1197
+ module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1194
1198
  /**
1195
1199
  */
1196
1200
  module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1197
1201
  /**
1198
1202
  */
1199
- module.exports.VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
1203
+ module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1200
1204
  /**
1201
1205
  */
1202
- module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1206
+ module.exports.RedeemerTagKind = Object.freeze({ Spend:0,"0":"Spend",Mint:1,"1":"Mint",Cert:2,"2":"Cert",Reward:3,"3":"Reward",Vote:4,"4":"Vote",VotingProposal:5,"5":"VotingProposal", });
1203
1207
  /**
1204
- * Each new language uses a different namespace for hashing its script
1205
- * This is because you could have a language where the same bytes have different semantics
1206
- * So this avoids scripts in different languages mapping to the same hash
1207
- * Note that the enum value here is different than the enum value for deciding the cost model of a script
1208
+ * Used to choosed the schema for a script JSON string
1208
1209
  */
1209
- module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1210
+ module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1210
1211
  /**
1211
1212
  */
1212
- module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1213
+ module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1213
1214
  /**
1214
1215
  */
1215
- module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1216
+ module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1216
1217
  /**
1217
- * Used to choosed the schema for a script JSON string
1218
1218
  */
1219
- module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1219
+ module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1220
1220
  /**
1221
1221
  */
1222
- module.exports.GovernanceActionKind = Object.freeze({ ParameterChangeAction:0,"0":"ParameterChangeAction",HardForkInitiationAction:1,"1":"HardForkInitiationAction",TreasuryWithdrawalsAction:2,"2":"TreasuryWithdrawalsAction",NoConfidenceAction:3,"3":"NoConfidenceAction",UpdateCommitteeAction:4,"4":"UpdateCommitteeAction",NewConstitutionAction:5,"5":"NewConstitutionAction",InfoAction:6,"6":"InfoAction", });
1222
+ module.exports.VoterKind = Object.freeze({ ConstitutionalCommitteeHotKeyHash:0,"0":"ConstitutionalCommitteeHotKeyHash",ConstitutionalCommitteeHotScriptHash:1,"1":"ConstitutionalCommitteeHotScriptHash",DRepKeyHash:2,"2":"DRepKeyHash",DRepScriptHash:3,"3":"DRepScriptHash",StakingPoolKeyHash:4,"4":"StakingPoolKeyHash", });
1223
1223
  /**
1224
1224
  */
1225
- module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1225
+ module.exports.PlutusDataKind = Object.freeze({ ConstrPlutusData:0,"0":"ConstrPlutusData",Map:1,"1":"Map",List:2,"2":"List",Integer:3,"3":"Integer",Bytes:4,"4":"Bytes", });
1226
1226
  /**
1227
1227
  */
1228
- module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1228
+ module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1229
1229
 
1230
1230
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1231
1231
  ? { register: () => {}, unregister: () => {} }
Binary file
@@ -4,14 +4,14 @@ export const memory: WebAssembly.Memory;
4
4
  export function get_decodable_types(a: number): void;
5
5
  export function decode_specific_type(a: number, b: number, c: number, d: number, e: number, f: number): void;
6
6
  export function get_possible_types_for_input(a: number, b: number, c: number): void;
7
- export function get_necessary_data_list_js(a: number, b: number, c: number): void;
8
- export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
7
+ export function cbor_to_json(a: number, b: number, c: number): void;
8
+ export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
9
9
  export function decode_plutus_program_uplc_json(a: number, b: number, c: number): void;
10
10
  export function decode_plutus_program_pretty_uplc(a: number, b: number, c: number): void;
11
11
  export function get_utxo_list_from_tx(a: number, b: number, c: number): void;
12
12
  export function execute_tx_scripts(a: number, b: number, c: number, d: number, e: number): void;
13
- export function cbor_to_json(a: number, b: number, c: number): void;
14
- export function check_block_or_tx_signatures(a: number, b: number, c: number): void;
13
+ export function get_necessary_data_list_js(a: number, b: number, c: number): void;
14
+ export function validate_transaction_js(a: number, b: number, c: number, d: number, e: number): void;
15
15
  export function __wbg_noconfidenceaction_free(a: number): void;
16
16
  export function noconfidenceaction_to_bytes(a: number, b: number): void;
17
17
  export function noconfidenceaction_from_bytes(a: number, b: number, c: number): void;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "collaborators": [
4
4
  "Evgenii Lisitskii <evgeniilisitskii@gmail.com>"
5
5
  ],
6
- "version": "0.1.0-beta.22",
6
+ "version": "0.1.0-beta.23",
7
7
  "files": [
8
8
  "node/cquisitor_lib_bg.wasm",
9
9
  "node/cquisitor_lib.js",