@cardananium/cquisitor-lib 0.1.0-beta.18 → 0.1.0-beta.19

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.
@@ -8,7 +8,7 @@ export function get_necessary_data_list_js(tx_hex: string): string;
8
8
  * @param {ValidationInputContext} validation_context
9
9
  * @returns {string}
10
10
  */
11
- export function validate_transaction_js(tx_hex: string, validation_context: ValidationInputContext): string;
11
+ export function validate_transaction_js(tx_hex: string, validation_context: string): string;
12
12
 
13
13
  /**
14
14
  * @returns {(string)[]}
@@ -1086,78 +1086,22 @@ function handleError(f, args) {
1086
1086
  }
1087
1087
  /**
1088
1088
  */
1089
- export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1090
- /**
1091
- */
1092
- 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", });
1093
- /**
1094
- */
1095
- export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1096
- /**
1097
- */
1098
- 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", });
1099
- /**
1100
- */
1101
- export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1102
- /**
1103
- */
1104
- 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", });
1105
- /**
1106
- */
1107
- export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1108
- /**
1109
- */
1110
- export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1111
- /**
1112
- */
1113
- export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1114
- /**
1115
- */
1116
- export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1117
- /**
1118
- * Each new language uses a different namespace for hashing its script
1119
- * This is because you could have a language where the same bytes have different semantics
1120
- * So this avoids scripts in different languages mapping to the same hash
1121
- * Note that the enum value here is different than the enum value for deciding the cost model of a script
1122
- */
1123
- export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1124
- /**
1125
- */
1126
- 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", });
1127
- /**
1128
- * Used to choosed the schema for a script JSON string
1129
- */
1130
- export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1131
- /**
1132
- */
1133
- export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1134
- /**
1135
- */
1136
- 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", });
1137
- /**
1138
- */
1139
- export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1140
- /**
1141
- */
1142
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", });
1143
1090
  /**
1144
1091
  */
1145
- 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", });
1092
+ 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", });
1146
1093
  /**
1147
1094
  */
1148
1095
  export const ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1149
1096
  /**
1150
1097
  */
1151
- 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", });
1152
- /**
1153
- */
1154
- export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1098
+ 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", });
1155
1099
  /**
1156
1100
  */
1157
- export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1101
+ export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1158
1102
  /**
1159
1103
  */
1160
- export const DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1104
+ export const CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1161
1105
  /**
1162
1106
  * JSON <-> PlutusData conversion schemas.
1163
1107
  * Follows ScriptDataJsonSchema in cardano-cli defined at:
@@ -1211,7 +1155,29 @@ BasicConversions:0,"0":"BasicConversions",
1211
1155
  DetailedSchema:1,"1":"DetailedSchema", });
1212
1156
  /**
1213
1157
  */
1214
- 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", });
1158
+ 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", });
1159
+ /**
1160
+ */
1161
+ export const RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1162
+ /**
1163
+ */
1164
+ 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", });
1165
+ /**
1166
+ */
1167
+ export const VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1168
+ /**
1169
+ */
1170
+ export const LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
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
+ * Used to choosed the schema for a script JSON string
1176
+ */
1177
+ export const ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1178
+ /**
1179
+ */
1180
+ 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", });
1215
1181
  /**
1216
1182
  */
1217
1183
  export const CoinSelectionStrategyCIP2 = Object.freeze({
@@ -1231,6 +1197,40 @@ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1231
1197
  * Same as RandomImprove, but before adding ADA, will insert by random-improve for each asset type.
1232
1198
  */
1233
1199
  RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1200
+ /**
1201
+ */
1202
+ 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", });
1203
+ /**
1204
+ */
1205
+ 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", });
1206
+ /**
1207
+ */
1208
+ export const MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1209
+ /**
1210
+ */
1211
+ export const MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1212
+ /**
1213
+ */
1214
+ export const CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1215
+ /**
1216
+ * Each new language uses a different namespace for hashing its script
1217
+ * This is because you could have a language where the same bytes have different semantics
1218
+ * So this avoids scripts in different languages mapping to the same hash
1219
+ * Note that the enum value here is different than the enum value for deciding the cost model of a script
1220
+ */
1221
+ export const ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1222
+ /**
1223
+ */
1224
+ export const MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1225
+ /**
1226
+ */
1227
+ export const TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1228
+ /**
1229
+ */
1230
+ export const CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1231
+ /**
1232
+ */
1233
+ export const NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1234
1234
 
1235
1235
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1236
1236
  ? { register: () => {}, unregister: () => {} }
Binary file
@@ -8,7 +8,7 @@ export function get_necessary_data_list_js(tx_hex: string): string;
8
8
  * @param {ValidationInputContext} validation_context
9
9
  * @returns {string}
10
10
  */
11
- export function validate_transaction_js(tx_hex: string, validation_context: ValidationInputContext): string;
11
+ export function validate_transaction_js(tx_hex: string, validation_context: string): string;
12
12
 
13
13
  /**
14
14
  * @returns {(string)[]}
@@ -1080,93 +1080,44 @@ function handleError(f, args) {
1080
1080
  }
1081
1081
  }
1082
1082
  /**
1083
- * JSON <-> PlutusData conversion schemas.
1084
- * Follows ScriptDataJsonSchema in cardano-cli defined at:
1085
- * https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
1086
- *
1087
- * All methods here have the following restrictions due to limitations on dependencies:
1088
- * * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
1089
- * * Hex strings for bytes don't accept odd-length (half-byte) strings.
1090
- * cardano-cli seems to support these however but it seems to be different than just 0-padding
1091
- * on either side when tested so proceed with caution
1092
1083
  */
1093
- module.exports.PlutusDatumSchema = Object.freeze({
1084
+ 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", });
1094
1085
  /**
1095
- * ScriptDataJsonNoSchema in cardano-node.
1096
- *
1097
- * This is the format used by --script-data-value in cardano-cli
1098
- * This tries to accept most JSON but does not support the full spectrum of Plutus datums.
1099
- * From JSON:
1100
- * * null/true/false/floats NOT supported
1101
- * * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
1102
- * To JSON:
1103
- * * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
1104
- * * Lists not supported in keys
1105
- * * Maps not supported in keys
1106
1086
  */
1107
- BasicConversions:0,"0":"BasicConversions",
1087
+ module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1108
1088
  /**
1109
- * ScriptDataJsonDetailedSchema in cardano-node.
1110
- *
1111
- * This is the format used by --script-data-file in cardano-cli
1112
- * This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
1113
- * The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
1114
- * 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
1115
- * e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
1116
- * 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
1117
- * Integer's value is a JSON number e.g. {"int": 100}
1118
- * Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
1119
- * Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
1120
- * Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
1121
- * respectively with their values being the plutus datum encoded via this same schema
1122
- * e.g. {"map": [
1123
- * {"k": {"int": 2}, "v": {"int": 5}},
1124
- * {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
1125
- * ]}
1126
- * From JSON:
1127
- * * null/true/false/floats NOT supported
1128
- * * the JSON must conform to a very specific schema
1129
- * To JSON:
1130
- * * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
1131
1089
  */
1132
- DetailedSchema:1,"1":"DetailedSchema", });
1090
+ 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", });
1133
1091
  /**
1134
1092
  */
1135
- module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1093
+ module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1136
1094
  /**
1137
1095
  */
1138
- 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", });
1096
+ 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", });
1139
1097
  /**
1140
1098
  */
1141
- 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", });
1099
+ module.exports.MIRKind = Object.freeze({ ToOtherPot:0,"0":"ToOtherPot",ToStakeCredentials:1,"1":"ToStakeCredentials", });
1142
1100
  /**
1143
1101
  */
1144
- module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1102
+ module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1145
1103
  /**
1146
1104
  */
1147
- module.exports.MetadataJsonSchema = Object.freeze({ NoConversions:0,"0":"NoConversions",BasicConversions:1,"1":"BasicConversions",DetailedSchema:2,"2":"DetailedSchema", });
1105
+ 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", });
1148
1106
  /**
1149
- * Each new language uses a different namespace for hashing its script
1150
- * This is because you could have a language where the same bytes have different semantics
1151
- * So this avoids scripts in different languages mapping to the same hash
1152
- * Note that the enum value here is different than the enum value for deciding the cost model of a script
1153
1107
  */
1154
- module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1108
+ 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", });
1155
1109
  /**
1156
1110
  */
1157
- module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1111
+ module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1158
1112
  /**
1159
1113
  */
1160
- module.exports.VoteKind = Object.freeze({ No:0,"0":"No",Yes:1,"1":"Yes",Abstain:2,"2":"Abstain", });
1114
+ 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", });
1161
1115
  /**
1162
1116
  * Used to choosed the schema for a script JSON string
1163
1117
  */
1164
1118
  module.exports.ScriptSchema = Object.freeze({ Wallet:0,"0":"Wallet",Node:1,"1":"Node", });
1165
1119
  /**
1166
1120
  */
1167
- 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", });
1168
- /**
1169
- */
1170
1121
  module.exports.CoinSelectionStrategyCIP2 = Object.freeze({
1171
1122
  /**
1172
1123
  * Performs CIP2's Largest First ada-only selection. Will error if outputs contain non-ADA assets.
@@ -1186,46 +1137,95 @@ LargestFirstMultiAsset:2,"2":"LargestFirstMultiAsset",
1186
1137
  RandomImproveMultiAsset:3,"3":"RandomImproveMultiAsset", });
1187
1138
  /**
1188
1139
  */
1189
- 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", });
1140
+ module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1190
1141
  /**
1191
1142
  */
1192
- module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1143
+ module.exports.MIRPot = Object.freeze({ Reserves:0,"0":"Reserves",Treasury:1,"1":"Treasury", });
1193
1144
  /**
1194
1145
  */
1195
- 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", });
1146
+ module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1196
1147
  /**
1197
1148
  */
1198
- module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1149
+ module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1199
1150
  /**
1200
1151
  */
1201
- module.exports.DRepKind = Object.freeze({ KeyHash:0,"0":"KeyHash",ScriptHash:1,"1":"ScriptHash",AlwaysAbstain:2,"2":"AlwaysAbstain",AlwaysNoConfidence:3,"3":"AlwaysNoConfidence", });
1152
+ module.exports.CborSetType = Object.freeze({ Tagged:0,"0":"Tagged",Untagged:1,"1":"Untagged", });
1202
1153
  /**
1203
1154
  */
1204
- 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", });
1155
+ 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", });
1205
1156
  /**
1206
1157
  */
1207
- module.exports.NetworkIdKind = Object.freeze({ Testnet:0,"0":"Testnet",Mainnet:1,"1":"Mainnet", });
1158
+ module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1208
1159
  /**
1160
+ * JSON <-> PlutusData conversion schemas.
1161
+ * Follows ScriptDataJsonSchema in cardano-cli defined at:
1162
+ * https://github.com/input-output-hk/cardano-node/blob/master/cardano-api/src/Cardano/Api/ScriptData.hs#L254
1163
+ *
1164
+ * All methods here have the following restrictions due to limitations on dependencies:
1165
+ * * JSON numbers above u64::MAX (positive) or below i64::MIN (negative) will throw errors
1166
+ * * Hex strings for bytes don't accept odd-length (half-byte) strings.
1167
+ * cardano-cli seems to support these however but it seems to be different than just 0-padding
1168
+ * on either side when tested so proceed with caution
1209
1169
  */
1210
- module.exports.ByronAddressType = Object.freeze({ ATPubKey:0,"0":"ATPubKey",ATScript:1,"1":"ATScript",ATRedeem:2,"2":"ATRedeem", });
1170
+ module.exports.PlutusDatumSchema = Object.freeze({
1211
1171
  /**
1172
+ * ScriptDataJsonNoSchema in cardano-node.
1173
+ *
1174
+ * This is the format used by --script-data-value in cardano-cli
1175
+ * This tries to accept most JSON but does not support the full spectrum of Plutus datums.
1176
+ * From JSON:
1177
+ * * null/true/false/floats NOT supported
1178
+ * * strings starting with 0x are treated as hex bytes. All other strings are encoded as their utf8 bytes.
1179
+ * To JSON:
1180
+ * * ConstrPlutusData not supported in ANY FORM (neither keys nor values)
1181
+ * * Lists not supported in keys
1182
+ * * Maps not supported in keys
1212
1183
  */
1213
- module.exports.CredKind = Object.freeze({ Key:0,"0":"Key",Script:1,"1":"Script", });
1184
+ BasicConversions:0,"0":"BasicConversions",
1214
1185
  /**
1186
+ * ScriptDataJsonDetailedSchema in cardano-node.
1187
+ *
1188
+ * This is the format used by --script-data-file in cardano-cli
1189
+ * This covers almost all (only minor exceptions) Plutus datums, but the JSON must conform to a strict schema.
1190
+ * The schema specifies that ALL keys and ALL values must be contained in a JSON map with 2 cases:
1191
+ * 1. For ConstrPlutusData there must be two fields "constructor" contianing a number and "fields" containing its fields
1192
+ * e.g. { "constructor": 2, "fields": [{"int": 2}, {"list": [{"bytes": "CAFEF00D"}]}]}
1193
+ * 2. For all other cases there must be only one field named "int", "bytes", "list" or "map"
1194
+ * Integer's value is a JSON number e.g. {"int": 100}
1195
+ * Bytes' value is a hex string representing the bytes WITHOUT any prefix e.g. {"bytes": "CAFEF00D"}
1196
+ * Lists' value is a JSON list of its elements encoded via the same schema e.g. {"list": [{"bytes": "CAFEF00D"}]}
1197
+ * Maps' value is a JSON list of objects, one for each key-value pair in the map, with keys "k" and "v"
1198
+ * respectively with their values being the plutus datum encoded via this same schema
1199
+ * e.g. {"map": [
1200
+ * {"k": {"int": 2}, "v": {"int": 5}},
1201
+ * {"k": {"map": [{"k": {"list": [{"int": 1}]}, "v": {"bytes": "FF03"}}]}, "v": {"list": []}}
1202
+ * ]}
1203
+ * From JSON:
1204
+ * * null/true/false/floats NOT supported
1205
+ * * the JSON must conform to a very specific schema
1206
+ * To JSON:
1207
+ * * all Plutus datums should be fully supported outside of the integer range limitations outlined above.
1215
1208
  */
1216
- 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", });
1209
+ DetailedSchema:1,"1":"DetailedSchema", });
1217
1210
  /**
1218
1211
  */
1219
- 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", });
1212
+ 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", });
1220
1213
  /**
1221
1214
  */
1222
- module.exports.CborContainerType = Object.freeze({ Array:0,"0":"Array",Map:1,"1":"Map", });
1215
+ module.exports.RelayKind = Object.freeze({ SingleHostAddr:0,"0":"SingleHostAddr",SingleHostName:1,"1":"SingleHostName",MultiHostName:2,"2":"MultiHostName", });
1223
1216
  /**
1224
1217
  */
1225
- module.exports.TransactionSetsState = Object.freeze({ AllSetsHaveTag:0,"0":"AllSetsHaveTag",AllSetsHaveNoTag:1,"1":"AllSetsHaveNoTag",MixedSets:2,"2":"MixedSets", });
1218
+ module.exports.LanguageKind = Object.freeze({ PlutusV1:0,"0":"PlutusV1",PlutusV2:1,"1":"PlutusV2",PlutusV3:2,"2":"PlutusV3", });
1226
1219
  /**
1227
1220
  */
1228
1221
  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", });
1222
+ /**
1223
+ * Each new language uses a different namespace for hashing its script
1224
+ * This is because you could have a language where the same bytes have different semantics
1225
+ * So this avoids scripts in different languages mapping to the same hash
1226
+ * Note that the enum value here is different than the enum value for deciding the cost model of a script
1227
+ */
1228
+ module.exports.ScriptHashNamespace = Object.freeze({ NativeScript:0,"0":"NativeScript",PlutusScript:1,"1":"PlutusScript",PlutusScriptV2:2,"2":"PlutusScriptV2",PlutusScriptV3:3,"3":"PlutusScriptV3", });
1229
1229
 
1230
1230
  const AddressFinalization = (typeof FinalizationRegistry === 'undefined')
1231
1231
  ? { register: () => {}, unregister: () => {} }
Binary file
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.18",
6
+ "version": "0.1.0-beta.19",
7
7
  "files": [
8
8
  "node/cquisitor_lib_bg.wasm",
9
9
  "node/cquisitor_lib.js",