@cardananium/cquisitor-lib 0.1.0-beta.55 → 0.1.0-beta.57

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.
@@ -941,6 +941,527 @@ export interface NecessaryInputData {
941
941
  utxos: TxInput[];
942
942
  }
943
943
 
944
+ export type SerializableScriptContext =
945
+ | {
946
+ purpose: SerializableScriptPurpose;
947
+ script_context_version: "V1V2";
948
+ tx_info: SerializableTxInfo;
949
+ }
950
+ | {
951
+ purpose: SerializableScriptInfo;
952
+ redeemer: SerializablePlutusData;
953
+ script_context_version: "V3";
954
+ tx_info: SerializableTxInfo;
955
+ };
956
+ export type SerializableScriptPurpose =
957
+ | {
958
+ policy_id: string;
959
+ purpose_type: "Minting";
960
+ }
961
+ | {
962
+ purpose_type: "Spending";
963
+ utxo_ref: SerializableTransactionInput;
964
+ }
965
+ | {
966
+ purpose_type: "Rewarding";
967
+ stake_credential: SerializableStakeCredential;
968
+ }
969
+ | {
970
+ certificate: SerializableCertificate;
971
+ index: bigint;
972
+ purpose_type: "Certifying";
973
+ }
974
+ | {
975
+ purpose_type: "Voting";
976
+ voter: SerializableVoter;
977
+ }
978
+ | {
979
+ index: bigint;
980
+ proposal: SerializableProposalProcedure;
981
+ purpose_type: "Proposing";
982
+ };
983
+ export type SerializableStakeCredential =
984
+ | {
985
+ credential_type: "KeyHash";
986
+ hash: string;
987
+ }
988
+ | {
989
+ credential_type: "ScriptHash";
990
+ hash: string;
991
+ };
992
+ export type SerializableCertificate =
993
+ | {
994
+ certificate_type: "StakeRegistration";
995
+ stake_credential: SerializableStakeCredential;
996
+ }
997
+ | {
998
+ certificate_type: "StakeDeregistration";
999
+ stake_credential: SerializableStakeCredential;
1000
+ }
1001
+ | {
1002
+ certificate_type: "StakeDelegation";
1003
+ pool_keyhash: string;
1004
+ stake_credential: SerializableStakeCredential;
1005
+ }
1006
+ | {
1007
+ certificate_type: "PoolRegistration";
1008
+ pool_params: SerializablePoolParams;
1009
+ }
1010
+ | {
1011
+ certificate_type: "PoolRetirement";
1012
+ epoch: bigint;
1013
+ pool_keyhash: string;
1014
+ }
1015
+ | {
1016
+ certificate_type: "Reg";
1017
+ deposit: bigint;
1018
+ stake_credential: SerializableStakeCredential;
1019
+ }
1020
+ | {
1021
+ certificate_type: "UnReg";
1022
+ refund: bigint;
1023
+ stake_credential: SerializableStakeCredential;
1024
+ }
1025
+ | {
1026
+ certificate_type: "VoteDeleg";
1027
+ drep: SerializableDRep;
1028
+ stake_credential: SerializableStakeCredential;
1029
+ }
1030
+ | {
1031
+ certificate_type: "StakeVoteDeleg";
1032
+ drep: SerializableDRep;
1033
+ pool_keyhash: string;
1034
+ stake_credential: SerializableStakeCredential;
1035
+ }
1036
+ | {
1037
+ certificate_type: "StakeRegDeleg";
1038
+ deposit: bigint;
1039
+ pool_keyhash: string;
1040
+ stake_credential: SerializableStakeCredential;
1041
+ }
1042
+ | {
1043
+ certificate_type: "VoteRegDeleg";
1044
+ deposit: bigint;
1045
+ drep: SerializableDRep;
1046
+ stake_credential: SerializableStakeCredential;
1047
+ }
1048
+ | {
1049
+ certificate_type: "StakeVoteRegDeleg";
1050
+ deposit: bigint;
1051
+ drep: SerializableDRep;
1052
+ pool_keyhash: string;
1053
+ stake_credential: SerializableStakeCredential;
1054
+ }
1055
+ | {
1056
+ certificate_type: "AuthCommitteeHot";
1057
+ committee_cold_credential: SerializableStakeCredential;
1058
+ committee_hot_credential: SerializableStakeCredential;
1059
+ }
1060
+ | {
1061
+ anchor?: SerializableAnchor | null;
1062
+ certificate_type: "ResignCommitteeCold";
1063
+ committee_cold_credential: SerializableStakeCredential;
1064
+ }
1065
+ | {
1066
+ anchor?: SerializableAnchor | null;
1067
+ certificate_type: "RegDRepCert";
1068
+ deposit: bigint;
1069
+ drep_credential: SerializableStakeCredential;
1070
+ }
1071
+ | {
1072
+ certificate_type: "UnRegDRepCert";
1073
+ drep_credential: SerializableStakeCredential;
1074
+ refund: bigint;
1075
+ }
1076
+ | {
1077
+ anchor?: SerializableAnchor | null;
1078
+ certificate_type: "UpdateDRepCert";
1079
+ drep_credential: SerializableStakeCredential;
1080
+ };
1081
+ export type SerializableRelay =
1082
+ | {
1083
+ ipv4?: string | null;
1084
+ ipv6?: string | null;
1085
+ port?: number | null;
1086
+ relay_type: "SingleHostAddr";
1087
+ }
1088
+ | {
1089
+ hostname: string;
1090
+ port?: number | null;
1091
+ relay_type: "SingleHostName";
1092
+ }
1093
+ | {
1094
+ hostname: string;
1095
+ relay_type: "MultiHostName";
1096
+ };
1097
+ export type SerializableDRep =
1098
+ | {
1099
+ drep_type: "Key";
1100
+ hash: string;
1101
+ }
1102
+ | {
1103
+ drep_type: "Script";
1104
+ hash: string;
1105
+ }
1106
+ | {
1107
+ drep_type: "Abstain";
1108
+ }
1109
+ | {
1110
+ drep_type: "NoConfidence";
1111
+ };
1112
+ export type SerializableVoter =
1113
+ | {
1114
+ hash: string;
1115
+ voter_type: "ConstitutionalCommitteeScript";
1116
+ }
1117
+ | {
1118
+ hash: string;
1119
+ voter_type: "ConstitutionalCommitteeKey";
1120
+ }
1121
+ | {
1122
+ hash: string;
1123
+ voter_type: "DRepScript";
1124
+ }
1125
+ | {
1126
+ hash: string;
1127
+ voter_type: "DRepKey";
1128
+ }
1129
+ | {
1130
+ hash: string;
1131
+ voter_type: "StakePoolKey";
1132
+ };
1133
+ export type SerializableGovAction =
1134
+ | {
1135
+ action_type: "ParameterChange";
1136
+ gov_action_id?: SerializableGovActionId | null;
1137
+ policy_hash?: string | null;
1138
+ protocol_params_update: SerializableProtocolParamsUpdate;
1139
+ }
1140
+ | {
1141
+ action_type: "HardForkInitiation";
1142
+ gov_action_id?: SerializableGovActionId | null;
1143
+ protocol_version: ProtocolVersion;
1144
+ }
1145
+ | {
1146
+ action_type: "TreasuryWithdrawals";
1147
+ policy_hash?: string | null;
1148
+ withdrawals: [unknown, unknown][];
1149
+ }
1150
+ | {
1151
+ action_type: "NoConfidence";
1152
+ gov_action_id?: SerializableGovActionId | null;
1153
+ }
1154
+ | {
1155
+ action_type: "UpdateCommittee";
1156
+ gov_action_id?: SerializableGovActionId | null;
1157
+ members_to_add: [unknown, unknown][];
1158
+ members_to_remove: SerializableStakeCredential[];
1159
+ quorum_threshold: SubCoin;
1160
+ }
1161
+ | {
1162
+ action_type: "NewConstitution";
1163
+ constitution: SerializableConstitution;
1164
+ gov_action_id?: SerializableGovActionId | null;
1165
+ }
1166
+ | {
1167
+ action_type: "Information";
1168
+ };
1169
+ export type SerializableTxInfo =
1170
+ | {
1171
+ V1: SerializableTxInfoV1;
1172
+ }
1173
+ | {
1174
+ V2: SerializableTxInfoV2;
1175
+ }
1176
+ | {
1177
+ V3: SerializableTxInfoV3;
1178
+ };
1179
+ export type SerializableCardanoValue =
1180
+ | {
1181
+ amount: bigint;
1182
+ value_type: "Coin";
1183
+ }
1184
+ | {
1185
+ assets: SerializableAsset[];
1186
+ coin: bigint;
1187
+ value_type: "Multiasset";
1188
+ };
1189
+ export type SerializableTransactionOutput =
1190
+ | {
1191
+ address: string;
1192
+ datum_hash?: string | null;
1193
+ output_format: "Legacy";
1194
+ value: SerializableCardanoValue;
1195
+ }
1196
+ | {
1197
+ address: string;
1198
+ datum_option?: SerializableDatumOption | null;
1199
+ output_format: "PostAlonzo";
1200
+ script_ref?: SerializableScriptRef | null;
1201
+ value: SerializableCardanoValue;
1202
+ };
1203
+ export type SerializableDatumOption =
1204
+ | {
1205
+ datum_type: "Hash";
1206
+ hash: string;
1207
+ }
1208
+ | {
1209
+ data: SerializablePlutusData;
1210
+ datum_type: "Data";
1211
+ };
1212
+ /**
1213
+ * Serializable version of PlutusData that can be converted to/from JSON
1214
+ */
1215
+ export type SerializablePlutusData =
1216
+ | {
1217
+ any_constructor?: number | null;
1218
+ fields: SerializablePlutusData[];
1219
+ tag: bigint;
1220
+ type: "Constr";
1221
+ }
1222
+ | {
1223
+ key_value_pairs: SerializableKeyValuePair[];
1224
+ type: "Map";
1225
+ }
1226
+ | (
1227
+ | {
1228
+ Int: string;
1229
+ }
1230
+ | {
1231
+ BigUInt: string;
1232
+ }
1233
+ | {
1234
+ BigNInt: string;
1235
+ }
1236
+ )
1237
+ | {
1238
+ type: "BoundedBytes";
1239
+ value: string;
1240
+ }
1241
+ | {
1242
+ type: "Array";
1243
+ values: SerializablePlutusData[];
1244
+ };
1245
+ export type SerializableScriptRef =
1246
+ | {
1247
+ script: string;
1248
+ script_type: "NativeScript";
1249
+ }
1250
+ | {
1251
+ script: string;
1252
+ script_type: "PlutusV1Script";
1253
+ }
1254
+ | {
1255
+ script: string;
1256
+ script_type: "PlutusV2Script";
1257
+ }
1258
+ | {
1259
+ script: string;
1260
+ script_type: "PlutusV3Script";
1261
+ };
1262
+ export type SerializableScriptInfo =
1263
+ | {
1264
+ policy_id: string;
1265
+ script_info_type: "Minting";
1266
+ }
1267
+ | {
1268
+ datum?: SerializablePlutusData | null;
1269
+ script_info_type: "Spending";
1270
+ utxo_ref: SerializableTransactionInput;
1271
+ }
1272
+ | {
1273
+ script_info_type: "Rewarding";
1274
+ stake_credential: SerializableStakeCredential;
1275
+ }
1276
+ | {
1277
+ certificate: SerializableCertificate;
1278
+ index: bigint;
1279
+ script_info_type: "Certifying";
1280
+ }
1281
+ | {
1282
+ script_info_type: "Voting";
1283
+ voter: SerializableVoter;
1284
+ }
1285
+ | {
1286
+ index: bigint;
1287
+ proposal: SerializableProposalProcedure;
1288
+ script_info_type: "Proposing";
1289
+ };
1290
+
1291
+ export interface SerializableTransactionInput {
1292
+ index: bigint;
1293
+ transaction_id: string;
1294
+ }
1295
+ export interface SerializablePoolParams {
1296
+ cost: bigint;
1297
+ margin: SubCoin;
1298
+ operator: string;
1299
+ pledge: bigint;
1300
+ pool_metadata?: SerializablePoolMetadata | null;
1301
+ pool_owners: string[];
1302
+ relays: SerializableRelay[];
1303
+ reward_account: string;
1304
+ vrf_keyhash: string;
1305
+ }
1306
+
1307
+ export interface SerializablePoolMetadata {
1308
+ hash: string;
1309
+ url: string;
1310
+ }
1311
+ export interface SerializableAnchor {
1312
+ data_hash: string;
1313
+ url: string;
1314
+ }
1315
+ export interface SerializableProposalProcedure {
1316
+ anchor: SerializableAnchor;
1317
+ deposit: bigint;
1318
+ gov_action: SerializableGovAction;
1319
+ reward_account: string;
1320
+ }
1321
+ export interface SerializableGovActionId {
1322
+ action_index: number;
1323
+ transaction_id: string;
1324
+ }
1325
+ export interface SerializableProtocolParamsUpdate {
1326
+ ada_per_utxo_byte?: number | null;
1327
+ collateral_percentage?: number | null;
1328
+ committee_term_limit?: number | null;
1329
+ cost_models_for_script_languages?: SerializableCostModels | null;
1330
+ desired_number_of_stake_pools?: number | null;
1331
+ drep_deposit?: number | null;
1332
+ drep_inactivity_period?: number | null;
1333
+ drep_voting_thresholds?: SerializableDRepVotingThresholds | null;
1334
+ execution_costs?: SerializableExUnitPrices | null;
1335
+ expansion_rate?: SubCoin | null;
1336
+ governance_action_deposit?: number | null;
1337
+ governance_action_validity_period?: number | null;
1338
+ key_deposit?: number | null;
1339
+ max_block_body_size?: number | null;
1340
+ max_block_ex_units?: ExUnits | null;
1341
+ max_block_header_size?: number | null;
1342
+ max_collateral_inputs?: number | null;
1343
+ max_transaction_size?: number | null;
1344
+ max_tx_ex_units?: ExUnits | null;
1345
+ max_value_size?: number | null;
1346
+ maximum_epoch?: number | null;
1347
+ min_committee_size?: number | null;
1348
+ min_pool_cost?: number | null;
1349
+ minfee_a?: number | null;
1350
+ minfee_b?: number | null;
1351
+ minfee_refscript_cost_per_byte?: SubCoin | null;
1352
+ pool_deposit?: number | null;
1353
+ pool_pledge_influence?: SubCoin | null;
1354
+ pool_voting_thresholds?: SerializablePoolVotingThresholds | null;
1355
+ treasury_growth_rate?: SubCoin | null;
1356
+ }
1357
+ export interface SerializableCostModels {
1358
+ plutus_v1?: number[] | null;
1359
+ plutus_v2?: number[] | null;
1360
+ plutus_v3?: number[] | null;
1361
+ }
1362
+ export interface SerializableDRepVotingThresholds {
1363
+ committee_no_confidence: SubCoin;
1364
+ committee_normal: SubCoin;
1365
+ hard_fork_initiation: SubCoin;
1366
+ motion_no_confidence: SubCoin;
1367
+ pp_economic_group: SubCoin;
1368
+ pp_governance_group: SubCoin;
1369
+ pp_network_group: SubCoin;
1370
+ pp_technical_group: SubCoin;
1371
+ treasury_withdrawal: SubCoin;
1372
+ update_constitution: SubCoin;
1373
+ }
1374
+ export interface SerializableExUnitPrices {
1375
+ mem_price: SubCoin;
1376
+ step_price: SubCoin;
1377
+ }
1378
+
1379
+ export interface SerializablePoolVotingThresholds {
1380
+ committee_no_confidence: SubCoin;
1381
+ committee_normal: SubCoin;
1382
+ hard_fork_initiation: SubCoin;
1383
+ motion_no_confidence: SubCoin;
1384
+ security_voting_threshold: SubCoin;
1385
+ }
1386
+
1387
+ export interface SerializableConstitution {
1388
+ anchor: SerializableAnchor;
1389
+ guardrail_script?: string | null;
1390
+ }
1391
+ export interface SerializableTxInfoV1 {
1392
+ certificates: SerializableCertificate[];
1393
+ data: [unknown, unknown][];
1394
+ fee: SerializableCardanoValue;
1395
+ id: string;
1396
+ inputs: SerializableTxInInfo[];
1397
+ mint: SerializableMintValue;
1398
+ outputs: SerializableTransactionOutput[];
1399
+ redeemers: [unknown, unknown][];
1400
+ signatories: string[];
1401
+ valid_range: SerializableTimeRange;
1402
+ withdrawals: [unknown, unknown][];
1403
+ }
1404
+ export interface SerializableAsset {
1405
+ policy_id: string;
1406
+ tokens: SerializableToken[];
1407
+ }
1408
+ export interface SerializableToken {
1409
+ asset_name: string;
1410
+ /**
1411
+ * Decimal string. Held as a string because the value range spans both
1412
+ * negative mint/burn amounts and `Value` amounts up to `u64::MAX` —
1413
+ * no fixed-width integer type covers both without loss.
1414
+ */
1415
+ quantity: string;
1416
+ }
1417
+ export interface SerializableTxInInfo {
1418
+ out_ref: SerializableTransactionInput;
1419
+ resolved: SerializableTransactionOutput;
1420
+ }
1421
+ export interface SerializableKeyValuePair {
1422
+ key: SerializablePlutusData;
1423
+ value: SerializablePlutusData;
1424
+ }
1425
+ export interface SerializableMintValue {
1426
+ mint_value: SerializableAsset[];
1427
+ }
1428
+ export interface SerializableTimeRange {
1429
+ lower_bound?: number | null;
1430
+ upper_bound?: number | null;
1431
+ }
1432
+ export interface SerializableTxInfoV2 {
1433
+ certificates: SerializableCertificate[];
1434
+ data: [unknown, unknown][];
1435
+ fee: SerializableCardanoValue;
1436
+ id: string;
1437
+ inputs: SerializableTxInInfo[];
1438
+ mint: SerializableMintValue;
1439
+ outputs: SerializableTransactionOutput[];
1440
+ redeemers: [unknown, unknown][];
1441
+ reference_inputs: SerializableTxInInfo[];
1442
+ signatories: string[];
1443
+ valid_range: SerializableTimeRange;
1444
+ withdrawals: [unknown, unknown][];
1445
+ }
1446
+ export interface SerializableTxInfoV3 {
1447
+ certificates: SerializableCertificate[];
1448
+ current_treasury_amount?: number | null;
1449
+ data: [unknown, unknown][];
1450
+ fee: bigint;
1451
+ id: string;
1452
+ inputs: SerializableTxInInfo[];
1453
+ mint: SerializableMintValue;
1454
+ outputs: SerializableTransactionOutput[];
1455
+ proposal_procedures: SerializableProposalProcedure[];
1456
+ redeemers: [unknown, unknown][];
1457
+ reference_inputs: SerializableTxInInfo[];
1458
+ signatories: string[];
1459
+ treasury_donation?: number | null;
1460
+ valid_range: SerializableTimeRange;
1461
+ votes: [unknown, unknown][];
1462
+ withdrawals: [unknown, unknown][];
1463
+ }
1464
+
944
1465
  export type GovernanceActionType =
945
1466
  | "parameterChangeAction"
946
1467
  | "hardForkInitiationAction"
@@ -1937,6 +2458,11 @@ export interface EvalRedeemerResult {
1937
2458
  index: bigint;
1938
2459
  logs: string[];
1939
2460
  provided_ex_units: ExUnits;
2461
+ /**
2462
+ * The mapped script context, serialized as a JSON string.
2463
+ */
2464
+ script_context?: string | null;
2465
+ script_context_bytes?: string | null;
1940
2466
  success: boolean;
1941
2467
  tag: RedeemerTag;
1942
2468
  }
Binary file
@@ -5,8 +5,11 @@ export const decode_specific_type: (a: number, b: number, c: number, d: number,
5
5
  export const get_decodable_types: () => [number, number];
6
6
  export const get_possible_types_for_input: (a: number, b: number) => [number, number];
7
7
  export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
8
- export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
9
- export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
8
+ export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
9
+ export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
10
+ export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
11
+ export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
12
+ export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
10
13
  export const cbor_to_json: (a: number, b: number) => [number, number, number];
11
14
  export const cddl_format: (a: number, b: number) => [number, number, number, number];
12
15
  export const cddl_outline: (a: number, b: number) => [number, number, number];
@@ -17,11 +20,8 @@ export const map_cbor_to_cddl: (a: number, b: number, c: number, d: number, e: n
17
20
  export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
18
21
  export const validate_cddl: (a: number, b: number) => [number, number, number];
19
22
  export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
20
- export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
21
- export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
22
- export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
23
- export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
24
- export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
23
+ export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
24
+ export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
25
25
  export const validate_cbor_from_slice: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
26
26
  export const validate_json_from_str: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
27
27
  export const cddl_from_str: (a: number, b: number) => [number, number, number];
@@ -941,6 +941,527 @@ export interface NecessaryInputData {
941
941
  utxos: TxInput[];
942
942
  }
943
943
 
944
+ export type SerializableScriptContext =
945
+ | {
946
+ purpose: SerializableScriptPurpose;
947
+ script_context_version: "V1V2";
948
+ tx_info: SerializableTxInfo;
949
+ }
950
+ | {
951
+ purpose: SerializableScriptInfo;
952
+ redeemer: SerializablePlutusData;
953
+ script_context_version: "V3";
954
+ tx_info: SerializableTxInfo;
955
+ };
956
+ export type SerializableScriptPurpose =
957
+ | {
958
+ policy_id: string;
959
+ purpose_type: "Minting";
960
+ }
961
+ | {
962
+ purpose_type: "Spending";
963
+ utxo_ref: SerializableTransactionInput;
964
+ }
965
+ | {
966
+ purpose_type: "Rewarding";
967
+ stake_credential: SerializableStakeCredential;
968
+ }
969
+ | {
970
+ certificate: SerializableCertificate;
971
+ index: bigint;
972
+ purpose_type: "Certifying";
973
+ }
974
+ | {
975
+ purpose_type: "Voting";
976
+ voter: SerializableVoter;
977
+ }
978
+ | {
979
+ index: bigint;
980
+ proposal: SerializableProposalProcedure;
981
+ purpose_type: "Proposing";
982
+ };
983
+ export type SerializableStakeCredential =
984
+ | {
985
+ credential_type: "KeyHash";
986
+ hash: string;
987
+ }
988
+ | {
989
+ credential_type: "ScriptHash";
990
+ hash: string;
991
+ };
992
+ export type SerializableCertificate =
993
+ | {
994
+ certificate_type: "StakeRegistration";
995
+ stake_credential: SerializableStakeCredential;
996
+ }
997
+ | {
998
+ certificate_type: "StakeDeregistration";
999
+ stake_credential: SerializableStakeCredential;
1000
+ }
1001
+ | {
1002
+ certificate_type: "StakeDelegation";
1003
+ pool_keyhash: string;
1004
+ stake_credential: SerializableStakeCredential;
1005
+ }
1006
+ | {
1007
+ certificate_type: "PoolRegistration";
1008
+ pool_params: SerializablePoolParams;
1009
+ }
1010
+ | {
1011
+ certificate_type: "PoolRetirement";
1012
+ epoch: bigint;
1013
+ pool_keyhash: string;
1014
+ }
1015
+ | {
1016
+ certificate_type: "Reg";
1017
+ deposit: bigint;
1018
+ stake_credential: SerializableStakeCredential;
1019
+ }
1020
+ | {
1021
+ certificate_type: "UnReg";
1022
+ refund: bigint;
1023
+ stake_credential: SerializableStakeCredential;
1024
+ }
1025
+ | {
1026
+ certificate_type: "VoteDeleg";
1027
+ drep: SerializableDRep;
1028
+ stake_credential: SerializableStakeCredential;
1029
+ }
1030
+ | {
1031
+ certificate_type: "StakeVoteDeleg";
1032
+ drep: SerializableDRep;
1033
+ pool_keyhash: string;
1034
+ stake_credential: SerializableStakeCredential;
1035
+ }
1036
+ | {
1037
+ certificate_type: "StakeRegDeleg";
1038
+ deposit: bigint;
1039
+ pool_keyhash: string;
1040
+ stake_credential: SerializableStakeCredential;
1041
+ }
1042
+ | {
1043
+ certificate_type: "VoteRegDeleg";
1044
+ deposit: bigint;
1045
+ drep: SerializableDRep;
1046
+ stake_credential: SerializableStakeCredential;
1047
+ }
1048
+ | {
1049
+ certificate_type: "StakeVoteRegDeleg";
1050
+ deposit: bigint;
1051
+ drep: SerializableDRep;
1052
+ pool_keyhash: string;
1053
+ stake_credential: SerializableStakeCredential;
1054
+ }
1055
+ | {
1056
+ certificate_type: "AuthCommitteeHot";
1057
+ committee_cold_credential: SerializableStakeCredential;
1058
+ committee_hot_credential: SerializableStakeCredential;
1059
+ }
1060
+ | {
1061
+ anchor?: SerializableAnchor | null;
1062
+ certificate_type: "ResignCommitteeCold";
1063
+ committee_cold_credential: SerializableStakeCredential;
1064
+ }
1065
+ | {
1066
+ anchor?: SerializableAnchor | null;
1067
+ certificate_type: "RegDRepCert";
1068
+ deposit: bigint;
1069
+ drep_credential: SerializableStakeCredential;
1070
+ }
1071
+ | {
1072
+ certificate_type: "UnRegDRepCert";
1073
+ drep_credential: SerializableStakeCredential;
1074
+ refund: bigint;
1075
+ }
1076
+ | {
1077
+ anchor?: SerializableAnchor | null;
1078
+ certificate_type: "UpdateDRepCert";
1079
+ drep_credential: SerializableStakeCredential;
1080
+ };
1081
+ export type SerializableRelay =
1082
+ | {
1083
+ ipv4?: string | null;
1084
+ ipv6?: string | null;
1085
+ port?: number | null;
1086
+ relay_type: "SingleHostAddr";
1087
+ }
1088
+ | {
1089
+ hostname: string;
1090
+ port?: number | null;
1091
+ relay_type: "SingleHostName";
1092
+ }
1093
+ | {
1094
+ hostname: string;
1095
+ relay_type: "MultiHostName";
1096
+ };
1097
+ export type SerializableDRep =
1098
+ | {
1099
+ drep_type: "Key";
1100
+ hash: string;
1101
+ }
1102
+ | {
1103
+ drep_type: "Script";
1104
+ hash: string;
1105
+ }
1106
+ | {
1107
+ drep_type: "Abstain";
1108
+ }
1109
+ | {
1110
+ drep_type: "NoConfidence";
1111
+ };
1112
+ export type SerializableVoter =
1113
+ | {
1114
+ hash: string;
1115
+ voter_type: "ConstitutionalCommitteeScript";
1116
+ }
1117
+ | {
1118
+ hash: string;
1119
+ voter_type: "ConstitutionalCommitteeKey";
1120
+ }
1121
+ | {
1122
+ hash: string;
1123
+ voter_type: "DRepScript";
1124
+ }
1125
+ | {
1126
+ hash: string;
1127
+ voter_type: "DRepKey";
1128
+ }
1129
+ | {
1130
+ hash: string;
1131
+ voter_type: "StakePoolKey";
1132
+ };
1133
+ export type SerializableGovAction =
1134
+ | {
1135
+ action_type: "ParameterChange";
1136
+ gov_action_id?: SerializableGovActionId | null;
1137
+ policy_hash?: string | null;
1138
+ protocol_params_update: SerializableProtocolParamsUpdate;
1139
+ }
1140
+ | {
1141
+ action_type: "HardForkInitiation";
1142
+ gov_action_id?: SerializableGovActionId | null;
1143
+ protocol_version: ProtocolVersion;
1144
+ }
1145
+ | {
1146
+ action_type: "TreasuryWithdrawals";
1147
+ policy_hash?: string | null;
1148
+ withdrawals: [unknown, unknown][];
1149
+ }
1150
+ | {
1151
+ action_type: "NoConfidence";
1152
+ gov_action_id?: SerializableGovActionId | null;
1153
+ }
1154
+ | {
1155
+ action_type: "UpdateCommittee";
1156
+ gov_action_id?: SerializableGovActionId | null;
1157
+ members_to_add: [unknown, unknown][];
1158
+ members_to_remove: SerializableStakeCredential[];
1159
+ quorum_threshold: SubCoin;
1160
+ }
1161
+ | {
1162
+ action_type: "NewConstitution";
1163
+ constitution: SerializableConstitution;
1164
+ gov_action_id?: SerializableGovActionId | null;
1165
+ }
1166
+ | {
1167
+ action_type: "Information";
1168
+ };
1169
+ export type SerializableTxInfo =
1170
+ | {
1171
+ V1: SerializableTxInfoV1;
1172
+ }
1173
+ | {
1174
+ V2: SerializableTxInfoV2;
1175
+ }
1176
+ | {
1177
+ V3: SerializableTxInfoV3;
1178
+ };
1179
+ export type SerializableCardanoValue =
1180
+ | {
1181
+ amount: bigint;
1182
+ value_type: "Coin";
1183
+ }
1184
+ | {
1185
+ assets: SerializableAsset[];
1186
+ coin: bigint;
1187
+ value_type: "Multiasset";
1188
+ };
1189
+ export type SerializableTransactionOutput =
1190
+ | {
1191
+ address: string;
1192
+ datum_hash?: string | null;
1193
+ output_format: "Legacy";
1194
+ value: SerializableCardanoValue;
1195
+ }
1196
+ | {
1197
+ address: string;
1198
+ datum_option?: SerializableDatumOption | null;
1199
+ output_format: "PostAlonzo";
1200
+ script_ref?: SerializableScriptRef | null;
1201
+ value: SerializableCardanoValue;
1202
+ };
1203
+ export type SerializableDatumOption =
1204
+ | {
1205
+ datum_type: "Hash";
1206
+ hash: string;
1207
+ }
1208
+ | {
1209
+ data: SerializablePlutusData;
1210
+ datum_type: "Data";
1211
+ };
1212
+ /**
1213
+ * Serializable version of PlutusData that can be converted to/from JSON
1214
+ */
1215
+ export type SerializablePlutusData =
1216
+ | {
1217
+ any_constructor?: number | null;
1218
+ fields: SerializablePlutusData[];
1219
+ tag: bigint;
1220
+ type: "Constr";
1221
+ }
1222
+ | {
1223
+ key_value_pairs: SerializableKeyValuePair[];
1224
+ type: "Map";
1225
+ }
1226
+ | (
1227
+ | {
1228
+ Int: string;
1229
+ }
1230
+ | {
1231
+ BigUInt: string;
1232
+ }
1233
+ | {
1234
+ BigNInt: string;
1235
+ }
1236
+ )
1237
+ | {
1238
+ type: "BoundedBytes";
1239
+ value: string;
1240
+ }
1241
+ | {
1242
+ type: "Array";
1243
+ values: SerializablePlutusData[];
1244
+ };
1245
+ export type SerializableScriptRef =
1246
+ | {
1247
+ script: string;
1248
+ script_type: "NativeScript";
1249
+ }
1250
+ | {
1251
+ script: string;
1252
+ script_type: "PlutusV1Script";
1253
+ }
1254
+ | {
1255
+ script: string;
1256
+ script_type: "PlutusV2Script";
1257
+ }
1258
+ | {
1259
+ script: string;
1260
+ script_type: "PlutusV3Script";
1261
+ };
1262
+ export type SerializableScriptInfo =
1263
+ | {
1264
+ policy_id: string;
1265
+ script_info_type: "Minting";
1266
+ }
1267
+ | {
1268
+ datum?: SerializablePlutusData | null;
1269
+ script_info_type: "Spending";
1270
+ utxo_ref: SerializableTransactionInput;
1271
+ }
1272
+ | {
1273
+ script_info_type: "Rewarding";
1274
+ stake_credential: SerializableStakeCredential;
1275
+ }
1276
+ | {
1277
+ certificate: SerializableCertificate;
1278
+ index: bigint;
1279
+ script_info_type: "Certifying";
1280
+ }
1281
+ | {
1282
+ script_info_type: "Voting";
1283
+ voter: SerializableVoter;
1284
+ }
1285
+ | {
1286
+ index: bigint;
1287
+ proposal: SerializableProposalProcedure;
1288
+ script_info_type: "Proposing";
1289
+ };
1290
+
1291
+ export interface SerializableTransactionInput {
1292
+ index: bigint;
1293
+ transaction_id: string;
1294
+ }
1295
+ export interface SerializablePoolParams {
1296
+ cost: bigint;
1297
+ margin: SubCoin;
1298
+ operator: string;
1299
+ pledge: bigint;
1300
+ pool_metadata?: SerializablePoolMetadata | null;
1301
+ pool_owners: string[];
1302
+ relays: SerializableRelay[];
1303
+ reward_account: string;
1304
+ vrf_keyhash: string;
1305
+ }
1306
+
1307
+ export interface SerializablePoolMetadata {
1308
+ hash: string;
1309
+ url: string;
1310
+ }
1311
+ export interface SerializableAnchor {
1312
+ data_hash: string;
1313
+ url: string;
1314
+ }
1315
+ export interface SerializableProposalProcedure {
1316
+ anchor: SerializableAnchor;
1317
+ deposit: bigint;
1318
+ gov_action: SerializableGovAction;
1319
+ reward_account: string;
1320
+ }
1321
+ export interface SerializableGovActionId {
1322
+ action_index: number;
1323
+ transaction_id: string;
1324
+ }
1325
+ export interface SerializableProtocolParamsUpdate {
1326
+ ada_per_utxo_byte?: number | null;
1327
+ collateral_percentage?: number | null;
1328
+ committee_term_limit?: number | null;
1329
+ cost_models_for_script_languages?: SerializableCostModels | null;
1330
+ desired_number_of_stake_pools?: number | null;
1331
+ drep_deposit?: number | null;
1332
+ drep_inactivity_period?: number | null;
1333
+ drep_voting_thresholds?: SerializableDRepVotingThresholds | null;
1334
+ execution_costs?: SerializableExUnitPrices | null;
1335
+ expansion_rate?: SubCoin | null;
1336
+ governance_action_deposit?: number | null;
1337
+ governance_action_validity_period?: number | null;
1338
+ key_deposit?: number | null;
1339
+ max_block_body_size?: number | null;
1340
+ max_block_ex_units?: ExUnits | null;
1341
+ max_block_header_size?: number | null;
1342
+ max_collateral_inputs?: number | null;
1343
+ max_transaction_size?: number | null;
1344
+ max_tx_ex_units?: ExUnits | null;
1345
+ max_value_size?: number | null;
1346
+ maximum_epoch?: number | null;
1347
+ min_committee_size?: number | null;
1348
+ min_pool_cost?: number | null;
1349
+ minfee_a?: number | null;
1350
+ minfee_b?: number | null;
1351
+ minfee_refscript_cost_per_byte?: SubCoin | null;
1352
+ pool_deposit?: number | null;
1353
+ pool_pledge_influence?: SubCoin | null;
1354
+ pool_voting_thresholds?: SerializablePoolVotingThresholds | null;
1355
+ treasury_growth_rate?: SubCoin | null;
1356
+ }
1357
+ export interface SerializableCostModels {
1358
+ plutus_v1?: number[] | null;
1359
+ plutus_v2?: number[] | null;
1360
+ plutus_v3?: number[] | null;
1361
+ }
1362
+ export interface SerializableDRepVotingThresholds {
1363
+ committee_no_confidence: SubCoin;
1364
+ committee_normal: SubCoin;
1365
+ hard_fork_initiation: SubCoin;
1366
+ motion_no_confidence: SubCoin;
1367
+ pp_economic_group: SubCoin;
1368
+ pp_governance_group: SubCoin;
1369
+ pp_network_group: SubCoin;
1370
+ pp_technical_group: SubCoin;
1371
+ treasury_withdrawal: SubCoin;
1372
+ update_constitution: SubCoin;
1373
+ }
1374
+ export interface SerializableExUnitPrices {
1375
+ mem_price: SubCoin;
1376
+ step_price: SubCoin;
1377
+ }
1378
+
1379
+ export interface SerializablePoolVotingThresholds {
1380
+ committee_no_confidence: SubCoin;
1381
+ committee_normal: SubCoin;
1382
+ hard_fork_initiation: SubCoin;
1383
+ motion_no_confidence: SubCoin;
1384
+ security_voting_threshold: SubCoin;
1385
+ }
1386
+
1387
+ export interface SerializableConstitution {
1388
+ anchor: SerializableAnchor;
1389
+ guardrail_script?: string | null;
1390
+ }
1391
+ export interface SerializableTxInfoV1 {
1392
+ certificates: SerializableCertificate[];
1393
+ data: [unknown, unknown][];
1394
+ fee: SerializableCardanoValue;
1395
+ id: string;
1396
+ inputs: SerializableTxInInfo[];
1397
+ mint: SerializableMintValue;
1398
+ outputs: SerializableTransactionOutput[];
1399
+ redeemers: [unknown, unknown][];
1400
+ signatories: string[];
1401
+ valid_range: SerializableTimeRange;
1402
+ withdrawals: [unknown, unknown][];
1403
+ }
1404
+ export interface SerializableAsset {
1405
+ policy_id: string;
1406
+ tokens: SerializableToken[];
1407
+ }
1408
+ export interface SerializableToken {
1409
+ asset_name: string;
1410
+ /**
1411
+ * Decimal string. Held as a string because the value range spans both
1412
+ * negative mint/burn amounts and `Value` amounts up to `u64::MAX` —
1413
+ * no fixed-width integer type covers both without loss.
1414
+ */
1415
+ quantity: string;
1416
+ }
1417
+ export interface SerializableTxInInfo {
1418
+ out_ref: SerializableTransactionInput;
1419
+ resolved: SerializableTransactionOutput;
1420
+ }
1421
+ export interface SerializableKeyValuePair {
1422
+ key: SerializablePlutusData;
1423
+ value: SerializablePlutusData;
1424
+ }
1425
+ export interface SerializableMintValue {
1426
+ mint_value: SerializableAsset[];
1427
+ }
1428
+ export interface SerializableTimeRange {
1429
+ lower_bound?: number | null;
1430
+ upper_bound?: number | null;
1431
+ }
1432
+ export interface SerializableTxInfoV2 {
1433
+ certificates: SerializableCertificate[];
1434
+ data: [unknown, unknown][];
1435
+ fee: SerializableCardanoValue;
1436
+ id: string;
1437
+ inputs: SerializableTxInInfo[];
1438
+ mint: SerializableMintValue;
1439
+ outputs: SerializableTransactionOutput[];
1440
+ redeemers: [unknown, unknown][];
1441
+ reference_inputs: SerializableTxInInfo[];
1442
+ signatories: string[];
1443
+ valid_range: SerializableTimeRange;
1444
+ withdrawals: [unknown, unknown][];
1445
+ }
1446
+ export interface SerializableTxInfoV3 {
1447
+ certificates: SerializableCertificate[];
1448
+ current_treasury_amount?: number | null;
1449
+ data: [unknown, unknown][];
1450
+ fee: bigint;
1451
+ id: string;
1452
+ inputs: SerializableTxInInfo[];
1453
+ mint: SerializableMintValue;
1454
+ outputs: SerializableTransactionOutput[];
1455
+ proposal_procedures: SerializableProposalProcedure[];
1456
+ redeemers: [unknown, unknown][];
1457
+ reference_inputs: SerializableTxInInfo[];
1458
+ signatories: string[];
1459
+ treasury_donation?: number | null;
1460
+ valid_range: SerializableTimeRange;
1461
+ votes: [unknown, unknown][];
1462
+ withdrawals: [unknown, unknown][];
1463
+ }
1464
+
944
1465
  export type GovernanceActionType =
945
1466
  | "parameterChangeAction"
946
1467
  | "hardForkInitiationAction"
@@ -1937,6 +2458,11 @@ export interface EvalRedeemerResult {
1937
2458
  index: bigint;
1938
2459
  logs: string[];
1939
2460
  provided_ex_units: ExUnits;
2461
+ /**
2462
+ * The mapped script context, serialized as a JSON string.
2463
+ */
2464
+ script_context?: string | null;
2465
+ script_context_bytes?: string | null;
1940
2466
  success: boolean;
1941
2467
  tag: RedeemerTag;
1942
2468
  }
Binary file
@@ -5,8 +5,11 @@ export const decode_specific_type: (a: number, b: number, c: number, d: number,
5
5
  export const get_decodable_types: () => [number, number];
6
6
  export const get_possible_types_for_input: (a: number, b: number) => [number, number];
7
7
  export const check_block_or_tx_signatures: (a: number, b: number) => [number, number, number];
8
- export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
9
- export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
8
+ export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
9
+ export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
10
+ export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
11
+ export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
12
+ export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
10
13
  export const cbor_to_json: (a: number, b: number) => [number, number, number];
11
14
  export const cddl_format: (a: number, b: number) => [number, number, number, number];
12
15
  export const cddl_outline: (a: number, b: number) => [number, number, number];
@@ -17,11 +20,8 @@ export const map_cbor_to_cddl: (a: number, b: number, c: number, d: number, e: n
17
20
  export const validate_cbor_against_cddl: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
18
21
  export const validate_cddl: (a: number, b: number) => [number, number, number];
19
22
  export const extract_hashes_from_transaction_js: (a: number, b: number) => [number, number, number, number];
20
- export const decode_plutus_program_pretty_uplc: (a: number, b: number) => [number, number, number, number];
21
- export const decode_plutus_program_uplc_json: (a: number, b: number) => [number, number, number];
22
- export const execute_tx_scripts: (a: number, b: number, c: any, d: any) => [number, number, number];
23
- export const get_ref_script_bytes: (a: number, b: number, c: number) => [number, number, number, number];
24
- export const get_utxo_list_from_tx: (a: number, b: number) => [number, number, number, number];
23
+ export const get_necessary_data_list_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
24
+ export const validate_transaction_js: (a: number, b: number, c: number, d: number) => [number, number, number, number];
25
25
  export const validate_cbor_from_slice: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
26
26
  export const validate_json_from_str: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
27
27
  export const cddl_from_str: (a: number, b: number) => [number, number, number];
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "Evgenii Lisitskii <evgeniilisitskii@gmail.com>"
5
5
  ],
6
6
  "description": "Cardano transaction validation library",
7
- "version": "0.1.0-beta.55",
7
+ "version": "0.1.0-beta.57",
8
8
  "license": "Apache-2.0",
9
9
  "files": [
10
10
  "node/cquisitor_lib_bg.wasm",